From 542483c3ff2cdff925a622978cccd9c09846ac78 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Sat, 21 Jan 2023 12:10:10 -0700 Subject: [PATCH] ed25519: use namespaced features for `serde_bytes`; MSRV 1.60 Since workspaces have to be bumped to MSRV 1.60 at the same time, this also bumps the MSRV of other crates in this repo along with bumping their version numbers to `-pre`. --- .github/workflows/dsa.yml | 6 +++--- .github/workflows/ecdsa.yml | 4 ++-- .github/workflows/ed25519.yml | 4 ++-- .github/workflows/rfc6979.yml | 4 ++-- .github/workflows/workspace.yml | 2 +- Cargo.lock | 6 +++--- dsa/Cargo.toml | 6 +++--- dsa/README.md | 4 ++-- dsa/src/verifying_key.rs | 2 +- ecdsa/Cargo.toml | 6 +++--- ecdsa/README.md | 4 ++-- ed25519/Cargo.toml | 6 +++--- ed25519/README.md | 4 ++-- ed25519/src/serde.rs | 3 --- ed25519/tests/serde.rs | 3 --- rfc6979/Cargo.toml | 4 ++-- rfc6979/README.md | 4 ++-- 17 files changed, 33 insertions(+), 39 deletions(-) diff --git a/.github/workflows/dsa.yml b/.github/workflows/dsa.yml index 664ccdda..82a41034 100644 --- a/.github/workflows/dsa.yml +++ b/.github/workflows/dsa.yml @@ -24,7 +24,7 @@ jobs: - thumbv7em-none-eabi - wasm32-unknown-unknown toolchain: - - 1.57.0 # MSRV + - 1.60.0 # MSRV - stable steps: - uses: actions/checkout@v3 @@ -43,7 +43,7 @@ jobs: - macos-latest - windows-latest toolchain: - - 1.57.0 # MSRV + - 1.60.0 # MSRV - stable runs-on: ${{ matrix.platform }} steps: @@ -60,4 +60,4 @@ jobs: override: true - run: cargo test --release --no-default-features - run: cargo test --release - - run: cargo test --release --all-features \ No newline at end of file + - run: cargo test --release --all-features diff --git a/.github/workflows/ecdsa.yml b/.github/workflows/ecdsa.yml index 3cff92b8..fe238219 100644 --- a/.github/workflows/ecdsa.yml +++ b/.github/workflows/ecdsa.yml @@ -26,7 +26,7 @@ jobs: - thumbv7em-none-eabi - wasm32-unknown-unknown rust: - - 1.57.0 # MSRV + - 1.60.0 # MSRV - stable steps: - uses: actions/checkout@v3 @@ -44,7 +44,7 @@ jobs: strategy: matrix: rust: - - 1.57.0 # MSRV + - 1.60.0 # MSRV - stable steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/ed25519.yml b/.github/workflows/ed25519.yml index 247713e5..e0f69108 100644 --- a/.github/workflows/ed25519.yml +++ b/.github/workflows/ed25519.yml @@ -24,7 +24,7 @@ jobs: - thumbv7em-none-eabi - wasm32-unknown-unknown toolchain: - - 1.57.0 # MSRV + - 1.60.0 # MSRV - stable steps: - uses: actions/checkout@v3 @@ -47,7 +47,7 @@ jobs: - macos-latest - windows-latest toolchain: - - 1.57.0 # MSRV + - 1.60.0 # MSRV - stable runs-on: ${{ matrix.platform }} steps: diff --git a/.github/workflows/rfc6979.yml b/.github/workflows/rfc6979.yml index 0dbf062f..9ef2449d 100644 --- a/.github/workflows/rfc6979.yml +++ b/.github/workflows/rfc6979.yml @@ -24,7 +24,7 @@ jobs: - thumbv7em-none-eabi - wasm32-unknown-unknown rust: - - 1.57.0 # MSRV + - 1.60.0 # MSRV - stable steps: - uses: actions/checkout@v3 @@ -41,7 +41,7 @@ jobs: strategy: matrix: rust: - - 1.57.0 # MSRV + - 1.60.0 # MSRV - stable steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml index 4845a8d3..02730c4c 100644 --- a/.github/workflows/workspace.yml +++ b/.github/workflows/workspace.yml @@ -34,7 +34,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.57.0 + toolchain: 1.66.0 components: clippy override: true profile: minimal diff --git a/Cargo.lock b/Cargo.lock index 7d8ed430..c4f08a34 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -142,7 +142,7 @@ dependencies = [ [[package]] name = "dsa" -version = "0.5.0" +version = "0.6.0-pre" dependencies = [ "digest 0.10.6", "num-bigint-dig", @@ -159,7 +159,7 @@ dependencies = [ [[package]] name = "ecdsa" -version = "0.15.0" +version = "0.16.0-pre" dependencies = [ "der", "elliptic-curve", @@ -489,7 +489,7 @@ dependencies = [ [[package]] name = "rfc6979" -version = "0.3.1" +version = "0.4.0-pre" dependencies = [ "crypto-bigint", "hmac", diff --git a/dsa/Cargo.toml b/dsa/Cargo.toml index 488dacde..e7d78454 100644 --- a/dsa/Cargo.toml +++ b/dsa/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dsa" -version = "0.5.0" +version = "0.6.0-pre" description = """ Pure Rust implementation of the Digital Signature Algorithm (DSA) as specified in FIPS 186-4 (Digital Signature Standard), providing RFC6979 deterministic @@ -12,14 +12,14 @@ readme = "README.md" repository = "https://github.com/RustCrypto/signatures/tree/master/dsa" categories = ["cryptography", "no-std"] keywords = ["crypto", "nist", "signature"] -rust-version = "1.57" +rust-version = "1.60" [dependencies] digest = "0.10" num-bigint = { package = "num-bigint-dig", version = "0.8", default-features = false, features = ["prime", "rand", "zeroize"] } num-traits = { version = "0.2", default-features = false } pkcs8 = { version = "0.9", default-features = false, features = ["alloc"] } -rfc6979 = { version = "0.3", path = "../rfc6979" } +rfc6979 = { version = "=0.4.0-pre", path = "../rfc6979" } sha2 = { version = "0.10", default-features = false } signature = { version = "2.0, <2.1", default-features = false, features = ["alloc", "digest", "rand_core"] } zeroize = { version = "1.5", default-features = false } diff --git a/dsa/README.md b/dsa/README.md index 3b9a7ffd..35c159fd 100644 --- a/dsa/README.md +++ b/dsa/README.md @@ -30,7 +30,7 @@ USE AT YOUR OWN RISK! ## Minimum Supported Rust Version -This crate requires **Rust 1.57** at a minimum. +This crate requires **Rust 1.60** at a minimum. We may change the MSRV in the future, but it will be accompanied by a minor version bump. @@ -59,7 +59,7 @@ dual licensed as above, without any additional terms or conditions. [build-image]: https://github.com/RustCrypto/signatures/actions/workflows/dsa.yml/badge.svg [build-link]: https://github.com/RustCrypto/signatures/actions/workflows/dsa.yml [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.60+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260048-signatures diff --git a/dsa/src/verifying_key.rs b/dsa/src/verifying_key.rs index a35697ff..289af83e 100644 --- a/dsa/src/verifying_key.rs +++ b/dsa/src/verifying_key.rs @@ -59,7 +59,7 @@ impl VerifyingKey { let w = s.mod_inverse(q)?.to_biguint().unwrap(); - let n = (q.bits() / 8) as usize; + let n = q.bits() / 8; let block_size = hash.len(); // Hash function output size let z_len = min(n, block_size); diff --git a/ecdsa/Cargo.toml b/ecdsa/Cargo.toml index 6e27defc..cf889eb6 100644 --- a/ecdsa/Cargo.toml +++ b/ecdsa/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ecdsa" -version = "0.15.0" +version = "0.16.0-pre" description = """ Pure Rust implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA) as specified in FIPS 186-4 (Digital Signature Standard), providing @@ -13,7 +13,7 @@ readme = "README.md" categories = ["cryptography", "no-std"] keywords = ["crypto", "ecc", "nist", "secp256k1", "signature"] edition = "2021" -rust-version = "1.57" +rust-version = "1.60" [dependencies] elliptic-curve = { version = "0.12", default-features = false, features = ["digest", "sec1"] } @@ -21,7 +21,7 @@ signature = { version = "2.0, <2.1", default-features = false, features = ["rand # optional dependencies der = { version = "0.6", optional = true } -rfc6979 = { version = "0.3", optional = true, path = "../rfc6979" } +rfc6979 = { version = "=0.4.0-pre", optional = true, path = "../rfc6979" } serdect = { version = "0.1", optional = true, default-features = false, features = ["alloc"] } [dev-dependencies] diff --git a/ecdsa/README.md b/ecdsa/README.md index 6da60999..c4cdfa1c 100644 --- a/ecdsa/README.md +++ b/ecdsa/README.md @@ -41,7 +41,7 @@ USE AT YOUR OWN RISK! ## Minimum Supported Rust Version -This crate requires **Rust 1.57** at a minimum. +This crate requires **Rust 1.60** at a minimum. We may change the MSRV in the future, but it will be accompanied by a minor version bump. @@ -70,7 +70,7 @@ dual licensed as above, without any additional terms or conditions. [build-image]: https://github.com/RustCrypto/signatures/actions/workflows/ecdsa.yml/badge.svg [build-link]: https://github.com/RustCrypto/signatures/actions/workflows/ecdsa.yml [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.60+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260048-signatures diff --git a/ed25519/Cargo.toml b/ed25519/Cargo.toml index d9d783ab..1fa4b319 100644 --- a/ed25519/Cargo.toml +++ b/ed25519/Cargo.toml @@ -14,7 +14,7 @@ readme = "README.md" categories = ["cryptography", "no-std"] keywords = ["crypto", "curve25519", "ecc", "signature", "signing"] edition = "2021" -rust-version = "1.57" +rust-version = "1.60" [dependencies] signature = { version = "2", default-features = false } @@ -22,7 +22,7 @@ signature = { version = "2", default-features = false } # optional dependencies pkcs8 = { version = "0.9", optional = true } serde = { version = "1", optional = true, default-features = false } -serde_bytes_crate = { package = "serde_bytes", version = "0.11", optional = true } +serde_bytes = { version = "0.11", optional = true } zeroize = { version = "1", optional = true, default-features = false } [dev-dependencies] @@ -36,7 +36,7 @@ rand_core = { version = "0.5", features = ["std"] } default = ["std"] alloc = ["pkcs8/alloc"] pem = ["alloc", "pkcs8/pem"] -serde_bytes = ["serde", "serde_bytes_crate", "std"] +serde_bytes = ["serde", "dep:serde_bytes"] std = ["signature/std"] [package.metadata.docs.rs] diff --git a/ed25519/README.md b/ed25519/README.md index 3294adc1..d425cde9 100644 --- a/ed25519/README.md +++ b/ed25519/README.md @@ -26,7 +26,7 @@ Ed25519 implementations, including HSMs or Cloud KMS services. ## Minimum Supported Rust Version -This crate requires **Rust 1.57** at a minimum. +This crate requires **Rust 1.60** at a minimum. Our policy is to allow MSRV to be raised in future released without that qualifing as a SemVer-breaking change, but it will be accompanied by a minor @@ -64,7 +64,7 @@ dual licensed as above, without any additional terms or conditions. [build-image]: https://github.com/RustCrypto/signatures/actions/workflows/ed25519.yml/badge.svg [build-link]: https://github.com/RustCrypto/signatures/actions/workflows/ed25519.yml [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.60+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260048-signatures diff --git a/ed25519/src/serde.rs b/ed25519/src/serde.rs index 79783f77..d7a7022c 100644 --- a/ed25519/src/serde.rs +++ b/ed25519/src/serde.rs @@ -4,9 +4,6 @@ use crate::{Signature, SignatureBytes}; use ::serde::{de, ser, Deserialize, Serialize}; use core::fmt; -#[cfg(feature = "serde_bytes")] -use serde_bytes_crate as serde_bytes; - impl Serialize for Signature { fn serialize(&self, serializer: S) -> Result { use ser::SerializeTuple; diff --git a/ed25519/tests/serde.rs b/ed25519/tests/serde.rs index cb2fccd6..63f0efbe 100644 --- a/ed25519/tests/serde.rs +++ b/ed25519/tests/serde.rs @@ -5,9 +5,6 @@ use ed25519::{Signature, SignatureBytes}; use hex_literal::hex; -#[cfg(feature = "serde_bytes")] -use serde_bytes_crate as serde_bytes; - const EXAMPLE_SIGNATURE: SignatureBytes = hex!( "3f3e3d3c3b3a393837363534333231302f2e2d2c2b2a29282726252423222120" "1f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100" diff --git a/rfc6979/Cargo.toml b/rfc6979/Cargo.toml index 087babf3..4d7af6b1 100644 --- a/rfc6979/Cargo.toml +++ b/rfc6979/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rfc6979" -version = "0.3.1" +version = "0.4.0-pre" description = """ Pure Rust implementation of RFC6979: Deterministic Usage of the Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA) @@ -12,7 +12,7 @@ readme = "README.md" categories = ["cryptography", "no-std"] keywords = ["dsa", "ecdsa", "signature"] edition = "2021" -rust-version = "1.57" +rust-version = "1.60" [dependencies] crypto-bigint = { version = "0.4", default-features = false, features = ["generic-array", "zeroize"] } diff --git a/rfc6979/README.md b/rfc6979/README.md index e19b54e8..1ac07aff 100644 --- a/rfc6979/README.md +++ b/rfc6979/README.md @@ -17,7 +17,7 @@ Algorithm described in RFC 6979 ยง 3.2: ## Minimum Supported Rust Version -This crate requires **Rust 1.57** at a minimum. +This crate requires **Rust 1.60** at a minimum. We may change the MSRV in the future, but it will be accompanied by a minor version bump. @@ -46,7 +46,7 @@ dual licensed as above, without any additional terms or conditions. [build-image]: https://github.com/RustCrypto/signatures/actions/workflows/rfc6979.yml/badge.svg [build-link]: https://github.com/RustCrypto/signatures/actions/workflows/rfc6979.yml [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.57+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.60+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260048-signatures