diff --git a/sha3/hashes.go b/sha3/hashes.go index 6a383c9..2b51cf4 100644 --- a/sha3/hashes.go +++ b/sha3/hashes.go @@ -9,17 +9,9 @@ package sha3 // bytes. import ( - "crypto" "hash" ) -func init() { - crypto.RegisterHash(crypto.SHA3_224, New224) - crypto.RegisterHash(crypto.SHA3_256, New256) - crypto.RegisterHash(crypto.SHA3_384, New384) - crypto.RegisterHash(crypto.SHA3_512, New512) -} - // New224 creates a new SHA3-224 hash. // Its generic security strength is 224 bits against preimage attacks, // and 112 bits against collision attacks. diff --git a/sha3/register.go b/sha3/register.go new file mode 100644 index 0000000..3cf6a22 --- /dev/null +++ b/sha3/register.go @@ -0,0 +1,18 @@ +// Copyright 2014 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. + +// +build go1.4 + +package sha3 + +import ( + "crypto" +) + +func init() { + crypto.RegisterHash(crypto.SHA3_224, New224) + crypto.RegisterHash(crypto.SHA3_256, New256) + crypto.RegisterHash(crypto.SHA3_384, New384) + crypto.RegisterHash(crypto.SHA3_512, New512) +}