keep-starknet-strange / garaga

State-of-the-art Elliptic Curve operations and SNARKS verification for Cairo & Starknet 🐺.
https://felt.gitbook.io/garaga
MIT License
181 stars 39 forks source link

feat: add Groth16 SNARK circuit on bn254 verification example #45

Closed feltroidprime closed 1 year ago

feltroidprime commented 1 year ago

add a file in /tests/cairo_snarks/groth16/sample_groth16.cairo

input a groth16 proof and use the pairing and e12 arithmetics functions to verify it. Example of usage of the library can be found in tests/protostar_tests/test_pair.cairo

reference https://www.zeroknowledgeblog.com/index.php/groth16

help is welcomed to create the proof for a simple groth16 circuit