Documentation
¶
Index ¶
- Variables
- func CheckDST(dst []byte) error
- func ExpandXMD(id crypto.Hash, input, dst []byte, length uint) ([]byte, error)
- func ExpandXMDTo(id crypto.Hash, out, input, dst []byte) error
- func ExpandXOF(ext *xHash.ExtendableHash, input, dst []byte, length uint) ([]byte, error)
- func VerifyDSTXMD(id crypto.Hash, dst []byte) error
- func VerifyDSTXOF(x *xHash.ExtendableHash, dst []byte) error
- func VetDSTXMD(id crypto.Hash, dst []byte) ([]byte, error)
- func VetDSTXOF(x *xHash.ExtendableHash, dst []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrZeroLengthDST is returned when a group could not be decoded. ErrZeroLengthDST = errors.New("the provided domain separation tag is empty") // ErrLengthTooHigh is returned when the requested output length is too large for the hash function or the DST. ErrLengthTooHigh = errors.New("requested byte length is too high") // ErrXMDOutputSizeTooBig is returned when the provided hash function returns too many bytes. ErrXMDOutputSizeTooBig = errors.New("the hash function's output size is too big") )
Functions ¶
func ExpandXMD ¶
ExpandXMD expands the input and dst using the given fixed length hash function. It implements expand_message_xmd as specified in RFC 9380 section 5.3.1. - dst MUST be non-nil, longer than 0 and lower than 256. It's recommended that DST is at least 16 bytes long. - length must be a positive integer lower than 255 * (size of digest).
func ExpandXMDTo ¶
ExpandXMDTo behaves like ExpandXMD but writes the output into out. The requested output length is len(out); cap(out) is ignored. An error is returned if len(out) is too high for the hash function or the DST.
func ExpandXOF ¶
ExpandXOF expands the input and dst using the given extendable output hash function. It implements expand_message_xof as specified in RFC 9380 section 5.3.2. - dst MUST be non-nil and its length longer than 0. It's recommended that DST is at least 16 bytes long. - length must be a positive integer higher than 32.
func VerifyDSTXMD ¶
VerifyDSTXMD returns an error if the DST or hash function are not compliant.
func VerifyDSTXOF ¶
func VerifyDSTXOF(x *xHash.ExtendableHash, dst []byte) error
VerifyDSTXOF returns an error if the DST or hash function are not compliant.
Types ¶
This section is empty.