poseidon

package
v0.0.0-...-b0046da Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Grain

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

Grain struct

func NewGrain

func NewGrain(POS_RF, POS_T, POS_RATE int64) *Grain

Constructor for Grain

func (*Grain) ReadBits

func (g *Grain) ReadBits(bits int) *big.Int

Read bits from the LFSR

func (*Grain) ReadFe

func (g *Grain) ReadFe(Q int) int

Read field element from the LFSR

type Poseidon

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

Poseidon structure

func NewPoseidon

func NewPoseidon(initial []int, posRf, posT, posRate, q int) *Poseidon

NewPoseidon is constructor for Poseidon structure

func (*Poseidon) BlockSize

func (p *Poseidon) BlockSize() int

TODO dummy BlockSize returns the block size

func (*Poseidon) Permute

func (p *Poseidon) Permute() error

Permute function to apply Poseidon permutation

func (*Poseidon) PoseidonPerm

func (p *Poseidon) PoseidonPerm()

func (*Poseidon) Read

func (p *Poseidon) Read(n int) []int

Read function (squeezing phase)

func (*Poseidon) ReadNoMod

func (p *Poseidon) ReadNoMod(n, posRate int) ([]int, error)

ReadNoMod is Read without modulus

func (*Poseidon) ReadUint32

func (p *Poseidon) ReadUint32(n int) []uint32

func (*Poseidon) Reset

func (p *Poseidon) Reset()

Reset resets the Poseidon state

func (*Poseidon) Size

func (p *Poseidon) Size() int

TODO dummy Size returns the output size in bytes

func (*Poseidon) Sum

func (p *Poseidon) Sum(b []byte) []byte

Sum appends the hash and returns the resulting slice

func (*Poseidon) Write

func (p *Poseidon) Write(data []byte) (n int, err error)

Write for hash.Hash interface (accepts byte slices)

func (*Poseidon) WriteInts

func (p *Poseidon) WriteInts(fes []int) error

WriteInts writes integer inputs (absorbing phase)

func (*Poseidon) WriteUint32

func (p *Poseidon) WriteUint32(fes []uint32) error

Jump to

Keyboard shortcuts

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