diff options
| author | Jack O'Connor <[email protected]> | 2025-04-16 18:55:39 -0700 |
|---|---|---|
| committer | Jack O'Connor <[email protected]> | 2025-04-16 18:55:39 -0700 |
| commit | 2de3cb1a21d09cdee4c8b6b14513063198cf1b82 (patch) | |
| tree | 2d69097c506d7693c9e3d411cb538c6bc1459f12 /src | |
| parent | afa5a0ede17f983b88d08917c4d6f097cded86f8 (diff) | |
clarify a comment
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.rs | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1125,11 +1125,11 @@ impl Hasher { // always merging 1 chunk at a time. Instead, each CV might represent any // power-of-two number of chunks, as long as the smaller-above-larger stack // order is maintained. Instead of the "count the trailing 0-bits" - // algorithm described in the spec, we use a "count the total number of - // 1-bits" variant that doesn't require us to retain the subtree size of - // the CV on top of the stack. The principle is the same: each CV that - // should remain in the stack is represented by a 1-bit in the total number - // of chunks (or bytes) so far. + // algorithm described in the spec (which assumes you're adding one chunk + // at a time), we use a "count the total number of 1-bits" variant (which + // doesn't assume that). The principle is the same: each CV that should + // remain in the stack is represented by a 1-bit in the total number of + // chunks (or bytes) so far. fn merge_cv_stack(&mut self, chunk_counter: u64) { // Account for non-zero cases of Hasher::set_input_offset, where there are no prior // subtrees in the stack. Note that initial_chunk_counter is always 0 for callers who don't |
