Skip to content

Commit fb44d75

Browse files
authored
p384: use generic prime order formulas (#601)
Uses the generic implementation of Renes-Costello-Batina 2015 added to the `elliptic-curve` crate: RustCrypto/traits#1022
1 parent d3386b7 commit fb44d75

File tree

6 files changed

+25
-517
lines changed

6 files changed

+25
-517
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

p384/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ edition = "2021"
1717
rust-version = "1.57"
1818

1919
[dependencies]
20-
elliptic-curve = { version = "0.12", default-features = false, features = ["hazmat", "sec1"] }
20+
elliptic-curve = { version = "0.12.1", default-features = false, features = ["hazmat", "sec1"] }
2121

2222
# optional dependencies
2323
ecdsa-core = { version = "0.14", package = "ecdsa", optional = true, default-features = false, features = ["der"] }

p384/src/arithmetic/field.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ use self::field_impl::*;
2828
use crate::FieldBytes;
2929
use core::ops::{AddAssign, MulAssign, Neg, SubAssign};
3030
use elliptic_curve::{
31-
bigint::{self, ArrayEncoding, Encoding, Integer, Limb, U384},
32-
subtle::{Choice, ConstantTimeEq, ConstantTimeLess, CtOption},
31+
bigint::{self, Encoding, Limb, U384},
32+
subtle::{Choice, ConstantTimeEq, CtOption},
3333
};
3434

3535
/// Constant representing the modulus
@@ -40,7 +40,7 @@ pub(crate) const MODULUS: U384 = U384::from_be_hex("ffffffffffffffffffffffffffff
4040
#[derive(Clone, Copy, Debug)]
4141
pub struct FieldElement(pub(super) U384);
4242

43-
impl_field_element!(
43+
elliptic_curve::impl_field_element!(
4444
FieldElement,
4545
FieldBytes,
4646
U384,

0 commit comments

Comments
 (0)