diff mbox

[6/8] crypto: caam - Convert GCM to new AEAD interface

Message ID 20150615132137.GA2367@gondor.apana.org.au (mailing list archive)
State Not Applicable
Delegated to: Herbert Xu
Headers show

Commit Message

Herbert Xu June 15, 2015, 1:21 p.m. UTC
On Mon, Jun 15, 2015 at 08:59:51PM +0800, Herbert Xu wrote:
>
> > alg: aead: Test 2 failed on encryption for gcm-aes-caam
> > 00000000: ab 6e 47 d4 2c ec 13 bd f5 3a 67 b2 12 57 bd df
> > 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 
> But this one seems obvious.  When assoclen is zero I failed to
> set VARSEQOUTLEN correctly for the cipher.

Please try this patch on top of it for the generic gcm failure.

Thanks!
diff mbox

Patch

diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c
index 95e8545..ca8948e 100644
--- a/drivers/crypto/caam/caamalg.c
+++ b/drivers/crypto/caam/caamalg.c
@@ -777,7 +777,7 @@  static int gcm_set_sh_desc(struct crypto_aead *aead)
 			 OP_ALG_AS_INITFINAL | OP_ALG_ENCRYPT);
 
 	/* if assoclen + cryptlen is ZERO, skip to ICV write */
-	append_math_sub(desc, NONE, SEQINLEN, REG0, CAAM_CMD_SZ);
+	append_math_sub(desc, VARSEQOUTLEN, SEQINLEN, REG0, CAAM_CMD_SZ);
 	zero_assoc_jump_cmd2 = append_jump(desc, JUMP_TEST_ALL |
 						 JUMP_COND_MATH_Z);