From bcc1910672cdcb06d787e497a65690114e1fb54b Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Fri, 30 Apr 2021 08:27:18 -0700 Subject: [PATCH] ed25519: bump `ring-compat` to v0.2; MSRV 1.47+ (#289) --- .github/workflows/ed25519.yml | 4 +- .github/workflows/workspace.yml | 2 +- Cargo.lock | 218 +++++++++++++++++++++++++++++++- README.md | 9 +- ed25519/Cargo.toml | 2 +- ed25519/README.md | 4 +- ed25519/src/lib.rs | 5 +- 7 files changed, 229 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ed25519.yml b/.github/workflows/ed25519.yml index 02b35d7..4662432 100644 --- a/.github/workflows/ed25519.yml +++ b/.github/workflows/ed25519.yml @@ -24,7 +24,7 @@ jobs: - thumbv7em-none-eabi - wasm32-unknown-unknown toolchain: - - 1.41.0 # MSRV + - 1.47.0 # MSRV - stable steps: - name: Checkout sources @@ -67,7 +67,7 @@ jobs: - macos-latest - windows-latest toolchain: - - 1.41.0 # MSRV + - 1.47.0 # MSRV - stable runs-on: ${{ matrix.platform }} steps: diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml index 0bd1dfd..79d7aa2 100644 --- a/.github/workflows/workspace.yml +++ b/.github/workflows/workspace.yml @@ -38,7 +38,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.44.0 # Highest MSRV in repo + toolchain: 1.47.0 # MSRV components: clippy - run: cargo clippy --all-features -- -D warnings diff --git a/Cargo.lock b/Cargo.lock index f8ef245..f165542 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,15 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "aead" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8aeaececfd937b9762778f2aca063ad24fdc827c48c07aeae36fb20c03afa11a" +dependencies = [ + "generic-array", +] + [[package]] name = "base64ct" version = "1.0.0" @@ -38,12 +47,24 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bumpalo" +version = "3.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" + [[package]] name = "byteorder" version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +[[package]] +name = "cc" +version = "1.0.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" + [[package]] name = "cfg-if" version = "1.0.0" @@ -116,6 +137,17 @@ dependencies = [ "signature", ] +[[package]] +name = "ecdsa" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b568b5e72165dd8913ac2aad6a60cb9cb297287615544c523c37f9247b58fc8" +dependencies = [ + "der", + "elliptic-curve", + "signature", +] + [[package]] name = "ed25519" version = "1.0.3" @@ -123,6 +155,7 @@ dependencies = [ "bincode", "ed25519-dalek", "rand_core 0.5.1", + "ring-compat", "serde", "signature", ] @@ -232,18 +265,68 @@ dependencies = [ "digest", ] +[[package]] +name = "js-sys" +version = "0.3.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d99f9e3e84b8f67f846ef5b4cbbc3b1c29f6c759fcbce6f01aa0e73d932a24c" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + [[package]] name = "libc" version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba4aede83fc3617411dc6993bc8c70919750c1c257c6ca6a502aed6e0e2394ae" +[[package]] +name = "log" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "once_cell" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" + [[package]] name = "opaque-debug" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "p256" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cf301f7f053902eaf046d541cd7b454a588b2bdd571f18195b57ae197aed2cb" +dependencies = [ + "ecdsa 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "elliptic-curve", +] + +[[package]] +name = "p384" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94e3bfd7d8f202c293072de214ad93480b533985bfee4fa4a13cfdd185fab13d" +dependencies = [ + "ecdsa 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "elliptic-curve", +] + [[package]] name = "pkcs8" version = "0.6.0" @@ -333,6 +416,39 @@ dependencies = [ "rand_core 0.5.1", ] +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "ring-compat" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c10e5a7d9bc5de3d81dc1600f535d163b9330c9e00a96678037593883c6031" +dependencies = [ + "aead", + "digest", + "ecdsa 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ed25519 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array", + "opaque-debug", + "p256", + "p384", + "ring", + "zeroize", +] + [[package]] name = "serde" version = "1.0.125" @@ -362,6 +478,12 @@ dependencies = [ "rand_core 0.6.2", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + [[package]] name = "spki" version = "0.3.0" @@ -379,9 +501,9 @@ checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" [[package]] name = "syn" -version = "1.0.64" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fd9d1e9976102a03c542daa2eff1b43f9d72306342f3f8b3ed5fb8908195d6f" +checksum = "6498a9efc342871f91cc2d0d694c674368b4ceb40f62b65a7a08c3792935e702" dependencies = [ "proc-macro2", "quote", @@ -418,6 +540,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "version_check" version = "0.9.3" @@ -430,6 +558,92 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +[[package]] +name = "wasm-bindgen" +version = "0.2.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83240549659d187488f91f33c0f8547cbfef0b2088bc470c116d1d260ef623d9" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae70622411ca953215ca6d06d3ebeb1e915f0f6613e3b495122878d7ebec7dae" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e734d91443f177bfdb41969de821e15c516931c3c3db3d318fa1b68975d0f6f" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53739ff08c8a68b0fdbcd54c372b8ab800b1449ab3c9d706503bc7dd1621b2c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9a543ae66aa233d14bb765ed9af4a33e81b8b58d1584cf1b47ff8cd0b9e4489" + +[[package]] +name = "web-sys" +version = "0.3.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a905d57e488fec8861446d3393670fb50d27a262344013181c2cdf9fff5481be" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + [[package]] name = "wyz" version = "0.2.0" diff --git a/README.md b/README.md index 613ccf6..eca5d3f 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,10 @@ and can be easily used for bare-metal or lightweight WebAssembly programming. ## Minimum Supported Rust Version -All crates in this repository support Rust **1.41** or higher. In future minimum -supported Rust version can be changed, but it will be done with the minor -version bump. +All crates in this repository support Rust **1.47** or higher. + +In the future the minimum supported Rust version may be changed, +but it will be accompanied by minor version bump. ## Usage @@ -44,7 +45,7 @@ dual licensed as above, without any additional terms or conditions. [//]: # (badges) -[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.47+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260048-signatures [deps-image]: https://deps.rs/repo/github/RustCrypto/signatures/status.svg diff --git a/ed25519/Cargo.toml b/ed25519/Cargo.toml index 6f48e23..3d929c2 100644 --- a/ed25519/Cargo.toml +++ b/ed25519/Cargo.toml @@ -18,7 +18,7 @@ serde = { version = "1", optional = true, default-features = false } [dev-dependencies] bincode = "1" ed25519-dalek = "1" -#ring-compat = "0.1" +ring-compat = "0.2" rand_core = { version = "0.5", features = ["std"] } [features] diff --git a/ed25519/README.md b/ed25519/README.md index a969eea..9c24a2b 100644 --- a/ed25519/README.md +++ b/ed25519/README.md @@ -24,7 +24,7 @@ Ed25519 implementations, including HSMs or Cloud KMS services. ## Minimum Supported Rust Version -This crate requires **Rust 1.41** at a minimum. +This crate requires **Rust 1.47** at a minimum. We may change the MSRV in the future, but it will be accompanied by a minor version bump. @@ -51,7 +51,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/ed25519/badge.svg [docs-link]: https://docs.rs/ed25519/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.47+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260048-signatures [build-image]: https://github.com/RustCrypto/signatures/workflows/ed25519/badge.svg?branch=master&event=push diff --git a/ed25519/src/lib.rs b/ed25519/src/lib.rs index 3b161e4..dac636a 100644 --- a/ed25519/src/lib.rs +++ b/ed25519/src/lib.rs @@ -15,7 +15,7 @@ //! //! ## Minimum Supported Rust Version //! -//! Rust **1.41** or higher. +//! Rust **1.47** or higher. //! //! Minimum supported Rust version may be changed in the future, but such //! changes will be accompanied with a minor version bump. @@ -159,8 +159,7 @@ //! instantiate and use the previously defined `HelloSigner` and `HelloVerifier` //! types with [`ring-compat`] as the signing/verification provider: //! -//! ```ignore -//! # TODO(tarcieri): update ring-compat and re-enable tests +//! ``` //! use ring_compat::signature::{ //! ed25519::{Signature, SigningKey, VerifyKey}, //! Signer, Verifier