summaryrefslogtreecommitdiffstats
path: root/crypto/ec/curve448
diff options
context:
space:
mode:
authorDr. Matthias St. Pierre <matthias.st.pierre@ncp-e.com>2020-10-15 12:55:50 +0300
committerMatt Caswell <matt@openssl.org>2020-10-15 11:59:53 +0100
commitb425001010044adbdbcd98f8682694b30b73bbf4 (patch)
treee87a5b512d7869cb6a500ecc74b706281be762cf /crypto/ec/curve448
parent29000e43ea257bf54f6ccb2064b3744853b821b2 (diff)
Rename OPENSSL_CTX prefix to OSSL_LIB_CTX
Many of the new types introduced by OpenSSL 3.0 have an OSSL_ prefix, e.g., OSSL_CALLBACK, OSSL_PARAM, OSSL_ALGORITHM, OSSL_SERIALIZER. The OPENSSL_CTX type stands out a little by using a different prefix. For consistency reasons, this type is renamed to OSSL_LIB_CTX. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12621)
Diffstat (limited to 'crypto/ec/curve448')
-rw-r--r--crypto/ec/curve448/curve448_local.h4
-rw-r--r--crypto/ec/curve448/ed448.h12
-rw-r--r--crypto/ec/curve448/eddsa.c26
3 files changed, 21 insertions, 21 deletions
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)