blake3
blake3 copied to clipboard
memory optimization or bug? the 4 PB limit of Hasher.stack
type Hasher struct {
// log(n) set of Merkle subtree roots, at most one per height.
stack [64 - (guts.MaxSIMD + 10)][8]uint32
I think technically that should be log2(guts.MaxSIMD)==4, instead of guts.MaxSIMD == 16, to get full 2^64-1 input support that the spec requires.
Its an extra 12*32 = 384 bytes per Hasher (so from 1216 bytes -> 1536 bytes for the stack), so probably not too expensive.
I think you're right -- good catch!