Skip to content

Commit

Permalink
ecdsa: use revised LinearCombination trait (#419)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri committed Dec 4, 2021
1 parent 6d63c20 commit f6cd96b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions ecdsa/Cargo.toml
Expand Up @@ -15,15 +15,15 @@ edition = "2021"
rust-version = "1.56"

[dependencies]
elliptic-curve = { version = "0.11.4", default-features = false, features = ["sec1"] }
elliptic-curve = { version = "0.11.5", default-features = false, features = ["sec1"] }
signature = { version = ">= 1.3.1, <1.5", default-features = false, features = ["rand-preview"] }

# optional dependencies
der = { version = "0.5", optional = true }
rfc6979 = { version = "0.1", optional = true, path = "../rfc6979" }

[dev-dependencies]
elliptic-curve = { version = "0.11", default-features = false, features = ["dev"] }
elliptic-curve = { version = "0.11.5", default-features = false, features = ["dev"] }
hex-literal = "0.3"
sha2 = { version = "0.9", default-features = false }

Expand Down
10 changes: 5 additions & 5 deletions ecdsa/src/hazmat.rs
Expand Up @@ -18,7 +18,7 @@ use {
group::Curve as _,
ops::{Invert, LinearCombination, Reduce},
AffineArithmetic, AffineXCoordinate, Field, FieldBytes, Group, ProjectiveArithmetic,
Scalar, ScalarArithmetic,
ProjectivePoint, Scalar, ScalarArithmetic,
},
};

Expand Down Expand Up @@ -112,7 +112,7 @@ where
#[cfg_attr(docsrs, doc(cfg(feature = "arithmetic")))]
pub trait VerifyPrimitive<C>: AffineXCoordinate<C> + Copy + Sized
where
C: PrimeCurve + AffineArithmetic<AffinePoint = Self> + LinearCombination + ProjectiveArithmetic,
C: PrimeCurve + AffineArithmetic<AffinePoint = Self> + ProjectiveArithmetic,
Scalar<C>: Reduce<C::UInt>,
SignatureSize<C>: ArrayLength<u8>,
{
Expand All @@ -127,10 +127,10 @@ where
let s_inv = Option::<Scalar<C>>::from(s.invert()).ok_or_else(Error::new)?;
let u1 = z * s_inv;
let u2 = *r * s_inv;
let x = C::lincomb(
&C::ProjectivePoint::generator(),
let x = ProjectivePoint::<C>::lincomb(
&ProjectivePoint::<C>::generator(),
&u1,
&C::ProjectivePoint::from(*self),
&ProjectivePoint::<C>::from(*self),
&u2,
)
.to_affine()
Expand Down
6 changes: 3 additions & 3 deletions ecdsa/src/verify.rs
Expand Up @@ -7,7 +7,7 @@ use crate::{
use core::{cmp::Ordering, fmt::Debug};
use elliptic_curve::{
generic_array::ArrayLength,
ops::{LinearCombination, Reduce},
ops::Reduce,
sec1::{self, EncodedPoint, FromEncodedPoint, ToEncodedPoint},
AffinePoint, FieldSize, PointCompression, PrimeCurve, ProjectiveArithmetic, PublicKey, Scalar,
};
Expand Down Expand Up @@ -79,7 +79,7 @@ impl<C> Copy for VerifyingKey<C> where C: PrimeCurve + ProjectiveArithmetic {}

impl<C, D> DigestVerifier<D, Signature<C>> for VerifyingKey<C>
where
C: PrimeCurve + ProjectiveArithmetic + LinearCombination,
C: PrimeCurve + ProjectiveArithmetic,
D: Digest<OutputSize = FieldSize<C>>,
AffinePoint<C>: VerifyPrimitive<C>,
Scalar<C>: Reduce<C::UInt>,
Expand All @@ -93,7 +93,7 @@ where

impl<C> Verifier<Signature<C>> for VerifyingKey<C>
where
C: PrimeCurve + ProjectiveArithmetic + DigestPrimitive + LinearCombination,
C: PrimeCurve + ProjectiveArithmetic + DigestPrimitive,
C::Digest: Digest<OutputSize = FieldSize<C>>,
AffinePoint<C>: VerifyPrimitive<C>,
Scalar<C>: Reduce<C::UInt>,
Expand Down

0 comments on commit f6cd96b

Please sign in to comment.