Skip to content

Commit

Permalink
elliptic-curve: use const-oid crate (#245)
Browse files Browse the repository at this point in the history
The previous implementation has been extracted into that crate.
  • Loading branch information
tarcieri authored Aug 4, 2020
1 parent 83c41ca commit 72f1909
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 68 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

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

23 changes: 6 additions & 17 deletions elliptic-curve/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,12 @@ edition = "2018"
categories = ["cryptography", "no-std"]
keywords = ["crypto", "ecc", "elliptic", "weierstrass"]

[dependencies.generic-array]
version = "0.14"
default-features = false

[dependencies.rand_core]
version = "0.5"
optional = true
default-features = false

[dependencies.subtle]
version = "2.2.2"
default-features = false

[dependencies.zeroize]
version = "1"
optional = true
default-features = false
[dependencies]
generic-array = { version = "0.14", default-features = false }
oid = { package = "const-oid", version = "0.1", optional = true }
rand_core = { version = "0.5", optional = true, default-features = false }
subtle = { version = "2.2.2", default-features = false }
zeroize = { version = "1", optional = true, default-features = false }

[features]
default = []
Expand Down
10 changes: 7 additions & 3 deletions elliptic-curve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
extern crate std;

pub mod error;
pub mod oid;
pub mod ops;
pub mod point;
pub mod scalar;
Expand All @@ -33,10 +32,13 @@ pub mod secret_key;
#[cfg_attr(docsrs, doc(cfg(feature = "weierstrass")))]
pub mod weierstrass;

pub use self::{error::Error, oid::ObjectIdentifier, secret_key::SecretKey};
pub use self::{error::Error, secret_key::SecretKey};
pub use generic_array::{self, typenum::consts};
pub use subtle;

#[cfg(feature = "oid")]
pub use oid;

#[cfg(feature = "rand_core")]
pub use rand_core;

Expand Down Expand Up @@ -82,9 +84,11 @@ pub trait Arithmetic: Curve {
}

/// Associate an object identifier (OID) with a curve
#[cfg(feature = "oid")]
#[cfg_attr(docsrs, doc(cfg(feature = "oid")))]
pub trait Identifier: Curve {
/// Object Identifier (OID) for this curve
const OID: ObjectIdentifier;
const OID: oid::ObjectIdentifier;
}

/// Randomly generate a value.
Expand Down
48 changes: 0 additions & 48 deletions elliptic-curve/src/oid.rs

This file was deleted.

0 comments on commit 72f1909

Please sign in to comment.