diff --git a/Cargo.lock b/Cargo.lock index 53359cf8..94c223a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -57,7 +57,7 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cmov" -version = "0.4.4" +version = "0.4.5" dependencies = [ "proptest", ] diff --git a/cmov/CHANGELOG.md b/cmov/CHANGELOG.md index b963cc41..709758ff 100644 --- a/cmov/CHANGELOG.md +++ b/cmov/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.4.5 (2026-01-15) +### Changed +- Introduce small ARM32 `asm!` optimization which also guarantees constant-time operation ([#1336], [#1346]) + +[#1336]: https://github.com/RustCrypto/utils/pull/1336 +[#1346]: https://github.com/RustCrypto/utils/pull/1346 + ## 0.4.4 (2026-01-14) ### Security - Fix non-constant-time assembly being emitted from portable backend on `thumbv6m-none-eabi` ([#1332]) diff --git a/cmov/Cargo.toml b/cmov/Cargo.toml index c8834439..f706832f 100644 --- a/cmov/Cargo.toml +++ b/cmov/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cmov" -version = "0.4.4" +version = "0.4.5" authors = ["RustCrypto Developers"] edition = "2024" rust-version = "1.85" @@ -11,9 +11,9 @@ license = "Apache-2.0 OR MIT" keywords = ["constant-time", "crypto", "intrinsics"] categories = ["cryptography", "hardware-support", "no-std"] description = """ -Conditional move CPU intrinsics which are guaranteed on major platforms to execute in constant-time -and not be rewritten as branches by the compiler. Provides wrappers for the CMOV family of -instructions on x86/x86_64 and CSEL on AArch64, along with a portable "best-effort" fallback. +Conditional move CPU intrinsics which are guaranteed on major platforms (ARM32/ARM64, x86/x86_64) to execute in +constant-time and not be rewritten as branches by the compiler. Provides wrappers for the CMOV family of +instructions on x86/x86_64 and CSEL on AArch64, along with a portable "best-effort" pure Rust fallback. """ [dev-dependencies] diff --git a/cmov/src/portable.rs b/cmov/src/portable.rs index 98f39393..650db5dd 100644 --- a/cmov/src/portable.rs +++ b/cmov/src/portable.rs @@ -156,7 +156,7 @@ fn masknz32(condition: u32) -> u32 { fn masknz64(condition: u64) -> u64 { let lo = masknz32((condition & 0xFFFF_FFFF) as u32); let hi = masknz32((condition >> 32) as u32); - let mask = (lo | hi) as u64; + let mask = u64::from(lo | hi); mask | mask << 32 }