poseidon

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: 7 Imported by: 67

Documentation

Index

Constants

View Source
const NROUNDSF = 8

NROUNDSF constant from Poseidon paper

Variables

View Source
var NROUNDSP = []int{56, 57, 56, 60, 60, 63, 64, 63, 60, 66, 60, 65, 70, 60, 64, 68}

NROUNDSP constant from Poseidon paper

Functions

func Hash

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

Hash computes the Poseidon hash for the given inputs

func HashBytes added in v0.0.3

func HashBytes(msg []byte) (*big.Int, error)

HashBytes returns a sponge hash of a msg byte slice split into blocks of 31 bytes

func HashBytesX added in v0.0.14

func HashBytesX(msg []byte, frameSize int) (*big.Int, error)

HashBytesX returns a sponge hash of a msg byte slice split into blocks of 31 bytes

func HashWithState added in v0.0.16

func HashWithState(inpBI []*big.Int, initState *big.Int) (*big.Int, error)

HashWithState computes the Poseidon hash for the given inputs and initState

func New added in v0.0.16

func New(frameSize int) (hash.Hash, error)

New returns a new hash.Hash computing the Poseidon hash.

func SpongeHash added in v0.0.14

func SpongeHash(inputs []*big.Int) (*big.Int, error)

SpongeHash returns a sponge hash of inputs (using Poseidon with frame size of 16 inputs)

func SpongeHashX added in v0.0.14

func SpongeHashX(inputs []*big.Int, frameSize int) (*big.Int, error)

SpongeHashX returns a sponge hash of inputs using Poseidon with configurable frame size

func Sum added in v0.0.16

func Sum(b []byte) []byte

Sum returns the Poseidon hash of the input bytes. use frame size of 16 inputs by default

Types

This section is empty.

Jump to

Keyboard shortcuts

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