Documentation
¶
Overview ¶
Package sha3 implements the SHA-3 hash algorithms and the SHAKE extendable output functions defined in FIPS 202.
Index ¶
- func Sum224(data []byte) [28]byte
- func Sum256(data []byte) [32]byte
- func Sum384(data []byte) [48]byte
- func Sum512(data []byte) [64]byte
- func SumSHAKE128(data []byte, length int) []byte
- func SumSHAKE256(data []byte, length int) []byte
- type SHA3
- func (s *SHA3) AppendBinary(p []byte) ([]byte, error)
- func (s *SHA3) BlockSize() int
- func (s *SHA3) MarshalBinary() ([]byte, error)
- func (s *SHA3) Reset()
- func (s *SHA3) Size() int
- func (s *SHA3) Sum(b []byte) []byte
- func (s *SHA3) UnmarshalBinary(data []byte) error
- func (s *SHA3) Write(p []byte) (n int, err error)
- type SHAKE
- func (s *SHAKE) AppendBinary(p []byte) ([]byte, error)
- func (s *SHAKE) BlockSize() int
- func (s *SHAKE) MarshalBinary() ([]byte, error)
- func (s *SHAKE) Read(p []byte) (n int, err error)
- func (s *SHAKE) Reset()
- func (s *SHAKE) UnmarshalBinary(data []byte) error
- func (s *SHAKE) Write(p []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SumSHAKE128 ¶
SumSHAKE128 applies the SHAKE128 extendable output function to data and returns an output of the given length in bytes.
func SumSHAKE256 ¶
SumSHAKE256 applies the SHAKE256 extendable output function to data and returns an output of the given length in bytes.
Types ¶
type SHA3 ¶
type SHA3 struct {
// contains filtered or unexported fields
}
SHA3 is an instance of a SHA-3 hash. It implements hash.Hash.
func (*SHA3) AppendBinary ¶
AppendBinary implements encoding.BinaryAppender.
func (*SHA3) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler.
func (*SHA3) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler.
type SHAKE ¶
type SHAKE struct {
// contains filtered or unexported fields
}
SHAKE is an instance of a SHAKE extendable output function.
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) AppendBinary ¶
AppendBinary implements encoding.BinaryAppender.
func (*SHAKE) MarshalBinary ¶
MarshalBinary implements encoding.BinaryMarshaler.
func (*SHAKE) Read ¶
Read squeezes more output from the XOF.
Any call to Write after a call to Read will panic.
func (*SHAKE) UnmarshalBinary ¶
UnmarshalBinary implements encoding.BinaryUnmarshaler.