diff options
| author | Jack O'Connor <[email protected]> | 2025-03-30 17:25:54 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-03-30 17:25:54 -0700 |
| commit | e1c2ea27fdd717fd924d7b286a125408d7e817f7 (patch) | |
| tree | c71005f1a46af1a8c9135865469b79ec40fde2e2 /c | |
| parent | 83a60d9da6a44b719e258926e568c203d3b4dd36 (diff) | |
add the `hazmat` module and deprecate the undocumented `guts` module
https://github.com/BLAKE3-team/BLAKE3/pull/458
Diffstat (limited to 'c')
| -rw-r--r-- | c/blake3.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -158,10 +158,10 @@ INLINE output_t parent_output(const uint8_t block[BLAKE3_BLOCK_LEN], // Given some input larger than one chunk, return the number of bytes that // should go in the left subtree. This is the largest power-of-2 number of // chunks that leaves at least 1 byte for the right subtree. -INLINE size_t left_len(size_t content_len) { - // Subtract 1 to reserve at least one byte for the right side. content_len +INLINE size_t left_subtree_len(size_t input_len) { + // Subtract 1 to reserve at least one byte for the right side. input_len // should always be greater than BLAKE3_CHUNK_LEN. - size_t full_chunks = (content_len - 1) / BLAKE3_CHUNK_LEN; + size_t full_chunks = (input_len - 1) / BLAKE3_CHUNK_LEN; return round_down_to_power_of_2(full_chunks) * BLAKE3_CHUNK_LEN; } @@ -282,7 +282,7 @@ size_t blake3_compress_subtree_wide(const uint8_t *input, size_t input_len, // the input into left and right subtrees. (Note that this is only optimal // as long as the SIMD degree is a power of 2. If we ever get a SIMD degree // of 3 or something, we'll need a more complicated strategy.) - size_t left_input_len = left_len(input_len); + size_t left_input_len = left_subtree_len(input_len); size_t right_input_len = input_len - left_input_len; const uint8_t *right_input = &input[left_input_len]; uint64_t right_chunk_counter = |
