arnaucube
arnaucube/go-iden3-cryptoPublic Self-hosted repository
go-iden3-crypto/babyjub/helpers.go
babyjub/helpers.goRaw
 1package babyjub
 2
 3import (
 4	"github.com/dchest/blake512"
 5)
 6
 7// Note on dchest/blake512: This specific blake512 module is compatible with
 8// the version of Blake512 used at circomlib, and this module has been reviewed
 9// to don't be doing do anything suspicious.
10
11// Blake512 performs the blake-512 hash over the buffer m.  Note that this is
12// the original blake from the SHA3 competition and not the new blake2 version.
13func Blake512(m []byte) []byte {
14	h := blake512.New()
15	_, err := h.Write(m[:])
16	if err != nil {
17		panic(err)
18	}
19	return h.Sum(nil)
20}