summaryrefslogtreecommitdiffstats
path: root/crypto/evp
diff options
context:
space:
mode:
authorPatrick Steuer <patrick.steuer@de.ibm.com>2018-03-28 13:23:56 +0100
committerAndy Polyakov <appro@openssl.org>2018-03-28 23:31:09 +0200
commit8eb399fb25a6ef68b2a9e8d34b242b9767c46abe (patch)
treebd2eb3776ba1d96cd1deda3d14d9b348ce5bab94 /crypto/evp
parent258689931ef9f25f282b550367f9c815b91069d7 (diff)
crypto/e_aes.c: use S390X_AES_FC macro
... to compute s390x aes function code from keylength. Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5250)
Diffstat (limited to 'crypto/evp')
-rw-r--r--crypto/evp/e_aes.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c
index 6f9cb6d2b4..a914a6e817 100644
--- a/crypto/evp/e_aes.c
+++ b/crypto/evp/e_aes.c
@@ -1734,8 +1734,7 @@ static int s390x_aes_gcm_init_key(EVP_CIPHER_CTX *ctx,
keylen = EVP_CIPHER_CTX_key_length(ctx);
memcpy(&gctx->kma.param.k, key, keylen);
- /* Convert key size to function code. */
- gctx->fc = S390X_AES_128 + (((keylen << 3) - 128) >> 6);
+ gctx->fc = S390X_AES_FC(keylen);
if (!enc)
gctx->fc |= S390X_DECRYPT;
@@ -2145,8 +2144,7 @@ static int s390x_aes_ccm_init_key(EVP_CIPHER_CTX *ctx,
if (key != NULL) {
keylen = EVP_CIPHER_CTX_key_length(ctx);
- /* Convert key size to function code. */
- cctx->aes.ccm.fc = S390X_AES_128 + (((keylen << 3) - 128) >> 6);
+ cctx->aes.ccm.fc = S390X_AES_FC(keylen);
memcpy(cctx->aes.ccm.kmac_param.k, key, keylen);
/* Store encoded m and l. */