Skip to content

Commit

Permalink
Migrate to group::CurveAffine
Browse files Browse the repository at this point in the history
  • Loading branch information
str4d committed Jul 29, 2023
1 parent 47dfe51 commit a3966d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ harness = false
[[bench]]
name = "point_bench"
harness = false

[patch.crates-io]
bls12_381 = { git = "https://github.com/zkcrypto/bls12_381.git", rev = "3d96155c306f6e3febfcb06c9b7754433458f7b5" }
group = { git = "https://github.com/zkcrypto/group.git", rev = "85c484fff517135cedfe265ef893bd4b8d745300" }
16 changes: 7 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ use core::iter::Sum;
use core::ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign};
use ff::{BatchInverter, Field};
use group::{
cofactor::{CofactorCurve, CofactorCurveAffine, CofactorGroup},
cofactor::{CofactorCurve, CofactorGroup},
prime::PrimeGroup,
Curve, Group, GroupEncoding,
Curve, CurveAffine, Group, GroupEncoding,
};
use rand_core::RngCore;
use subtle::{Choice, ConditionallySelectable, ConstantTimeEq, CtOption};
Expand Down Expand Up @@ -1354,22 +1354,20 @@ impl CofactorGroup for ExtendedPoint {
}

impl Curve for ExtendedPoint {
type AffineRepr = AffinePoint;
type Affine = AffinePoint;

fn batch_normalize(p: &[Self], q: &mut [Self::AffineRepr]) {
fn batch_normalize(p: &[Self], q: &mut [Self::Affine]) {
Self::batch_normalize(p, q);
}

fn to_affine(&self) -> Self::AffineRepr {
fn to_affine(&self) -> Self::Affine {
self.into()
}
}

impl CofactorCurve for ExtendedPoint {
type Affine = AffinePoint;
}
impl CofactorCurve for ExtendedPoint {}

impl CofactorCurveAffine for AffinePoint {
impl CurveAffine for AffinePoint {
type Scalar = Fr;
type Curve = ExtendedPoint;

Expand Down

0 comments on commit a3966d9

Please sign in to comment.