Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elliptic-curve: use const-oid crate #245

Merged
merged 1 commit into from
Aug 4, 2020
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
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.