Skip to content

Commit

Permalink
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 a4db652
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 517 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion p384/Cargo.toml
Expand Up @@ -17,7 +17,7 @@ edition = "2021"
rust-version = "1.57"

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

# optional dependencies
ecdsa-core = { version = "0.14", package = "ecdsa", optional = true, default-features = false, features = ["der"] }
Expand Down
6 changes: 3 additions & 3 deletions p384/src/arithmetic/field.rs
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

0 comments on commit a4db652

Please sign in to comment.