summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@iki.fi>2021-01-21 22:15:57 +0200
committerJussi Kivilinna <jussi.kivilinna@iki.fi>2021-01-26 19:41:10 +0200
commita14447f8169aff30a49f5c2ab06bd5bbd1cc3531 (patch)
tree3199058593a1134d4c6c84abe9ca63d86ed4bb21
parent8d404a629167d67ed56e45de3e65d1e0b7cdeb24 (diff)
downloadlibgcrypt-a14447f8169aff30a49f5c2ab06bd5bbd1cc3531.tar.gz
rijndael: remove unused use_xxx flags
* cipher/rijndael-internal.h (RIJNDAEL_context_s): Remove unused 'use_padlock', 'use_aesni', 'use_ssse3', 'use_arm_ce', 'use_ppc_crypto' and 'use_ppc9le_crypto'. * cipher/rijndael.c (do_setkey): Do not setup 'use_padlock', 'use_aesni', 'use_ssse3', 'use_arm_ce', 'use_ppc_crypto' and 'use_ppc9le_crypto'. -- Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
-rw-r--r--cipher/rijndael-internal.h20
-rw-r--r--cipher/rijndael.c25
2 files changed, 2 insertions, 43 deletions
diff --git a/cipher/rijndael-internal.h b/cipher/rijndael-internal.h
index 447a773a..7e01f6b0 100644
--- a/cipher/rijndael-internal.h
+++ b/cipher/rijndael-internal.h
@@ -164,26 +164,10 @@ typedef struct RIJNDAEL_context_s
} u2;
int rounds; /* Key-length-dependent number of rounds. */
unsigned int decryption_prepared:1; /* The decryption key schedule is available. */
-#ifdef USE_PADLOCK
- unsigned int use_padlock:1; /* Padlock shall be used. */
-#endif /*USE_PADLOCK*/
#ifdef USE_AESNI
- unsigned int use_aesni:1; /* AES-NI shall be used. */
- unsigned int use_avx:1; /* AVX shall be used. */
- unsigned int use_avx2:1; /* AVX2 shall be used. */
+ unsigned int use_avx:1; /* AVX shall be used by AES-NI implementation. */
+ unsigned int use_avx2:1; /* AVX2 shall be used by AES-NI implementation. */
#endif /*USE_AESNI*/
-#ifdef USE_SSSE3
- unsigned int use_ssse3:1; /* SSSE3 shall be used. */
-#endif /*USE_SSSE3*/
-#ifdef USE_ARM_CE
- unsigned int use_arm_ce:1; /* ARMv8 CE shall be used. */
-#endif /*USE_ARM_CE*/
-#ifdef USE_PPC_CRYPTO
- unsigned int use_ppc_crypto:1; /* PowerPC crypto shall be used. */
-#endif /*USE_PPC_CRYPTO*/
-#ifdef USE_PPC_CRYPTO_WITH_PPC9LE
- unsigned int use_ppc9le_crypto:1; /* POWER9 LE crypto shall be used. */
-#endif
#ifdef USE_S390X_CRYPTO
byte km_func;
byte km_func_xts;
diff --git a/cipher/rijndael.c b/cipher/rijndael.c
index 2b1aa5e5..fe137327 100644
--- a/cipher/rijndael.c
+++ b/cipher/rijndael.c
@@ -441,24 +441,6 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen,
hwfeatures = _gcry_get_hw_features ();
ctx->decryption_prepared = 0;
-#ifdef USE_PADLOCK
- ctx->use_padlock = 0;
-#endif
-#ifdef USE_AESNI
- ctx->use_aesni = 0;
-#endif
-#ifdef USE_SSSE3
- ctx->use_ssse3 = 0;
-#endif
-#ifdef USE_ARM_CE
- ctx->use_arm_ce = 0;
-#endif
-#ifdef USE_PPC_CRYPTO
- ctx->use_ppc_crypto = 0;
-#endif
-#ifdef USE_PPC_CRYPTO_WITH_PPC9LE
- ctx->use_ppc9le_crypto = 0;
-#endif
/* Setup default bulk encryption routines. */
memset (bulk_ops, 0, sizeof(*bulk_ops));
@@ -486,7 +468,6 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen,
ctx->prefetch_enc_fn = NULL;
ctx->prefetch_dec_fn = NULL;
ctx->prepare_decryption = _gcry_aes_aesni_prepare_decryption;
- ctx->use_aesni = 1;
ctx->use_avx = !!(hwfeatures & HWF_INTEL_AVX);
ctx->use_avx2 = !!(hwfeatures & HWF_INTEL_AVX2);
@@ -509,7 +490,6 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen,
ctx->prefetch_enc_fn = NULL;
ctx->prefetch_dec_fn = NULL;
ctx->prepare_decryption = _gcry_aes_padlock_prepare_decryption;
- ctx->use_padlock = 1;
memcpy (ctx->padlockkey, key, keylen);
}
#endif
@@ -522,7 +502,6 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen,
ctx->prefetch_enc_fn = NULL;
ctx->prefetch_dec_fn = NULL;
ctx->prepare_decryption = _gcry_aes_ssse3_prepare_decryption;
- ctx->use_ssse3 = 1;
/* Setup SSSE3 bulk encryption routines. */
bulk_ops->cfb_enc = _gcry_aes_ssse3_cfb_enc;
@@ -543,7 +522,6 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen,
ctx->prefetch_enc_fn = NULL;
ctx->prefetch_dec_fn = NULL;
ctx->prepare_decryption = _gcry_aes_armv8_ce_prepare_decryption;
- ctx->use_arm_ce = 1;
/* Setup ARM-CE bulk encryption routines. */
bulk_ops->cfb_enc = _gcry_aes_armv8_ce_cfb_enc;
@@ -565,8 +543,6 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen,
ctx->prefetch_enc_fn = NULL;
ctx->prefetch_dec_fn = NULL;
ctx->prepare_decryption = _gcry_aes_ppc8_prepare_decryption;
- ctx->use_ppc_crypto = 1; /* same key-setup as USE_PPC_CRYPTO */
- ctx->use_ppc9le_crypto = 1;
/* Setup PPC9LE bulk encryption routines. */
bulk_ops->cfb_enc = _gcry_aes_ppc9le_cfb_enc;
@@ -588,7 +564,6 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen,
ctx->prefetch_enc_fn = NULL;
ctx->prefetch_dec_fn = NULL;
ctx->prepare_decryption = _gcry_aes_ppc8_prepare_decryption;
- ctx->use_ppc_crypto = 1;
/* Setup PPC8 bulk encryption routines. */
bulk_ops->cfb_enc = _gcry_aes_ppc8_cfb_enc;