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:
Kevin Jue
2023-06-17 19:44:20 -07:00
committed by GitHub
parent 15b7dcbcdb
commit 9ce7bb7dbb
12 changed files with 17094 additions and 95 deletions

View File

@@ -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]
}