-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Description
This is a miscomputation error inside an implementation of a cryptographic algorithm (I am on an aarch64-apple-darwin
and have not checked other targets) .
https://github.com/RustCrypto/password-hashes/tree/master/yescrypt
The source code in question, the yescrypt
crate, has been mechanically translated from C (using corrode), contains ample usage of unsafe
and is not idiomatic Rust (something we intend to address eventually), so there is a possibility it is UB within the code itself which is being triggered on recent versions of nightly.
The problem does NOT occur with nightly-2025-08-10
, and DOES occur with the latest nightly-2025-09-02
.
Steps to reproduce:
$ git clone https://github.com/RustCrypto/password-hashes
$ cd password-hashes/yescrypt
$ cargo test
On stable or nightly-2025-08-10
:
test result: ok. 25 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
On nightly-2025-08-11
and later:
thread 'kat1' (9233754) panicked at yescrypt/tests/kats.rs:18:5:
assertion `left == right` failed
left: [119, 214, 87, 98, 56, 101, 123, 32]
right: [27, 45, 153, 207, 3, 3, 251, 154]
...
test result: FAILED. 0 passed; 25 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Meta
rustc --version --verbose
:
$ rustc --version --verbose
rustc 1.91.0-nightly (c8ca44c98 2025-08-10)
binary: rustc
commit-hash: c8ca44c98eade864824a3c0a15fbdc1edb7f9dd4
commit-date: 2025-08-10
host: aarch64-apple-darwin
release: 1.91.0-nightly
LLVM version: 21.1.0