mirror of
https://github.com/arnaucube/gnark-plonky2-verifier.git
synced 2026-01-12 09:01:32 +01:00
Step test case with public inputs (#23)
* added step test case * export solidity code * just set proof's public input as public variables * make serialization a command line option * added flag to output solidity * some changes to the benchmark file * used gnark cherry picked bug fix * removed fuzz testing * added some logging * more debug messages and test cases for the hint issue * removed usage of goldilocks reduce * removed prints * removed GoldilocksReduce * removed prints * added a todo * some serialization changes
This commit is contained in:
@@ -165,12 +165,12 @@ func GoldilocksMulAdd(api frontend.API, operand1, operand2, operand3 frontend.Va
|
||||
|
||||
func GoldilocksMulAddHint(_ *big.Int, inputs []*big.Int, results []*big.Int) error {
|
||||
if len(inputs) != 3 {
|
||||
return fmt.Errorf("GoldilocksMulAddHint expects 3 input operands")
|
||||
panic("GoldilocksMulAddHint expects 3 input operands")
|
||||
}
|
||||
|
||||
for _, operand := range inputs {
|
||||
if operand.Cmp(GOLDILOCKS_MODULUS) >= 0 {
|
||||
return fmt.Errorf("%s is not in the field", operand.String())
|
||||
panic(fmt.Sprintf("%s is not in the field", operand.String()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,10 +184,3 @@ func GoldilocksMulAddHint(_ *big.Int, inputs []*big.Int, results []*big.Int) err
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func GoldilocksReduce(api frontend.API, x frontend.Variable) frontend.Variable {
|
||||
// Use gnark's emulated field library.
|
||||
fieldAPI := NewFieldAPI(api)
|
||||
element := fieldAPI.NewElement(x)
|
||||
return fieldAPI.Reduce(element).Limbs[0]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user