Repository navigation
EC: Use only array types when crossing Rust<->C boundary - #1758
Merged
Merged
Conversation
Owner
Author
|
@vkrasnov I don't know that this presently solves any problem but it is definitely safer to do it this way. I wrote this when trying to figure out what's wrong with your P-521 code on a 32-bit machine. |
Better match the Rust declarations of these functions. Prepare to support more target platforms and more weird things (like P-521) that by avoiding any kind of alignment assumptions at the language boundary (or elsewhere).
Avoid using the P384_POINT type on the C side. It seems to work for all the targets we support, for P-384, but this pattern probably doesn't work in general. Especially due to alignment issues for 32-bit targets, it is doubtful it would work for P-521.
briansmith
force-pushed
the
b/fiat_limbs
branch
from
October 18, 2023 16:50
922ae77 to
65af475
Compare
Codecov Report
@@ Coverage Diff @@
## main #1758 +/- ##
=======================================
Coverage 96.00% 96.00%
=======================================
Files 138 138
Lines 20691 20751 +60
Branches 226 226
=======================================
+ Hits 19864 19923 +59
- Misses 790 792 +2
+ Partials 37 36 -1
... and 3 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
3 of 13 tasks
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.
Don't assume that a struct that contains only arrays has no padding, and don't assume we can cast between a
P{256,384}_POINTand aLimb[3][P{256,384}_LIMBS]array.