diff options
Diffstat (limited to 'crypto/ec')
-rw-r--r-- | crypto/ec/curve25519.c | 6 | ||||
-rw-r--r-- | crypto/ec/curve448/curve448_local.h | 4 | ||||
-rw-r--r-- | crypto/ec/curve448/ed448.h | 12 | ||||
-rw-r--r-- | crypto/ec/curve448/eddsa.c | 26 | ||||
-rw-r--r-- | crypto/ec/ec_ameth.c | 8 | ||||
-rw-r--r-- | crypto/ec/ec_backend.c | 3 | ||||
-rw-r--r-- | crypto/ec/ec_curve.c | 4 | ||||
-rw-r--r-- | crypto/ec/ec_key.c | 6 | ||||
-rw-r--r-- | crypto/ec/ec_kmeth.c | 2 | ||||
-rw-r--r-- | crypto/ec/ec_lib.c | 8 | ||||
-rw-r--r-- | crypto/ec/ec_local.h | 8 | ||||
-rw-r--r-- | crypto/ec/ecdh_kdf.c | 2 | ||||
-rw-r--r-- | crypto/ec/ecx_key.c | 2 | ||||
-rw-r--r-- | crypto/ec/ecx_meth.c | 6 |
14 files changed, 49 insertions, 48 deletions
diff --git a/crypto/ec/curve25519.c b/crypto/ec/curve25519.c index b945c35f29..d939003043 100644 --- a/crypto/ec/curve25519.c +++ b/crypto/ec/curve25519.c @@ -5439,7 +5439,7 @@ static void sc_muladd(uint8_t *s, const uint8_t *a, const uint8_t *b, int ED25519_sign(uint8_t *out_sig, const uint8_t *message, size_t message_len, const uint8_t public_key[32], const uint8_t private_key[32], - OPENSSL_CTX *libctx, const char *propq) + OSSL_LIB_CTX *libctx, const char *propq) { uint8_t az[SHA512_DIGEST_LENGTH]; uint8_t nonce[SHA512_DIGEST_LENGTH]; @@ -5495,7 +5495,7 @@ static const char allzeroes[15]; int ED25519_verify(const uint8_t *message, size_t message_len, const uint8_t signature[64], const uint8_t public_key[32], - OPENSSL_CTX *libctx, const char *propq) + OSSL_LIB_CTX *libctx, const char *propq) { int i; ge_p3 A; @@ -5577,7 +5577,7 @@ err: return res; } -int ED25519_public_from_private(OPENSSL_CTX *ctx, uint8_t out_public_key[32], +int ED25519_public_from_private(OSSL_LIB_CTX *ctx, uint8_t out_public_key[32], const uint8_t private_key[32], const char *propq) { uint8_t az[SHA512_DIGEST_LENGTH]; diff --git a/crypto/ec/curve448/curve448_local.h b/crypto/ec/curve448/curve448_local.h index 62a61fd979..c5ffa75f6b 100644 --- a/crypto/ec/curve448/curve448_local.h +++ b/crypto/ec/curve448/curve448_local.h @@ -10,11 +10,11 @@ # define OSSL_CRYPTO_EC_CURVE448_LOCAL_H # include "curve448utils.h" -int ED448ph_sign(OPENSSL_CTX *ctx, uint8_t *out_sig, const uint8_t hash[64], +int ED448ph_sign(OSSL_LIB_CTX *ctx, uint8_t *out_sig, const uint8_t hash[64], const uint8_t public_key[57], const uint8_t private_key[57], const uint8_t *context, size_t context_len, const char *propq); -int ED448ph_verify(OPENSSL_CTX *ctx, const uint8_t hash[64], +int ED448ph_verify(OSSL_LIB_CTX *ctx, const uint8_t hash[64], const uint8_t signature[114], const uint8_t public_key[57], const uint8_t *context, size_t context_len, const char *propq); diff --git a/crypto/ec/curve448/ed448.h b/crypto/ec/curve448/ed448.h index 16248b28cc..af9bbb39ac 100644 --- a/crypto/ec/curve448/ed448.h +++ b/crypto/ec/curve448/ed448.h @@ -38,7 +38,7 @@ * privkey (in): The private key. */ c448_error_t c448_ed448_derive_public_key( - OPENSSL_CTX *ctx, + OSSL_LIB_CTX *ctx, uint8_t pubkey [EDDSA_448_PUBLIC_BYTES], const uint8_t privkey [EDDSA_448_PRIVATE_BYTES], const char *propq); @@ -61,7 +61,7 @@ c448_error_t c448_ed448_derive_public_key( * disambiguation. For Ed448 it is safe. */ c448_error_t c448_ed448_sign( - OPENSSL_CTX *ctx, + OSSL_LIB_CTX *ctx, uint8_t signature[EDDSA_448_SIGNATURE_BYTES], const uint8_t privkey[EDDSA_448_PRIVATE_BYTES], const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES], @@ -87,7 +87,7 @@ c448_error_t c448_ed448_sign( * disambiguation. For Ed448 it is safe. */ c448_error_t c448_ed448_sign_prehash( - OPENSSL_CTX *ctx, + OSSL_LIB_CTX *ctx, uint8_t signature[EDDSA_448_SIGNATURE_BYTES], const uint8_t privkey[EDDSA_448_PRIVATE_BYTES], const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES], @@ -114,7 +114,7 @@ c448_error_t c448_ed448_sign_prehash( * non-prehashed messages, at least without some very careful protocol-level * disambiguation. For Ed448 it is safe. */ -c448_error_t c448_ed448_verify(OPENSSL_CTX *ctx, +c448_error_t c448_ed448_verify(OSSL_LIB_CTX *ctx, const uint8_t signature[EDDSA_448_SIGNATURE_BYTES], const uint8_t @@ -142,7 +142,7 @@ c448_error_t c448_ed448_verify(OPENSSL_CTX *ctx, * disambiguation. For Ed448 it is safe. */ c448_error_t c448_ed448_verify_prehash( - OPENSSL_CTX *ctx, + OSSL_LIB_CTX *ctx, const uint8_t signature[EDDSA_448_SIGNATURE_BYTES], const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES], const uint8_t hash[64], @@ -199,7 +199,7 @@ c448_error_t curve448_point_decode_like_eddsa_and_mul_by_ratio( * ed (in): The EdDSA private key */ c448_error_t c448_ed448_convert_private_key_to_x448( - OPENSSL_CTX *ctx, + OSSL_LIB_CTX *ctx, uint8_t x[X448_PRIVATE_BYTES], const uint8_t ed[EDDSA_448_PRIVATE_BYTES], const char *propq); diff --git a/crypto/ec/curve448/eddsa.c b/crypto/ec/curve448/eddsa.c index 51a14642dc..d4c7f1562a 100644 --- a/crypto/ec/curve448/eddsa.c +++ b/crypto/ec/curve448/eddsa.c @@ -20,7 +20,7 @@ #define COFACTOR 4 -static c448_error_t oneshot_hash(OPENSSL_CTX *ctx, uint8_t *out, size_t outlen, +static c448_error_t oneshot_hash(OSSL_LIB_CTX *ctx, uint8_t *out, size_t outlen, const uint8_t *in, size_t inlen, const char *propq) { @@ -54,7 +54,7 @@ static void clamp(uint8_t secret_scalar_ser[EDDSA_448_PRIVATE_BYTES]) secret_scalar_ser[EDDSA_448_PRIVATE_BYTES - 2] |= 0x80; } -static c448_error_t hash_init_with_dom(OPENSSL_CTX *ctx, EVP_MD_CTX *hashctx, +static c448_error_t hash_init_with_dom(OSSL_LIB_CTX *ctx, EVP_MD_CTX *hashctx, uint8_t prehashed, uint8_t for_prehash, const uint8_t *context, @@ -95,7 +95,7 @@ static c448_error_t hash_init_with_dom(OPENSSL_CTX *ctx, EVP_MD_CTX *hashctx, /* In this file because it uses the hash */ c448_error_t c448_ed448_convert_private_key_to_x448( - OPENSSL_CTX *ctx, + OSSL_LIB_CTX *ctx, uint8_t x[X448_PRIVATE_BYTES], const uint8_t ed [EDDSA_448_PRIVATE_BYTES], const char *propq) @@ -107,7 +107,7 @@ c448_error_t c448_ed448_convert_private_key_to_x448( } c448_error_t c448_ed448_derive_public_key( - OPENSSL_CTX *ctx, + OSSL_LIB_CTX *ctx, uint8_t pubkey[EDDSA_448_PUBLIC_BYTES], const uint8_t privkey[EDDSA_448_PRIVATE_BYTES], const char *propq) @@ -153,7 +153,7 @@ c448_error_t c448_ed448_derive_public_key( } c448_error_t c448_ed448_sign( - OPENSSL_CTX *ctx, + OSSL_LIB_CTX *ctx, uint8_t signature[EDDSA_448_SIGNATURE_BYTES], const uint8_t privkey[EDDSA_448_PRIVATE_BYTES], const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES], @@ -261,7 +261,7 @@ c448_error_t c448_ed448_sign( } c448_error_t c448_ed448_sign_prehash( - OPENSSL_CTX *ctx, + OSSL_LIB_CTX *ctx, uint8_t signature[EDDSA_448_SIGNATURE_BYTES], const uint8_t privkey[EDDSA_448_PRIVATE_BYTES], const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES], @@ -273,7 +273,7 @@ c448_error_t c448_ed448_sign_prehash( } c448_error_t c448_ed448_verify( - OPENSSL_CTX *ctx, + OSSL_LIB_CTX *ctx, const uint8_t signature[EDDSA_448_SIGNATURE_BYTES], const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES], const uint8_t *message, size_t message_len, @@ -356,7 +356,7 @@ c448_error_t c448_ed448_verify( } c448_error_t c448_ed448_verify_prehash( - OPENSSL_CTX *ctx, + OSSL_LIB_CTX *ctx, const uint8_t signature[EDDSA_448_SIGNATURE_BYTES], const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES], const uint8_t hash[64], const uint8_t *context, @@ -366,7 +366,7 @@ c448_error_t c448_ed448_verify_prehash( context_len, propq); } -int ED448_sign(OPENSSL_CTX *ctx, uint8_t *out_sig, const uint8_t *message, +int ED448_sign(OSSL_LIB_CTX *ctx, uint8_t *out_sig, const uint8_t *message, size_t message_len, const uint8_t public_key[57], const uint8_t private_key[57], const uint8_t *context, size_t context_len, const char *propq) @@ -376,7 +376,7 @@ int ED448_sign(OPENSSL_CTX *ctx, uint8_t *out_sig, const uint8_t *message, == C448_SUCCESS; } -int ED448_verify(OPENSSL_CTX *ctx, const uint8_t *message, size_t message_len, +int ED448_verify(OSSL_LIB_CTX *ctx, const uint8_t *message, size_t message_len, const uint8_t signature[114], const uint8_t public_key[57], const uint8_t *context, size_t context_len, const char *propq) { @@ -385,7 +385,7 @@ int ED448_verify(OPENSSL_CTX *ctx, const uint8_t *message, size_t message_len, propq) == C448_SUCCESS; } -int ED448ph_sign(OPENSSL_CTX *ctx, uint8_t *out_sig, const uint8_t hash[64], +int ED448ph_sign(OSSL_LIB_CTX *ctx, uint8_t *out_sig, const uint8_t hash[64], const uint8_t public_key[57], const uint8_t private_key[57], const uint8_t *context, size_t context_len, const char *propq) { @@ -394,7 +394,7 @@ int ED448ph_sign(OPENSSL_CTX *ctx, uint8_t *out_sig, const uint8_t hash[64], } -int ED448ph_verify(OPENSSL_CTX *ctx, const uint8_t hash[64], +int ED448ph_verify(OSSL_LIB_CTX *ctx, const uint8_t hash[64], const uint8_t signature[114], const uint8_t public_key[57], const uint8_t *context, size_t context_len, const char *propq) { @@ -402,7 +402,7 @@ int ED448ph_verify(OPENSSL_CTX *ctx, const uint8_t hash[64], (uint8_t)context_len, propq) == C448_SUCCESS; } -int ED448_public_from_private(OPENSSL_CTX *ctx, uint8_t out_public_key[57], +int ED448_public_from_private(OSSL_LIB_CTX *ctx, uint8_t out_public_key[57], const uint8_t private_key[57], const char *propq) { return c448_ed448_derive_public_key(ctx, out_public_key, private_key, propq) diff --git a/crypto/ec/ec_ameth.c b/crypto/ec/ec_ameth.c index caeb7f70cc..8857d3e388 100644 --- a/crypto/ec/ec_ameth.c +++ b/crypto/ec/ec_ameth.c @@ -101,7 +101,7 @@ static int eckey_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey) } static EC_KEY *eckey_type2param(int ptype, const void *pval, - OPENSSL_CTX *libctx, const char *propq) + OSSL_LIB_CTX *libctx, const char *propq) { EC_KEY *eckey = NULL; EC_GROUP *group = NULL; @@ -155,7 +155,7 @@ static int eckey_pub_decode(EVP_PKEY *pkey, const X509_PUBKEY *pubkey) int ptype, pklen; EC_KEY *eckey = NULL; X509_ALGOR *palg; - OPENSSL_CTX *libctx = NULL; + OSSL_LIB_CTX *libctx = NULL; const char *propq = NULL; if (!X509_PUBKEY_get0_libctx(&libctx, &propq, pubkey) @@ -200,7 +200,7 @@ static int eckey_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b) } static int eckey_priv_decode_ex(EVP_PKEY *pkey, const PKCS8_PRIV_KEY_INFO *p8, - OPENSSL_CTX *libctx, const char *propq) + OSSL_LIB_CTX *libctx, const char *propq) { const unsigned char *p = NULL; const void *pval; @@ -562,7 +562,7 @@ size_t ec_pkey_dirty_cnt(const EVP_PKEY *pkey) static int ec_pkey_export_to(const EVP_PKEY *from, void *to_keydata, - EVP_KEYMGMT *to_keymgmt, OPENSSL_CTX *libctx, + EVP_KEYMGMT *to_keymgmt, OSSL_LIB_CTX *libctx, const char *propq) { const EC_KEY *eckey = NULL; diff --git a/crypto/ec/ec_backend.c b/crypto/ec/ec_backend.c index 8acbcebd6f..f4a6d976aa 100644 --- a/crypto/ec/ec_backend.c +++ b/crypto/ec/ec_backend.c @@ -50,7 +50,8 @@ static char *ec_param_encoding_id2name(int id) } int ec_group_todata(const EC_GROUP *group, OSSL_PARAM_BLD *tmpl, - OSSL_PARAM params[], OPENSSL_CTX *libctx, const char *propq, + OSSL_PARAM params[], OSSL_LIB_CTX *libctx, + const char *propq, BN_CTX *bnctx, unsigned char **genbuf) { int ret = 0, curve_nid, encoding_flag; diff --git a/crypto/ec/ec_curve.c b/crypto/ec/ec_curve.c index d8f46f4849..687860ea92 100644 --- a/crypto/ec/ec_curve.c +++ b/crypto/ec/ec_curve.c @@ -3180,7 +3180,7 @@ int ec_curve_name2nid(const char *name) return NID_undef; } -static EC_GROUP *ec_group_new_from_data(OPENSSL_CTX *libctx, +static EC_GROUP *ec_group_new_from_data(OSSL_LIB_CTX *libctx, const char *propq, const ec_list_element curve) { @@ -3290,7 +3290,7 @@ static EC_GROUP *ec_group_new_from_data(OPENSSL_CTX *libctx, return group; } -EC_GROUP *EC_GROUP_new_by_curve_name_ex(OPENSSL_CTX *libctx, const char *propq, +EC_GROUP *EC_GROUP_new_by_curve_name_ex(OSSL_LIB_CTX *libctx, const char *propq, int nid) { EC_GROUP *ret = NULL; diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c index 807b5e670a..63001203ae 100644 --- a/crypto/ec/ec_key.c +++ b/crypto/ec/ec_key.c @@ -34,12 +34,12 @@ EC_KEY *EC_KEY_new(void) } #endif -EC_KEY *EC_KEY_new_ex(OPENSSL_CTX *ctx, const char *propq) +EC_KEY *EC_KEY_new_ex(OSSL_LIB_CTX *ctx, const char *propq) { return ec_key_new_method_int(ctx, propq, NULL); } -EC_KEY *EC_KEY_new_by_curve_name_ex(OPENSSL_CTX *ctx, const char *propq, +EC_KEY *EC_KEY_new_by_curve_name_ex(OSSL_LIB_CTX *ctx, const char *propq, int nid) { EC_KEY *ret = EC_KEY_new_ex(ctx, propq); @@ -651,7 +651,7 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, } -OPENSSL_CTX *ec_key_get_libctx(const EC_KEY *key) +OSSL_LIB_CTX *ec_key_get_libctx(const EC_KEY *key) { return key->libctx; } diff --git a/crypto/ec/ec_kmeth.c b/crypto/ec/ec_kmeth.c index 3fec8a4d81..d01b96f654 100644 --- a/crypto/ec/ec_kmeth.c +++ b/crypto/ec/ec_kmeth.c @@ -76,7 +76,7 @@ int EC_KEY_set_method(EC_KEY *key, const EC_KEY_METHOD *meth) return 1; } -EC_KEY *ec_key_new_method_int(OPENSSL_CTX *libctx, const char *propq, +EC_KEY *ec_key_new_method_int(OSSL_LIB_CTX *libctx, const char *propq, ENGINE *engine) { EC_KEY *ret = OPENSSL_zalloc(sizeof(*ret)); diff --git a/crypto/ec/ec_lib.c b/crypto/ec/ec_lib.c index 72ada1f723..d1d403e175 100644 --- a/crypto/ec/ec_lib.c +++ b/crypto/ec/ec_lib.c @@ -26,7 +26,7 @@ /* functions for EC_GROUP objects */ -EC_GROUP *ec_group_new_ex(OPENSSL_CTX *libctx, const char *propq, +EC_GROUP *ec_group_new_ex(OSSL_LIB_CTX *libctx, const char *propq, const EC_METHOD *meth) { EC_GROUP *ret; @@ -1403,7 +1403,7 @@ int EC_GROUP_get_pentanomial_basis(const EC_GROUP *group, unsigned int *k1, * mathematically wrong anyway and should not be used. */ static EC_GROUP *ec_group_explicit_to_named(const EC_GROUP *group, - OPENSSL_CTX *libctx, + OSSL_LIB_CTX *libctx, const char *propq, BN_CTX *ctx) { @@ -1499,7 +1499,7 @@ static int ec_encoding_param2id(const OSSL_PARAM *p, int *id) } static EC_GROUP *group_new_from_name(const OSSL_PARAM *p, - OPENSSL_CTX *libctx, const char *propq) + OSSL_LIB_CTX *libctx, const char *propq) { int ok = 0, nid; const char *curve_name = NULL; @@ -1528,7 +1528,7 @@ static EC_GROUP *group_new_from_name(const OSSL_PARAM *p, } EC_GROUP *EC_GROUP_new_from_params(const OSSL_PARAM params[], - OPENSSL_CTX *libctx, const char *propq) + OSSL_LIB_CTX *libctx, const char *propq) { const OSSL_PARAM *ptmp, *pa, *pb; int ok = 0; diff --git a/crypto/ec/ec_local.h b/crypto/ec/ec_local.h index 33f40167aa..004cfbd8d4 100644 --- a/crypto/ec/ec_local.h +++ b/crypto/ec/ec_local.h @@ -275,7 +275,7 @@ struct ec_group_st { EC_PRE_COMP *ec; } pre_comp; - OPENSSL_CTX *libctx; + OSSL_LIB_CTX *libctx; char *propq; }; @@ -299,7 +299,7 @@ struct ec_key_st { CRYPTO_EX_DATA ex_data; #endif CRYPTO_RWLOCK *lock; - OPENSSL_CTX *libctx; + OSSL_LIB_CTX *libctx; char *propq; /* Provider data */ @@ -601,7 +601,7 @@ int ec_group_simple_order_bits(const EC_GROUP *group); * \param meth EC_METHOD to use * \return newly created EC_GROUP object or NULL in case of an error. */ -EC_GROUP *ec_group_new_ex(OPENSSL_CTX *libctx, const char *propq, +EC_GROUP *ec_group_new_ex(OSSL_LIB_CTX *libctx, const char *propq, const EC_METHOD *meth); #ifdef ECP_NISTZ256_ASM @@ -657,7 +657,7 @@ struct ec_key_method_st { #define EC_KEY_METHOD_DYNAMIC 1 -EC_KEY *ec_key_new_method_int(OPENSSL_CTX *libctx, const char *propq, +EC_KEY *ec_key_new_method_int(OSSL_LIB_CTX *libctx, const char *propq, ENGINE *engine); int ossl_ec_key_gen(EC_KEY *eckey); diff --git a/crypto/ec/ecdh_kdf.c b/crypto/ec/ecdh_kdf.c index 7695e0be18..df0858a032 100644 --- a/crypto/ec/ecdh_kdf.c +++ b/crypto/ec/ecdh_kdf.c @@ -25,7 +25,7 @@ int ecdh_KDF_X9_63(unsigned char *out, size_t outlen, const unsigned char *Z, size_t Zlen, const unsigned char *sinfo, size_t sinfolen, const EVP_MD *md, - OPENSSL_CTX *libctx, const char *propq) + OSSL_LIB_CTX *libctx, const char *propq) { int ret = 0; EVP_KDF_CTX *kctx = NULL; diff --git a/crypto/ec/ecx_key.c b/crypto/ec/ecx_key.c index dd4b872ab0..1d2891928e 100644 --- a/crypto/ec/ecx_key.c +++ b/crypto/ec/ecx_key.c @@ -10,7 +10,7 @@ #include <openssl/err.h> #include "crypto/ecx.h" -ECX_KEY *ecx_key_new(OPENSSL_CTX *libctx, ECX_KEY_TYPE type, int haspubkey, +ECX_KEY *ecx_key_new(OSSL_LIB_CTX *libctx, ECX_KEY_TYPE type, int haspubkey, const char *propq) { ECX_KEY *ret = OPENSSL_zalloc(sizeof(*ret)); diff --git a/crypto/ec/ecx_meth.c b/crypto/ec/ecx_meth.c index 9aab96a050..5405164783 100644 --- a/crypto/ec/ecx_meth.c +++ b/crypto/ec/ecx_meth.c @@ -36,7 +36,7 @@ typedef enum { /* Setup EVP_PKEY using public, private or generation */ static int ecx_key_op(EVP_PKEY *pkey, int id, const X509_ALGOR *palg, const unsigned char *p, int plen, ecx_key_op_t op, - OPENSSL_CTX *libctx, const char *propq) + OSSL_LIB_CTX *libctx, const char *propq) { ECX_KEY *key = NULL; unsigned char *privkey, *pubkey; @@ -150,7 +150,7 @@ static int ecx_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b) } static int ecx_priv_decode_ex(EVP_PKEY *pkey, const PKCS8_PRIV_KEY_INFO *p8, - OPENSSL_CTX *libctx, const char *propq) + OSSL_LIB_CTX *libctx, const char *propq) { const unsigned char *p; int plen; @@ -396,7 +396,7 @@ static size_t ecx_pkey_dirty_cnt(const EVP_PKEY *pkey) } static int ecx_pkey_export_to(const EVP_PKEY *from, void *to_keydata, - EVP_KEYMGMT *to_keymgmt, OPENSSL_CTX *libctx, + EVP_KEYMGMT *to_keymgmt, OSSL_LIB_CTX *libctx, const char *propq) { const ECX_KEY *key = from->pkey.ecx; |