예제 #1
0
파일: shake.go 프로젝트: LegoShrimp/crypto
// NewShakeCipher256 creates a Cipher implementing the SHAKE256 algorithm,
// which provides 256-bit security against all known attacks.
func NewShakeCipher256(key []byte, options ...interface{}) abstract.Cipher {
	return cipher.FromSponge(newKeccak512(), key,
		append(shakeOpts, options...)...)
}
예제 #2
0
파일: hashes.go 프로젝트: LegoShrimp/crypto
// NewCipher512 creates a Cipher implementing the SHA3-512 algorithm,
// which provides 512-bit security against preimage attacks
// and 256-bit security against collisions.
func NewCipher512(key []byte, options ...interface{}) abstract.Cipher {
	return cipher.FromSponge(newKeccak1024(), key,
		append(sha3opts, options...)...)
}
예제 #3
0
파일: shake.go 프로젝트: LegoShrimp/crypto
func (s *shake) Reset() {
	s.cipher = cipher.FromSponge(s.sponge(), abstract.NoKey,
		cipher.Padding(0x1f))
	s.squeezing = false
}
예제 #4
0
파일: sponge.go 프로젝트: LegoShrimp/crypto
// NewCipher creates a Cipher implementing the 64-4-1 mode of NORX.
func NewCipher(key []byte, options ...interface{}) abstract.Cipher {
	return cipher.FromSponge(newSponge(), key, options...)
}