summaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/crypto/blake2s
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/crypto/blake2s')
-rw-r--r--vendor/golang.org/x/crypto/blake2s/blake2s.go10
-rw-r--r--vendor/golang.org/x/crypto/blake2s/register.go21
2 files changed, 9 insertions, 22 deletions
diff --git a/vendor/golang.org/x/crypto/blake2s/blake2s.go b/vendor/golang.org/x/crypto/blake2s/blake2s.go
index e3f46aab3..c25d07d4f 100644
--- a/vendor/golang.org/x/crypto/blake2s/blake2s.go
+++ b/vendor/golang.org/x/crypto/blake2s/blake2s.go
@@ -16,9 +16,10 @@
//
// BLAKE2X is a construction to compute hash values larger than 32 bytes. It
// can produce hash values between 0 and 65535 bytes.
-package blake2s // import "golang.org/x/crypto/blake2s"
+package blake2s
import (
+ "crypto"
"encoding/binary"
"errors"
"hash"
@@ -55,6 +56,13 @@ func Sum256(data []byte) [Size]byte {
// and BinaryUnmarshaler for state (de)serialization as documented by hash.Hash.
func New256(key []byte) (hash.Hash, error) { return newDigest(Size, key) }
+func init() {
+ crypto.RegisterHash(crypto.BLAKE2s_256, func() hash.Hash {
+ h, _ := New256(nil)
+ return h
+ })
+}
+
// New128 returns a new hash.Hash computing the BLAKE2s-128 checksum given a
// non-empty key. Note that a 128-bit digest is too small to be secure as a
// cryptographic hash and should only be used as a MAC, thus the key argument
diff --git a/vendor/golang.org/x/crypto/blake2s/register.go b/vendor/golang.org/x/crypto/blake2s/register.go
deleted file mode 100644
index 3156148a4..000000000
--- a/vendor/golang.org/x/crypto/blake2s/register.go
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build go1.9
-
-package blake2s
-
-import (
- "crypto"
- "hash"
-)
-
-func init() {
- newHash256 := func() hash.Hash {
- h, _ := New256(nil)
- return h
- }
-
- crypto.RegisterHash(crypto.BLAKE2s_256, newHash256)
-}