Commit Graph
3 Commits
Author SHA1 Message Date
Austin Clements e67f5eca87 blake2b: use proper Go frame sizes
Similar to the previous commit, blake2b's assembly routines claim they
have a zero byte frame and manually subtract a frame from the SP,
which can fail to grow the stack when necessary, leading to memory
corruption.

Fix this by using the correct stack frame sizes so the generated stack
growth prologue is correct, and aligning the SP up instead of down.

Change-Id: Ic426338c45c94a2c01d549860c2295a0ee9200be
Reviewed-on: https://go-review.googlesource.com/31585
Reviewed-by: Adam Langley <agl@golang.org>
Reviewed-by: Andreas Auernhammer <aead@mail.de>
2016-10-21 19:51:14 +00:00
Andreas Auernhammer c367d6eeb7 blake2s,blake2b: fix typo in package doc
Change-Id: I6c33e69dc3e45d86843861973952d6f11c0fae88
Reviewed-on: https://go-review.googlesource.com/31397
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-10-19 07:14:13 +00:00
Andreas Auernhammer 9e9c7d4ed3 blake2b: new package
Add the hash function BLAKE2b defined in RFC 7693.

On amd64/AVX2
name 		time/op
Write128-4 	164ns ± 1%
Write1K-4 	1.19µs ± 2%
Sum128-4 	187ns ± 1%
Sum1K-4 	1.21µs ± 1%

name 		speed
Write128-4 	800MB/s ± 1%
Write1K-4 	856MB/s ± 2%
Sum128-4 	682MB/s ± 1%
Sum1K-4     	842MB/s ± 1%

On amd64/SSE4
name 		time/op
Write128-4 	192ns ± 1%
Write1K-4 	1.37µs ± 0%
Sum128-4 	215ns ± 1%
Sum1K-4 	1.39µs ± 1%

name 		speed
Write128-4 	665MB/s ± 1%
Write1K-4 	746MB/s ± 0%
Sum128-4 	592MB/s ± 1%
Sum1K-4 	735MB/s ± 1%

Change-Id: I0b41ae136980b0e8a970be330e8cc5f02b9e6818
Reviewed-on: https://go-review.googlesource.com/30918
Reviewed-by: Adam Langley <agl@golang.org>
2016-10-18 17:05:21 +00:00