testutils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const TestFpModulus = 0x429d16a1

Variables

View Source
var (
	TestFpE             = uint64(bits.TrailingZeros64(uint64(TestFpModulus) - 1))
	TestFpProgenitorExp = binary.LittleEndian.AppendUint32(nil, TestFpModulus>>(TestFpE+1))
	TestFpRootOfUnity   = uint64(0xa93059e)
)

Functions

func TestBinaryOp

func TestBinaryOp[FP impl.FiniteFieldElementPtrLowLevel[FP, F], F any](tb testing.TB, a, b, c *F, op func(c, a, b *F))

func TestBinaryOpWithOk

func TestBinaryOpWithOk[FP impl.FiniteFieldElementPtrLowLevel[FP, F], F any](tb testing.TB, a, b, c *F, ok ct.Bool, op func(c, a, b *F) ct.Bool)

func TestUnaryOp

func TestUnaryOp[FP impl.FiniteFieldElementPtrLowLevel[FP, F], F any](tb testing.TB, a, c *F, op func(c, a *F))

func TestUnaryOpWithOk

func TestUnaryOpWithOk[FP impl.FiniteFieldElementPtrLowLevel[FP, F], F any](tb testing.TB, a, c *F, ok ct.Bool, op func(c, a *F) ct.Bool)

Types

type BinaryOpVector

type BinaryOpVector[FP impl.FiniteFieldElementPtrLowLevel[FP, F], F any] struct {
	A FiniteFieldElementJSON[FP, F] `json:"a"`
	B FiniteFieldElementJSON[FP, F] `json:"b"`
	C FiniteFieldElementJSON[FP, F] `json:"c"`
}

type BinaryOpVectorWithOk

type BinaryOpVectorWithOk[FP impl.FiniteFieldElementPtrLowLevel[FP, F], F any] struct {
	A  FiniteFieldElementJSON[FP, F] `json:"a"`
	B  FiniteFieldElementJSON[FP, F] `json:"b"`
	C  FiniteFieldElementJSON[FP, F] `json:"c"`
	Ok ct.Bool                       `json:"ok"`
}

type BinaryOpVectors

type BinaryOpVectors[FP impl.FiniteFieldElementPtrLowLevel[FP, F], F any] struct {
	Vectors []BinaryOpVector[FP, F] `json:"vectors"`
}

type BinaryOpVectorsWithOk

type BinaryOpVectorsWithOk[FP impl.FiniteFieldElementPtrLowLevel[FP, F], F any] struct {
	Vectors []BinaryOpVectorWithOk[FP, F] `json:"vectors"`
}

type FiniteFieldElementJSON

type FiniteFieldElementJSON[FP impl.FiniteFieldElementPtrLowLevel[FP, F], F any] struct {
	V F
}

func (*FiniteFieldElementJSON[FP, F]) UnmarshalJSON

func (f *FiniteFieldElementJSON[FP, F]) UnmarshalJSON(data []byte) error

type TestFp

type TestFp uint64

func (*TestFp) Add

func (fp *TestFp) Add(lhs, rhs *TestFp)

func (*TestFp) Bytes

func (fp *TestFp) Bytes() []byte

func (*TestFp) ComponentsBytes

func (fp *TestFp) ComponentsBytes() [][]byte

func (*TestFp) Degree

func (*TestFp) Degree() uint64

func (*TestFp) Div

func (fp *TestFp) Div(lhs, rhs *TestFp) (ok ct.Bool)

func (*TestFp) Double

func (fp *TestFp) Double(v *TestFp)

func (*TestFp) Equal

func (fp *TestFp) Equal(rhs *TestFp) ct.Bool

func (*TestFp) Inv

func (fp *TestFp) Inv(v *TestFp) (ok ct.Bool)

func (*TestFp) IsNonZero

func (fp *TestFp) IsNonZero() ct.Bool

func (*TestFp) IsOne

func (fp *TestFp) IsOne() ct.Bool

func (*TestFp) IsZero

func (fp *TestFp) IsZero() ct.Bool

func (*TestFp) Limbs

func (fp *TestFp) Limbs() []uint64

func (*TestFp) Mul

func (fp *TestFp) Mul(lhs, rhs *TestFp)

func (*TestFp) Neg

func (fp *TestFp) Neg(v *TestFp)

func (*TestFp) Select

func (fp *TestFp) Select(choice ct.Choice, z, nz *TestFp)

func (*TestFp) Set

func (fp *TestFp) Set(v *TestFp)

func (*TestFp) SetBytes

func (fp *TestFp) SetBytes(data []byte) (ok ct.Bool)

func (*TestFp) SetBytesWide

func (fp *TestFp) SetBytesWide(data []byte) (ok ct.Bool)

func (*TestFp) SetLimbs

func (fp *TestFp) SetLimbs(data []uint64) (ok ct.Bool)

func (*TestFp) SetOne

func (fp *TestFp) SetOne()

func (*TestFp) SetRandom

func (fp *TestFp) SetRandom(prng io.Reader) (ok ct.Bool)

func (*TestFp) SetUint64

func (fp *TestFp) SetUint64(u uint64)

func (*TestFp) SetUniformBytes

func (fp *TestFp) SetUniformBytes(componentsData ...[]byte) (ok ct.Bool)

func (*TestFp) SetZero

func (fp *TestFp) SetZero()

func (*TestFp) Sqrt

func (fp *TestFp) Sqrt(v *TestFp) (ok ct.Bool)

func (*TestFp) Square

func (fp *TestFp) Square(v *TestFp)

func (*TestFp) Sub

func (fp *TestFp) Sub(lhs, rhs *TestFp)

type UnaryOpVector

type UnaryOpVector[FP impl.FiniteFieldElementPtrLowLevel[FP, F], F any] struct {
	A FiniteFieldElementJSON[FP, F] `json:"a"`
	C FiniteFieldElementJSON[FP, F] `json:"c"`
}

type UnaryOpVectorWithOk

type UnaryOpVectorWithOk[FP impl.FiniteFieldElementPtrLowLevel[FP, F], F any] struct {
	A  FiniteFieldElementJSON[FP, F] `json:"a"`
	C  FiniteFieldElementJSON[FP, F] `json:"c"`
	Ok ct.Bool                       `json:"ok"`
}

type UnaryOpVectors

type UnaryOpVectors[FP impl.FiniteFieldElementPtrLowLevel[FP, F], F any] struct {
	Vectors []UnaryOpVector[FP, F] `json:"vectors"`
}

type UnaryOpVectorsWithOk

type UnaryOpVectorsWithOk[FP impl.FiniteFieldElementPtrLowLevel[FP, F], F any] struct {
	Vectors []UnaryOpVectorWithOk[FP, F] `json:"vectors"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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