func TestImplementsHash(t *testing.T) { tsd, err := NewDigest(Version1) if err != nil { t.Fatal(err) } _ = hash.Hash(tsd) }
func fastSHA512() hash.Hash { scratch := buf.Alloc() C.sha512_init((*C.hash_state)(unsafe.Pointer(&scratch[0]))) goo := fastSHA512State{scratch} return hash.Hash(goo) }
// NewMAC returns hash.Hash calculating Skein Message Authentication Code of the // given length in bytes. A MAC is a cryptographic hash that uses a key to // authenticate a message. The receiver verifies the hash by recomputing it // using the same key. func NewMAC(outLen uint64, key []byte) hash.Hash { return hash.Hash(New(outLen, &Args{Key: key})) }
// NewHash returns hash.Hash calculating checksum of the given length in bytes // (for example, to calculate 256-bit hash, outLen must be set to 32). func NewHash(outLen uint64) hash.Hash { return hash.Hash(New(outLen, nil)) }