Documentation
¶
Overview ¶
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length functions defined by FIPS 202, as well as the cSHAKE extendable-output-length functions defined by SP 800-185.
Index ¶
- type Digest
- func (d *Digest) AppendBinary(b []byte) ([]byte, error)
- func (d *Digest) BlockSize() int
- func (d *Digest) Clone() *Digest
- func (d *Digest) MarshalBinary() ([]byte, error)
- func (d *Digest) Reset()
- func (d *Digest) Size() int
- func (d *Digest) Sum(b []byte) []byte
- func (d *Digest) UnmarshalBinary(b []byte) error
- func (d *Digest) Write(p []byte) (n int, err error)
- type SHAKE
- func (s *SHAKE) AppendBinary(b []byte) ([]byte, error)
- func (s *SHAKE) BlockSize() int
- func (s *SHAKE) Clone() *SHAKE
- func (s *SHAKE) MarshalBinary() ([]byte, error)
- func (s *SHAKE) Read(out []byte) (n int, err error)
- func (s *SHAKE) Reset()
- func (s *SHAKE) Size() int
- func (s *SHAKE) Sum(in []byte) []byte
- func (s *SHAKE) UnmarshalBinary(b []byte) error
- func (s *SHAKE) Write(p []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Digest ¶
type Digest struct {
// contains filtered or unexported fields
}
func NewLegacyKeccak256 ¶
func NewLegacyKeccak256() *Digest
NewLegacyKeccak256 returns a new Digest computing the legacy, non-standard Keccak-256 hash.
func NewLegacyKeccak512 ¶
func NewLegacyKeccak512() *Digest
NewLegacyKeccak512 returns a new Digest computing the legacy, non-standard Keccak-512 hash.
func (*Digest) MarshalBinary ¶
func (*Digest) Sum ¶
Sum appends the current hash to b and returns the resulting slice. It does not change the underlying hash state.
func (*Digest) UnmarshalBinary ¶
type SHAKE ¶
type SHAKE struct {
// contains filtered or unexported fields
}
func NewCShake128 ¶
NewCShake128 creates a new cSHAKE128 XOF.
N is used to define functions based on cSHAKE, it can be empty when plain cSHAKE is desired. S is a customization byte string used for domain separation. When N and S are both empty, this is equivalent to NewShake128.
func NewCShake256 ¶
NewCShake256 creates a new cSHAKE256 XOF.
N is used to define functions based on cSHAKE, it can be empty when plain cSHAKE is desired. S is a customization byte string used for domain separation. When N and S are both empty, this is equivalent to NewShake256.
func (*SHAKE) MarshalBinary ¶
func (*SHAKE) Sum ¶
Sum appends a portion of output to b and returns the resulting slice. The output length is selected to provide full-strength generic security: 32 bytes for SHAKE128 and 64 bytes for SHAKE256. It does not change the underlying state. It panics if any output has already been read.