Skip to content

Commit

Permalink
use int instead of size_t in 0 <= s < L check loop
Browse files Browse the repository at this point in the history
using a signed integer type (int) is preferable here,
to avoid potential issues with unsigned underflow.
  • Loading branch information
DeckerSU committed Oct 2, 2024
1 parent afcb471 commit e245176
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cryptoconditions/src/include/ed25519/src/verify.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int ed25519_verify(const unsigned char *signature, const unsigned char *message,
/* make sure 0 <= s < L, as per RFC 8032, section 5.1.7 to prevent signature
* malleability. Due to the three-bit check above (forces s < 2^253) there
* is not that much room, but adding L once works with most signatures */
for (size_t i = 31; ; i--)
for (int i = 31; ; i--)
{
if (signature[i+32] < curve25519_order[i])
{
Expand Down

0 comments on commit e245176

Please sign in to comment.