perf(k12): remove redundant 8KiB buffer zeroing in process_chunk
The buffer was zeroed after each full chunk in KangarooTwelveCore::process_chunk(). This is unnecessary because subsequent reads only consume [..bufpos] and bufpos is reset to 0. Removing the memset avoids extra work on long inputs and aligns with the project’s pattern of cleaning sensitive data via Drop under the zeroize feature.
This is unnecessary because subsequent reads only consume [..bufpos]
I would feel better about that if there were a debug_assert_eq!(self.bufpos, CHUNK_SIZE) for the if self.chain_length == 0 above, though I guess if that weren't the case it could be unnecessarily hashing zeros
I wonder why the implementation simply does not use CHUNK_SIZE for block size.
@newpavlov IIUC, the block size is implicitly CHUNK_SIZE unless chaining is being used
This is unnecessary because subsequent reads only consume [..bufpos]
I would feel better about that if there were a
debug_assert_eq!(self.bufpos, CHUNK_SIZE)for theif self.chain_length == 0above, though I guess if that weren't the case it could be unnecessarily hashing zeros
corrected