mirror of
https://github.com/arnaucube/sonobe.git
synced 2026-01-19 04:11:34 +01:00
Onchain decider circuit for Protogalaxy (#145)
* Move r1cs and ccs to standalone folders * Simplify type bounds of SparseMatrixVar * Implement `EquivalenceGadget` trait for `FpVar` and `NonNativeUintVar`. Together with the existing `MatrixGadget` and `VectorGadget`, we can now use the same logic for checking R1CS satisfiability of `R1CSVar` both natively and non-natively. * Simplify trait bounds * Implement `ArithGadget` for `R1CSMatricesVar` and `CCSMatricesVar` * `PedersenGadget::commit` now takes slices as input * Structs for proofs and auxiliary values in protogalaxy * `u` in LCCCS should be `z[0]` * `Inputize` trait * Generic decider circuits * Verifier should check the commitments in committed instances * Update the comments according to the new docs * Fix examples * Add `DeciderEnabledNIFS::fold_group_elements_native` to wrap code for folding commitments * Fix incorrect endian * Format * Get rid of `unwrap` when possible
This commit is contained in:
@@ -17,9 +17,12 @@ use ark_grumpkin::{constraints::GVar as GVar2, Projective as G2};
|
||||
|
||||
use folding_schemes::{
|
||||
commitment::{kzg::KZG, pedersen::Pedersen},
|
||||
folding::nova::{
|
||||
decider_eth::{prepare_calldata, Decider as DeciderEth},
|
||||
Nova, PreprocessorParam,
|
||||
folding::{
|
||||
nova::{
|
||||
decider_eth::{prepare_calldata, Decider as DeciderEth},
|
||||
Nova, PreprocessorParam,
|
||||
},
|
||||
traits::CommittedInstanceOps,
|
||||
},
|
||||
frontend::FCircuit,
|
||||
transcript::poseidon::poseidon_canonical_config,
|
||||
@@ -85,7 +88,6 @@ fn main() {
|
||||
// prepare the Nova prover & verifier params
|
||||
let nova_preprocess_params = PreprocessorParam::new(poseidon_config, f_circuit.clone());
|
||||
let nova_params = N::preprocess(&mut rng, &nova_preprocess_params).unwrap();
|
||||
let pp_hash = nova_params.1.pp_hash().unwrap();
|
||||
|
||||
// initialize the folding scheme engine, in our case we use Nova
|
||||
let mut nova = N::init(&nova_params, f_circuit.clone(), z_0).unwrap();
|
||||
@@ -119,8 +121,8 @@ fn main() {
|
||||
nova.i,
|
||||
nova.z_0.clone(),
|
||||
nova.z_i.clone(),
|
||||
&nova.U_i,
|
||||
&nova.u_i,
|
||||
&nova.U_i.get_commitments(),
|
||||
&nova.u_i.get_commitments(),
|
||||
&proof,
|
||||
)
|
||||
.unwrap();
|
||||
@@ -133,7 +135,6 @@ fn main() {
|
||||
|
||||
let calldata: Vec<u8> = prepare_calldata(
|
||||
function_selector,
|
||||
pp_hash,
|
||||
nova.i,
|
||||
nova.z_0,
|
||||
nova.z_i,
|
||||
|
||||
Reference in New Issue
Block a user