Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Replace nova::bn256_grumpkin with halo2curves library #920

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dashmap = "5.5.0"
ff = { workspace = true }
fxhash = "0.2.1"
generic-array = "0.14.7"
halo2curves = "0.4"
hex = { version = "0.4.3", features = ["serde"] }
indexmap = { version = "2.1.0", features = ["rayon", "serde"] }
itertools = "0.11"
Expand Down
7 changes: 4 additions & 3 deletions src/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
//! relating this field to the expresions of the language.
use clap::ValueEnum;
use ff::{PrimeField, PrimeFieldBits};
use nova::provider::bn256_grumpkin::{bn256, grumpkin};
use halo2curves::bn256::Fr as Bn256Scalar;
use halo2curves::grumpkin::Fr as GrumpkinScalar;
use serde::{Deserialize, Serialize};
use std::convert::TryFrom;
use std::hash::Hash;
Expand Down Expand Up @@ -268,11 +269,11 @@ impl LurkField for pasta_curves::vesta::Scalar {
const FIELD: LanguageField = LanguageField::Vesta;
}

impl LurkField for bn256::Scalar {
impl LurkField for Bn256Scalar {
const FIELD: LanguageField = LanguageField::BN256;
}

impl LurkField for grumpkin::Scalar {
impl LurkField for GrumpkinScalar {
const FIELD: LanguageField = LanguageField::Grumpkin;
}

Expand Down
3 changes: 2 additions & 1 deletion src/lem/multiframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,8 @@ where
#[cfg(test)]
mod tests {
use bellpepper_core::test_cs::TestConstraintSystem;
use nova::provider::bn256_grumpkin::{bn256::Scalar as Bn, grumpkin::Scalar as Gr};
use halo2curves::bn256::Fr as Bn;
use halo2curves::grumpkin::Fr as Gr;
use pasta_curves::{Fp, Fq};

use crate::{
Expand Down
8 changes: 3 additions & 5 deletions src/proof/nova.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
use abomonation::Abomonation;
use bellpepper_core::{num::AllocatedNum, ConstraintSystem};
use ff::Field;
use halo2curves::bn256::Fr as Bn256Scalar;
use nova::{
errors::NovaError,
provider::{
bn256_grumpkin::{bn256, Bn256Engine, GrumpkinEngine},
pasta::{PallasEngine, VestaEngine},
},
provider::{Bn256Engine, GrumpkinEngine, PallasEngine, VestaEngine},
traits::{
circuit::{StepCircuit, TrivialCircuit},
evaluation::EvaluationEngineTrait,
Expand Down Expand Up @@ -68,7 +66,7 @@ impl CurveCycleEquipped for pallas::Scalar {
}
// The impl CurveCycleEquipped for vesta::Scalar is academically possible, but voluntarily omitted to avoid confusion.

impl CurveCycleEquipped for bn256::Scalar {
impl CurveCycleEquipped for Bn256Scalar {
type EE1 = nova::provider::ipa_pc::EvaluationEngine<Self::E1>;
type EE2 = nova::provider::ipa_pc::EvaluationEngine<Self::E2>;

Expand Down
Loading