Skip to content

Commit 560455f

Browse files
committed
[WIP] p384: use generic prime order formulas
Uses the generic implementation of Renes-Costello-Batina 2015 added to the `elliptic-curve` crate: RustCrypto/traits#1022
1 parent d3386b7 commit 560455f

File tree

6 files changed

+27
-516
lines changed

6 files changed

+27
-516
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ members = [
1010

1111
[profile.dev]
1212
opt-level = 2
13+
14+
[patch.crates-io.elliptic-curve]
15+
git = "https://github.com/RustCrypto/traits.git"
16+
branch = "elliptic-curve/generic-prime-order-formulas"

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)