-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade k256/p256/p384/ed25519-dalek; remove ring/signatory/secp256k1 (…
…#91) This commit removes Signatory and its associated wrapper crates (for *ring* and the `secp256k1` crates, which use native code bindings). They can now be completely replaced by the `k256`, `p256`, and `p384` crates, along with `ed25519-dalek`, which natively implement the traits from the `signature` crate that Signatory originally provided. The result is fewer overall dependencies and faster compile times (owing to the elimination of C/ASM dependencies) Additionally, this PR pulls in the `ccm` crate and begins to properly implement key/object wrapping (i.e. encryption) using the same algorithms as the YubiHSM2 itself.
- Loading branch information
1 parent
d78e28e
commit 45bcbd6
Showing
31 changed files
with
890 additions
and
629 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
//! Elliptic Curve Digital Signature Algorithm (ECDSA) support | ||
pub mod algorithm; | ||
pub mod nistp256; | ||
pub mod nistp384; | ||
|
||
#[cfg(feature = "secp256k1")] | ||
pub mod secp256k1; | ||
|
||
pub(crate) mod commands; | ||
mod signature; | ||
mod signer; | ||
|
||
pub use self::{algorithm::Algorithm, signature::Signature, signer::Signer}; | ||
pub use signatory::ecdsa::{curve, PublicKey}; | ||
pub use self::{algorithm::Algorithm, nistp256::NistP256, nistp384::NistP384, signer::Signer}; | ||
pub use ::ecdsa::{asn1, elliptic_curve::sec1, signature, Signature}; | ||
|
||
#[cfg(feature = "secp256k1")] | ||
pub use self::secp256k1::Secp256k1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//! NIST P-256 elliptic curve (a.k.a. prime256v1, secp256r1) | ||
//! | ||
//! ## About | ||
//! | ||
//! NIST P-256 is a Weierstrass curve specified in FIPS 186-4: Digital Signature | ||
//! Standard (DSS): | ||
//! | ||
//! <https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf> | ||
//! | ||
//! Also known as prime256v1 (ANSI X9.62) and secp256r1 (SECG), it's included in | ||
//! the US National Security Agency's "Suite B" and is widely used in protocols | ||
//! like TLS and the associated X.509 PKI. | ||
pub use p256::NistP256; | ||
|
||
/// ECDSA/P-256 signature (fixed-size) | ||
pub type Signature = super::Signature<NistP256>; | ||
|
||
/// ECDSA/P-256 signer | ||
pub type Signer = super::Signer<NistP256>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//! NIST P-384 elliptic curve. | ||
//! | ||
//! ## About | ||
//! | ||
//! NIST P-384 is a Weierstrass curve specified in FIPS 186-4: Digital Signature | ||
//! Standard (DSS): | ||
//! | ||
//! <https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf> | ||
pub use p384::NistP384; | ||
|
||
/// ECDSA/P-384 signature (fixed-size) | ||
pub type Signature = super::Signature<NistP384>; | ||
|
||
/// ECDSA/P-384 signer | ||
pub type Signer = super::Signer<NistP384>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//! secp256k1 elliptic curve | ||
//! | ||
//! ## About | ||
//! | ||
//! The secp256k1 elliptic curve is specified by Certicom's SECG in | ||
//! "SEC 2: Recommended Elliptic Curve Domain Parameters": | ||
//! | ||
//! <https://www.secg.org/sec2-v2.pdf> | ||
//! | ||
//! It's primarily notable for usage in Bitcoin and other cryptocurrencies. | ||
pub use k256::{ecdsa::recoverable, Secp256k1}; | ||
|
||
/// ECDSA/secp256k1 signature (fixed-size) | ||
pub type Signature = super::Signature<Secp256k1>; | ||
|
||
/// ECDSA/secp256k1 signature with public key recovery support (ala Ethereum) | ||
pub type RecoverableSignature = k256::ecdsa::recoverable::Signature; | ||
|
||
/// ECDSA/secp256k1 signer | ||
pub type Signer = super::Signer<Secp256k1>; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.