diff options
Diffstat (limited to 'providers/implementations/include')
-rw-r--r-- | providers/implementations/include/prov/blake2.h | 49 | ||||
-rw-r--r-- | providers/implementations/include/prov/digestcommon.h | 26 |
2 files changed, 40 insertions, 35 deletions
diff --git a/providers/implementations/include/prov/blake2.h b/providers/implementations/include/prov/blake2.h index 895cfb87f0..33b82490ef 100644 --- a/providers/implementations/include/prov/blake2.h +++ b/providers/implementations/include/prov/blake2.h @@ -83,34 +83,39 @@ struct blake2b_ctx_st { typedef struct blake2s_ctx_st BLAKE2S_CTX; typedef struct blake2b_ctx_st BLAKE2B_CTX; -int blake2s256_init(void *ctx); -int blake2b512_init(void *ctx); +int ossl_blake2s256_init(void *ctx); +int ossl_blake2b512_init(void *ctx); -int blake2b_init(BLAKE2B_CTX *c, const BLAKE2B_PARAM *P); -int blake2b_init_key(BLAKE2B_CTX *c, const BLAKE2B_PARAM *P, const void *key); -int blake2b_update(BLAKE2B_CTX *c, const void *data, size_t datalen); -int blake2b_final(unsigned char *md, BLAKE2B_CTX *c); +int ossl_blake2b_init(BLAKE2B_CTX *c, const BLAKE2B_PARAM *P); +int ossl_blake2b_init_key(BLAKE2B_CTX *c, const BLAKE2B_PARAM *P, + const void *key); +int ossl_blake2b_update(BLAKE2B_CTX *c, const void *data, size_t datalen); +int ossl_blake2b_final(unsigned char *md, BLAKE2B_CTX *c); /* * These setters are internal and do not check the validity of their parameters. * See blake2b_mac_ctrl for validation logic. */ -void blake2b_param_init(BLAKE2B_PARAM *P); -void blake2b_param_set_digest_length(BLAKE2B_PARAM *P, uint8_t outlen); -void blake2b_param_set_key_length(BLAKE2B_PARAM *P, uint8_t keylen); -void blake2b_param_set_personal(BLAKE2B_PARAM *P, const uint8_t *personal, size_t length); -void blake2b_param_set_salt(BLAKE2B_PARAM *P, const uint8_t *salt, size_t length); - -int blake2s_init(BLAKE2S_CTX *c, const BLAKE2S_PARAM *P); -int blake2s_init_key(BLAKE2S_CTX *c, const BLAKE2S_PARAM *P, const void *key); -int blake2s_update(BLAKE2S_CTX *c, const void *data, size_t datalen); -int blake2s_final(unsigned char *md, BLAKE2S_CTX *c); - -void blake2s_param_init(BLAKE2S_PARAM *P); -void blake2s_param_set_digest_length(BLAKE2S_PARAM *P, uint8_t outlen); -void blake2s_param_set_key_length(BLAKE2S_PARAM *P, uint8_t keylen); -void blake2s_param_set_personal(BLAKE2S_PARAM *P, const uint8_t *personal, size_t length); -void blake2s_param_set_salt(BLAKE2S_PARAM *P, const uint8_t *salt, size_t length); +void ossl_blake2b_param_init(BLAKE2B_PARAM *P); +void ossl_blake2b_param_set_digest_length(BLAKE2B_PARAM *P, uint8_t outlen); +void ossl_blake2b_param_set_key_length(BLAKE2B_PARAM *P, uint8_t keylen); +void ossl_blake2b_param_set_personal(BLAKE2B_PARAM *P, const uint8_t *personal, + size_t length); +void ossl_blake2b_param_set_salt(BLAKE2B_PARAM *P, const uint8_t *salt, + size_t length); +int ossl_blake2s_init(BLAKE2S_CTX *c, const BLAKE2S_PARAM *P); +int ossl_blake2s_init_key(BLAKE2S_CTX *c, const BLAKE2S_PARAM *P, + const void *key); +int ossl_blake2s_update(BLAKE2S_CTX *c, const void *data, size_t datalen); +int ossl_blake2s_final(unsigned char *md, BLAKE2S_CTX *c); + +void ossl_blake2s_param_init(BLAKE2S_PARAM *P); +void ossl_blake2s_param_set_digest_length(BLAKE2S_PARAM *P, uint8_t outlen); +void ossl_blake2s_param_set_key_length(BLAKE2S_PARAM *P, uint8_t keylen); +void ossl_blake2s_param_set_personal(BLAKE2S_PARAM *P, const uint8_t *personal, + size_t length); +void ossl_blake2s_param_set_salt(BLAKE2S_PARAM *P, const uint8_t *salt, + size_t length); #endif /* OSSL_PROVIDERS_DEFAULT_INCLUDE_INTERNAL_BLAKE2_H */ diff --git a/providers/implementations/include/prov/digestcommon.h b/providers/implementations/include/prov/digestcommon.h index f1164c5a1a..894e7295e5 100644 --- a/providers/implementations/include/prov/digestcommon.h +++ b/providers/implementations/include/prov/digestcommon.h @@ -24,25 +24,25 @@ extern "C" { # endif #define PROV_FUNC_DIGEST_GET_PARAM(name, blksize, dgstsize, flags) \ -static OSSL_FUNC_digest_get_params_fn name##_get_params; \ +static OSSL_FUNC_digest_get_params_fn name##_get_params; \ static int name##_get_params(OSSL_PARAM params[]) \ { \ - return digest_default_get_params(params, blksize, dgstsize, flags); \ + return ossl_digest_default_get_params(params, blksize, dgstsize, flags); \ } #define PROV_DISPATCH_FUNC_DIGEST_GET_PARAMS(name) \ { OSSL_FUNC_DIGEST_GET_PARAMS, (void (*)(void))name##_get_params }, \ { OSSL_FUNC_DIGEST_GETTABLE_PARAMS, \ - (void (*)(void))digest_default_gettable_params } + (void (*)(void))ossl_digest_default_gettable_params } # define PROV_DISPATCH_FUNC_DIGEST_CONSTRUCT_START( \ name, CTX, blksize, dgstsize, flags, init, upd, fin) \ -static OSSL_FUNC_digest_newctx_fn name##_newctx; \ -static OSSL_FUNC_digest_freectx_fn name##_freectx; \ -static OSSL_FUNC_digest_dupctx_fn name##_dupctx; \ +static OSSL_FUNC_digest_newctx_fn name##_newctx; \ +static OSSL_FUNC_digest_freectx_fn name##_freectx; \ +static OSSL_FUNC_digest_dupctx_fn name##_dupctx; \ static void *name##_newctx(void *prov_ctx) \ { \ - CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL; \ + CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL; \ return ctx; \ } \ static void name##_freectx(void *vctx) \ @@ -53,7 +53,7 @@ static void name##_freectx(void *vctx) \ static void *name##_dupctx(void *ctx) \ { \ CTX *in = (CTX *)ctx; \ - CTX *ret = ossl_prov_is_running() ? OPENSSL_malloc(sizeof(*ret)) : NULL; \ + CTX *ret = ossl_prov_is_running() ? OPENSSL_malloc(sizeof(*ret)) : NULL; \ if (ret != NULL) \ *ret = *in; \ return ret; \ @@ -61,13 +61,13 @@ static void *name##_dupctx(void *ctx) \ static OSSL_FUNC_digest_init_fn name##_internal_init; \ static int name##_internal_init(void *ctx) \ { \ - return ossl_prov_is_running() ? init(ctx) : 0; \ + return ossl_prov_is_running() ? init(ctx) : 0; \ } \ static OSSL_FUNC_digest_final_fn name##_internal_final; \ static int name##_internal_final(void *ctx, unsigned char *out, size_t *outl, \ size_t outsz) \ { \ - if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) { \ + if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) { \ *outl = dgstsize; \ return 1; \ } \ @@ -103,9 +103,9 @@ PROV_DISPATCH_FUNC_DIGEST_CONSTRUCT_START(name, CTX, blksize, dgstsize, flags, \ PROV_DISPATCH_FUNC_DIGEST_CONSTRUCT_END -const OSSL_PARAM *digest_default_gettable_params(void *provctx); -int digest_default_get_params(OSSL_PARAM params[], size_t blksz, size_t paramsz, - unsigned long flags); +const OSSL_PARAM *ossl_digest_default_gettable_params(void *provctx); +int ossl_digest_default_get_params(OSSL_PARAM params[], size_t blksz, + size_t paramsz, unsigned long flags); # ifdef __cplusplus } |