Commit c49e9fa1 authored by Jonathan Rudenberg's avatar Jonathan Rudenberg Committed by GitHub

Merge pull request #20 from mimoo/mimoo-patch-1

added golang's blake2b implementation
parents 01cefa3e a80962bd
......@@ -10,7 +10,7 @@ import (
"hash"
"io"
"github.com/minio/blake2b-simd"
"golang.org/x/crypto/blake2b"
"golang.org/x/crypto/blake2s"
"golang.org/x/crypto/chacha20poly1305"
"golang.org/x/crypto/curve25519"
......@@ -202,8 +202,16 @@ var HashSHA256 HashFunc = hashFn{sha256.New, "SHA256"}
// HashSHA512 is the SHA-512 hash function.
var HashSHA512 HashFunc = hashFn{sha512.New, "SHA512"}
func blake2bNew() hash.Hash {
h, err := blake2b.New512(nil)
if err != nil {
panic(err)
}
return h
}
// HashBLAKE2b is the BLAKE2b hash function.
var HashBLAKE2b HashFunc = hashFn{blake2b.New512, "BLAKE2b"}
var HashBLAKE2b HashFunc = hashFn{blake2bNew, "BLAKE2b"}
func blake2sNew() hash.Hash {
h, err := blake2s.New256(nil)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment