Curve25519: lshift of a negative value is undefined in C#9372
Merged
JacobBarthelmeh merged 2 commits intowolfSSL:masterfrom Nov 6, 2025
Merged
Curve25519: lshift of a negative value is undefined in C#9372JacobBarthelmeh merged 2 commits intowolfSSL:masterfrom
JacobBarthelmeh merged 2 commits intowolfSSL:masterfrom
Conversation
Change all left shifts to be of unsigned values. In some cases the values were negative. Added macros to make the code easier to be consistent.
54c54bf to
574067e
Compare
Contributor
Author
|
Code is generated using scripts modified by: |
5929dc0 to
8372fba
Compare
Change all left shifts to be of unsigned values. In some cases the values were negative. Changed 128-bit variable implementation of Curve25519. (generated) Changed Ed25519 C implementation. Changed Curve448 C implementation. (generated) Changed Ed448 C implementation. (generated)
8372fba to
e4d47fb
Compare
JacobBarthelmeh
approved these changes
Nov 6, 2025
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.
Description
Change all left shifts to be of unsigned values.
In some cases the values were negative.
Added macros to make the code easier to be consistent.
Fixes zd#20728
Testing
./configure --disable-shared --enable-curve25519=no128bit
and thrashed it with curve25519_thrash.c
./configure --disable-shared --enable-curve25519
and thrashed it with curve25519_thrash.c
./configure --disable-shared --enable-curve25519=no128bit --enable-ed25519
and thrashed it with ed25519_thrash.c
./configure --disable-shared --enable-curve25519 --enable-ed25519
and thrashed it with ed25519_thrash.c
./configure --disable-shared --enable-curve448=no128bit
and thrashed it with curve448_thrash.c
./configure --disable-shared --enable-curve448
and thrashed it with curve448_thrash.c
./configure --disable-shared --enable-curve448=no128bit --enable-ed448
and thrashed it with ed448_thrash.c
./configure --disable-shared --enable-curve448 --enable-ed448
and thrashed it with ed448_thrash.c
Checklist