Advisory

RUSTSEC-2026-0212

Also known as: None

Summary

Potentially Incorrect Output of Constant-Time Swap/Select on Aarch64

Details

The implementation of constant-time swap and select on aarch64
platforms used a cmp instruction in inline assembly to check whether
an 8-bit wide selector was 0. The cmp instruction works on 32-bit
registers, which included the unspecified high 24 bits of the cmp operand.
Depending on the execution environment the cmp
could thus potentially return an incorrect result because its
operand's high bits in the inline assembly were set when Rust expected them to be unset.
This could lead to incorrect results for the constant-time swap and select
operations built from this comparison.

Impact
In certain circumstances the swap and select instructions on aarch64
platforms returned incorrect results.

Mitigation
Starting from version 0.0.6, the selector is compared using a tst
instruction with a mask, which only compares the first 8 bits of the
selector.

Severity

Not rated by the source.

Dates

Published
2026-05-26 12:00 UTC
Modified
2026-07-17 11:45 UTC

Affected packages and fixes

libcrux-secrets

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 0.0.6 (semver)

Fixed versions

0.0.6

Fix

  • Fixed version 0.0.6
    cargo update -p libcrux-secrets --precise 0.0.6

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences