...

Package expander

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

Overview ▾

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

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.

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)
}