poseidondst

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arity

type Arity interface {
	Arity() int
}

type Arity11

type Arity11 struct{}

func (Arity11) Arity

func (a Arity11) Arity() int

type Arity16

type Arity16 struct{}

func (Arity16) Arity

func (a Arity16) Arity() int

type Arity2

type Arity2 struct{}

func (Arity2) Arity

func (a Arity2) Arity() int

type Arity24

type Arity24 struct{}

func (Arity24) Arity

func (a Arity24) Arity() int

type Arity3

type Arity3 struct{}

func (Arity3) Arity

func (a Arity3) Arity() int

type Arity32

type Arity32 struct{}

func (Arity32) Arity

func (a Arity32) Arity() int

type Arity36

type Arity36 struct{}

func (Arity36) Arity

func (a Arity36) Arity() int

type Arity4

type Arity4 struct{}

func (Arity4) Arity

func (a Arity4) Arity() int

type Arity8

type Arity8 struct{}

func (Arity8) Arity

func (a Arity8) Arity() int

type DST

type DST interface {
	DST() *fr.Element
}

type DSTElement

type DSTElement[D DST] struct {
	fr.Element
}

DSTElement is a custom element which overrides SetString used by the poseidon hash function to set the default hardcoded DST. We hijack the SetString function to set the DST to the hardcoded value needed for Snap.

func (*DSTElement[D]) Add

func (c *DSTElement[D]) Add(e2 *DSTElement[D], e *DSTElement[D]) *DSTElement[D]

func (*DSTElement[D]) BigInt

func (c *DSTElement[D]) BigInt(b *big.Int) *big.Int

func (*DSTElement[D]) Cmp

func (c *DSTElement[D]) Cmp(x *DSTElement[D]) int

func (*DSTElement[D]) Inverse

func (c *DSTElement[D]) Inverse(e *DSTElement[D]) *DSTElement[D]

func (*DSTElement[D]) Mul

func (c *DSTElement[D]) Mul(e2 *DSTElement[D], e *DSTElement[D]) *DSTElement[D]

func (*DSTElement[D]) New

func (c *DSTElement[D]) New() *DSTElement[D]

func (*DSTElement[D]) Set

func (c *DSTElement[D]) Set(e *DSTElement[D]) *DSTElement[D]

func (*DSTElement[D]) SetBigInt

func (c *DSTElement[D]) SetBigInt(b *big.Int) *DSTElement[D]

func (*DSTElement[D]) SetBytes

func (c *DSTElement[D]) SetBytes(bytes []byte) *DSTElement[D]

func (*DSTElement[D]) SetOne

func (c *DSTElement[D]) SetOne() *DSTElement[D]

func (*DSTElement[D]) SetString

func (c *DSTElement[D]) SetString(s string) (*DSTElement[D], error)

func (*DSTElement[D]) SetUint64

func (c *DSTElement[D]) SetUint64(u uint64) *DSTElement[D]

func (*DSTElement[D]) SetZero

func (c *DSTElement[D]) SetZero() *DSTElement[D]

func (*DSTElement[D]) Square

func (c *DSTElement[D]) Square(e *DSTElement[D]) *DSTElement[D]

func (*DSTElement[D]) Sub

func (c *DSTElement[D]) Sub(e2 *DSTElement[D], e *DSTElement[D]) *DSTElement[D]

type MerkleTree2

type MerkleTree2 = DSTElement[MerkleTreeDST[Arity2]]

type MerkleTree8

type MerkleTree8 = DSTElement[MerkleTreeDST[Arity8]]

type MerkleTreeDST

type MerkleTreeDST[A Arity] struct{}

func (MerkleTreeDST[A]) DST

func (m MerkleTreeDST[A]) DST() *fr.Element

type SnapDST

type SnapDST struct{}

func (SnapDST) DST

func (s SnapDST) DST() *fr.Element

type SnapElement

type SnapElement = DSTElement[SnapDST]

Jump to

Keyboard shortcuts

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