Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Cargo.lock

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

3 changes: 2 additions & 1 deletion k256/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ num-traits = "0.2"
criterion = "0.3"

[features]
default = ["arithmetic", "std"]
default = ["arithmetic", "oid", "std"]
arithmetic = []
digest = ["ecdsa-core/digest"]
ecdsa = ["arithmetic", "ecdsa-core/signer", "ecdsa-core/verifier", "rand", "sha256", "zeroize"]
endomorphism-mul = []
field-montgomery = []
force-32-bit = []
oid = ["elliptic-curve/oid"]
rand = ["elliptic-curve/rand_core"]
sha256 = ["digest", "sha2"]
test-vectors = []
Expand Down
10 changes: 7 additions & 3 deletions k256/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ pub use arithmetic::{
AffinePoint, ProjectivePoint,
};

use elliptic_curve::{consts::U32, ObjectIdentifier};
use elliptic_curve::consts::U32;

#[cfg(feature = "oid")]
use elliptic_curve::oid::ObjectIdentifier;

/// K-256 (secp256k1) elliptic curve.
///
Expand All @@ -56,12 +59,13 @@ impl elliptic_curve::Curve for Secp256k1 {
type ElementSize = U32;
}

impl elliptic_curve::weierstrass::Curve for Secp256k1 {}

#[cfg(feature = "oid")]
impl elliptic_curve::Identifier for Secp256k1 {
const OID: ObjectIdentifier = ObjectIdentifier::new(&[1, 3, 132, 0, 10]);
}

impl elliptic_curve::weierstrass::Curve for Secp256k1 {}

/// K-256 (secp256k1) Secret Key.
pub type SecretKey = elliptic_curve::SecretKey<Secp256k1>;

Expand Down
1 change: 1 addition & 0 deletions p256/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ proptest = "0.10"
default = ["arithmetic", "std"]
arithmetic = []
ecdsa = ["arithmetic", "ecdsa-core/signer", "ecdsa-core/verifier", "rand", "sha256", "zeroize"]
oid = ["elliptic-curve/oid"]
rand = ["elliptic-curve/rand_core"]
sha256 = ["ecdsa-core/digest", "ecdsa-core/hazmat", "sha2"]
test-vectors = []
Expand Down
10 changes: 7 additions & 3 deletions p256/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ pub use arithmetic::{
#[cfg(all(feature = "arithmetic", feature = "rand"))]
pub use arithmetic::scalar::blinding::BlindedScalar;

use elliptic_curve::{consts::U32, oid::ObjectIdentifier};
use elliptic_curve::consts::U32;

#[cfg(feature = "oid")]
use elliptic_curve::oid::ObjectIdentifier;

/// NIST P-256 elliptic curve.
///
Expand Down Expand Up @@ -64,12 +67,13 @@ impl elliptic_curve::Curve for NistP256 {
type ElementSize = U32;
}

impl elliptic_curve::weierstrass::Curve for NistP256 {}

#[cfg(feature = "oid")]
impl elliptic_curve::Identifier for NistP256 {
const OID: ObjectIdentifier = ObjectIdentifier::new(&[1, 2, 840, 10045, 3, 1, 7]);
}

impl elliptic_curve::weierstrass::Curve for NistP256 {}

/// NIST P-256 Secret Key
pub type SecretKey = elliptic_curve::SecretKey<NistP256>;

Expand Down
1 change: 1 addition & 0 deletions p384/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ version = "0.9"
optional = true

[features]
oid = ["elliptic-curve/oid"]
sha384 = ["ecdsa/digest", "ecdsa/hazmat", "sha2"]
std = ["elliptic-curve/std"]

Expand Down
6 changes: 5 additions & 1 deletion p384/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ pub mod ecdsa;

pub use elliptic_curve;

use elliptic_curve::{consts::U48, ObjectIdentifier};
use elliptic_curve::consts::U48;

#[cfg(feature = "oid")]
use elliptic_curve::oid::ObjectIdentifier;

/// NIST P-384 elliptic curve.
///
Expand Down Expand Up @@ -49,6 +52,7 @@ impl elliptic_curve::Curve for NistP384 {
type ElementSize = U48;
}

#[cfg(feature = "oid")]
impl elliptic_curve::Identifier for NistP384 {
const OID: ObjectIdentifier = ObjectIdentifier::new(&[1, 3, 132, 0, 34]);
}
Expand Down