Skip to content

ctutils: constant-time hardening for non-zero comparisons - #1582

Merged
tarcieri merged 1 commit into
masterfrom
checkct/nonzero-hardening
Oct 29, 2026
Merged

tarcieri merged 1 commit into
masterfrom
checkct/nonzero-hardening

Conversation

@tarcieri

Copy link
Copy Markdown
Member

Extends cargo checkct coverage to cover non-zero comparisons via Choice, uncovering some non-constant-time code generation on riscv32 and Thumb-1 targets.

Addresses the problem with a new nonzero_primitive! macro and selective use of black_box on these targets, using cargo checkct to verify this addresses the issue. This should not have an impact on codegen on other platforms, which were already constant-time.

Extends `cargo checkct` coverage to cover non-zero comparisons via
`Choice`, uncovering some non-constant-time code generation on `riscv32`
and Thumb-1 targets.

Addresses the problem with a new `nonzero_primitive!` macro and
selective use of `black_box` on these targets, using `cargo checkct` to
verify this addresses the issue. This should not have an impact on
codegen on other platforms, which were already constant-time.
@tarcieri
tarcieri force-pushed the checkct/nonzero-hardening branch from 56787a0 to 40c1546 Compare October 29, 2026 18:55
@tarcieri
tarcieri merged commit 5d666b6 into master Oct 29, 2026
16 checks passed
@tarcieri
tarcieri deleted the checkct/nonzero-hardening branch October 29, 2026 18:59
tarcieri added a commit to RustCrypto/crypto-bigint that referenced this pull request Oct 29, 2026
This includes unreleased fixes from RustCrypto/utils#1582 as well as
some Thumb-1 specific fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant