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:
+1
-1
@@ -40,7 +40,7 @@ const (
|
|||||||
func Sum(m []byte, key *[KeySize]byte) *[Size]byte {
|
func Sum(m []byte, key *[KeySize]byte) *[Size]byte {
|
||||||
mac := hmac.New(sha512.New, key[:])
|
mac := hmac.New(sha512.New, key[:])
|
||||||
mac.Write(m)
|
mac.Write(m)
|
||||||
out := new([KeySize]byte)
|
out := new([Size]byte)
|
||||||
copy(out[:], mac.Sum(nil)[:Size])
|
copy(out[:], mac.Sum(nil)[:Size])
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user