diff options
| author | Jack O'Connor <[email protected]> | 2019-12-12 23:40:13 -0500 |
|---|---|---|
| committer | Jack O'Connor <[email protected]> | 2019-12-12 23:40:13 -0500 |
| commit | a52d4daa9873ac403397827eda0b7314e45462c2 (patch) | |
| tree | 6c5208616c156dc7279346335816f89f0af68a51 | |
| parent | fe9b8fedd7743ab017c7a3eab40a6128396bd4c9 (diff) | |
update MAX_DEPTH
| -rw-r--r-- | reference_impl/reference_impl.rs | 6 | ||||
| -rw-r--r-- | src/c/blake3.h | 2 | ||||
| -rw-r--r-- | src/lib.rs | 4 | ||||
| -rw-r--r-- | src/test.rs | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/reference_impl/reference_impl.rs b/reference_impl/reference_impl.rs index 3299deb..9416b4b 100644 --- a/reference_impl/reference_impl.rs +++ b/reference_impl/reference_impl.rs @@ -235,8 +235,8 @@ fn parent_output( pub struct Hasher { chunk_state: ChunkState, key: [u32; 8], - cv_stack: [[u32; 8]; 53], // Space for 53 subtree chaining values: - cv_stack_len: u8, // 2^53 * CHUNK_LEN = 2^64 + cv_stack: [[u32; 8]; 54], // Space for 54 subtree chaining values: + cv_stack_len: u8, // 2^54 * CHUNK_LEN = 2^64 } impl Hasher { @@ -244,7 +244,7 @@ impl Hasher { Self { chunk_state: ChunkState::new(key, 0, flags), key: *key, - cv_stack: [[0; 8]; 53], + cv_stack: [[0; 8]; 54], cv_stack_len: 0, } } diff --git a/src/c/blake3.h b/src/c/blake3.h index 4c5624c..5c68521 100644 --- a/src/c/blake3.h +++ b/src/c/blake3.h @@ -6,7 +6,7 @@ #define BLAKE3_OUT_LEN 32 #define BLAKE3_BLOCK_LEN 64 #define BLAKE3_CHUNK_LEN 1024 -#define BLAKE3_MAX_DEPTH 53 +#define BLAKE3_MAX_DEPTH 54 #define BLAKE3_MAX_SIMD_DEGREE 16 typedef struct { @@ -639,8 +639,8 @@ fn parent_node_output( pub struct Hasher { key: CVWords, chunk_state: ChunkState, - // 2^53 * 2048 = 2^64 - cv_stack: ArrayVec<[CVBytes; 53]>, + // 2^54 * CHUNK_LEN = 2^64 + cv_stack: ArrayVec<[CVBytes; 54]>, } impl Hasher { diff --git a/src/test.rs b/src/test.rs index e7fe96e..ba22e4e 100644 --- a/src/test.rs +++ b/src/test.rs @@ -198,7 +198,7 @@ fn test_reference_impl_size() { // that happens, we can either disable this test, or test for multiple // expected values. For now, the purpose of this test is to make sure we // notice if that happens. - assert_eq!(1848, core::mem::size_of::<reference_impl::Hasher>()); + assert_eq!(1880, core::mem::size_of::<reference_impl::Hasher>()); } #[test] |
