From c90954cbb977fd7832b7baaec1e03e7c4dd38f52 Mon Sep 17 00:00:00 2001 From: woat Date: Wed, 30 Sep 2020 17:06:23 +0000 Subject: [PATCH] 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 Trust: Roland Shoemaker --- nacl/auth/auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nacl/auth/auth.go b/nacl/auth/auth.go index ec1d6eb..1d588d5 100644 --- a/nacl/auth/auth.go +++ b/nacl/auth/auth.go @@ -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 }