]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/crypto/sha256/sha256.go
[dev.boringcrypto] all: merge commit 57c115e1 into dev.boringcrypto
[gostls13.git] / src / crypto / sha256 / sha256.go
index 8b54a427d7d4c8c25cd650fe2703a8cbae0c4306..465d00e0e68315c8a114f37d92fdf4f55af3baa3 100644 (file)
@@ -276,7 +276,7 @@ func Sum256(data []byte) [Size]byte {
 }
 
 // Sum224 returns the SHA224 checksum of the data.
-func Sum224(data []byte) (sum224 [Size224]byte) {
+func Sum224(data []byte) [Size224]byte {
        if boring.Enabled {
                h := New224()
                h.Write(data)
@@ -289,6 +289,6 @@ func Sum224(data []byte) (sum224 [Size224]byte) {
        d.Reset()
        d.Write(data)
        sum := d.checkSum()
-       copy(sum224[:], sum[:Size224])
-       return
+       ap := (*[Size224]byte)(sum[:])
+       return *ap
 }