Skip to content

Commit

Permalink
Fix sm9_z256_point_from_uncompressed_octets bug
Browse files Browse the repository at this point in the history
Fix the issue of #1698

This might lead to Invalid curve attack.
  • Loading branch information
guanzhi committed Jun 18, 2024
1 parent 572ab07 commit 5b3c897
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sm9_z256.c
Original file line number Diff line number Diff line change
Expand Up @@ -3149,7 +3149,7 @@ int sm9_z256_point_from_uncompressed_octets(SM9_Z256_POINT *P, const uint8_t oct
sm9_z256_modp_to_mont(P->X, P->X);

sm9_z256_from_bytes(P->Y, octets + 32 + 1);
if (sm9_z256_cmp(P->X, SM9_Z256_P) >= 0) {
if (sm9_z256_cmp(P->Y, SM9_Z256_P) >= 0) {
error_print();
return -1;
}
Expand Down

0 comments on commit 5b3c897

Please sign in to comment.