Documentation
¶
Overview ¶
Package msgexpand generates arbitrary bytes from an XOF or Hash function.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrZeroLengthDST indicates that given dst has zero value ErrZeroLengthDST = errors.New("msgexpand: zero-length dst") // ErrRecommendedDSTLen indicates that given dst length shorter than recommended size ErrRecommendedDSTLen = fmt.Errorf("msgexpand: dst length shorter than recommended length (%d)", recommendedDSTLen) )
Functions ¶
This section is empty.
Types ¶
type MessageExpand ¶
type MessageExpand interface { // Expand generates a pseudo-random byte string of a determined length by // expanding an input string. Expand(in, dst []byte, lenInBytes int) (uniform []byte, err error) }
MessageExpand is an interface that identify XMD and XOF Expand.
func NewMessageExpandXMD ¶
func NewMessageExpandXMD(h hash.Hashing) MessageExpand
NewMessageExpandXMD returns a expander interface based on a Merkle-Damgård hash functions.
func NewMessageExpandXOF ¶
func NewMessageExpandXOF(id xof.Extendable, secLevel int) MessageExpand
NewMessageExpandXOF returns an expander based on an extendable output functions. The kSecLevel parameter is the target security level in bits.
Click to show internal directories.
Click to hide internal directories.