Commits

Eric Roshan Eisner committed 0277095 Draft

ignore unused part of buffer

benchmark old ns/op new ns/op delta
BenchmarkHash8Bytes 2143 2056 -4.06%
BenchmarkHash1K 12299 12208 -0.74%
BenchmarkHash8K 89690 89741 +0.06%

benchmark old MB/s new MB/s speedup
BenchmarkHash8Bytes 3.73 3.89 1.04x
BenchmarkHash1K 83.25 83.87 1.01x
BenchmarkHash8K 91.34 91.28 1.00x

Comments (0)

Files changed (1)

 		panic("sha3: close after close")
 	}
 	d.buf[d.n] = 0x01
-	for i := d.n + 1; i < len(d.buf); i++ {
+	for i := d.n + 1; i < d.blocksize; i++ {
 		d.buf[i] = 0
 	}
 	d.buf[d.blocksize-1] |= 0x80