package expander

import "github.com/cloudflare/circl/expander"

Package expander generates arbitrary bytes from an XOF or Hash function.

Index

Functions

func NewExpanderMD

func NewExpanderMD(h crypto.Hash, dst []byte) *expanderMD

NewExpanderMD returns a hash function based on a Merkle-Damgård hash function.

func NewExpanderXOF

func NewExpanderXOF(id xof.ID, kSecLevel uint, dst []byte) *expanderXOF

NewExpanderXOF returns an Expander based on an extendable output function. The kSecLevel parameter is the target security level in bits, and dst is a domain separation string.

Types

type Expander

type Expander interface {
	// Expand generates a pseudo-random byte string of a determined length by
	// expanding an input string.
	Expand(in []byte, length uint) (pseudo []byte)
}

Source Files

expander.go

Version
v1.6.1 (latest)
Published
Apr 9, 2025
Platform
linux/amd64
Imports
5 packages
Last checked
3 hours ago

Tools for package owners.