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 (d *SHA3) Clone() (hash.Cloner, error)
- 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. The zero value is a usable SHA3-256 hash.
func (*SHA3) AppendBinary ΒΆ
AppendBinary implements encoding.BinaryAppender.
func (*SHA3) Clone ΒΆ added in go1.25.0
Clone implements hash.Cloner.
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. The zero value is a usable SHAKE256 hash.
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.