Skip to content

Commit 5fc4767

Browse files
fix: Support for BMFF V3 hashing options (#1253)
* Support for BMFF Hash V3 validation of fixedBlockSize and fixedBlockSizes Merkle trees generation of fixedBlockSize Merkle trees * Bug fix for case when BMFF exclusion subset is using length with no offset * Setting to control Merkle tree storage * Change error message * More error checking PR comment change * Make settings fetch return error is not set * Add test for no fixed offset * Fix formatting * Check for conflicting block types * Fix error response for competing Merkle block types * Make spec responses * Allow 0 length fixed offset * A little cleanup * Make sure there is a recognized hash binding * Fix for some more edge cases * clippy fix --------- Co-authored-by: Gavin Peacock <[email protected]>
1 parent c6b6a59 commit 5fc4767

File tree

18 files changed

+980
-254
lines changed

18 files changed

+980
-254
lines changed

sdk/examples/data_hash.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ fn user_data_hash_with_sdk_hashing() -> Result<()> {
118118

119119
// we need to add a data hash that excludes the manifest
120120
let mut dh = DataHash::new("my_manifest", "sha265");
121-
let hr = HashRange::new(manifest_pos, placeholder_manifest.len());
121+
let hr = HashRange::new(manifest_pos as u64, placeholder_manifest.len() as u64);
122122
dh.add_exclusion(hr.clone());
123123

124124
// Hash the bytes excluding the manifest we inserted
@@ -176,7 +176,7 @@ fn user_data_hash_with_user_hashing() -> Result<()> {
176176
// Figure out where you want to put the manifest, let's put it at the beginning of the JPEG as first segment
177177
// we will need to add a data hash that excludes the manifest
178178
let mut dh = DataHash::new("my_manifest", "sha265");
179-
let hr = HashRange::new(2, placeholder_manifest.len());
179+
let hr = HashRange::new(2, placeholder_manifest.len() as u64);
180180
dh.add_exclusion(hr);
181181

182182
// since the only thing we are excluding in this example is the manifest we can just hash all the bytes

0 commit comments

Comments
 (0)