mirror of
https://github.com/arnaucube/Nova.git
synced 2026-02-01 08:46:39 +01:00
Add Grumpkin cycle implementation (#181)
* bn256+grumpkin from halo2curves * chore: Integrate halo2curves more extensively - Extend existing tests with additional test cases using the new curve types * fix: Assign correct orders to bn256 and grumpkin scalar fields - Swap scalar orders between grumpkin and bn256 in `impl_traits!` implementation * test: Finish improving test integration with halo2curves - Enhances test coverage for `pasta_curves` and `halo2curves` - Cleans up commented code in `test_ivc_nontrivial` and `test_ivc_nontrivial_with_compression` tests - Updates relevant test cases in `src/lib.rs` to include new curve tests * chore: Remove commented-out/uneeded code in bn254_grumpkin.rs * test: reproduce test_from_label for bn254_grumpkin - Implement the `from_label_serial` function in bn254_grumpkin provider - Add a test to compare parallel and serial implementations of `from_label` function * refactor: Clean up to_coordinate & summarize changes * refactor: rename bn254_grumpkin -> bn256_grumpkin * test: Expand testing for public params digest using bn256 and grumpkin * chore: Update halo2curves dependency in Cargo.toml - Updated the `halo2curves` dependency in `Cargo.toml` to the latest version `0.1.0` from a specific git branch. * refactor: Refactor multi-exponentiation methods across providers - Updated bn256_grumpkin.rs to use the cpu_best_multiexp function from pasta provider instead of its native function. - Modified visibility of cpu_best_multiexp function in pasta.rs from private to crate level. * chore: set up dependencies to import the correct getrandom feature on Wasm --------- Co-authored-by: Leo Alt <leo@ethereum.org>
This commit is contained in:
committed by
GitHub
parent
905ec2d5a1
commit
4b077bcab1
25
src/lib.rs
25
src/lib.rs
@@ -793,6 +793,7 @@ fn compute_digest<G: Group, T: Serialize>(o: &T) -> G::Scalar {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::provider::bn256_grumpkin::{bn256, grumpkin};
|
||||
use crate::provider::pedersen::CommitmentKeyExtTrait;
|
||||
|
||||
use super::*;
|
||||
@@ -895,6 +896,23 @@ mod tests {
|
||||
trivial_circuit2,
|
||||
"3f7b25f589f2da5ab26254beba98faa54f6442ebf5fa5860caf7b08b576cab00",
|
||||
);
|
||||
|
||||
let trivial_circuit1_grumpkin =
|
||||
TrivialTestCircuit::<<bn256::Point as Group>::Scalar>::default();
|
||||
let trivial_circuit2_grumpkin =
|
||||
TrivialTestCircuit::<<grumpkin::Point as Group>::Scalar>::default();
|
||||
let cubic_circuit1_grumpkin = CubicCircuit::<<bn256::Point as Group>::Scalar>::default();
|
||||
|
||||
test_pp_digest_with::<bn256::Point, grumpkin::Point, _, _>(
|
||||
trivial_circuit1_grumpkin,
|
||||
trivial_circuit2_grumpkin.clone(),
|
||||
"967acca1d6b4731cd65d4072c12bbaca9648f24d7bcc2877aee720e4265d4302",
|
||||
);
|
||||
test_pp_digest_with::<bn256::Point, grumpkin::Point, _, _>(
|
||||
cubic_circuit1_grumpkin,
|
||||
trivial_circuit2_grumpkin,
|
||||
"44629f26a78bf6c4e3077f940232050d1793d304fdba5e221d0cf66f76a37903",
|
||||
);
|
||||
}
|
||||
|
||||
fn test_ivc_trivial_with<G1, G2>()
|
||||
@@ -949,6 +967,8 @@ mod tests {
|
||||
type G1 = pasta_curves::pallas::Point;
|
||||
type G2 = pasta_curves::vesta::Point;
|
||||
test_ivc_trivial_with::<G1, G2>();
|
||||
|
||||
test_ivc_trivial_with::<bn256::Point, grumpkin::Point>();
|
||||
}
|
||||
|
||||
fn test_ivc_nontrivial_with<G1, G2>()
|
||||
@@ -1030,6 +1050,7 @@ mod tests {
|
||||
type G2 = pasta_curves::vesta::Point;
|
||||
|
||||
test_ivc_nontrivial_with::<G1, G2>();
|
||||
test_ivc_nontrivial_with::<bn256::Point, grumpkin::Point>();
|
||||
}
|
||||
|
||||
fn test_ivc_nontrivial_with_compression_with<G1, G2>()
|
||||
@@ -1124,6 +1145,7 @@ mod tests {
|
||||
type G2 = pasta_curves::vesta::Point;
|
||||
|
||||
test_ivc_nontrivial_with_compression_with::<G1, G2>();
|
||||
test_ivc_nontrivial_with_compression_with::<bn256::Point, grumpkin::Point>();
|
||||
}
|
||||
|
||||
fn test_ivc_nontrivial_with_spark_compression_with<G1, G2>()
|
||||
@@ -1221,6 +1243,7 @@ mod tests {
|
||||
type G2 = pasta_curves::vesta::Point;
|
||||
|
||||
test_ivc_nontrivial_with_spark_compression_with::<G1, G2>();
|
||||
test_ivc_nontrivial_with_spark_compression_with::<bn256::Point, grumpkin::Point>();
|
||||
}
|
||||
|
||||
fn test_ivc_nondet_with_compression_with<G1, G2>()
|
||||
@@ -1377,6 +1400,7 @@ mod tests {
|
||||
type G2 = pasta_curves::vesta::Point;
|
||||
|
||||
test_ivc_nondet_with_compression_with::<G1, G2>();
|
||||
test_ivc_nondet_with_compression_with::<bn256::Point, grumpkin::Point>();
|
||||
}
|
||||
|
||||
fn test_ivc_base_with<G1, G2>()
|
||||
@@ -1443,5 +1467,6 @@ mod tests {
|
||||
type G2 = pasta_curves::vesta::Point;
|
||||
|
||||
test_ivc_base_with::<G1, G2>();
|
||||
test_ivc_base_with::<bn256::Point, grumpkin::Point>();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user