prov: prefix provider internal functions with ossl_
authorPauli <paul.dale@oracle.com>
Mon, 28 Sep 2020 02:47:04 +0000 (12:47 +1000)
committerPauli <paul.dale@oracle.com>
Tue, 29 Sep 2020 06:33:16 +0000 (16:33 +1000)
Also convert the names to lower case.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13014)

87 files changed:
providers/baseprov.c
providers/common/bio_prov.c
providers/common/include/prov/provider_ctx.h
providers/common/provider_ctx.c
providers/defltprov.c
providers/fips/fipsprov.c
providers/fips/self_test_kats.c
providers/implementations/ciphers/cipher_aes.h
providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c
providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.h
providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_hw.c
providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_hw.c
providers/implementations/ciphers/cipher_aes_ccm.c
providers/implementations/ciphers/cipher_aes_ccm.h
providers/implementations/ciphers/cipher_aes_ccm_hw.c
providers/implementations/ciphers/cipher_aes_ccm_hw_aesni.inc
providers/implementations/ciphers/cipher_aes_ccm_hw_s390x.inc
providers/implementations/ciphers/cipher_aes_ccm_hw_t4.inc
providers/implementations/ciphers/cipher_aes_gcm.c
providers/implementations/ciphers/cipher_aes_gcm.h
providers/implementations/ciphers/cipher_aes_gcm_hw.c
providers/implementations/ciphers/cipher_aes_gcm_hw_aesni.inc
providers/implementations/ciphers/cipher_aes_gcm_hw_armv8.inc
providers/implementations/ciphers/cipher_aes_gcm_hw_s390x.inc
providers/implementations/ciphers/cipher_aes_gcm_hw_t4.inc
providers/implementations/ciphers/cipher_aes_hw.c
providers/implementations/ciphers/cipher_aes_ocb.c
providers/implementations/ciphers/cipher_aes_ocb.h
providers/implementations/ciphers/cipher_aes_ocb_hw.c
providers/implementations/ciphers/cipher_aes_siv.c
providers/implementations/ciphers/cipher_aes_siv.h
providers/implementations/ciphers/cipher_aes_siv_hw.c
providers/implementations/ciphers/cipher_aes_xts.c
providers/implementations/ciphers/cipher_aes_xts.h
providers/implementations/ciphers/cipher_aes_xts_hw.c
providers/implementations/ciphers/cipher_aria.h
providers/implementations/ciphers/cipher_aria_ccm.c
providers/implementations/ciphers/cipher_aria_ccm.h
providers/implementations/ciphers/cipher_aria_ccm_hw.c
providers/implementations/ciphers/cipher_aria_gcm.c
providers/implementations/ciphers/cipher_aria_gcm.h
providers/implementations/ciphers/cipher_aria_gcm_hw.c
providers/implementations/ciphers/cipher_aria_hw.c
providers/implementations/ciphers/cipher_blowfish.h
providers/implementations/ciphers/cipher_blowfish_hw.c
providers/implementations/ciphers/cipher_camellia.h
providers/implementations/ciphers/cipher_camellia_hw.c
providers/implementations/ciphers/cipher_cast.h
providers/implementations/ciphers/cipher_cast5_hw.c
providers/implementations/ciphers/cipher_chacha20.c
providers/implementations/ciphers/cipher_chacha20.h
providers/implementations/ciphers/cipher_chacha20_hw.c
providers/implementations/ciphers/cipher_chacha20_poly1305.c
providers/implementations/ciphers/cipher_chacha20_poly1305.h
providers/implementations/ciphers/cipher_chacha20_poly1305_hw.c
providers/implementations/ciphers/cipher_desx_hw.c
providers/implementations/ciphers/cipher_idea.h
providers/implementations/ciphers/cipher_idea_hw.c
providers/implementations/ciphers/cipher_rc2.c
providers/implementations/ciphers/cipher_rc2.h
providers/implementations/ciphers/cipher_rc2_hw.c
providers/implementations/ciphers/cipher_rc4.c
providers/implementations/ciphers/cipher_rc4.h
providers/implementations/ciphers/cipher_rc4_hmac_md5.c
providers/implementations/ciphers/cipher_rc4_hmac_md5.h
providers/implementations/ciphers/cipher_rc4_hmac_md5_hw.c
providers/implementations/ciphers/cipher_rc4_hw.c
providers/implementations/ciphers/cipher_rc5.c
providers/implementations/ciphers/cipher_rc5.h
providers/implementations/ciphers/cipher_rc5_hw.c
providers/implementations/ciphers/cipher_seed.h
providers/implementations/ciphers/cipher_seed_hw.c
providers/implementations/ciphers/cipher_sm4.h
providers/implementations/ciphers/cipher_sm4_hw.c
providers/implementations/ciphers/cipher_tdes.h
providers/implementations/ciphers/cipher_tdes_default.h
providers/implementations/ciphers/cipher_tdes_wrap.c
providers/implementations/encode_decode/encode_key2any.c
providers/implementations/include/prov/ciphercommon.h
providers/implementations/rands/drbg.c
providers/implementations/rands/drbg_ctr.c
providers/implementations/rands/drbg_hash.c
providers/implementations/rands/drbg_hmac.c
providers/implementations/rands/drbg_local.h
providers/implementations/rands/test_rng.c
providers/implementations/storemgmt/file_store.c
providers/legacyprov.c

index aeb81e2..41dc656 100644 (file)
@@ -116,8 +116,8 @@ static const OSSL_ALGORITHM *base_query(void *provctx, int operation_id,
 
 static void base_teardown(void *provctx)
 {
-    BIO_meth_free(PROV_CTX_get0_core_bio_method(provctx));
-    PROV_CTX_free(provctx);
+    BIO_meth_free(ossl_prov_ctx_get0_core_bio_method(provctx));
+    ossl_prov_ctx_free(provctx);
 }
 
 /* Functions we provide to the core */
@@ -169,15 +169,16 @@ int ossl_base_provider_init(const OSSL_CORE_HANDLE *handle,
      * This only works for built-in providers.  Most providers should
      * create their own library context.
      */
-    if ((*provctx = PROV_CTX_new()) == NULL
+    if ((*provctx = ossl_prov_ctx_new()) == NULL
             || (corebiometh = bio_prov_init_bio_method()) == NULL) {
-        PROV_CTX_free(*provctx);
+        ossl_prov_ctx_free(*provctx);
         *provctx = NULL;
         return 0;
     }
-    PROV_CTX_set0_library_context(*provctx, (OPENSSL_CTX *)c_get_libctx(handle));
-    PROV_CTX_set0_handle(*provctx, handle);
-    PROV_CTX_set0_core_bio_method(*provctx, corebiometh);
+    ossl_prov_ctx_set0_library_context(*provctx,
+                                       (OPENSSL_CTX *)c_get_libctx(handle));
+    ossl_prov_ctx_set0_handle(*provctx, handle);
+    ossl_prov_ctx_set0_core_bio_method(*provctx, corebiometh);
 
     *out = base_dispatch_table;
 
index c049795..afdeb80 100644 (file)
@@ -213,7 +213,7 @@ BIO_METHOD *bio_prov_init_bio_method(void)
 BIO *bio_new_from_core_bio(PROV_CTX *provctx, OSSL_CORE_BIO *corebio)
 {
     BIO *outbio;
-    BIO_METHOD *corebiometh = PROV_CTX_get0_core_bio_method(provctx);
+    BIO_METHOD *corebiometh = ossl_prov_ctx_get0_core_bio_method(provctx);
 
     if (corebiometh == NULL)
         return NULL;
index a252143..c650777 100644 (file)
@@ -26,15 +26,15 @@ typedef struct prov_ctx_st {
  * fetching functions.
  */
 # define PROV_LIBRARY_CONTEXT_OF(provctx)        \
-    PROV_CTX_get0_library_context((provctx))
+    ossl_prov_ctx_get0_library_context((provctx))
 
-PROV_CTX *PROV_CTX_new(void);
-void PROV_CTX_free(PROV_CTX *ctx);
-void PROV_CTX_set0_library_context(PROV_CTX *ctx, OPENSSL_CTX *libctx);
-void PROV_CTX_set0_handle(PROV_CTX *ctx, const OSSL_CORE_HANDLE *handle);
-void PROV_CTX_set0_core_bio_method(PROV_CTX *ctx, BIO_METHOD *corebiometh);
-OPENSSL_CTX *PROV_CTX_get0_library_context(PROV_CTX *ctx);
-const OSSL_CORE_HANDLE *PROV_CTX_get0_handle(PROV_CTX *ctx);
-BIO_METHOD *PROV_CTX_get0_core_bio_method(PROV_CTX *ctx);
+PROV_CTX *ossl_prov_ctx_new(void);
+void ossl_prov_ctx_free(PROV_CTX *ctx);
+void ossl_prov_ctx_set0_library_context(PROV_CTX *ctx, OPENSSL_CTX *libctx);
+void ossl_prov_ctx_set0_handle(PROV_CTX *ctx, const OSSL_CORE_HANDLE *handle);
+void ossl_prov_ctx_set0_core_bio_method(PROV_CTX *ctx, BIO_METHOD *corebiometh);
+OPENSSL_CTX *ossl_prov_ctx_get0_library_context(PROV_CTX *ctx);
+const OSSL_CORE_HANDLE *ossl_prov_ctx_get0_handle(PROV_CTX *ctx);
+BIO_METHOD *ossl_prov_ctx_get0_core_bio_method(PROV_CTX *ctx);
 
 #endif
index 04cca1f..6d81c20 100644 (file)
 #include "prov/provider_ctx.h"
 #include "prov/bio.h"
 
-PROV_CTX *PROV_CTX_new(void)
+PROV_CTX *ossl_prov_ctx_new(void)
 {
     return OPENSSL_zalloc(sizeof(PROV_CTX));
 }
 
-void PROV_CTX_free(PROV_CTX *ctx)
+void ossl_prov_ctx_free(PROV_CTX *ctx)
 {
     OPENSSL_free(ctx);
 }
 
-void PROV_CTX_set0_library_context(PROV_CTX *ctx, OPENSSL_CTX *libctx)
+void ossl_prov_ctx_set0_library_context(PROV_CTX *ctx, OPENSSL_CTX *libctx)
 {
     if (ctx != NULL)
         ctx->libctx = libctx;
 }
 
-void PROV_CTX_set0_handle(PROV_CTX *ctx, const OSSL_CORE_HANDLE *handle)
+void ossl_prov_ctx_set0_handle(PROV_CTX *ctx, const OSSL_CORE_HANDLE *handle)
 {
     if (ctx != NULL)
         ctx->handle = handle;
 }
 
-void PROV_CTX_set0_core_bio_method(PROV_CTX *ctx, BIO_METHOD *corebiometh)
+void ossl_prov_ctx_set0_core_bio_method(PROV_CTX *ctx, BIO_METHOD *corebiometh)
 {
     if (ctx != NULL)
         ctx->corebiometh = corebiometh;
 }
 
-OPENSSL_CTX *PROV_CTX_get0_library_context(PROV_CTX *ctx)
+OPENSSL_CTX *ossl_prov_ctx_get0_library_context(PROV_CTX *ctx)
 {
     if (ctx == NULL)
         return NULL;
     return ctx->libctx;
 }
 
-const OSSL_CORE_HANDLE *PROV_CTX_get0_handle(PROV_CTX *ctx)
+const OSSL_CORE_HANDLE *ossl_prov_ctx_get0_handle(PROV_CTX *ctx)
 {
     if (ctx == NULL)
         return NULL;
     return ctx->handle;
 }
 
-BIO_METHOD *PROV_CTX_get0_core_bio_method(PROV_CTX *ctx)
+BIO_METHOD *ossl_prov_ctx_get0_core_bio_method(PROV_CTX *ctx)
 {
     if (ctx == NULL)
         return NULL;
index 542e120..06ce516 100644 (file)
@@ -502,8 +502,8 @@ static const OSSL_ALGORITHM *deflt_query(void *provctx, int operation_id,
 
 static void deflt_teardown(void *provctx)
 {
-    BIO_meth_free(PROV_CTX_get0_core_bio_method(provctx));
-    PROV_CTX_free(provctx);
+    BIO_meth_free(ossl_prov_ctx_get0_core_bio_method(provctx));
+    ossl_prov_ctx_free(provctx);
 }
 
 /* Functions we provide to the core */
@@ -556,15 +556,16 @@ int ossl_default_provider_init(const OSSL_CORE_HANDLE *handle,
      * This only works for built-in providers.  Most providers should
      * create their own library context.
      */
-    if ((*provctx = PROV_CTX_new()) == NULL
+    if ((*provctx = ossl_prov_ctx_new()) == NULL
             || (corebiometh = bio_prov_init_bio_method()) == NULL) {
-        PROV_CTX_free(*provctx);
+        ossl_prov_ctx_free(*provctx);
         *provctx = NULL;
         return 0;
     }
-    PROV_CTX_set0_library_context(*provctx, (OPENSSL_CTX *)c_get_libctx(handle));
-    PROV_CTX_set0_handle(*provctx, handle);
-    PROV_CTX_set0_core_bio_method(*provctx, corebiometh);
+    ossl_prov_ctx_set0_library_context(*provctx,
+                                       (OPENSSL_CTX *)c_get_libctx(handle));
+    ossl_prov_ctx_set0_handle(*provctx, handle);
+    ossl_prov_ctx_set0_core_bio_method(*provctx, corebiometh);
 
     *out = deflt_dispatch_table;
 
index 3425133..1cbe5ed 100644 (file)
@@ -519,7 +519,8 @@ static const OSSL_ALGORITHM *fips_query(void *provctx, int operation_id,
     case OSSL_OP_DIGEST:
         return fips_digests;
     case OSSL_OP_CIPHER:
-        ossl_prov_cache_exported_algorithms(fips_ciphers, exported_fips_ciphers);
+        ossl_prov_cache_exported_algorithms(fips_ciphers,
+                                            exported_fips_ciphers);
         return exported_fips_ciphers;
     case OSSL_OP_MAC:
         return fips_macs;
@@ -544,7 +545,7 @@ static const OSSL_ALGORITHM *fips_query(void *provctx, int operation_id,
 static void fips_teardown(void *provctx)
 {
     OPENSSL_CTX_free(PROV_LIBRARY_CONTEXT_OF(provctx));
-    PROV_CTX_free(provctx);
+    ossl_prov_ctx_free(provctx);
 }
 
 static void fips_intern_teardown(void *provctx)
@@ -553,7 +554,7 @@ static void fips_intern_teardown(void *provctx)
      * We know that the library context is the same as for the outer provider,
      * so no need to destroy it here.
      */
-    PROV_CTX_free(provctx);
+    ossl_prov_ctx_free(provctx);
 }
 
 /* Functions we provide to the core */
@@ -690,7 +691,7 @@ int OSSL_provider_init(const OSSL_CORE_HANDLE *handle,
         fips_security_checks = 0;
 
     /*  Create a context. */
-    if ((*provctx = PROV_CTX_new()) == NULL
+    if ((*provctx = ossl_prov_ctx_new()) == NULL
         || (libctx = OPENSSL_CTX_new()) == NULL) {
         /*
          * We free libctx separately here and only here because it hasn't
@@ -700,8 +701,8 @@ int OSSL_provider_init(const OSSL_CORE_HANDLE *handle,
         OPENSSL_CTX_free(libctx);
         goto err;
     }
-    PROV_CTX_set0_library_context(*provctx, libctx);
-    PROV_CTX_set0_handle(*provctx, handle);
+    ossl_prov_ctx_set0_library_context(*provctx, libctx);
+    ossl_prov_ctx_set0_handle(*provctx, handle);
 
     if ((fgbl = openssl_ctx_get_data(libctx, OPENSSL_CTX_FIPS_PROV_INDEX,
                                      &fips_prov_ossl_ctx_method)) == NULL)
@@ -754,7 +755,7 @@ int fips_intern_provider_init(const OSSL_CORE_HANDLE *handle,
     if (c_internal_get_libctx == NULL)
         return 0;
 
-    if ((*provctx = PROV_CTX_new()) == NULL)
+    if ((*provctx = ossl_prov_ctx_new()) == NULL)
         return 0;
 
     /*
@@ -762,9 +763,10 @@ int fips_intern_provider_init(const OSSL_CORE_HANDLE *handle,
      * internal provider. This is not something that most providers would be
      * able to do.
      */
-    PROV_CTX_set0_library_context(*provctx,
-                                  (OPENSSL_CTX *)c_internal_get_libctx(handle));
-    PROV_CTX_set0_handle(*provctx, handle);
+    ossl_prov_ctx_set0_library_context(
+        *provctx, (OPENSSL_CTX *)c_internal_get_libctx(handle)
+    );
+    ossl_prov_ctx_set0_handle(*provctx, handle);
 
     *out = intern_dispatch_table;
     return 1;
index 50a0a69..5e76a1c 100644 (file)
@@ -315,7 +315,10 @@ static int self_test_drbg(const ST_KAT_DRBG *t, OSSL_SELF_TEST *st,
     if (!EVP_RAND_set_ctx_params(test, drbg_params))
         goto err;
 
-    /* This calls PROV_DRBG_reseed() internally when prediction_resistance = 1 */
+    /*
+     * This calls ossl_prov_drbg_reseed() internally when
+     * prediction_resistance = 1
+     */
     if (!EVP_RAND_generate(drbg, out, t->expectedlen, strength,
                            prediction_resistance,
                            t->entropyaddin2, t->entropyaddin2len))
@@ -329,7 +332,8 @@ static int self_test_drbg(const ST_KAT_DRBG *t, OSSL_SELF_TEST *st,
     if (!EVP_RAND_uninstantiate(drbg))
         goto err;
     /*
-     * Check that the DRBG data has been zeroized after PROV_DRBG_uninstantiate.
+     * Check that the DRBG data has been zeroized after
+     * ossl_prov_drbg_uninstantiate.
      */
     if (!EVP_RAND_verify_zeroization(drbg))
         goto err;
index f2ee746..2fa9658 100644 (file)
@@ -51,12 +51,12 @@ typedef struct prov_aes_ctx_st {
 
 } PROV_AES_CTX;
 
-#define PROV_CIPHER_HW_aes_ofb PROV_CIPHER_HW_aes_ofb128
-#define PROV_CIPHER_HW_aes_cfb PROV_CIPHER_HW_aes_cfb128
-const PROV_CIPHER_HW *PROV_CIPHER_HW_aes_ecb(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_aes_cbc(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_aes_ofb128(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_aes_cfb128(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_aes_cfb1(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_aes_cfb8(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_aes_ctr(size_t keybits);
+#define ossl_prov_cipher_hw_aes_ofb ossl_prov_cipher_hw_aes_ofb128
+#define ossl_prov_cipher_hw_aes_cfb ossl_prov_cipher_hw_aes_cfb128
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_ecb(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cbc(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_ofb128(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cfb128(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cfb1(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_cfb8(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_ctr(size_t keybits);
index 1d499d9..16916fd 100644 (file)
@@ -308,7 +308,7 @@ static void *aes_cbc_hmac_sha1_newctx(void *provctx, size_t kbits,
     ctx = OPENSSL_zalloc(sizeof(*ctx));
     if (ctx != NULL)
         base_init(provctx, &ctx->base_ctx,
-                  PROV_CIPHER_HW_aes_cbc_hmac_sha1(), kbits, blkbits,
+                  ossl_prov_cipher_hw_aes_cbc_hmac_sha1(), kbits, blkbits,
                   ivbits, flags);
     return ctx;
 }
@@ -335,7 +335,7 @@ static void *aes_cbc_hmac_sha256_newctx(void *provctx, size_t kbits,
     ctx = OPENSSL_zalloc(sizeof(*ctx));
     if (ctx != NULL)
         base_init(provctx, &ctx->base_ctx,
-                  PROV_CIPHER_HW_aes_cbc_hmac_sha256(), kbits, blkbits,
+                  ossl_prov_cipher_hw_aes_cbc_hmac_sha256(), kbits, blkbits,
                   ivbits, flags);
     return ctx;
 }
index 73d39bb..75c450c 100644 (file)
@@ -26,8 +26,8 @@ typedef struct prov_cipher_hw_aes_hmac_sha_ctx_st {
 # endif /* OPENSSL_NO_MULTIBLOCK) */
 } PROV_CIPHER_HW_AES_HMAC_SHA;
 
-const PROV_CIPHER_HW_AES_HMAC_SHA *PROV_CIPHER_HW_aes_cbc_hmac_sha1(void);
-const PROV_CIPHER_HW_AES_HMAC_SHA *PROV_CIPHER_HW_aes_cbc_hmac_sha256(void);
+const PROV_CIPHER_HW_AES_HMAC_SHA *ossl_prov_cipher_hw_aes_cbc_hmac_sha1(void);
+const PROV_CIPHER_HW_AES_HMAC_SHA *ossl_prov_cipher_hw_aes_cbc_hmac_sha256(void);
 
 #ifdef AES_CBC_HMAC_SHA_CAPABLE
 # include <openssl/aes.h>
index 12644e7..b3aebbe 100644 (file)
@@ -22,7 +22,7 @@ int cipher_capable_aes_cbc_hmac_sha1(void)
     return 0;
 }
 
-const PROV_CIPHER_HW_AES_HMAC_SHA *PROV_CIPHER_HW_aes_cbc_hmac_sha1(void)
+const PROV_CIPHER_HW_AES_HMAC_SHA *ossl_prov_cipher_hw_aes_cbc_hmac_sha1(void)
 {
     return NULL;
 }
@@ -788,7 +788,7 @@ static const PROV_CIPHER_HW_AES_HMAC_SHA cipher_hw_aes_hmac_sha1 = {
 # endif
 };
 
-const PROV_CIPHER_HW_AES_HMAC_SHA *PROV_CIPHER_HW_aes_cbc_hmac_sha1(void)
+const PROV_CIPHER_HW_AES_HMAC_SHA *ossl_prov_cipher_hw_aes_cbc_hmac_sha1(void)
 {
     return &cipher_hw_aes_hmac_sha1;
 }
index 35106e0..8e738bc 100644 (file)
@@ -22,7 +22,7 @@ int cipher_capable_aes_cbc_hmac_sha256(void)
     return 0;
 }
 
-const PROV_CIPHER_HW_AES_HMAC_SHA *PROV_CIPHER_HW_aes_cbc_hmac_sha256(void)
+const PROV_CIPHER_HW_AES_HMAC_SHA *ossl_prov_cipher_hw_aes_cbc_hmac_sha256(void)
 {
     return NULL;
 }
@@ -837,7 +837,7 @@ static const PROV_CIPHER_HW_AES_HMAC_SHA cipher_hw_aes_hmac_sha256 = {
 # endif
 };
 
-const PROV_CIPHER_HW_AES_HMAC_SHA *PROV_CIPHER_HW_aes_cbc_hmac_sha256(void)
+const PROV_CIPHER_HW_AES_HMAC_SHA *ossl_prov_cipher_hw_aes_cbc_hmac_sha256(void)
 {
     return &cipher_hw_aes_hmac_sha256;
 }
index 52bdd78..5913b2c 100644 (file)
@@ -29,7 +29,7 @@ static void *aes_ccm_newctx(void *provctx, size_t keybits)
 
     ctx = OPENSSL_zalloc(sizeof(*ctx));
     if (ctx != NULL)
-        ccm_initctx(&ctx->base, keybits, PROV_AES_HW_ccm(keybits));
+        ccm_initctx(&ctx->base, keybits, ossl_prov_aes_hw_ccm(keybits));
     return ctx;
 }
 
index ee0257c..2c3ebd0 100644 (file)
@@ -45,4 +45,4 @@ typedef struct prov_aes_ccm_ctx_st {
     } ccm;
 } PROV_AES_CCM_CTX;
 
-const PROV_CCM_HW *PROV_AES_HW_ccm(size_t keylen);
+const PROV_CCM_HW *ossl_prov_aes_hw_ccm(size_t keylen);
index db2e3f2..db50187 100644 (file)
@@ -62,7 +62,7 @@ static const PROV_CCM_HW aes_ccm = {
 #elif defined(SPARC_AES_CAPABLE)
 # include "cipher_aes_ccm_hw_t4.inc"
 #else
-const PROV_CCM_HW *PROV_AES_HW_ccm(size_t keybits)
+const PROV_CCM_HW *ossl_prov_aes_hw_ccm(size_t keybits)
 {
     return &aes_ccm;
 }
index 7e83565..12b2bfe 100644 (file)
@@ -32,7 +32,7 @@ static const PROV_CCM_HW aesni_ccm = {
     ccm_generic_gettag
 };
 
-const PROV_CCM_HW *PROV_AES_HW_ccm(size_t keybits)
+const PROV_CCM_HW *ossl_prov_aes_hw_ccm(size_t keybits)
 {
     return AESNI_CAPABLE ? &aesni_ccm : &aes_ccm;
 }
index cec7c96..9a9f128 100644 (file)
@@ -258,7 +258,7 @@ static const PROV_CCM_HW s390x_aes_ccm = {
     s390x_aes_ccm_gettag
 };
 
-const PROV_CCM_HW *PROV_AES_HW_ccm(size_t keybits)
+const PROV_CCM_HW *ossl_prov_aes_hw_ccm(size_t keybits)
 {
     if ((keybits == 128 && S390X_aes_128_ccm_CAPABLE)
          || (keybits == 192 && S390X_aes_192_ccm_CAPABLE)
index c4b6d15..f81f422 100644 (file)
@@ -30,7 +30,7 @@ static const PROV_CCM_HW t4_aes_ccm = {
     ccm_generic_gettag
 };
 
-const PROV_CCM_HW *PROV_AES_HW_ccm(size_t keybits)
+const PROV_CCM_HW *ossl_prov_aes_hw_ccm(size_t keybits)
 {
     return SPARC_AES_CAPABLE ? &t4_aes_ccm : &aes_ccm;
 }
index b5c7e84..6e97b1f 100644 (file)
@@ -32,7 +32,7 @@ static void *aes_gcm_newctx(void *provctx, size_t keybits)
 
     ctx = OPENSSL_zalloc(sizeof(*ctx));
     if (ctx != NULL)
-        gcm_initctx(provctx, &ctx->base, keybits, PROV_AES_HW_gcm(keybits),
+        gcm_initctx(provctx, &ctx->base, keybits, ossl_prov_aes_hw_gcm(keybits),
                     AES_GCM_IV_MIN_SIZE);
     return ctx;
 }
index d700640..2fe5e54 100644 (file)
@@ -41,4 +41,4 @@ typedef struct prov_aes_gcm_ctx_st {
     } plat;
 } PROV_AES_GCM_CTX;
 
-const PROV_GCM_HW *PROV_AES_HW_gcm(size_t keybits);
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits);
index c662887..f29a280 100644 (file)
@@ -142,7 +142,7 @@ static const PROV_GCM_HW aes_gcm = {
 #elif defined(AES_PMULL_CAPABLE) && defined(AES_GCM_ASM)
 # include "cipher_aes_gcm_hw_armv8.inc"
 #else
-const PROV_GCM_HW *PROV_AES_HW_gcm(size_t keybits)
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits)
 {
     return &aes_gcm;
 }
index 9e2504a..c25bd61 100644 (file)
@@ -31,7 +31,7 @@ static const PROV_GCM_HW aesni_gcm = {
     gcm_one_shot
 };
 
-const PROV_GCM_HW *PROV_AES_HW_gcm(size_t keybits)
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits)
 {
     return AESNI_CAPABLE ? &aesni_gcm : &aes_gcm;
 }
index f44ada0..5c84bf3 100644 (file)
@@ -77,7 +77,7 @@ static const PROV_GCM_HW armv8_aes_gcm = {
     gcm_one_shot
 };
 
-const PROV_GCM_HW *PROV_AES_HW_gcm(size_t keybits)
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits)
 {
     return AES_PMULL_CAPABLE ? &armv8_aes_gcm : &aes_gcm;
 }
index e13771a..256b9cb 100644 (file)
@@ -290,7 +290,7 @@ static const PROV_GCM_HW s390x_aes_gcm = {
     s390x_aes_gcm_one_shot
 };
 
-const PROV_GCM_HW *PROV_AES_HW_gcm(size_t keybits)
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits)
 {
     if ((keybits == 128 && S390X_aes_128_gcm_CAPABLE)
          || (keybits == 192 && S390X_aes_192_gcm_CAPABLE)
index 0a47712..1ad3ea4 100644 (file)
@@ -46,7 +46,7 @@ static const PROV_GCM_HW t4_aes_gcm = {
     gcm_cipher_final,
     gcm_one_shot
 };
-const PROV_GCM_HW *PROV_AES_HW_gcm(size_t keybits)
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits)
 {
     return SPARC_AES_CAPABLE ? &t4_aes_gcm : &aes_gcm;
 }
index e0bd4db..5080931 100644 (file)
@@ -130,7 +130,7 @@ static const PROV_CIPHER_HW aes_##mode = {                                     \
     cipher_hw_aes_copyctx                                                      \
 };                                                                             \
 PROV_CIPHER_HW_declare(mode)                                                   \
-const PROV_CIPHER_HW *PROV_CIPHER_HW_aes_##mode(size_t keybits)                \
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_##mode(size_t keybits)           \
 {                                                                              \
     PROV_CIPHER_HW_select(mode)                                                \
     return &aes_##mode;                                                        \
index 3728711..c96718b 100644 (file)
@@ -308,7 +308,7 @@ static void *aes_ocb_newctx(void *provctx, size_t kbits, size_t blkbits,
     ctx = OPENSSL_zalloc(sizeof(*ctx));
     if (ctx != NULL) {
         cipher_generic_initkey(ctx, kbits, blkbits, ivbits, mode, flags,
-                               PROV_CIPHER_HW_aes_ocb(kbits), NULL);
+                               ossl_prov_cipher_hw_aes_ocb(kbits), NULL);
         ctx->taglen = OCB_DEFAULT_TAG_LEN;
     }
     return ctx;
index 94d8183..674f4bb 100644 (file)
@@ -36,4 +36,4 @@ typedef struct prov_aes_ocb_ctx_st {
     unsigned char aad_buf[OCB_MAX_AAD_LEN];   /* Store partial AAD blocks */
 } PROV_AES_OCB_CTX;
 
-const PROV_CIPHER_HW *PROV_CIPHER_HW_aes_ocb(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_ocb(size_t keybits);
index 5caca0b..7aa97dc 100644 (file)
@@ -113,7 +113,7 @@ static const PROV_CIPHER_HW aes_generic_ocb = {
     NULL
 };
 PROV_CIPHER_HW_declare()
-const PROV_CIPHER_HW *PROV_CIPHER_HW_aes_ocb(size_t keybits)
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_ocb(size_t keybits)
 {
     PROV_CIPHER_HW_select()
     return &aes_generic_ocb;
index cac71ee..e427c6b 100644 (file)
@@ -39,7 +39,7 @@ static void *aes_siv_newctx(void *provctx, size_t keybits, unsigned int mode,
         ctx->mode = mode;
         ctx->flags = flags;
         ctx->keylen = keybits / 8;
-        ctx->hw = PROV_CIPHER_HW_aes_siv(keybits);
+        ctx->hw = ossl_prov_cipher_hw_aes_siv(keybits);
         ctx->libctx = PROV_LIBRARY_CONTEXT_OF(provctx);
     }
     return ctx;
index 3179943..b407b40 100644 (file)
@@ -34,4 +34,4 @@ typedef struct prov_siv_ctx_st {
     OPENSSL_CTX *libctx;
 } PROV_AES_SIV_CTX;
 
-const PROV_CIPHER_HW_AES_SIV *PROV_CIPHER_HW_aes_siv(size_t keybits);
+const PROV_CIPHER_HW_AES_SIV *ossl_prov_cipher_hw_aes_siv(size_t keybits);
index 547eb1a..ddd88e0 100644 (file)
@@ -130,7 +130,7 @@ static const PROV_CIPHER_HW_AES_SIV aes_siv_hw =
     aes_siv_dupctx,
 };
 
-const PROV_CIPHER_HW_AES_SIV *PROV_CIPHER_HW_aes_siv(size_t keybits)
+const PROV_CIPHER_HW_AES_SIV *ossl_prov_cipher_hw_aes_siv(size_t keybits)
 {
     return &aes_siv_hw;
 }
index e28008b..ca40bbd 100644 (file)
@@ -116,7 +116,7 @@ static void *aes_xts_newctx(void *provctx, unsigned int mode, uint64_t flags,
 
     if (ctx != NULL) {
         cipher_generic_initkey(&ctx->base, kbits, blkbits, ivbits, mode, flags,
-                               PROV_CIPHER_HW_aes_xts(kbits), NULL);
+                               ossl_prov_cipher_hw_aes_xts(kbits), NULL);
     }
     return ctx;
 }
index 23ae696..3e2bbeb 100644 (file)
@@ -32,4 +32,4 @@ typedef struct prov_aes_xts_ctx_st {
     OSSL_xts_stream_fn stream;
 } PROV_AES_XTS_CTX;
 
-const PROV_CIPHER_HW *PROV_CIPHER_HW_aes_xts(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts(size_t keybits);
index 028d160..15c136b 100644 (file)
@@ -169,7 +169,7 @@ static const PROV_CIPHER_HW aes_generic_xts = {
     cipher_hw_aes_xts_copyctx
 };
 PROV_CIPHER_HW_declare_xts()
-const PROV_CIPHER_HW *PROV_CIPHER_HW_aes_xts(size_t keybits)
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts(size_t keybits)
 {
     PROV_CIPHER_HW_select_xts()
     return &aes_generic_xts;
index 282408c..7a59860 100644 (file)
@@ -19,12 +19,12 @@ typedef struct prov_aria_ctx_st {
 } PROV_ARIA_CTX;
 
 
-# define PROV_CIPHER_HW_aria_ofb PROV_CIPHER_HW_aria_ofb128
-# define PROV_CIPHER_HW_aria_cfb PROV_CIPHER_HW_aria_cfb128
-const PROV_CIPHER_HW *PROV_CIPHER_HW_aria_ecb(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_aria_cbc(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_aria_ofb128(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_aria_cfb128(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_aria_cfb1(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_aria_cfb8(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_aria_ctr(size_t keybits);
+#define ossl_prov_cipher_hw_aria_ofb ossl_prov_cipher_hw_aria_ofb128
+#define ossl_prov_cipher_hw_aria_cfb ossl_prov_cipher_hw_aria_cfb128
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aria_ecb(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aria_cbc(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aria_ofb128(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aria_cfb128(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aria_cfb1(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aria_cfb8(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aria_ctr(size_t keybits);
index 7f89b22..a19ad65 100644 (file)
@@ -24,7 +24,7 @@ static void *aria_ccm_newctx(void *provctx, size_t keybits)
 
     ctx = OPENSSL_zalloc(sizeof(*ctx));
     if (ctx != NULL)
-        ccm_initctx(&ctx->base, keybits, PROV_ARIA_HW_ccm(keybits));
+        ccm_initctx(&ctx->base, keybits, ossl_prov_aria_hw_ccm(keybits));
     return ctx;
 }
 
index a85cf89..c1865ce 100644 (file)
@@ -19,4 +19,4 @@ typedef struct prov_aria_ccm_ctx_st {
     } ks;                       /* ARIA key schedule to use */
 } PROV_ARIA_CCM_CTX;
 
-const PROV_CCM_HW *PROV_ARIA_HW_ccm(size_t keylen);
+const PROV_CCM_HW *ossl_prov_aria_hw_ccm(size_t keylen);
index db3a9c8..bfdb75b 100644 (file)
@@ -34,7 +34,7 @@ static const PROV_CCM_HW ccm_aria = {
     ccm_generic_auth_decrypt,
     ccm_generic_gettag
 };
-const PROV_CCM_HW *PROV_ARIA_HW_ccm(size_t keybits)
+const PROV_CCM_HW *ossl_prov_aria_hw_ccm(size_t keybits)
 {
     return &ccm_aria;
 }
index 4e934fe..ad667ae 100644 (file)
@@ -24,8 +24,8 @@ static void *aria_gcm_newctx(void *provctx, size_t keybits)
 
     ctx = OPENSSL_zalloc(sizeof(*ctx));
     if (ctx != NULL)
-        gcm_initctx(provctx, &ctx->base, keybits, PROV_ARIA_HW_gcm(keybits),
-                    ARIA_GCM_IV_MIN_SIZE);
+        gcm_initctx(provctx, &ctx->base, keybits,
+                    ossl_prov_aria_hw_gcm(keybits), ARIA_GCM_IV_MIN_SIZE);
     return ctx;
 }
 
index 2d08a59..973586b 100644 (file)
@@ -19,4 +19,4 @@ typedef struct prov_aria_gcm_ctx_st {
     } ks;
 } PROV_ARIA_GCM_CTX;
 
-const PROV_GCM_HW *PROV_ARIA_HW_gcm(size_t keybits);
+const PROV_GCM_HW *ossl_prov_aria_hw_gcm(size_t keybits);
index 1d8e470..54c635e 100644 (file)
@@ -31,7 +31,7 @@ static const PROV_GCM_HW aria_gcm = {
     gcm_cipher_final,
     gcm_one_shot
 };
-const PROV_GCM_HW *PROV_ARIA_HW_gcm(size_t keybits)
+const PROV_GCM_HW *ossl_prov_aria_hw_gcm(size_t keybits)
 {
     return &aria_gcm;
 }
index b0c5675..6486474 100644 (file)
@@ -37,7 +37,7 @@ static const PROV_CIPHER_HW aria_##mode = {                                    \
     cipher_hw_chunked_##mode,                                                  \
     cipher_hw_aria_copyctx                                                     \
 };                                                                             \
-const PROV_CIPHER_HW *PROV_CIPHER_HW_aria_##mode(size_t keybits)               \
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aria_##mode(size_t keybits)          \
 {                                                                              \
     return &aria_##mode;                                                       \
 }
index 2d66d1b..3fa86ee 100644 (file)
@@ -18,7 +18,7 @@ typedef struct prov_blowfish_ctx_st {
     } ks;
 } PROV_BLOWFISH_CTX;
 
-const PROV_CIPHER_HW *PROV_CIPHER_HW_blowfish_cbc(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_blowfish_ecb(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_blowfish_ofb64(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_blowfish_cfb64(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_blowfish_cbc(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_blowfish_ecb(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_blowfish_ofb64(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_blowfish_cfb64(size_t keybits);
index 3ff43e4..4855a71 100644 (file)
@@ -31,7 +31,7 @@ static const PROV_CIPHER_HW bf_##mode = {                                      \
     cipher_hw_blowfish_initkey,                                                \
     cipher_hw_blowfish_##mode##_cipher                                         \
 };                                                                             \
-const PROV_CIPHER_HW *PROV_CIPHER_HW_blowfish_##mode(size_t keybits)           \
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_blowfish_##mode(size_t keybits)      \
 {                                                                              \
     return &bf_##mode;                                                         \
 }
index 07f67db..2dd658f 100644 (file)
@@ -19,12 +19,12 @@ typedef struct prov_camellia_ctx_st {
     } ks;
 } PROV_CAMELLIA_CTX;
 
-#define PROV_CIPHER_HW_camellia_ofb PROV_CIPHER_HW_camellia_ofb128
-#define PROV_CIPHER_HW_camellia_cfb PROV_CIPHER_HW_camellia_cfb128
-const PROV_CIPHER_HW *PROV_CIPHER_HW_camellia_ecb(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_camellia_cbc(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_camellia_ofb128(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_camellia_cfb128(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_camellia_cfb1(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_camellia_cfb8(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_camellia_ctr(size_t keybits);
+#define ossl_prov_cipher_hw_camellia_ofb ossl_prov_cipher_hw_camellia_ofb128
+#define ossl_prov_cipher_hw_camellia_cfb ossl_prov_cipher_hw_camellia_cfb128
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_camellia_ecb(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_camellia_cbc(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_camellia_ofb128(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_camellia_cfb128(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_camellia_cfb1(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_camellia_cfb8(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_camellia_ctr(size_t keybits);
index 3a8fa28..af4db44 100644 (file)
@@ -58,7 +58,7 @@ static const PROV_CIPHER_HW camellia_##mode = {                                \
     cipher_hw_camellia_copyctx                                                 \
 };                                                                             \
 PROV_CIPHER_HW_declare(mode)                                                   \
-const PROV_CIPHER_HW *PROV_CIPHER_HW_camellia_##mode(size_t keybits)           \
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_camellia_##mode(size_t keybits)      \
 {                                                                              \
     PROV_CIPHER_HW_select(mode)                                                \
     return &camellia_##mode;                                                   \
index 218f5c4..fdba630 100644 (file)
@@ -18,7 +18,7 @@ typedef struct prov_cast_ctx_st {
     } ks;
 } PROV_CAST_CTX;
 
-const PROV_CIPHER_HW *PROV_CIPHER_HW_cast5_cbc(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_cast5_ecb(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_cast5_ofb64(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_cast5_cfb64(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_cast5_cbc(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_cast5_ecb(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_cast5_ofb64(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_cast5_cfb64(size_t keybits);
index 2257b40..73f0628 100644 (file)
@@ -31,7 +31,7 @@ static const PROV_CIPHER_HW cast5_##mode = {                                   \
     cipher_hw_cast5_initkey,                                                   \
     cipher_hw_cast5_##mode##_cipher                                            \
 };                                                                             \
-const PROV_CIPHER_HW *PROV_CIPHER_HW_cast5_##mode(size_t keybits)              \
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_cast5_##mode(size_t keybits)         \
 {                                                                              \
     return &cast5_##mode;                                                      \
 }
index 1f44601..89493c3 100644 (file)
@@ -38,7 +38,7 @@ void chacha20_initctx(PROV_CHACHA20_CTX *ctx)
                            CHACHA20_BLKLEN * 8,
                            CHACHA20_IVLEN * 8,
                            0, CHACHA20_FLAGS,
-                           PROV_CIPHER_HW_chacha20(CHACHA20_KEYLEN * 8),
+                           ossl_prov_cipher_hw_chacha20(CHACHA20_KEYLEN * 8),
                            NULL);
 }
 
index 808570f..c494de7 100644 (file)
@@ -27,7 +27,7 @@ typedef struct prov_cipher_hw_chacha20_st {
 
 } PROV_CIPHER_HW_CHACHA20;
 
-const PROV_CIPHER_HW *PROV_CIPHER_HW_chacha20(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_chacha20(size_t keybits);
 
 OSSL_FUNC_cipher_encrypt_init_fn chacha20_einit;
 OSSL_FUNC_cipher_decrypt_init_fn chacha20_dinit;
index dce0a6c..c298c6f 100644 (file)
@@ -114,7 +114,7 @@ static const PROV_CIPHER_HW_CHACHA20 chacha20_hw = {
     chacha20_initiv
 };
 
-const PROV_CIPHER_HW *PROV_CIPHER_HW_chacha20(size_t keybits)
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_chacha20(size_t keybits)
 {
     return (PROV_CIPHER_HW *)&chacha20_hw;
 }
index e2aa691..474d43b 100644 (file)
@@ -56,9 +56,9 @@ static void *chacha20_poly1305_newctx(void *provctx)
                                CHACHA20_POLY1305_IVLEN * 8,
                                CHACHA20_POLY1305_MODE,
                                CHACHA20_POLY1305_FLAGS,
-                               PROV_CIPHER_HW_chacha20_poly1305(
+                               ossl_prov_cipher_hw_chacha20_poly1305(
                                    CHACHA20_POLY1305_KEYLEN * 8),
-                               NULL);
+                                   NULL);
         ctx->nonce_len = CHACHA20_POLY1305_IVLEN;
         ctx->tls_payload_length = NO_TLS_PAYLOAD_LENGTH;
         chacha20_initctx(&ctx->chacha);
index 00b173d..c7c3e88 100644 (file)
@@ -40,4 +40,4 @@ typedef struct prov_cipher_hw_chacha_aead_st {
                             size_t flen);
 } PROV_CIPHER_HW_CHACHA20_POLY1305;
 
-const PROV_CIPHER_HW *PROV_CIPHER_HW_chacha20_poly1305(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_chacha20_poly1305(size_t keybits);
index d9f314c..8bbae65 100644 (file)
@@ -399,7 +399,7 @@ static const PROV_CIPHER_HW_CHACHA20_POLY1305 chacha20poly1305_hw =
     chacha_poly1305_tls_iv_set_fixed
 };
 
-const PROV_CIPHER_HW *PROV_CIPHER_HW_chacha20_poly1305(size_t keybits)
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_chacha20_poly1305(size_t keybits)
 {
     return (PROV_CIPHER_HW *)&chacha20poly1305_hw;
 }
index dac6c39..7dc4c50 100644 (file)
@@ -73,7 +73,8 @@ static const PROV_CIPHER_HW desx_cbc =
     cipher_hw_desx_cbc,
     cipher_hw_desx_copyctx
 };
-const PROV_CIPHER_HW *PROV_CIPHER_HW_tdes_desx_cbc(void)
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_desx_cbc(void)
 {
     return &desx_cbc;
 }
index ebe590b..cb3541a 100644 (file)
@@ -18,7 +18,7 @@ typedef struct prov_idea_ctx_st {
     } ks;
 } PROV_IDEA_CTX;
 
-const PROV_CIPHER_HW *PROV_CIPHER_HW_idea_cbc(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_idea_ecb(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_idea_ofb64(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_idea_cfb64(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_idea_cbc(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_idea_ecb(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_idea_ofb64(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_idea_cfb64(size_t keybits);
index 009ef35..1c451b7 100644 (file)
@@ -43,7 +43,7 @@ static const PROV_CIPHER_HW idea_##mode = {                                    \
     cipher_hw_idea_initkey,                                                    \
     cipher_hw_idea_##mode##_cipher                                             \
 };                                                                             \
-const PROV_CIPHER_HW *PROV_CIPHER_HW_idea_##mode(size_t keybits)               \
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_idea_##mode(size_t keybits)          \
 {                                                                              \
     return &idea_##mode;                                                       \
 }
index 022f4c6..2a303ce 100644 (file)
@@ -210,7 +210,8 @@ static void * alg##_##kbits##_##lcmode##_newctx(void *provctx)                 \
      if (ctx != NULL) {                                                        \
          cipher_generic_initkey(ctx, kbits, blkbits, ivbits,                   \
                                 EVP_CIPH_##UCMODE##_MODE, flags,               \
-                                PROV_CIPHER_HW_##alg##_##lcmode(kbits), NULL); \
+                                ossl_prov_cipher_hw_##alg##_##lcmode(kbits),   \
+                                NULL);                                         \
          ctx->key_bits = kbits;                                                \
      }                                                                         \
      return ctx;                                                               \
index 82f0f6c..fca1e95 100644 (file)
@@ -19,10 +19,10 @@ typedef struct prov_rc2_ctx_st {
     size_t key_bits;
 } PROV_RC2_CTX;
 
-#define PROV_CIPHER_HW_rc2_ofb128 PROV_CIPHER_HW_rc2_ofb64
-#define PROV_CIPHER_HW_rc2_cfb128 PROV_CIPHER_HW_rc2_cfb64
+#define ossl_prov_cipher_hw_rc2_ofb128 ossl_prov_cipher_hw_rc2_ofb64
+#define ossl_prov_cipher_hw_rc2_cfb128 ossl_prov_cipher_hw_rc2_cfb64
 
-const PROV_CIPHER_HW *PROV_CIPHER_HW_rc2_cbc(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_rc2_ecb(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_rc2_ofb64(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_rc2_cfb64(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc2_cbc(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc2_ecb(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc2_ofb64(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc2_cfb64(size_t keybits);
index 2583172..da9ff72 100644 (file)
@@ -32,7 +32,7 @@ static const PROV_CIPHER_HW rc2_##mode = {                                     \
     cipher_hw_rc2_initkey,                                                     \
     cipher_hw_rc2_##mode##_cipher                                              \
 };                                                                             \
-const PROV_CIPHER_HW *PROV_CIPHER_HW_rc2_##mode(size_t keybits)                \
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc2_##mode(size_t keybits)           \
 {                                                                              \
     return &rc2_##mode;                                                        \
 }
index f9086fb..d92d036 100644 (file)
@@ -67,7 +67,7 @@ static void * alg##_##kbits##_newctx(void *provctx)                            \
      ctx = OPENSSL_zalloc(sizeof(*ctx));                                       \
      if (ctx != NULL) {                                                        \
          cipher_generic_initkey(ctx, kbits, blkbits, ivbits, 0, flags,         \
-                                PROV_CIPHER_HW_##alg(kbits), NULL);            \
+                                ossl_prov_cipher_hw_##alg(kbits), NULL);       \
      }                                                                         \
      return ctx;                                                               \
 }                                                                              \
index a2d0a50..ec038bd 100644 (file)
@@ -18,4 +18,4 @@ typedef struct prov_rc4_ctx_st {
     } ks;
 } PROV_RC4_CTX;
 
-const PROV_CIPHER_HW *PROV_CIPHER_HW_rc4(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc4(size_t keybits);
index 60d0eea..964597b 100644 (file)
@@ -58,7 +58,7 @@ static void *rc4_hmac_md5_newctx(void *provctx)
                                RC4_HMAC_MD5_BLOCK_BITS,
                                RC4_HMAC_MD5_IV_BITS,
                                RC4_HMAC_MD5_MODE, RC4_HMAC_MD5_FLAGS,
-                               PROV_CIPHER_HW_rc4_hmac_md5(RC4_HMAC_MD5_KEY_BITS),
+                               ossl_prov_cipher_hw_rc4_hmac_md5(RC4_HMAC_MD5_KEY_BITS),
                                NULL);
      return ctx;
 }
index ff7ed7e..042f5f1 100644 (file)
@@ -30,4 +30,4 @@ typedef struct prov_cipher_hw_rc4_hmac_md5_st {
 
 } PROV_CIPHER_HW_RC4_HMAC_MD5;
 
-const PROV_CIPHER_HW *PROV_CIPHER_HW_rc4_hmac_md5(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc4_hmac_md5(size_t keybits);
index 54b8f08..73233a2 100644 (file)
@@ -225,7 +225,8 @@ static const PROV_CIPHER_HW_RC4_HMAC_MD5 rc4_hmac_md5_hw = {
     cipher_hw_rc4_hmac_md5_tls_init,
     cipher_hw_rc4_hmac_md5_init_mackey
 };
-const PROV_CIPHER_HW *PROV_CIPHER_HW_rc4_hmac_md5(size_t keybits)
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc4_hmac_md5(size_t keybits)
 {
     return (PROV_CIPHER_HW *)&rc4_hmac_md5_hw;
 }
index 8d88aca..09192b5 100644 (file)
@@ -37,7 +37,7 @@ static const PROV_CIPHER_HW rc4_hw = {
     cipher_hw_rc4_initkey,
     cipher_hw_rc4_cipher
 };
-const PROV_CIPHER_HW *PROV_CIPHER_HW_rc4(size_t keybits)
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc4(size_t keybits)
 {
     return &rc4_hw;
 }
index 0078b32..dba0a3a 100644 (file)
@@ -121,7 +121,8 @@ static void * alg##_##kbits##_##lcmode##_newctx(void *provctx)                 \
      if (ctx != NULL) {                                                        \
          cipher_generic_initkey(ctx, kbits, blkbits, ivbits,                   \
                                 EVP_CIPH_##UCMODE##_MODE, flags,               \
-                                PROV_CIPHER_HW_##alg##_##lcmode(kbits), NULL); \
+                                ossl_prov_cipher_hw_##alg##_##lcmode(kbits),   \
+                                NULL);                                         \
          ctx->rounds = RC5_12_ROUNDS;                                          \
      }                                                                         \
      return ctx;                                                               \
index fe0d09f..508b662 100644 (file)
@@ -19,7 +19,7 @@ typedef struct prov_blowfish_ctx_st {
     unsigned int rounds;       /* number of rounds */
 } PROV_RC5_CTX;
 
-const PROV_CIPHER_HW *PROV_CIPHER_HW_rc5_cbc(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_rc5_ecb(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_rc5_ofb64(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_rc5_cfb64(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_cbc(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_ecb(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_ofb64(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_cfb64(size_t keybits);
index 0d3d513..898bd38 100644 (file)
@@ -30,7 +30,7 @@ static const PROV_CIPHER_HW rc5_##mode = {                                     \
     cipher_hw_rc5_initkey,                                                     \
     cipher_hw_rc5_##mode##_cipher                                              \
 };                                                                             \
-const PROV_CIPHER_HW *PROV_CIPHER_HW_rc5_##mode(size_t keybits)                \
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_rc5_##mode(size_t keybits)           \
 {                                                                              \
     return &rc5_##mode;                                                        \
 }
index 976af35..21f8b6e 100644 (file)
@@ -18,7 +18,7 @@ typedef struct prov_seed_ctx_st {
     } ks;
 } PROV_SEED_CTX;
 
-const PROV_CIPHER_HW *PROV_CIPHER_HW_seed_cbc(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_seed_ecb(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_seed_ofb128(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_seed_cfb128(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_seed_cbc(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_seed_ecb(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_seed_ofb128(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_seed_cfb128(size_t keybits);
index 016b3bc..2d1dba9 100644 (file)
@@ -31,7 +31,7 @@ static const PROV_CIPHER_HW seed_##mode = {                                    \
     cipher_hw_seed_initkey,                                                    \
     cipher_hw_seed_##mode##_cipher                                             \
 };                                                                             \
-const PROV_CIPHER_HW *PROV_CIPHER_HW_seed_##mode(size_t keybits)               \
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_seed_##mode(size_t keybits)          \
 {                                                                              \
     return &seed_##mode;                                                       \
 }
index d5c9633..e1b3363 100644 (file)
@@ -18,8 +18,8 @@ typedef struct prov_cast_ctx_st {
     } ks;
 } PROV_SM4_CTX;
 
-const PROV_CIPHER_HW *PROV_CIPHER_HW_sm4_cbc(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_sm4_ecb(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_sm4_ctr(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_sm4_ofb128(size_t keybits);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_sm4_cfb128(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_sm4_cbc(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_sm4_ecb(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_sm4_ctr(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_sm4_ofb128(size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_sm4_cfb128(size_t keybits);
index 73e8828..bc13517 100644 (file)
@@ -34,7 +34,7 @@ static const PROV_CIPHER_HW sm4_##mode = {                                     \
     cipher_hw_chunked_##mode,                                                  \
     cipher_hw_sm4_copyctx                                                      \
 };                                                                             \
-const PROV_CIPHER_HW *PROV_CIPHER_HW_sm4_##mode(size_t keybits)                \
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_sm4_##mode(size_t keybits)           \
 {                                                                              \
     return &sm4_##mode;                                                        \
 }
index 902f80e..d3500e7 100644 (file)
@@ -36,7 +36,8 @@ static OSSL_FUNC_cipher_newctx_fn tdes_##type##_##lcmode##_newctx;
 static void *tdes_##type##_##lcmode##_newctx(void *provctx)                    \
 {                                                                              \
     return tdes_newctx(provctx, EVP_CIPH_##UCMODE##_MODE, kbits, blkbits,      \
-                       ivbits, flags, PROV_CIPHER_HW_tdes_##type##_##lcmode());\
+                       ivbits, flags,                                          \
+                       ossl_prov_cipher_hw_tdes_##type##_##lcmode());          \
 }                                                                              \
 static OSSL_FUNC_cipher_get_params_fn tdes_##type##_##lcmode##_get_params;       \
 static int tdes_##type##_##lcmode##_get_params(OSSL_PARAM params[])            \
@@ -84,7 +85,7 @@ static const PROV_CIPHER_HW type##_##mode = {                                  \
     cipher_hw_tdes_##mode,                                                     \
     cipher_hw_tdes_copyctx                                                     \
 };                                                                             \
-const PROV_CIPHER_HW *PROV_CIPHER_HW_tdes_##type##_##mode(void)                \
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_##type##_##mode(void)           \
 {                                                                              \
     return &type##_##mode;                                                     \
 }
@@ -97,5 +98,5 @@ int cipher_hw_tdes_cbc(PROV_CIPHER_CTX *ctx, unsigned char *out,
 int cipher_hw_tdes_ecb(PROV_CIPHER_CTX *ctx, unsigned char *out,
                        const unsigned char *in, size_t len);
 
-const PROV_CIPHER_HW *PROV_CIPHER_HW_tdes_ede3_cbc(void);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_tdes_ede3_ecb(void);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_ede3_cbc(void);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_ede3_ecb(void);
index 0bc499f..7d2f1cb 100644 (file)
 #include "prov/ciphercommon.h"
 #include "cipher_tdes.h"
 
-const PROV_CIPHER_HW *PROV_CIPHER_HW_tdes_ede3_ofb(void);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_tdes_ede3_cfb(void);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_tdes_ede3_cfb1(void);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_tdes_ede3_cfb8(void);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_ede3_ofb(void);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_ede3_cfb(void);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_ede3_cfb1(void);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_ede3_cfb8(void);
 
-const PROV_CIPHER_HW *PROV_CIPHER_HW_tdes_ede2_cbc(void);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_tdes_ede2_ecb(void);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_tdes_ede2_ofb(void);
-const PROV_CIPHER_HW *PROV_CIPHER_HW_tdes_ede2_cfb(void);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_ede2_cbc(void);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_ede2_ecb(void);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_ede2_ofb(void);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_ede2_cfb(void);
 
-const PROV_CIPHER_HW *PROV_CIPHER_HW_tdes_desx_cbc(void);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_desx_cbc(void);
 
-const PROV_CIPHER_HW *PROV_CIPHER_HW_tdes_wrap_cbc(void);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_tdes_wrap_cbc(void);
index 9007e40..2c84505 100644 (file)
@@ -175,7 +175,7 @@ static OSSL_FUNC_cipher_newctx_fn tdes_wrap_newctx;                            \
 static void *tdes_wrap_newctx(void *provctx)                                   \
 {                                                                              \
     return tdes_newctx(provctx, EVP_CIPH_WRAP_MODE, kbits, blkbits, ivbits,    \
-                       flags, PROV_CIPHER_HW_tdes_wrap_cbc());                 \
+                       flags, ossl_prov_cipher_hw_tdes_wrap_cbc());            \
 }                                                                              \
 static OSSL_FUNC_cipher_get_params_fn tdes_wrap_get_params;                    \
 static int tdes_wrap_get_params(OSSL_PARAM params[])                           \
index dc7ccbc..c3402c8 100644 (file)
@@ -778,7 +778,7 @@ static const OSSL_PARAM *key2any_settable_ctx_params(ossl_unused void *provctx)
 static int key2any_set_ctx_params(void *vctx, const OSSL_PARAM params[])
 {
     struct key2any_ctx_st *ctx = vctx;
-    OPENSSL_CTX *libctx = PROV_CTX_get0_library_context(ctx->provctx);
+    OPENSSL_CTX *libctx = ossl_prov_ctx_get0_library_context(ctx->provctx);
     const OSSL_PARAM *cipherp =
         OSSL_PARAM_locate_const(params, OSSL_ENCODER_PARAM_CIPHER);
     const OSSL_PARAM *propsp =
index 4c7eb31..137836d 100644 (file)
@@ -186,7 +186,7 @@ static void * alg##_##kbits##_##lcmode##_newctx(void *provctx)                 \
      if (ctx != NULL) {                                                        \
          cipher_generic_initkey(ctx, kbits, blkbits, ivbits,                   \
                                 EVP_CIPH_##UCMODE##_MODE, flags,               \
-                                PROV_CIPHER_HW_##alg##_##lcmode(kbits),        \
+                                ossl_prov_cipher_hw_##alg##_##lcmode(kbits),   \
                                 provctx);                                      \
      }                                                                         \
      return ctx;                                                               \
index f97d830..022e8e3 100644 (file)
@@ -136,7 +136,7 @@ static unsigned int get_parent_reseed_count(PROV_DRBG *drbg)
  * Implements the get_entropy() callback
  *
  * If the DRBG has a parent, then the required amount of entropy input
- * is fetched using the parent's PROV_DRBG_generate().
+ * is fetched using the parent's ossl_prov_drbg_generate().
  *
  * Otherwise, the entropy is polled from the system entropy sources
  * using prov_pool_acquire_entropy().
@@ -390,9 +390,9 @@ static void prov_drbg_clear_nonce(PROV_DRBG *drbg, unsigned char *nonce,
  *
  * Returns 1 on success, 0 on failure.
  */
-int PROV_DRBG_instantiate(PROV_DRBG *drbg, unsigned int strength,
-                          int prediction_resistance,
-                          const unsigned char *pers, size_t perslen)
+int ossl_prov_drbg_instantiate(PROV_DRBG *drbg, unsigned int strength,
+                               int prediction_resistance,
+                               const unsigned char *pers, size_t perslen)
 {
     unsigned char *nonce = NULL, *entropy = NULL;
     size_t noncelen = 0, entropylen = 0;
@@ -520,7 +520,7 @@ int PROV_DRBG_instantiate(PROV_DRBG *drbg, unsigned int strength,
  *
  * Returns 1 on success, 0 on failure.
  */
-int PROV_DRBG_uninstantiate(PROV_DRBG *drbg)
+int ossl_prov_drbg_uninstantiate(PROV_DRBG *drbg)
 {
     drbg->state = EVP_RAND_STATE_UNINITIALISED;
     return 1;
@@ -533,9 +533,9 @@ int PROV_DRBG_uninstantiate(PROV_DRBG *drbg)
  *
  * Returns 1 on success, 0 on failure.
  */
-int PROV_DRBG_reseed(PROV_DRBG *drbg, int prediction_resistance,
-                     const unsigned char *ent, size_t ent_len,
-                     const unsigned char *adin, size_t adinlen)
+int ossl_prov_drbg_reseed(PROV_DRBG *drbg, int prediction_resistance,
+                          const unsigned char *ent, size_t ent_len,
+                          const unsigned char *adin, size_t adinlen)
 {
     unsigned char *entropy = NULL;
     size_t entropylen = 0;
@@ -647,9 +647,9 @@ int PROV_DRBG_reseed(PROV_DRBG *drbg, int prediction_resistance,
  * Returns 1 on success, 0 on failure.
  *
  */
-int PROV_DRBG_generate(PROV_DRBG *drbg, unsigned char *out, size_t outlen,
-                       unsigned int strength, int prediction_resistance,
-                       const unsigned char *adin, size_t adinlen)
+int ossl_prov_drbg_generate(PROV_DRBG *drbg, unsigned char *out, size_t outlen,
+                            unsigned int strength, int prediction_resistance,
+                            const unsigned char *adin, size_t adinlen)
 {
     int fork_id;
     int reseed_required = 0;
@@ -706,8 +706,8 @@ int PROV_DRBG_generate(PROV_DRBG *drbg, unsigned char *out, size_t outlen,
         reseed_required = 1;
 
     if (reseed_required || prediction_resistance) {
-        if (!PROV_DRBG_reseed(drbg, prediction_resistance, NULL, 0,
-                              adin, adinlen)) {
+        if (!ossl_prov_drbg_reseed(drbg, prediction_resistance, NULL, 0,
+                                   adin, adinlen)) {
             PROVerr(0, PROV_R_RESEED_ERROR);
             return 0;
         }
@@ -760,7 +760,7 @@ static int rand_drbg_restart(PROV_DRBG *drbg)
     /* repair uninitialized state */
     if (drbg->state == EVP_RAND_STATE_UNINITIALISED)
         /* reinstantiate drbg */
-        PROV_DRBG_instantiate(drbg, drbg->strength, 0, NULL, 0);
+        ossl_prov_drbg_instantiate(drbg, drbg->strength, 0, NULL, 0);
 
     rand_pool_free(drbg->seed_pool);
     drbg->seed_pool = NULL;
index a13582f..990fac3 100644 (file)
@@ -330,8 +330,8 @@ static int drbg_ctr_instantiate_wrapper(void *vdrbg, unsigned int strength,
 {
     PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
 
-    return PROV_DRBG_instantiate(drbg, strength, prediction_resistance,
-                                 pstr, pstr_len);
+    return ossl_prov_drbg_instantiate(drbg, strength, prediction_resistance,
+                                      pstr, pstr_len);
 }
 
 static int drbg_ctr_reseed(PROV_DRBG *drbg,
@@ -355,8 +355,8 @@ static int drbg_ctr_reseed_wrapper(void *vdrbg, int prediction_resistance,
 {
     PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
 
-    return PROV_DRBG_reseed(drbg, prediction_resistance, ent, ent_len,
-                            adin, adin_len);
+    return ossl_prov_drbg_reseed(drbg, prediction_resistance, ent, ent_len,
+                                 adin, adin_len);
 }
 
 static void ctr96_inc(unsigned char *counter)
@@ -452,8 +452,8 @@ static int drbg_ctr_generate_wrapper
 {
     PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
 
-    return PROV_DRBG_generate(drbg, out, outlen, strength,
-                              prediction_resistance, adin, adin_len);
+    return ossl_prov_drbg_generate(drbg, out, outlen, strength,
+                                   prediction_resistance, adin, adin_len);
 }
 
 static int drbg_ctr_uninstantiate(PROV_DRBG *drbg)
@@ -465,7 +465,7 @@ static int drbg_ctr_uninstantiate(PROV_DRBG *drbg)
     OPENSSL_cleanse(ctr->bltmp, sizeof(ctr->bltmp));
     OPENSSL_cleanse(ctr->KX, sizeof(ctr->KX));
     ctr->bltmp_pos = 0;
-    return PROV_DRBG_uninstantiate(drbg);
+    return ossl_prov_drbg_uninstantiate(drbg);
 }
 
 static int drbg_ctr_uninstantiate_wrapper(void *vdrbg)
index e420d70..cf05188 100644 (file)
@@ -270,8 +270,8 @@ static int drbg_hash_instantiate_wrapper(void *vdrbg, unsigned int strength,
 {
     PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
 
-    return PROV_DRBG_instantiate(drbg, strength, prediction_resistance,
-                                 pstr, pstr_len);
+    return ossl_prov_drbg_instantiate(drbg, strength, prediction_resistance,
+                                      pstr, pstr_len);
 }
 
 /*
@@ -304,8 +304,8 @@ static int drbg_hash_reseed_wrapper(void *vdrbg, int prediction_resistance,
 {
     PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
 
-    return PROV_DRBG_reseed(drbg, prediction_resistance, ent, ent_len,
-                            adin, adin_len);
+    return ossl_prov_drbg_reseed(drbg, prediction_resistance, ent, ent_len,
+                                 adin, adin_len);
 }
 
 /*
@@ -352,8 +352,8 @@ static int drbg_hash_generate_wrapper
 {
     PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
 
-    return PROV_DRBG_generate(drbg, out, outlen, strength,
-                              prediction_resistance, adin, adin_len);
+    return ossl_prov_drbg_generate(drbg, out, outlen, strength,
+                                   prediction_resistance, adin, adin_len);
 }
 
 static int drbg_hash_uninstantiate(PROV_DRBG *drbg)
@@ -363,7 +363,7 @@ static int drbg_hash_uninstantiate(PROV_DRBG *drbg)
     OPENSSL_cleanse(hash->V, sizeof(hash->V));
     OPENSSL_cleanse(hash->C, sizeof(hash->C));
     OPENSSL_cleanse(hash->vtmp, sizeof(hash->vtmp));
-    return PROV_DRBG_uninstantiate(drbg);
+    return ossl_prov_drbg_uninstantiate(drbg);
 }
 
 static int drbg_hash_uninstantiate_wrapper(void *vdrbg)
index 9b6ce0a..57b9ac6 100644 (file)
@@ -154,8 +154,8 @@ static int drbg_hmac_instantiate_wrapper(void *vdrbg, unsigned int strength,
 {
     PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
 
-    return PROV_DRBG_instantiate(drbg, strength, prediction_resistance,
-                                 pstr, pstr_len);
+    return ossl_prov_drbg_instantiate(drbg, strength, prediction_resistance,
+                                      pstr, pstr_len);
 }
 
 /*
@@ -182,8 +182,8 @@ static int drbg_hmac_reseed_wrapper(void *vdrbg, int prediction_resistance,
 {
     PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
 
-    return PROV_DRBG_reseed(drbg, prediction_resistance, ent, ent_len,
-                            adin, adin_len);
+    return ossl_prov_drbg_reseed(drbg, prediction_resistance, ent, ent_len,
+                                 adin, adin_len);
 }
 
 /*
@@ -251,8 +251,8 @@ static int drbg_hmac_generate_wrapper
 {
     PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
 
-    return PROV_DRBG_generate(drbg, out, outlen, strength,
-                              prediction_resistance, adin, adin_len);
+    return ossl_prov_drbg_generate(drbg, out, outlen, strength,
+                                   prediction_resistance, adin, adin_len);
 }
 
 static int drbg_hmac_uninstantiate(PROV_DRBG *drbg)
@@ -261,7 +261,7 @@ static int drbg_hmac_uninstantiate(PROV_DRBG *drbg)
 
     OPENSSL_cleanse(hmac->K, sizeof(hmac->K));
     OPENSSL_cleanse(hmac->V, sizeof(hmac->V));
-    return PROV_DRBG_uninstantiate(drbg);
+    return ossl_prov_drbg_uninstantiate(drbg);
 }
 
 static int drbg_hmac_uninstantiate_wrapper(void *vdrbg)
index 66539de..40ca6fa 100644 (file)
@@ -205,19 +205,19 @@ PROV_DRBG *prov_rand_drbg_new
                      const unsigned char *adin, size_t adin_len));
 void prov_rand_drbg_free(PROV_DRBG *drbg);
 
-int PROV_DRBG_instantiate(PROV_DRBG *drbg, unsigned int strength,
-                          int prediction_resistance,
-                          const unsigned char *pers, size_t perslen);
+int ossl_prov_drbg_instantiate(PROV_DRBG *drbg, unsigned int strength,
+                               int prediction_resistance,
+                               const unsigned char *pers, size_t perslen);
 
-int PROV_DRBG_uninstantiate(PROV_DRBG *drbg);
+int ossl_prov_drbg_uninstantiate(PROV_DRBG *drbg);
 
-int PROV_DRBG_reseed(PROV_DRBG *drbg, int prediction_resistance,
-                     const unsigned char *ent, size_t ent_len,
-                     const unsigned char *adin, size_t adinlen);
+int ossl_prov_drbg_reseed(PROV_DRBG *drbg, int prediction_resistance,
+                          const unsigned char *ent, size_t ent_len,
+                          const unsigned char *adin, size_t adinlen);
 
-int PROV_DRBG_generate(PROV_DRBG *drbg, unsigned char *out, size_t outlen,
-                       unsigned int strength, int prediction_resistance,
-                       const unsigned char *adin, size_t adinlen);
+int ossl_prov_drbg_generate(PROV_DRBG *drbg, unsigned char *out, size_t outlen,
+                            unsigned int strength, int prediction_resistance,
+                            const unsigned char *adin, size_t adinlen);
 
 /* Verify that an array of numeric values is all zero */
 #define PROV_DRBG_VERYIFY_ZEROIZATION(v)    \
index b6ec7b1..bb0d2a4 100644 (file)
@@ -94,8 +94,8 @@ static int test_rng_instantiate_wrapper(void *vdrbg, unsigned int strength,
     if (pstr != NULL && pstr_len >= drbg->max_perslen)
         return 0;
 
-    return PROV_DRBG_instantiate(drbg, strength, prediction_resistance,
-                                 pstr, pstr_len);
+    return ossl_prov_drbg_instantiate(drbg, strength, prediction_resistance,
+                                      pstr, pstr_len);
 }
 
 static int test_rng_uninstantiate(PROV_DRBG *drbg)
@@ -103,7 +103,7 @@ static int test_rng_uninstantiate(PROV_DRBG *drbg)
     PROV_TEST_RNG *t = (PROV_TEST_RNG *)drbg->data;
 
     t->entropy_pos = 0;
-    return PROV_DRBG_uninstantiate(drbg);
+    return ossl_prov_drbg_uninstantiate(drbg);
 }
 
 static int test_rng_uninstantiate_wrapper(void *vdrbg)
index 9fd6514..5b0616e 100644 (file)
@@ -530,7 +530,7 @@ void file_load_cleanup(void *construct_data)
 static int file_setup_decoders(struct file_ctx_st *ctx)
 {
     EVP_PKEY *dummy; /* for OSSL_DECODER_CTX_new_by_EVP_PKEY() */
-    OPENSSL_CTX *libctx = PROV_CTX_get0_library_context(ctx->provctx);
+    OPENSSL_CTX *libctx = ossl_prov_ctx_get0_library_context(ctx->provctx);
     OSSL_DECODER *to_obj = NULL; /* Last resort decoder */
     OSSL_DECODER_INSTANCE *to_obj_inst = NULL;
     OSSL_DECODER_CLEANUP *old_cleanup = NULL;
index f6e9db0..2085f4d 100644 (file)
@@ -162,7 +162,7 @@ static const OSSL_ALGORITHM *legacy_query(void *provctx, int operation_id,
 static void legacy_teardown(void *provctx)
 {
     OPENSSL_CTX_free(PROV_LIBRARY_CONTEXT_OF(provctx));
-    PROV_CTX_free(provctx);
+    ossl_prov_ctx_free(provctx);
 }
 
 /* Functions we provide to the core */
@@ -202,15 +202,15 @@ int OSSL_provider_init(const OSSL_CORE_HANDLE *handle,
     if (c_get_libctx == NULL)
         return 0;
 
-    if ((*provctx = PROV_CTX_new()) == NULL
+    if ((*provctx = ossl_prov_ctx_new()) == NULL
         || (libctx = OPENSSL_CTX_new()) == NULL) {
         OPENSSL_CTX_free(libctx);
         legacy_teardown(*provctx);
         *provctx = NULL;
         return 0;
     }
-    PROV_CTX_set0_library_context(*provctx, libctx);
-    PROV_CTX_set0_handle(*provctx, handle);
+    ossl_prov_ctx_set0_library_context(*provctx, libctx);
+    ossl_prov_ctx_set0_handle(*provctx, handle);
 
     *out = legacy_dispatch_table;