poseidon2

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSizebuffer = errors.New("the size of the input should match the size of the hash buffer")
)

Functions

This section is empty.

Types

type Permutation added in v0.13.0

type Permutation struct {
	// contains filtered or unexported fields
}

func NewPoseidon2 added in v0.13.0

func NewPoseidon2(api frontend.API) (*Permutation, error)

NewPoseidon2 returns a new Poseidon2 hasher with default parameters as defined in the gnark-crypto library.

func NewPoseidon2FromParameters added in v0.13.0

func NewPoseidon2FromParameters(api frontend.API, width, nbFullRounds, nbPartialRounds int) (*Permutation, error)

NewPoseidon2FromParameters returns a new Poseidon2 hasher with the given parameters. The parameters are used to precompute the round keys. The round key computation is deterministic and depends on the curve ID. See the corresponding NewParameters function in the gnark-crypto library poseidon2 packages for more details.

func (*Permutation) Compress added in v0.13.0

func (h *Permutation) Compress(left, right frontend.Variable) frontend.Variable

Compress applies the permutation on left and right and returns the right lane of the result. Panics if the permutation instance is not initialized with a width of 2.

Implements the hash.Compressor interface for building a Merkle-Damgard hash construction.

func (*Permutation) Permutation added in v0.13.0

func (h *Permutation) Permutation(input []frontend.Variable) error

Permutation applies the permutation on input, and stores the result in input.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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