Skip to content

ctutils: add integer primitives module - #1570

Merged
tarcieri merged 1 commit into
masterfrom
ctutils/add-primitives-module
Oct 23, 2026
Merged

tarcieri merged 1 commit into
masterfrom
ctutils/add-primitives-module

Conversation

@tarcieri

Copy link
Copy Markdown
Member

Adds a set of functions extracted from RustCrypto/crypto-bigint#1360 which provide a set of reusable integer primitive operations where we were previously generating non-constant-time code on certain platforms.

Validates the generated assembly is constant time using cargo checkct/BINSEC.

Adds a set of functions extracted from RustCrypto/crypto-bigint#1360
which provide a set of reusable integer primitive operations where
we were previously generating non-constant-time code on certain
platforms.

Validates the generated assembly is constant time using
`cargo checkct`/BINSEC.
@tarcieri
tarcieri merged commit a89a688 into master Oct 23, 2026
15 checks passed
@tarcieri
tarcieri deleted the ctutils/add-primitives-module branch October 23, 2026 02:13
tarcieri added a commit that referenced this pull request Oct 23, 2026
Followup to #1570 which added `overflowing_add_*` primitives which
return `Choice`. This adds the analogous subtraction functionality.
@tarcieri tarcieri mentioned this pull request Oct 23, 2026
tarcieri added a commit that referenced this pull request Oct 23, 2026
## Added
- `primitives` module (#1570, #1572)

## Fixed
- Harden Thumb-1 comparisons and `Choice` composition (#1571)
tarcieri added a commit to RustCrypto/crypto-bigint that referenced this pull request Oct 23, 2026
Fix secret-dependent branches in zero counting, bit-length rounding,
division, and Montgomery multiplication. Reuse the hardened primitives
and `Choice` operations from RustCrypto/utils#1570 and
RustCrypto/utils#1571.

Add `cargo checkct` regressions across Thumb-1, Thumb-2, RISCV32, and
x86-64, including unoptimized coverage for `nlimbs`.
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