예제 #1
0
func TestImplementsHash(t *testing.T) {
	tsd, err := NewDigest(Version1)
	if err != nil {
		t.Fatal(err)
	}

	_ = hash.Hash(tsd)
}
예제 #2
0
func fastSHA512() hash.Hash {
	scratch := buf.Alloc()
	C.sha512_init((*C.hash_state)(unsafe.Pointer(&scratch[0])))
	goo := fastSHA512State{scratch}
	return hash.Hash(goo)
}
예제 #3
0
파일: skein.go 프로젝트: dchest/skein
// 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}))
}
예제 #4
0
파일: skein.go 프로젝트: dchest/skein
// 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))
}