Remove MAC cruft
authorRichard Levitte <levitte@openssl.org>
Thu, 22 Aug 2019 10:08:55 +0000 (12:08 +0200)
committerRichard Levitte <levitte@openssl.org>
Sat, 24 Aug 2019 11:01:15 +0000 (13:01 +0200)
A few declarations and static functions / arrays that are no longer
used were left behind when MACs moved to be implemented by providers.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/9667)

crypto/evp/m_sha3.c
crypto/include/internal/evp_int.h

index f3266ebec2b499ad5cff9970fd9a4042c8ee1b10..1e71eed9487b63e51ad6a5333c9f1cec77949389 100644 (file)
@@ -36,12 +36,6 @@ static int shake_init(EVP_MD_CTX *ctx)
     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;
@@ -323,27 +317,3 @@ EVP_MD_SHA3(512)
 
 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)
index 7b1c6aa9c2db2458683afa981976f8ae89fc5213..b86b1d1af0fa26f2bf90325b3b7c95b0a8c46063 100644 (file)
@@ -118,8 +118,6 @@ extern const EVP_PKEY_METHOD hkdf_pkey_meth;
 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;
@@ -142,10 +140,6 @@ struct evp_mac_st {
     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:
@@ -153,7 +147,6 @@ const EVP_MD *evp_keccak_kmac256(void);
  * 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 */