mimc7

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: Apache-2.0, MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

View Source
const SEED = "mimc"

SEED defines the seed used to constants

Variables

This section is empty.

Functions

func Hash

func Hash(arr []*big.Int, key *big.Int) (*big.Int, error)

Hash performs the MIMC7 hash over a *big.Int array

func HashBytes added in v0.0.3

func HashBytes(b []byte) *big.Int

HashBytes hashes a msg byte slice by blocks of 31 bytes encoded as little-endian

func HashGeneric

func HashGeneric(iv *big.Int, arr []*big.Int, nRounds int) (*big.Int, error)

HashGeneric performs the MIMC7 hash over a *big.Int array, in a generic way, where it can be specified the Finite Field over R, and the number of rounds

func MIMC7Hash

func MIMC7Hash(xInBI, kBI *big.Int) *big.Int

MIMC7Hash performs the MIMC7 hash over a *big.Int, using the Finite Field over R and the number of rounds setted in the `constants` variable

func MIMC7HashGeneric

func MIMC7HashGeneric(xInBI, kBI *big.Int, nRounds int) *big.Int

MIMC7HashGeneric performs the MIMC7 hash over a *big.Int, in a generic way, where it can be specified the Finite Field over R, and the number of rounds

Types

This section is empty.

Jump to

Keyboard shortcuts

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