RC stores the round constants for use in the ι step.
var RC = [24]uint64{ 0x0000000000000001, 0x0000000000008082, 0x800000000000808A, 0x8000000080008000, 0x000000000000808B, 0x0000000080000001, 0x8000000080008081, 0x8000000000008009, 0x000000000000008A, 0x0000000000000088, 0x0000000080008009, 0x000000008000000A, 0x000000008000808B, 0x800000000000008B, 0x8000000000008089, 0x8000000000008003, 0x8000000000008002, 0x8000000000000080, 0x000000000000800A, 0x800000008000000A, 0x8000000080008081, 0x8000000000008080, 0x0000000080000001, 0x8000000080008008, }
func KeccakF1600(a *[25]uint64, turbo bool)
KeccakF1600 applies the Keccak permutation to a 1600b-wide state represented as a slice of 25 uint64s. If turbo is true, applies the 12-round variant instead of the regular 24-round variant. nolint:funlen
func ShakeSum128(hash, data []byte)
ShakeSum128 writes an arbitrary-length digest of data into hash.
func ShakeSum256(hash, data []byte)
ShakeSum256 writes an arbitrary-length digest of data into hash.
func Sum224(data []byte) (digest [28]byte)
Sum224 returns the SHA3-224 digest of the data.
func Sum256(data []byte) (digest [32]byte)
Sum256 returns the SHA3-256 digest of the data.
func Sum384(data []byte) (digest [48]byte)
Sum384 returns the SHA3-384 digest of the data.
func Sum512(data []byte) (digest [64]byte)
Sum512 returns the SHA3-512 digest of the data.
func TurboShakeSum128(hash, data []byte, D byte)
TurboShakeSum128 writes an arbitrary-length digest of data into hash.
func TurboShakeSum256(hash, data []byte, D byte)
TurboShakeSum256 writes an arbitrary-length digest of data into hash.
ShakeHash defines the interface to hash functions that support arbitrary-length output.
type ShakeHash interface { // Write absorbs more data into the hash's state. It panics if input is // written to it after output has been read from it. io.Writer // Read reads more output from the hash; reading affects the hash's // state. (ShakeHash.Read is thus very different from Hash.Sum) // It never returns an error. io.Reader // Clone returns a copy of the ShakeHash in its current state. Clone() ShakeHash // Reset resets the ShakeHash to its initial state. Reset() }
type State struct {
// contains filtered or unexported fields
}
func New224() State
New224 creates a new SHA3-224 hash. Its generic security strength is 224 bits against preimage attacks, and 112 bits against collision attacks.
func New256() State
New256 creates a new SHA3-256 hash. Its generic security strength is 256 bits against preimage attacks, and 128 bits against collision attacks.
func New384() State
New384 creates a new SHA3-384 hash. Its generic security strength is 384 bits against preimage attacks, and 192 bits against collision attacks.
func New512() State
New512 creates a new SHA3-512 hash. Its generic security strength is 512 bits against preimage attacks, and 256 bits against collision attacks.
func NewShake128() State
NewShake128 creates a new SHAKE128 variable-output-length ShakeHash. Its generic security strength is 128 bits against all attacks if at least 32 bytes of its output are used.
func NewShake256() State
NewShake256 creates a new SHAKE256 variable-output-length ShakeHash. Its generic security strength is 256 bits against all attacks if at least 64 bytes of its output are used.
func NewTurboShake128(D byte) State
NewTurboShake128 creates a new TurboSHAKE128 variable-output-length ShakeHash. Its generic security strength is 128 bits against all attacks if at least 32 bytes of its output are used. D is the domain separation byte and must be between 0x01 and 0x7f inclusive.
func NewTurboShake256(D byte) State
NewTurboShake256 creates a new TurboSHAKE256 variable-output-length ShakeHash. Its generic security strength is 256 bits against all attacks if at least 64 bytes of its output are used. D is the domain separation byte and must be between 0x01 and 0x7f inclusive.
func (d *State) BlockSize() int
BlockSize returns the rate of sponge underlying this hash function.
func (d *State) Clone() ShakeHash
Clone returns copy of SHAKE context within its current state.
func (d *State) IsAbsorbing() bool
func (d *State) Read(out []byte) (n int, err error)
Read squeezes an arbitrary number of bytes from the sponge.
func (d *State) Reset()
Reset clears the internal state by zeroing the sponge state and the byte buffer, and setting Sponge.state to absorbing.
func (d *State) Size() int
Size returns the output size of the hash function in bytes.
func (d *State) Sum(in []byte) []byte
Sum applies padding to the hash state and then squeezes out the desired number of output bytes.
func (d *State) SwitchDS(D byte)
func (d *State) Write(p []byte) (written int, err error)
Write absorbs more data into the hash's state. It produces an error if more data is written to the ShakeHash after writing