sha3

Imports

Imports #

"crypto"
"crypto/internal/fips140/sha3"
"hash"
_ "unsafe"

Structs

SHA3 struct #

SHA3 is an instance of a SHA-3 hash. It implements [hash.Hash].

type SHA3 struct {
s sha3.Digest
}

SHAKE struct #

SHAKE is an instance of a SHAKE extendable output function.

type SHAKE struct {
s sha3.SHAKE
}

Functions

AppendBinary method #

AppendBinary implements [encoding.BinaryAppender].

func (s *SHA3) AppendBinary(p []byte) ([]byte, error)

AppendBinary method #

AppendBinary implements [encoding.BinaryAppender].

func (s *SHAKE) AppendBinary(p []byte) ([]byte, error)

BlockSize method #

BlockSize returns the rate of the XOF.

func (s *SHAKE) BlockSize() int

BlockSize method #

BlockSize returns the hash's rate.

func (s *SHA3) BlockSize() int

MarshalBinary method #

MarshalBinary implements [encoding.BinaryMarshaler].

func (s *SHAKE) MarshalBinary() ([]byte, error)

MarshalBinary method #

MarshalBinary implements [encoding.BinaryMarshaler].

func (s *SHA3) MarshalBinary() ([]byte, error)

New224 function #

New224 creates a new SHA3-224 hash.

func New224() *SHA3

New256 function #

New256 creates a new SHA3-256 hash.

func New256() *SHA3

New384 function #

New384 creates a new SHA3-384 hash.

func New384() *SHA3

New512 function #

New512 creates a new SHA3-512 hash.

func New512() *SHA3

NewCSHAKE128 function #

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 NewCSHAKE128(N []byte, S []byte) *SHAKE

NewCSHAKE256 function #

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 NewCSHAKE256(N []byte, S []byte) *SHAKE

NewSHAKE128 function #

NewSHAKE128 creates a new SHAKE128 XOF.

func NewSHAKE128() *SHAKE

NewSHAKE256 function #

NewSHAKE256 creates a new SHAKE256 XOF.

func NewSHAKE256() *SHAKE

Read method #

Read squeezes more output from the XOF. Any call to Write after a call to Read will panic.

func (s *SHAKE) Read(p []byte) (n int, err error)

Reset method #

Reset resets the hash to its initial state.

func (s *SHA3) Reset()

Reset method #

Reset resets the XOF to its initial state.

func (s *SHAKE) Reset()

Size method #

Size returns the number of bytes Sum will produce.

func (s *SHA3) Size() int

Sum method #

Sum appends the current hash to b and returns the resulting slice.

func (s *SHA3) Sum(b []byte) []byte

Sum224 function #

Sum224 returns the SHA3-224 hash of data.

func Sum224(data []byte) [28]byte

Sum256 function #

Sum256 returns the SHA3-256 hash of data.

func Sum256(data []byte) [32]byte

Sum384 function #

Sum384 returns the SHA3-384 hash of data.

func Sum384(data []byte) [48]byte

Sum512 function #

Sum512 returns the SHA3-512 hash of data.

func Sum512(data []byte) [64]byte

SumSHAKE128 function #

SumSHAKE128 applies the SHAKE128 extendable output function to data and returns an output of the given length in bytes.

func SumSHAKE128(data []byte, length int) []byte

SumSHAKE256 function #

SumSHAKE256 applies the SHAKE256 extendable output function to data and returns an output of the given length in bytes.

func SumSHAKE256(data []byte, length int) []byte

UnmarshalBinary method #

UnmarshalBinary implements [encoding.BinaryUnmarshaler].

func (s *SHA3) UnmarshalBinary(data []byte) error

UnmarshalBinary method #

UnmarshalBinary implements [encoding.BinaryUnmarshaler].

func (s *SHAKE) UnmarshalBinary(data []byte) error

Write method #

Write absorbs more data into the XOF's state. It panics if any output has already been read.

func (s *SHAKE) Write(p []byte) (n int, err error)

Write method #

Write absorbs more data into the hash's state.

func (s *SHA3) Write(p []byte) (n int, err error)

fips140hash_sha3Unwrap function #

go:linkname fips140hash_sha3Unwrap crypto/internal/fips140hash.sha3Unwrap

func fips140hash_sha3Unwrap(sha3 *SHA3) *sha3.Digest

init function #

func init()

sumSHAKE128 function #

func sumSHAKE128(out []byte, data []byte, length int) []byte

sumSHAKE256 function #

func sumSHAKE256(out []byte, data []byte, length int) []byte

Generated with Arrow