diff options
Diffstat (limited to 'src/crypto/sha512/sha512.go')
-rw-r--r-- | src/crypto/sha512/sha512.go | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/crypto/sha512/sha512.go b/src/crypto/sha512/sha512.go index 1285cca7ee..c800a294a2 100644 --- a/src/crypto/sha512/sha512.go +++ b/src/crypto/sha512/sha512.go @@ -12,13 +12,12 @@ package sha512 import ( "crypto" + "crypto/internal/boring" "encoding/binary" "errors" "hash" ) -import "crypto/internal/boring" - func init() { crypto.RegisterHash(crypto.SHA384, New384) crypto.RegisterHash(crypto.SHA512, New) @@ -345,11 +344,7 @@ func (d *digest) checkSum() [Size]byte { // Sum512 returns the SHA512 checksum of the data. func Sum512(data []byte) [Size]byte { if boring.Enabled { - h := New() - h.Write(data) - var ret [Size]byte - h.Sum(ret[:0]) - return ret + return boring.SHA512(data) } d := digest{function: crypto.SHA512} d.Reset() @@ -360,11 +355,7 @@ func Sum512(data []byte) [Size]byte { // Sum384 returns the SHA384 checksum of the data. func Sum384(data []byte) [Size384]byte { if boring.Enabled { - h := New384() - h.Write(data) - var ret [Size384]byte - h.Sum(ret[:0]) - return ret + return boring.SHA384(data) } d := digest{function: crypto.SHA384} d.Reset() |