diff --git a/.github/workflows/ctutils.yml b/.github/workflows/ctutils.yml index be9a6fb3..b4304da7 100644 --- a/.github/workflows/ctutils.yml +++ b/.github/workflows/ctutils.yml @@ -33,7 +33,7 @@ jobs: strategy: matrix: rust: - - 1.85.0 # MSRV + - 1.86.0 # MSRV - stable target: - thumbv7em-none-eabi @@ -58,7 +58,7 @@ jobs: strategy: matrix: rust: - - 1.85.0 # MSRV + - 1.86.0 # MSRV - stable steps: - uses: actions/checkout@v7 diff --git a/ctutils/Cargo.toml b/ctutils/Cargo.toml index 725866bc..514485a1 100644 --- a/ctutils/Cargo.toml +++ b/ctutils/Cargo.toml @@ -14,7 +14,7 @@ categories = ["cryptography", "no-std"] keywords = ["constant-time", "crypto", "intrinsics"] readme = "README.md" edition = "2024" -rust-version = "1.85" +rust-version = "1.86" [dependencies] cmov = "0.5.3" diff --git a/ctutils/README.md b/ctutils/README.md index 4758a3d8..74cc8d64 100644 --- a/ctutils/README.md +++ b/ctutils/README.md @@ -79,7 +79,7 @@ dual licensed as above, without any additional terms or conditions. [docs-image]: https://docs.rs/ctutils/badge.svg [docs-link]: https://docs.rs/ctutils/ [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[msrv-image]: https://img.shields.io/badge/rustc-1.85+-blue.svg +[msrv-image]: https://img.shields.io/badge/rustc-1.86+-blue.svg [build-image]: https://github.com/RustCrypto/utils/actions/workflows/ctutils.yml/badge.svg [build-link]: https://github.com/RustCrypto/utils/actions/workflows/ctutils.yml [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg diff --git a/ctutils/src/choice.rs b/ctutils/src/choice.rs index f93014d2..16a73879 100644 --- a/ctutils/src/choice.rs +++ b/ctutils/src/choice.rs @@ -386,44 +386,42 @@ impl Choice { /// the small amount of timing variability it introduces can potentially be exploited. Whenever /// possible, prefer fully constant-time approaches instead. /// - // TODO(tarcieri): `const fn` when MSRV 1.86 #[must_use] - pub fn to_bool(self) -> bool { + pub const fn to_bool(self) -> bool { self.to_u8() != 0 } /// Convert [`Choice`] to a `u8`, attempting to apply a "best effort" optimization barrier. - // TODO(tarcieri): `const fn` when MSRV 1.86 #[must_use] - pub fn to_u8(self) -> u8 { + pub const fn to_u8(self) -> u8 { // `black_box` is documented as working on a "best effort" basis. That's fine, this type is // likewise documented as only working on a "best effort" basis itself. The only way we // rely on `black_box` for correctness is it behaving as the identity function. core::hint::black_box(self.0) } - /// HACK: workaround to allow `const fn` boolean support on Rust 1.85. + /// DEPRECATED: previously a workaround to allow `const fn` boolean support on Rust 1.85. /// - /// This does not apply `black_box` to the output. + /// Use [`Choice::to_bool`] instead. /// ///