diff options
author | tb <> | 2025-01-06 11:59:02 +0000 |
---|---|---|
committer | tb <> | 2025-01-06 11:59:02 +0000 |
commit | 52f13317baa428db8efa6305c98bcca1c8d6b93e (patch) | |
tree | 0ee2fc6379d14a64692dcf7f36e8c5180d72a607 /src/lib/libcrypto/ec/ec_lib.c | |
parent | 1d5dc8af4f29575850958ce2ca4c6ffcc27dece5 (diff) | |
download | openbsd-52f13317baa428db8efa6305c98bcca1c8d6b93e.tar.gz openbsd-52f13317baa428db8efa6305c98bcca1c8d6b93e.tar.bz2 openbsd-52f13317baa428db8efa6305c98bcca1c8d6b93e.zip |
Stop caching one in the Montgomery domain
This is only used by ec_points_make_affine(), which is only used by the
wNAF multiplication, which is only used by ECDSA. We can afford computing
that one once per ECDSA verification given the cost of the rest of this.
Thus, the field_set_to_one() member disappears from the EC_METHOD and the
mont_one member disappears from EC_GROUP and with it all the complications
when setting/copying/freeing the group.
ok jsing
Diffstat (limited to 'src/lib/libcrypto/ec/ec_lib.c')
-rw-r--r-- | src/lib/libcrypto/ec/ec_lib.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c index 03c6f3aa90..170bdedc57 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.95 2025/01/06 10:56:46 tb Exp $ */ | 1 | /* $OpenBSD: ec_lib.c,v 1.96 2025/01/06 11:59:02 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 | */ |
@@ -107,8 +107,7 @@ EC_GROUP_new(const EC_METHOD *meth) | |||
107 | goto err; | 107 | goto err; |
108 | 108 | ||
109 | /* | 109 | /* |
110 | * generator and seed are optional. mont_ctx, mont_one are only for | 110 | * generator, seed and mont_ctx are optional. |
111 | * curves using EC_GFp_mont_method() | ||
112 | */ | 111 | */ |
113 | 112 | ||
114 | return group; | 113 | return group; |
@@ -131,7 +130,6 @@ EC_GROUP_free(EC_GROUP *group) | |||
131 | BN_free(group->b); | 130 | BN_free(group->b); |
132 | 131 | ||
133 | BN_MONT_CTX_free(group->mont_ctx); | 132 | BN_MONT_CTX_free(group->mont_ctx); |
134 | BN_free(group->mont_one); | ||
135 | 133 | ||
136 | EC_POINT_free(group->generator); | 134 | EC_POINT_free(group->generator); |
137 | BN_free(group->order); | 135 | BN_free(group->order); |