-
Notifications
You must be signed in to change notification settings - Fork 970
fix: reorder wc_curve25519_make_pub/generic to input-before-output #10367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -155,22 +155,22 @@ enum { | |||||||||||
| }; | ||||||||||||
|
|
||||||||||||
| WOLFSSL_API | ||||||||||||
| int wc_curve25519_make_pub(int public_size, byte* pub, int private_size, | ||||||||||||
| const byte* priv); | ||||||||||||
| int wc_curve25519_make_pub(int private_size, const byte* priv, | ||||||||||||
| int public_size, byte* pub); | ||||||||||||
| #ifdef WOLFSSL_CURVE25519_BLINDING | ||||||||||||
| WOLFSSL_API | ||||||||||||
| int wc_curve25519_make_pub_blind(int public_size, byte* pub, int private_size, | ||||||||||||
| const byte* priv, WC_RNG* rng); | ||||||||||||
| int wc_curve25519_make_pub_blind(int private_size, const byte* priv, | ||||||||||||
| int public_size, byte* pub, WC_RNG* rng); | ||||||||||||
|
Comment on lines
+162
to
+163
|
||||||||||||
| int wc_curve25519_make_pub_blind(int private_size, const byte* priv, | |
| int public_size, byte* pub, WC_RNG* rng); | |
| int wc_curve25519_make_pub_blind(int public_size, byte* pub, | |
| int private_size, const byte* priv, | |
| WC_RNG* rng); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To prevent regressions of the original issue (pub/priv swapped still compiles because both sizes are 32 and both pointers are byte*), add a negative test that intentionally calls wc_curve25519_make_pub() with the arguments swapped and verifies it returns an error (using a deliberately non-clamped buffer for the would-be private key).