summaryrefslogtreecommitdiff
path: root/drivers/crypto/inside-secure
diff options
context:
space:
mode:
authorPascal van Leeuwen <pascalvanl@gmail.com>2019-11-08 10:00:21 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2019-11-17 09:02:38 +0800
commitb8151220f35da4653d95c840e03b8a9db2c0d1c0 (patch)
treef80663778ef980889e54820762ea4cff1b3119ca /drivers/crypto/inside-secure
parent4a97bfc79619c40d400f2a7b763a0d9cd1d33891 (diff)
crypto: inside-secure - Fixed authenc w/ (3)DES fails on Macchiatobin
Fixed 2 copy-paste mistakes in the commit mentioned below that caused authenc w/ (3)DES to consistently fail on Macchiatobin (but strangely work fine on x86+FPGA??). Now fully tested on both platforms. Fixes: 13a1bb93f7b1c9 ("crypto: inside-secure - Fixed warnings...") Signed-off-by: Pascal van Leeuwen <pvanleeuwen@verimatrix.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/inside-secure')
-rw-r--r--drivers/crypto/inside-secure/safexcel_cipher.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/crypto/inside-secure/safexcel_cipher.c b/drivers/crypto/inside-secure/safexcel_cipher.c
index 98f9fc60c268..c02995694b41 100644
--- a/drivers/crypto/inside-secure/safexcel_cipher.c
+++ b/drivers/crypto/inside-secure/safexcel_cipher.c
@@ -405,7 +405,8 @@ static int safexcel_aead_setkey(struct crypto_aead *ctfm, const u8 *key,
if (priv->flags & EIP197_TRC_CACHE && ctx->base.ctxr_dma) {
for (i = 0; i < keys.enckeylen / sizeof(u32); i++) {
- if (le32_to_cpu(ctx->key[i]) != aes.key_enc[i]) {
+ if (le32_to_cpu(ctx->key[i]) !=
+ ((u32 *)keys.enckey)[i]) {
ctx->base.needs_inv = true;
break;
}
@@ -459,7 +460,7 @@ static int safexcel_aead_setkey(struct crypto_aead *ctfm, const u8 *key,
/* Now copy the keys into the context */
for (i = 0; i < keys.enckeylen / sizeof(u32); i++)
- ctx->key[i] = cpu_to_le32(aes.key_enc[i]);
+ ctx->key[i] = cpu_to_le32(((u32 *)keys.enckey)[i]);
ctx->key_len = keys.enckeylen;
memcpy(ctx->ipad, &istate.state, ctx->state_sz);