return sha3_init(EVP_MD_CTX_md_data(ctx), '\x1f', ctx->digest->md_size * 8);
}
-static int kmac_init(EVP_MD_CTX *ctx)
-{
- return keccak_kmac_init(EVP_MD_CTX_md_data(ctx), '\x04',
- ctx->digest->md_size * 8 / 2);
-}
-
static int shake_ctrl(EVP_MD_CTX *evp_ctx, int cmd, int p1, void *p2)
{
KECCAK1600_CTX *ctx = evp_ctx->md_data;
EVP_MD_SHAKE(128)
EVP_MD_SHAKE(256)
-
-
-# define EVP_MD_KECCAK_KMAC(bitlen) \
-const EVP_MD *evp_keccak_kmac##bitlen(void) \
-{ \
- static const EVP_MD kmac_##bitlen##_md = { \
- NID_kmac##bitlen, \
- 0, \
- 2 * bitlen / 8, \
- EVP_MD_FLAG_XOF, \
- kmac_init, \
- update, \
- final, \
- NULL, \
- NULL, \
- (KECCAK1600_WIDTH - bitlen * 2) / 8, \
- sizeof(KECCAK1600_CTX), \
- shake_ctrl \
- }; \
- return &kmac_##bitlen##_md; \
-}
-
-EVP_MD_KECCAK_KMAC(128)
-EVP_MD_KECCAK_KMAC(256)
extern const EVP_PKEY_METHOD poly1305_pkey_meth;
extern const EVP_PKEY_METHOD siphash_pkey_meth;
-/* struct evp_mac_impl_st is defined by the implementation */
-typedef struct evp_mac_impl_st EVP_MAC_IMPL;
struct evp_mac_st {
OSSL_PROVIDER *prov;
char *name;
OSSL_OP_mac_set_ctx_params_fn *set_ctx_params;
};
-/* Internal keccak algorithms used for KMAC */
-const EVP_MD *evp_keccak_kmac128(void);
-const EVP_MD *evp_keccak_kmac256(void);
-
/*
* This function is internal for now, but can be made external when needed.
* The documentation would read:
* EVP_add_mac() adds the MAC implementation C<mac> to the internal
* object database.
*/
-int EVP_add_mac(const EVP_MAC *mac);
int EVP_add_kdf(const EVP_KDF *kdf);
/* struct evp_kdf_impl_st is defined by the implementation */