BN254 and Grumpkin Poseidon configurations (#106)

* Add BN254 and Grumpkin Poseidon configurations

* Remove unncecessary comment

* Fix BN254 Poseidon config test

* Correction

* Update folding-schemes/src/transcript/poseidon/grumpkin.rs

Co-authored-by: Pierre <pdaixmoreux@gmail.com>

---------

Co-authored-by: Pierre <pdaixmoreux@gmail.com>
This commit is contained in:
Ahmad Afuni
2024-06-03 22:36:17 +10:00
committed by GitHub
parent da4ab5c937
commit 852134a898
23 changed files with 1195 additions and 74 deletions

View File

@@ -25,7 +25,7 @@ use folding_schemes::folding::nova::Nova;
use folding_schemes::frontend::FCircuit;
use folding_schemes::{Error, FoldingScheme};
mod utils;
use folding_schemes::transcript::poseidon::poseidon_test_config;
use folding_schemes::transcript::poseidon::poseidon_canonical_config;
use utils::init_nova_ivc_params;
/// This is the circuit that we want to fold, it implements the FCircuit trait. The parameter z_i
@@ -131,7 +131,7 @@ pub mod tests {
// test to check that the ExternalInputsCircuits computes the same values inside and outside the circuit
#[test]
fn test_f_circuit() {
let poseidon_config = poseidon_test_config::<Fr>();
let poseidon_config = poseidon_canonical_config::<Fr>();
let cs = ConstraintSystem::<Fr>::new_ref();
@@ -169,7 +169,7 @@ fn main() {
];
assert_eq!(external_inputs.len(), num_steps);
let poseidon_config = poseidon_test_config::<Fr>();
let poseidon_config = poseidon_canonical_config::<Fr>();
let F_circuit = ExternalInputsCircuits::<Fr>::new(poseidon_config).unwrap();
println!("Prepare Nova ProverParams & VerifierParams");

View File

@@ -21,7 +21,7 @@ use folding_schemes::{
decider_eth_circuit::DeciderEthCircuit, get_r1cs, Nova, ProverParams, VerifierParams,
},
frontend::FCircuit,
transcript::poseidon::poseidon_test_config,
transcript::poseidon::poseidon_canonical_config,
FoldingScheme,
};
@@ -37,7 +37,7 @@ pub(crate) fn init_nova_ivc_params<FC: FCircuit<Fr>>(
KZGVerifierKey<Bn254>,
) {
let mut rng = ark_std::test_rng();
let poseidon_config = poseidon_test_config::<Fr>();
let poseidon_config = poseidon_canonical_config::<Fr>();
// get the CM & CF_CM len
let (r1cs, cf_r1cs) = get_r1cs::<G1, GVar, G2, GVar2, FC>(&poseidon_config, F_circuit).unwrap();