Lines Matching full:chunk

82 // Chaining values within a given chunk (specifically the compress_in_place
159 // Given some input larger than one chunk, return the number of bytes that
170 // on a single thread. Write out the chunk chaining values and return the
195 // Hash the remaining partial chunk, if there is one. Note that the empty in compress_chunks_parallel()
196 // chunk (meaning the empty message) is a different codepath. in compress_chunks_parallel()
263 // not used when the whole input is only 1 chunk long; that's a different
274 // Note that the single chunk case does *not* bump the SIMD degree up to 2 in blake3_compress_subtree_wide()
276 // this gives us the option of multi-threading even the 2-chunk case, which in blake3_compress_subtree_wide()
300 // sure there are two outputs. Except, as noted above, at the chunk in blake3_compress_subtree_wide()
301 // level, where we allow degree=1. (Note that the 1-chunk-input case is in blake3_compress_subtree_wide()
337 // chunk or less. That's a different codepath.
370 chunk_state_init(&self->chunk, key, flags); in hasher_init_base()
402 // aren't always merging 1 chunk at a time. Instead, each CV might represent
414 output_t output = parent_output(parent_node, self->key, self->chunk.flags); in hasher_merge_cv_stack()
472 // If we have some partial chunk bytes in the internal chunk_state, we need in llvm_blake3_hasher_update()
473 // to finish that chunk first. in llvm_blake3_hasher_update()
474 if (chunk_state_len(&self->chunk) > 0) { in llvm_blake3_hasher_update()
475 size_t take = BLAKE3_CHUNK_LEN - chunk_state_len(&self->chunk); in llvm_blake3_hasher_update()
479 chunk_state_update(&self->chunk, input_bytes, take); in llvm_blake3_hasher_update()
482 // If we've filled the current chunk and there's more coming, finalize this in llvm_blake3_hasher_update()
483 // chunk and proceed. In this case we know it's not the root. in llvm_blake3_hasher_update()
485 output_t output = chunk_state_output(&self->chunk); in llvm_blake3_hasher_update()
488 hasher_push_cv(self, chunk_cv, self->chunk.chunk_counter); in llvm_blake3_hasher_update()
489 chunk_state_reset(&self->chunk, self->key, self->chunk.chunk_counter + 1); in llvm_blake3_hasher_update()
496 // a single chunk (so, definitely not the root chunk), hash the largest whole in llvm_blake3_hasher_update()
504 // waiting for 1 more chunk, we can't hash a subtree of 4 chunks. We have in llvm_blake3_hasher_update()
510 uint64_t count_so_far = self->chunk.chunk_counter * BLAKE3_CHUNK_LEN; in llvm_blake3_hasher_update()
529 // The shrunken subtree_len might now be 1 chunk long. If so, hash that one in llvm_blake3_hasher_update()
530 // chunk by itself. Otherwise, compress the subtree into a pair of CVs. in llvm_blake3_hasher_update()
534 chunk_state_init(&chunk_state, self->key, self->chunk.flags); in llvm_blake3_hasher_update()
535 chunk_state.chunk_counter = self->chunk.chunk_counter; in llvm_blake3_hasher_update()
546 self->chunk.chunk_counter, in llvm_blake3_hasher_update()
547 self->chunk.flags, cv_pair); in llvm_blake3_hasher_update()
548 hasher_push_cv(self, cv_pair, self->chunk.chunk_counter); in llvm_blake3_hasher_update()
550 self->chunk.chunk_counter + (subtree_chunks / 2)); in llvm_blake3_hasher_update()
552 self->chunk.chunk_counter += subtree_chunks; in llvm_blake3_hasher_update()
557 // If there's any remaining input less than a full chunk, add it to the chunk in llvm_blake3_hasher_update()
564 chunk_state_update(&self->chunk, input_bytes, input_len); in llvm_blake3_hasher_update()
565 hasher_merge_cv_stack(self, self->chunk.chunk_counter); in llvm_blake3_hasher_update()
588 // If the subtree stack is empty, then the current chunk is the root. in llvm_blake3_hasher_finalize_seek()
590 output_t output = chunk_state_output(&self->chunk); in llvm_blake3_hasher_finalize_seek()
594 // If there are any bytes in the chunk state, finalize that chunk and do a in llvm_blake3_hasher_finalize_seek()
595 // roll-up merge between that chunk hash and every subtree in the stack. In in llvm_blake3_hasher_finalize_seek()
598 // each other first. Otherwise, if there are no bytes in the chunk state, in llvm_blake3_hasher_finalize_seek()
599 // then the top of the stack is a chunk hash, and we start the merge from in llvm_blake3_hasher_finalize_seek()
603 if (chunk_state_len(&self->chunk) > 0) { in llvm_blake3_hasher_finalize_seek()
605 output = chunk_state_output(&self->chunk); in llvm_blake3_hasher_finalize_seek()
610 self->chunk.flags); in llvm_blake3_hasher_finalize_seek()
617 output = parent_output(parent_block, self->key, self->chunk.flags); in llvm_blake3_hasher_finalize_seek()
623 chunk_state_reset(&self->chunk, self->key, 0); in llvm_blake3_hasher_reset()