nacl/auth: use Size instead of KeySize for Sum output

Fixes golang/go#41692

Change-Id: If6e885ca2e016dfecf534093c989356142ec7823
GitHub-Last-Rev: fe67c18f18ccfc766687b8db4bda92b9f7879a2b
GitHub-Pull-Request: golang/crypto#154
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/258357
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Trust: Roland Shoemaker <roland@golang.org>
This commit is contained in:
woat
2020-10-02 09:40:18 +00:00
committed by Filippo Valsorda
parent eb9a90e9f9
commit c90954cbb9
+1 -1
View File
@@ -40,7 +40,7 @@ const (
func Sum(m []byte, key *[KeySize]byte) *[Size]byte {
mac := hmac.New(sha512.New, key[:])
mac.Write(m)
out := new([KeySize]byte)
out := new([Size]byte)
copy(out[:], mac.Sum(nil)[:Size])
return out
}