diff options
| author | tb <> | 2025-01-06 14:10:32 +0000 |
|---|---|---|
| committer | tb <> | 2025-01-06 14:10:32 +0000 |
| commit | 5fe1809b29ea07bb51ff7e8df06c129f64c5c9fb (patch) | |
| tree | 50f1e670da065b506a4ec987a0eb85de475db533 /src | |
| parent | 1bfab4c2439582493bf86856c6170af62ea1ed96 (diff) | |
| download | openbsd-5fe1809b29ea07bb51ff7e8df06c129f64c5c9fb.tar.gz openbsd-5fe1809b29ea07bb51ff7e8df06c129f64c5c9fb.tar.bz2 openbsd-5fe1809b29ea07bb51ff7e8df06c129f64c5c9fb.zip | |
Use a slightly more sensible order in ec_local.h
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/ec/ec_local.h | 69 |
1 files changed, 33 insertions, 36 deletions
diff --git a/src/lib/libcrypto/ec/ec_local.h b/src/lib/libcrypto/ec/ec_local.h index c74bb05d9a..fad66eb4ec 100644 --- a/src/lib/libcrypto/ec/ec_local.h +++ b/src/lib/libcrypto/ec/ec_local.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ec_local.h,v 1.49 2025/01/06 12:35:14 jsing Exp $ */ | 1 | /* $OpenBSD: ec_local.h,v 1.50 2025/01/06 14:10:32 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 | */ |
| @@ -184,25 +184,6 @@ struct ec_group_st { | |||
| 184 | BN_MONT_CTX *mont_ctx; | 184 | BN_MONT_CTX *mont_ctx; |
| 185 | } /* EC_GROUP */; | 185 | } /* EC_GROUP */; |
| 186 | 186 | ||
| 187 | struct ec_key_st { | ||
| 188 | const EC_KEY_METHOD *meth; | ||
| 189 | |||
| 190 | int version; | ||
| 191 | |||
| 192 | EC_GROUP *group; | ||
| 193 | |||
| 194 | EC_POINT *pub_key; | ||
| 195 | BIGNUM *priv_key; | ||
| 196 | |||
| 197 | unsigned int enc_flag; | ||
| 198 | point_conversion_form_t conv_form; | ||
| 199 | |||
| 200 | int references; | ||
| 201 | int flags; | ||
| 202 | |||
| 203 | CRYPTO_EX_DATA ex_data; | ||
| 204 | } /* EC_KEY */; | ||
| 205 | |||
| 206 | struct ec_point_st { | 187 | struct ec_point_st { |
| 207 | const EC_METHOD *meth; | 188 | const EC_METHOD *meth; |
| 208 | 189 | ||
| @@ -221,8 +202,20 @@ int ec_wnaf_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *m, | |||
| 221 | const EC_POINT *point, const BIGNUM *n, BN_CTX *ctx); | 202 | const EC_POINT *point, const BIGNUM *n, BN_CTX *ctx); |
| 222 | 203 | ||
| 223 | int ec_group_simple_order_bits(const EC_GROUP *group); | 204 | int ec_group_simple_order_bits(const EC_GROUP *group); |
| 205 | int ec_group_is_builtin_curve(const EC_GROUP *group, int *out_nid); | ||
| 206 | int ec_group_get_field_type(const EC_GROUP *group); | ||
| 207 | |||
| 208 | /* | ||
| 209 | * Wrappers around the unergonomic EC_POINT_{oct2point,point2oct}(). | ||
| 210 | */ | ||
| 211 | int ec_point_from_octets(const EC_GROUP *group, const unsigned char *buf, | ||
| 212 | size_t buf_len, EC_POINT **out_point, uint8_t *out_form, BN_CTX *ctx_in); | ||
| 213 | int ec_point_to_octets(const EC_GROUP *group, const EC_POINT *point, int form, | ||
| 214 | unsigned char **out_buf, size_t *len, BN_CTX *ctx_in); | ||
| 224 | 215 | ||
| 225 | /* EC_METHOD definitions */ | 216 | /* Public API in OpenSSL */ |
| 217 | const BIGNUM *EC_GROUP_get0_cofactor(const EC_GROUP *group); | ||
| 218 | const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group); | ||
| 226 | 219 | ||
| 227 | struct ec_key_method_st { | 220 | struct ec_key_method_st { |
| 228 | const char *name; | 221 | const char *name; |
| @@ -252,6 +245,25 @@ struct ec_key_method_st { | |||
| 252 | 245 | ||
| 253 | #define EC_KEY_METHOD_DYNAMIC 1 | 246 | #define EC_KEY_METHOD_DYNAMIC 1 |
| 254 | 247 | ||
| 248 | struct ec_key_st { | ||
| 249 | const EC_KEY_METHOD *meth; | ||
| 250 | |||
| 251 | int version; | ||
| 252 | |||
| 253 | EC_GROUP *group; | ||
| 254 | |||
| 255 | EC_POINT *pub_key; | ||
| 256 | BIGNUM *priv_key; | ||
| 257 | |||
| 258 | unsigned int enc_flag; | ||
| 259 | point_conversion_form_t conv_form; | ||
| 260 | |||
| 261 | int references; | ||
| 262 | int flags; | ||
| 263 | |||
| 264 | CRYPTO_EX_DATA ex_data; | ||
| 265 | } /* EC_KEY */; | ||
| 266 | |||
| 255 | int eckey_compute_pubkey(EC_KEY *eckey); | 267 | int eckey_compute_pubkey(EC_KEY *eckey); |
| 256 | int ec_key_gen(EC_KEY *eckey); | 268 | int ec_key_gen(EC_KEY *eckey); |
| 257 | int ecdh_compute_key(unsigned char **out, size_t *out_len, | 269 | int ecdh_compute_key(unsigned char **out, size_t *out_len, |
| @@ -267,19 +279,4 @@ int ecdsa_verify_sig(const unsigned char *dgst, int dgst_len, | |||
| 267 | int ecdh_KDF_X9_63(unsigned char *out, size_t outlen, const unsigned char *Z, | 279 | int ecdh_KDF_X9_63(unsigned char *out, size_t outlen, const unsigned char *Z, |
| 268 | size_t Zlen, const unsigned char *sinfo, size_t sinfolen, const EVP_MD *md); | 280 | size_t Zlen, const unsigned char *sinfo, size_t sinfolen, const EVP_MD *md); |
| 269 | 281 | ||
| 270 | int ec_group_is_builtin_curve(const EC_GROUP *group, int *out_nid); | ||
| 271 | int ec_group_get_field_type(const EC_GROUP *group); | ||
| 272 | |||
| 273 | /* | ||
| 274 | * Wrappers around the unergonomic EC_POINT_{oct2point,point2oct}(). | ||
| 275 | */ | ||
| 276 | int ec_point_from_octets(const EC_GROUP *group, const unsigned char *buf, | ||
| 277 | size_t buf_len, EC_POINT **out_point, uint8_t *out_form, BN_CTX *ctx_in); | ||
| 278 | int ec_point_to_octets(const EC_GROUP *group, const EC_POINT *point, int form, | ||
| 279 | unsigned char **out_buf, size_t *len, BN_CTX *ctx_in); | ||
| 280 | |||
| 281 | /* Public API in OpenSSL */ | ||
| 282 | const BIGNUM *EC_GROUP_get0_cofactor(const EC_GROUP *group); | ||
| 283 | const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group); | ||
| 284 | |||
| 285 | __END_HIDDEN_DECLS | 282 | __END_HIDDEN_DECLS |
