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

Migrate to group::CurveAffine #787

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ members = [
"halo2_gadgets",
"halo2_proofs",
]

[patch.crates-io]
group = { git = "https://github.com/zkcrypto/group.git", rev = "696c2128529b5a9e18eed46d1da531753695db04" }
pasta_curves = { git = "https://github.com/zcash/pasta_curves.git", rev = "fb643a4e5ea25e035af758595f903b4002b0b7a3" }
2 changes: 1 addition & 1 deletion halo2_gadgets/src/ecc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ impl<C: CurveAffine, EccChip: EccInstructions<C>> FixedPointShort<C, EccChip> {
#[cfg(test)]
pub(crate) mod tests {
use ff::PrimeField;
use group::{prime::PrimeCurveAffine, Curve, Group};
use group::{Curve, CurveAffine, Group};

use halo2_proofs::{
circuit::{Layouter, SimpleFloorPlanner, Value},
Expand Down
2 changes: 1 addition & 1 deletion halo2_gadgets/src/ecc/chip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{
use arrayvec::ArrayVec;

use ff::PrimeField;
use group::prime::PrimeCurveAffine;
use group::CurveAffine as _;
use halo2_proofs::{
circuit::{AssignedCell, Chip, Layouter, Value},
plonk::{Advice, Assigned, Column, ConstraintSystem, Error, Fixed},
Expand Down
2 changes: 1 addition & 1 deletion halo2_gadgets/src/ecc/chip/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ impl Config {

#[cfg(test)]
pub mod tests {
use group::{prime::PrimeCurveAffine, Curve};
use group::{Curve, CurveAffine};
use halo2_proofs::{
circuit::{Layouter, Value},
plonk::Error,
Expand Down
2 changes: 1 addition & 1 deletion halo2_gadgets/src/ecc/chip/witness_point.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::{EccPoint, NonIdentityEccPoint};

use group::prime::PrimeCurveAffine;
use group::CurveAffine as _;

use halo2_proofs::{
circuit::{AssignedCell, Region, Value},
Expand Down
2 changes: 1 addition & 1 deletion halo2_gadgets/src/sinsemilla/chip/hash_to_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ where
{
use crate::sinsemilla::primitives::{K, S_PERSONALIZATION};

use group::{prime::PrimeCurveAffine, Curve};
use group::{Curve, CurveAffine};
use pasta_curves::arithmetic::CurveExt;

let field_elems: Value<Vec<_>> = message
Expand Down
2 changes: 1 addition & 1 deletion halo2_gadgets/src/sinsemilla/primitives/addition.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::ops::Add;

use group::{cofactor::CofactorCurveAffine, Group};
use group::{CurveAffine, Group};
use pasta_curves::pallas;
use subtle::{ConstantTimeEq, CtOption};

Expand Down
4 changes: 2 additions & 2 deletions halo2_proofs/src/poly/commitment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::arithmetic::{best_fft, best_multiexp, parallelize, CurveAffine, Curve
use crate::helpers::CurveRead;

use ff::{Field, PrimeField};
use group::{prime::PrimeCurveAffine, Curve, Group};
use group::{Curve, Group};
use std::ops::{Add, AddAssign, Mul, MulAssign};

mod msm;
Expand Down Expand Up @@ -74,7 +74,7 @@ impl<C: CurveAffine> Params<C> {

// Let's evaluate all of the Lagrange basis polynomials
// using an inverse FFT.
let mut alpha_inv = <<C as PrimeCurveAffine>::Curve as Group>::Scalar::ROOT_OF_UNITY_INV;
let mut alpha_inv = <C::Curve as Group>::Scalar::ROOT_OF_UNITY_INV;
for _ in k..C::Scalar::S {
alpha_inv = alpha_inv.square();
}
Expand Down
Loading