Repository navigation
Vendor primitives from ctutils - #1377
Merged
Merged
Conversation
It seems I made a mistake extracting these into `ctutils`. I thought that might be a nice place to handle modeling borrows/overflows as `Choice` but in the course of both trying to fix the constant-time issues in `crypto-bigint` and then try to restore some of the previous performance I discovered the actual requirements of the function changed because I accidentally shipped a function signature with a performance bottleneck, and then in the course of subsequent refactoring I found I wasn't even able to salvage `overflowing_add_*`. So I am declaring the entire `ctutils::primitives` module a mistake, but it's already published, so the best I can do is remove `crypto-bigint`'s dependence on it and then deprecate it. This moves the exact primitives that `crypto-bigint` needs back to the `crypto_bigint::primitives` module, which uses intrinsics we know work when available with a software fallback. It also adds `cargo checkct` tests for these primitives.
tarcieri
force-pushed
the
vendor-primitives-from-ctutils
branch
from
October 26, 2026 02:41
31c6e8f to
f87f8cb
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1377 +/- ##
==========================================
- Coverage 91.39% 91.37% -0.02%
==========================================
Files 190 190
Lines 23128 23192 +64
==========================================
+ Hits 21138 21192 +54
- Misses 1990 2000 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It seems I made a mistake extracting these into
ctutils. I thought that might be a nice place to handle modeling borrows/overflows asChoicebut in the course of both trying to fix the constant-time issues incrypto-bigintand then try to restore some of the previous performance I discovered the actual requirements of the function changed because I accidentally shipped a function signature with a performance bottleneck, and then in the course of subsequent refactoring I found I wasn't even able to salvageoverflowing_add_*.So I am declaring the entire
ctutils::primitivesmodule a mistake, but it's already published, so the best I can do is removecrypto-bigint's dependence on it and then deprecate it.This moves the exact primitives that
crypto-bigintneeds back to thecrypto_bigint::primitivesmodule, which uses intrinsics we know work when available with a software fallback.It also adds
cargo checkcttests for these primitives.