提交 8eb399fb 编写于 作者: P Patrick Steuer 提交者: Andy Polyakov

crypto/e_aes.c: use S390X_AES_FC macro

... to compute s390x aes function code from keylength.
Signed-off-by: NPatrick Steuer <patrick.steuer@de.ibm.com>
Reviewed-by: NRichard Levitte <levitte@openssl.org>
Reviewed-by: NAndy Polyakov <appro@openssl.org>
Reviewed-by: NRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5250)
上级 25868993
......@@ -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. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册