Documentation ¶
Index ¶
- func AllocateSlice(n int) []frontend.Variable
- func AssertCircuitSolved(t *testing.T, def TestDefineFunc)
- func ChecksumLooselyPackedBytes(b []byte, buf []byte, h hashinterface.Hash)
- func Exp(api frontend.API, x frontend.Variable, n int) frontend.Variable
- func PartialChecksumBatchesPackedHint(maxNbBatches int) solver.Hint
- func RepeatedVariable(x frontend.Variable, n int) []frontend.Variable
- type TestDefineFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllocateSlice ¶
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 PartialChecksumBatchesPackedHint ¶
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.
Types ¶
type TestDefineFunc ¶
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).