expander

package
v1.3.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL