mirror of
https://github.com/arnaucube/sonobe.git
synced 2026-01-28 14:56:40 +01:00
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:
@@ -559,7 +559,7 @@ pub mod tests {
|
||||
use crate::commitment::pedersen::Pedersen;
|
||||
use crate::folding::nova::nifs::tests::prepare_simple_fold_inputs;
|
||||
use crate::folding::nova::nifs::NIFS;
|
||||
use crate::transcript::poseidon::poseidon_test_config;
|
||||
use crate::transcript::poseidon::poseidon_canonical_config;
|
||||
|
||||
#[test]
|
||||
fn test_committed_instance_var() {
|
||||
@@ -615,7 +615,7 @@ pub mod tests {
|
||||
#[test]
|
||||
fn test_committed_instance_hash() {
|
||||
let mut rng = ark_std::test_rng();
|
||||
let poseidon_config = poseidon_test_config::<Fr>();
|
||||
let poseidon_config = poseidon_canonical_config::<Fr>();
|
||||
|
||||
let i = Fr::from(3_u32);
|
||||
let z_0 = vec![Fr::from(3_u32)];
|
||||
@@ -654,7 +654,7 @@ pub mod tests {
|
||||
#[test]
|
||||
fn test_challenge_gadget() {
|
||||
let mut rng = ark_std::test_rng();
|
||||
let poseidon_config = poseidon_test_config::<Fr>();
|
||||
let poseidon_config = poseidon_canonical_config::<Fr>();
|
||||
|
||||
let u_i = CommittedInstance::<Projective> {
|
||||
cmE: Projective::rand(&mut rng),
|
||||
|
||||
@@ -377,7 +377,7 @@ pub mod tests {
|
||||
|
||||
use crate::folding::nova::get_cm_coordinates;
|
||||
use crate::folding::nova::nifs::tests::prepare_simple_fold_inputs;
|
||||
use crate::transcript::poseidon::poseidon_test_config;
|
||||
use crate::transcript::poseidon::poseidon_canonical_config;
|
||||
|
||||
#[test]
|
||||
fn test_committed_instance_cyclefold_var() {
|
||||
@@ -488,7 +488,7 @@ pub mod tests {
|
||||
#[test]
|
||||
fn test_cyclefold_challenge_gadget() {
|
||||
let mut rng = ark_std::test_rng();
|
||||
let poseidon_config = poseidon_test_config::<Fq>();
|
||||
let poseidon_config = poseidon_canonical_config::<Fq>();
|
||||
|
||||
let u_i = CommittedInstance::<Projective> {
|
||||
cmE: Projective::zero(), // zero on purpose, so we test also the zero point case
|
||||
@@ -550,7 +550,7 @@ pub mod tests {
|
||||
#[test]
|
||||
fn test_cyclefold_hash_gadget() {
|
||||
let mut rng = ark_std::test_rng();
|
||||
let poseidon_config = poseidon_test_config::<Fq>();
|
||||
let poseidon_config = poseidon_canonical_config::<Fq>();
|
||||
|
||||
let U_i = CommittedInstance::<Projective> {
|
||||
cmE: Projective::rand(&mut rng),
|
||||
|
||||
@@ -292,7 +292,7 @@ pub mod tests {
|
||||
use crate::commitment::pedersen::Pedersen;
|
||||
use crate::folding::nova::{get_cs_params_len, ProverParams};
|
||||
use crate::frontend::tests::CubicFCircuit;
|
||||
use crate::transcript::poseidon::poseidon_test_config;
|
||||
use crate::transcript::poseidon::poseidon_canonical_config;
|
||||
|
||||
#[test]
|
||||
fn test_decider() {
|
||||
@@ -319,7 +319,7 @@ pub mod tests {
|
||||
>;
|
||||
|
||||
let mut rng = ark_std::test_rng();
|
||||
let poseidon_config = poseidon_test_config::<Fr>();
|
||||
let poseidon_config = poseidon_canonical_config::<Fr>();
|
||||
|
||||
let F_circuit = CubicFCircuit::<Fr>::new(()).unwrap();
|
||||
let z_0 = vec![Fr::from(3_u32)];
|
||||
|
||||
@@ -614,7 +614,7 @@ pub mod tests {
|
||||
use crate::commitment::pedersen::Pedersen;
|
||||
use crate::folding::nova::{get_cs_params_len, ProverParams, VerifierParams};
|
||||
use crate::frontend::tests::{CubicFCircuit, CustomFCircuit, WrapperCircuit};
|
||||
use crate::transcript::poseidon::poseidon_test_config;
|
||||
use crate::transcript::poseidon::poseidon_canonical_config;
|
||||
use crate::FoldingScheme;
|
||||
|
||||
use crate::ccs::r1cs::tests::{get_test_r1cs, get_test_z};
|
||||
@@ -768,7 +768,7 @@ pub mod tests {
|
||||
#[test]
|
||||
fn test_decider_circuit() {
|
||||
let mut rng = ark_std::test_rng();
|
||||
let poseidon_config = poseidon_test_config::<Fr>();
|
||||
let poseidon_config = poseidon_canonical_config::<Fr>();
|
||||
|
||||
let F_circuit = CubicFCircuit::<Fr>::new(()).unwrap();
|
||||
let z_0 = vec![Fr::from(3_u32)];
|
||||
@@ -843,7 +843,7 @@ pub mod tests {
|
||||
#[test]
|
||||
fn test_kzg_challenge_gadget() {
|
||||
let mut rng = ark_std::test_rng();
|
||||
let poseidon_config = poseidon_test_config::<Fr>();
|
||||
let poseidon_config = poseidon_canonical_config::<Fr>();
|
||||
|
||||
let U_i = CommittedInstance::<Projective> {
|
||||
cmE: Projective::rand(&mut rng),
|
||||
|
||||
@@ -815,14 +815,14 @@ pub mod tests {
|
||||
|
||||
use crate::commitment::pedersen::Pedersen;
|
||||
use crate::frontend::tests::CubicFCircuit;
|
||||
use crate::transcript::poseidon::poseidon_test_config;
|
||||
use crate::transcript::poseidon::poseidon_canonical_config;
|
||||
|
||||
/// This test tests the Nova+CycleFold IVC, and by consequence it is also testing the
|
||||
/// AugmentedFCircuit
|
||||
#[test]
|
||||
fn test_ivc() {
|
||||
let mut rng = ark_std::test_rng();
|
||||
let poseidon_config = poseidon_test_config::<Fr>();
|
||||
let poseidon_config = poseidon_canonical_config::<Fr>();
|
||||
|
||||
let F_circuit = CubicFCircuit::<Fr>::new(()).unwrap();
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ pub mod tests {
|
||||
use crate::commitment::pedersen::{Params as PedersenParams, Pedersen};
|
||||
use crate::folding::nova::circuits::ChallengeGadget;
|
||||
use crate::folding::nova::traits::NovaR1CS;
|
||||
use crate::transcript::poseidon::{poseidon_test_config, PoseidonTranscript};
|
||||
use crate::transcript::poseidon::{poseidon_canonical_config, PoseidonTranscript};
|
||||
|
||||
#[allow(clippy::type_complexity)]
|
||||
pub(crate) fn prepare_simple_fold_inputs<C>() -> (
|
||||
@@ -257,7 +257,7 @@ pub mod tests {
|
||||
NIFS::<C, Pedersen<C>>::compute_cmT(&pedersen_params, &r1cs, &w1, &ci1, &w2, &ci2)
|
||||
.unwrap();
|
||||
|
||||
let poseidon_config = poseidon_test_config::<C::ScalarField>();
|
||||
let poseidon_config = poseidon_canonical_config::<C::ScalarField>();
|
||||
|
||||
let r_bits = ChallengeGadget::<C>::get_challenge_native(
|
||||
&poseidon_config,
|
||||
|
||||
Reference in New Issue
Block a user