diff options
Diffstat (limited to 'providers/implementations/include/prov/blake2.h')
-rw-r--r-- | providers/implementations/include/prov/blake2.h | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/providers/implementations/include/prov/blake2.h b/providers/implementations/include/prov/blake2.h index d18cbc708c4f..42229e2d7402 100644 --- a/providers/implementations/include/prov/blake2.h +++ b/providers/implementations/include/prov/blake2.h @@ -1,5 +1,5 @@ /* - * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -14,6 +14,7 @@ # include <openssl/e_os2.h> # include <stddef.h> +# include <crypto/evp.h> # define BLAKE2S_BLOCKBYTES 64 # define BLAKE2S_OUTBYTES 32 @@ -82,8 +83,15 @@ struct blake2b_ctx_st { typedef struct blake2s_ctx_st BLAKE2S_CTX; typedef struct blake2b_ctx_st BLAKE2B_CTX; -int ossl_blake2s256_init(void *ctx); -int ossl_blake2b512_init(void *ctx); +struct blake2b_md_data_st { + BLAKE2B_CTX ctx; + BLAKE2B_PARAM params; +}; + +struct blake2s_md_data_st { + BLAKE2S_CTX ctx; + BLAKE2S_PARAM params; +}; int ossl_blake2b_init(BLAKE2B_CTX *c, const BLAKE2B_PARAM *P); int ossl_blake2b_init_key(BLAKE2B_CTX *c, const BLAKE2B_PARAM *P, @@ -91,6 +99,11 @@ int ossl_blake2b_init_key(BLAKE2B_CTX *c, const BLAKE2B_PARAM *P, int ossl_blake2b_update(BLAKE2B_CTX *c, const void *data, size_t datalen); int ossl_blake2b_final(unsigned char *md, BLAKE2B_CTX *c); +OSSL_FUNC_digest_get_ctx_params_fn ossl_blake2b_get_ctx_params; +OSSL_FUNC_digest_set_ctx_params_fn ossl_blake2b_set_ctx_params; +OSSL_FUNC_digest_gettable_ctx_params_fn ossl_blake2b_gettable_ctx_params; +OSSL_FUNC_digest_settable_ctx_params_fn ossl_blake2b_settable_ctx_params; + /* * These setters are internal and do not check the validity of their parameters. * See blake2b_mac_ctrl for validation logic. @@ -117,4 +130,9 @@ void ossl_blake2s_param_set_personal(BLAKE2S_PARAM *P, const uint8_t *personal, void ossl_blake2s_param_set_salt(BLAKE2S_PARAM *P, const uint8_t *salt, size_t length); +OSSL_FUNC_digest_get_ctx_params_fn ossl_blake2s_get_ctx_params; +OSSL_FUNC_digest_set_ctx_params_fn ossl_blake2s_set_ctx_params; +OSSL_FUNC_digest_gettable_ctx_params_fn ossl_blake2s_gettable_ctx_params; +OSSL_FUNC_digest_settable_ctx_params_fn ossl_blake2s_settable_ctx_params; + #endif /* OSSL_PROV_BLAKE2_H */ |