Пример #1
0
// 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
// 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
func (s *shake) Reset() {
	s.cipher = cipher.FromSponge(s.sponge(), abstract.NoKey,
		cipher.Padding(0x1f))
	s.squeezing = false
}
Пример #4
0
// 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...)
}