Skip to content

Commit 829328e

Browse files
authored
elliptic-curve: deprecate MulByGenerator (#1822)
This now should use `group::Group` directly. Followup to #1821
1 parent b46b3d1 commit 829328e

File tree

3 files changed

+2
-18
lines changed

3 files changed

+2
-18
lines changed

elliptic-curve/src/arithmetic.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use crate::{
44
Curve, FieldBytes, PrimeCurve, ScalarPrimitive,
5-
ops::{Invert, LinearCombination, MulByGenerator, Reduce, ShrAssign},
5+
ops::{Invert, LinearCombination, Reduce, ShrAssign},
66
point::AffineCoordinates,
77
scalar::{FromUintUnchecked, IsHigh},
88
};
@@ -46,7 +46,6 @@ pub trait CurveArithmetic: Curve {
4646
+ Into<Self::AffinePoint>
4747
+ LinearCombination<[(Self::ProjectivePoint, Self::Scalar)]>
4848
+ LinearCombination<[(Self::ProjectivePoint, Self::Scalar); 2]>
49-
+ MulByGenerator
5049
+ group::Curve<AffineRepr = Self::AffinePoint>
5150
+ group::Group<Scalar = Self::Scalar>;
5251

elliptic-curve/src/dev.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::{
88
array::typenum::U32,
99
bigint::{Limb, U256},
1010
error::{Error, Result},
11-
ops::{Invert, LinearCombination, MulByGenerator, Reduce, ShrAssign},
11+
ops::{Invert, LinearCombination, Reduce, ShrAssign},
1212
point::AffineCoordinates,
1313
rand_core::TryRngCore,
1414
scalar::{FromUintUnchecked, IsHigh},
@@ -807,8 +807,6 @@ impl MulAssign<&Scalar> for ProjectivePoint {
807807
}
808808
}
809809

810-
impl MulByGenerator for ProjectivePoint {}
811-
812810
impl Neg for ProjectivePoint {
813811
type Output = ProjectivePoint;
814812

elliptic-curve/src/ops.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
pub use core::ops::{Add, AddAssign, Mul, Neg, Shr, ShrAssign, Sub, SubAssign};
44

55
use crypto_bigint::Integer;
6-
use group::Group;
76
use subtle::{Choice, ConditionallySelectable, CtOption};
87

98
#[cfg(feature = "alloc")]
@@ -168,18 +167,6 @@ where
168167
}
169168
}
170169

171-
/// Multiplication by the generator.
172-
///
173-
/// May use optimizations (e.g. precomputed tables) when available.
174-
// TODO(tarcieri): replace this with `Group::mul_by_generator``? (see zkcrypto/group#44)
175-
pub trait MulByGenerator: Group {
176-
/// Multiply by the generator of the prime-order subgroup.
177-
#[must_use]
178-
fn mul_by_generator(scalar: &Self::Scalar) -> Self {
179-
Self::generator() * scalar
180-
}
181-
}
182-
183170
/// Modular reduction.
184171
pub trait Reduce<Uint: Integer>: Sized {
185172
/// Bytes used as input to [`Reduce::reduce_bytes`].

0 commit comments

Comments
 (0)