diff options
author | tb <> | 2025-01-09 06:51:11 +0000 |
---|---|---|
committer | tb <> | 2025-01-09 06:51:11 +0000 |
commit | 8384d37643bc0285fd901aec33be3e185257f3ec (patch) | |
tree | e52ab7c647c275123e0fa71375dc2f9ca8faefc8 | |
parent | ca8f8299cdbaef3933495df4f20083ce2f2a6d7c (diff) | |
download | openbsd-8384d37643bc0285fd901aec33be3e185257f3ec.tar.gz openbsd-8384d37643bc0285fd901aec33be3e185257f3ec.tar.bz2 openbsd-8384d37643bc0285fd901aec33be3e185257f3ec.zip |
check_discriminant: make the assumptions on p, a, b more explicit
requested by jsing
-rw-r--r-- | src/lib/libcrypto/ec/ec_lib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c index a50b1e5633..322662a1e6 100644 --- a/src/lib/libcrypto/ec/ec_lib.c +++ b/src/lib/libcrypto/ec/ec_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_lib.c,v 1.103 2025/01/07 08:30:52 tb Exp $ */ | 1 | /* $OpenBSD: ec_lib.c,v 1.104 2025/01/09 06:51:11 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Originally written by Bodo Moeller for the OpenSSL project. | 3 | * Originally written by Bodo Moeller for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -623,7 +623,8 @@ EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx_in) | |||
623 | goto err; | 623 | goto err; |
624 | 624 | ||
625 | /* | 625 | /* |
626 | * Check that the discriminant 4a^3 + 27b^2 is non-zero modulo p. | 626 | * Check that the discriminant 4a^3 + 27b^2 is non-zero modulo p |
627 | * assuming that p > 3 is prime and that a and b are in [0, p). | ||
627 | */ | 628 | */ |
628 | 629 | ||
629 | if (BN_is_zero(a) && BN_is_zero(b)) | 630 | if (BN_is_zero(a) && BN_is_zero(b)) |