gnarkutil

package
v0.0.0-...-4af87b5 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllocateSlice

func AllocateSlice(n int) []frontend.Variable

Allocate a slice of field element

func AssertCircuitSolved

func AssertCircuitSolved(t *testing.T, def TestDefineFunc)

AssertCircuitSolved asserts that the testing circuit defined by def is satisfied. This is used to check that a specified "gnark" circuit functions works as expected without having to implement a custom circuit for every test.

func ChecksumLooselyPackedBytes

func ChecksumLooselyPackedBytes(b []byte, buf []byte, h hashinterface.Hash)

ChecksumLooselyPackedBytes produces the results expected by CheckBatchesSums, but more generalized b is partitioned into elements of length len(buf)-1 and hashed together, with zero padding on the right if necessary. the first bytes of the result are put in buf. if b consists of only one "element", the result is not hashed

func Exp

exponentiation in gnark circuit, using the fast exponentiation

func PartialChecksumBatchesPackedHint

func PartialChecksumBatchesPackedHint(maxNbBatches int) solver.Hint

ins: nbBatches, [end byte positions], payload... the result for each batch is <data (31 bytes)> ... <data (31 bytes)> for soundness some kind of length indicator must later be incorporated.

func RepeatedVariable

func RepeatedVariable(x frontend.Variable, n int) []frontend.Variable

Types

type TestDefineFunc

type TestDefineFunc func(frontend.API) error

TestDefineFunc represents a gnark's Define function that should be self-standing and does not uses a witness (all variables are either constants or internal).

Jump to

Keyboard shortcuts

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