Skip to content
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
3 changes: 1 addition & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,6 @@ required-features = ["groups"]
name = "hash_to_curve"
harness = false
required-features = ["experimental"]

[patch.crates-io]
group = { git = "https://github.com/zkcrypto/group.git", rev = "21104854da7f316c470213ab4a2ace239d24dd28" }
16 changes: 7 additions & 9 deletions src/g1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use core::fmt;
use core::iter::Sum;
use core::ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign};
use group::{
prime::{PrimeCurve, PrimeCurveAffine, PrimeGroup},
Curve, Group, GroupEncoding, UncompressedEncoding,
prime::{PrimeCurve, PrimeGroup},
Curve, CurveAffine, Group, GroupEncoding, UncompressedEncoding,
};
use rand_core::TryRngCore;
use subtle::{Choice, ConditionallySelectable, ConstantTimeEq, CtOption};
Expand Down Expand Up @@ -1007,22 +1007,20 @@ impl WnafGroup for G1Projective {
impl PrimeGroup for G1Projective {}

impl Curve for G1Projective {
type AffineRepr = G1Affine;
type Affine = G1Affine;

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 PrimeCurve for G1Projective {
type Affine = G1Affine;
}
impl PrimeCurve for G1Projective {}

impl PrimeCurveAffine for G1Affine {
impl CurveAffine for G1Affine {
type Scalar = Scalar;
type Curve = G1Projective;

Expand Down
16 changes: 7 additions & 9 deletions src/g2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use core::fmt;
use core::iter::Sum;
use core::ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign};
use group::{
prime::{PrimeCurve, PrimeCurveAffine, PrimeGroup},
Curve, Group, GroupEncoding, UncompressedEncoding,
prime::{PrimeCurve, PrimeGroup},
Curve, CurveAffine, Group, GroupEncoding, UncompressedEncoding,
};
use rand_core::TryRngCore;
use subtle::{Choice, ConditionallySelectable, ConstantTimeEq, CtOption};
Expand Down Expand Up @@ -1151,22 +1151,20 @@ impl WnafGroup for G2Projective {
impl PrimeGroup for G2Projective {}

impl Curve for G2Projective {
type AffineRepr = G2Affine;
type Affine = G2Affine;

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 PrimeCurve for G2Projective {
type Affine = G2Affine;
}
impl PrimeCurve for G2Projective {}

impl PrimeCurveAffine for G2Affine {
impl CurveAffine for G2Affine {
type Scalar = Scalar;
type Curve = G2Projective;

Expand Down
Loading