Skip to content

Commit 2ced04e

Browse files
authored
cmov v0.4.5 (#1347)
### Changed - Introduce small ARM32 `asm!` optimization which also guarantees constant-time operation (#1336, #1346)
1 parent 2fcad3c commit 2ced04e

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmov/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## 0.4.5 (2026-01-15)
8+
### Changed
9+
- Introduce small ARM32 `asm!` optimization which also guarantees constant-time operation ([#1336], [#1346])
10+
11+
[#1336]: https://github.com/RustCrypto/utils/pull/1336
12+
[#1346]: https://github.com/RustCrypto/utils/pull/1346
13+
714
## 0.4.4 (2026-01-14)
815
### Security
916
- Fix non-constant-time assembly being emitted from portable backend on `thumbv6m-none-eabi` ([#1332])

cmov/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cmov"
3-
version = "0.4.4"
3+
version = "0.4.5"
44
authors = ["RustCrypto Developers"]
55
edition = "2024"
66
rust-version = "1.85"
@@ -11,9 +11,9 @@ license = "Apache-2.0 OR MIT"
1111
keywords = ["constant-time", "crypto", "intrinsics"]
1212
categories = ["cryptography", "hardware-support", "no-std"]
1313
description = """
14-
Conditional move CPU intrinsics which are guaranteed on major platforms to execute in constant-time
15-
and not be rewritten as branches by the compiler. Provides wrappers for the CMOV family of
16-
instructions on x86/x86_64 and CSEL on AArch64, along with a portable "best-effort" fallback.
14+
Conditional move CPU intrinsics which are guaranteed on major platforms (ARM32/ARM64, x86/x86_64) to execute in
15+
constant-time and not be rewritten as branches by the compiler. Provides wrappers for the CMOV family of
16+
instructions on x86/x86_64 and CSEL on AArch64, along with a portable "best-effort" pure Rust fallback.
1717
"""
1818

1919
[dev-dependencies]

cmov/src/portable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ fn masknz32(condition: u32) -> u32 {
156156
fn masknz64(condition: u64) -> u64 {
157157
let lo = masknz32((condition & 0xFFFF_FFFF) as u32);
158158
let hi = masknz32((condition >> 32) as u32);
159-
let mask = (lo | hi) as u64;
159+
let mask = u64::from(lo | hi);
160160
mask | mask << 32
161161
}
162162

0 commit comments

Comments
 (0)