Skip to content

Commit

Permalink
[WIP] p384: use generic prime order formulas
Browse files Browse the repository at this point in the history
Uses the generic implementation of Renes-Costello-Batina 2015 added to
the `elliptic-curve` crate:

RustCrypto/traits#1022
  • Loading branch information
tarcieri committed Jun 12, 2022
1 parent d3386b7 commit 560455f
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 516 deletions.
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.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ members = [

[profile.dev]
opt-level = 2

[patch.crates-io.elliptic-curve]
git = "https://github.com/RustCrypto/traits.git"
branch = "elliptic-curve/generic-prime-order-formulas"
6 changes: 3 additions & 3 deletions p384/src/arithmetic/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ use self::field_impl::*;
use crate::FieldBytes;
use core::ops::{AddAssign, MulAssign, Neg, SubAssign};
use elliptic_curve::{
bigint::{self, ArrayEncoding, Encoding, Integer, Limb, U384},
subtle::{Choice, ConstantTimeEq, ConstantTimeLess, CtOption},
bigint::{self, Encoding, Limb, U384},
subtle::{Choice, ConstantTimeEq, CtOption},
};

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

impl_field_element!(
elliptic_curve::impl_field_element!(
FieldElement,
FieldBytes,
U384,
Expand Down
Loading

0 comments on commit 560455f

Please sign in to comment.