Skip to content

Miscomputation error on nightly starting with 2025-08-11 #146163

@tarcieri

Description

@tarcieri

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

Metadata

Metadata

Assignees

Labels

A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.I-miscompileIssue: Correct Rust code lowers to incorrect machine codeI-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessP-criticalCritical priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.llvm-fixed-upstreamIssue expected to be fixed by the next major LLVM upgrade, or backported fixesregression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions