From 70309c79b0589e7e872a642d1d4382d0dbd15ff8 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Fri, 12 Jan 2024 11:39:43 -0700 Subject: [PATCH] keccak: 2021 edition upgrade; MSRV 1.60 `keccak` was previously excluded from the toplevel workspace due to its MSRV of 1.41 and incompatibilities with packages used by `ascon`. This bumps the edition, changes the version to `0.2.0-pre` to denote it contains breaking changes (though this is not intended to be a `0.2.0-pre` release), and bumps MSRV. With the MSRV bumped, `keccak` can and has been re-added to the toplevel workspace. --- .github/workflows/keccak.yml | 2 +- Cargo.lock | 22 ++++++++++++++++++++++ Cargo.toml | 4 ++-- keccak/Cargo.lock | 25 ------------------------- keccak/Cargo.toml | 5 +++-- keccak/README.md | 4 ++-- keccak/src/lib.rs | 1 - 7 files changed, 30 insertions(+), 33 deletions(-) delete mode 100644 keccak/Cargo.lock diff --git a/.github/workflows/keccak.yml b/.github/workflows/keccak.yml index 9ddfb3c..dc32669 100644 --- a/.github/workflows/keccak.yml +++ b/.github/workflows/keccak.yml @@ -21,7 +21,7 @@ jobs: set-msrv: uses: RustCrypto/actions/.github/workflows/set-msrv.yml@master with: - msrv: 1.41.0 + msrv: 1.60.0 build: needs: set-msrv diff --git a/Cargo.lock b/Cargo.lock index 22c0524..12d4d41 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9,6 +9,28 @@ dependencies = [ "zeroize", ] +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "keccak" +version = "0.2.0-pre" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "libc" +version = "0.2.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" + [[package]] name = "zeroize" version = "1.6.0" diff --git a/Cargo.toml b/Cargo.toml index c139b19..cf8ac35 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] -exclude = ["keccak"] # TODO(tarcieri): add back to `members` when MSRV >= 1.56 +resolver = "2" members = [ "ascon", - #"keccak", + "keccak", ] diff --git a/keccak/Cargo.lock b/keccak/Cargo.lock deleted file mode 100644 index 4d7f9f0..0000000 --- a/keccak/Cargo.lock +++ /dev/null @@ -1,25 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "cpufeatures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" -dependencies = [ - "libc", -] - -[[package]] -name = "keccak" -version = "0.1.5" -dependencies = [ - "cpufeatures", -] - -[[package]] -name = "libc" -version = "0.2.137" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" diff --git a/keccak/Cargo.toml b/keccak/Cargo.toml index 8a87110..2ff2234 100644 --- a/keccak/Cargo.toml +++ b/keccak/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "keccak" -version = "0.1.5" +version = "0.2.0-pre" description = """ Pure Rust implementation of the Keccak sponge function including the keccak-f and keccak-p variants @@ -12,7 +12,8 @@ repository = "https://github.com/RustCrypto/sponges/tree/master/keccak" keywords = ["crypto", "sponge", "keccak", "keccak-f", "keccak-p"] categories = ["cryptography", "no-std"] readme = "README.md" -edition = "2018" +edition = "2021" +rust-version = "1.60" [features] asm = [] # Use optimized assembly when available (currently only ARMv8) diff --git a/keccak/README.md b/keccak/README.md index 989c311..413c6fb 100644 --- a/keccak/README.md +++ b/keccak/README.md @@ -22,7 +22,7 @@ is built on this crate. ## Minimum Supported Rust Version -Rust **1.41** or higher by default, or **1.59** with the `asm` feature enabled. +Rust **1.60** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. @@ -56,7 +56,7 @@ dual licensed as above, without any additional terms or conditions. [build-image]: https://github.com/RustCrypto/sponges/actions/workflows/keccak.yml/badge.svg [build-link]: https://github.com/RustCrypto/sponges/actions/workflows/keccak.yml [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.60+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/369879-sponges diff --git a/keccak/src/lib.rs b/keccak/src/lib.rs index dc18ea3..151e7ba 100644 --- a/keccak/src/lib.rs +++ b/keccak/src/lib.rs @@ -54,7 +54,6 @@ )] use core::{ - convert::TryInto, fmt::Debug, mem::size_of, ops::{BitAnd, BitAndAssign, BitXor, BitXorAssign, Not},