All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: "Horia Geantă" <horia.geanta@freescale.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: <ruchika.gupta@freescale.com>, <cristian.stoica@freescale.com>,
	<NiteshNarayanLal@freescale.com>, <jinyanjiang@gmail.com>,
	Tudor Ambarus <tudor.ambarus@freescale.com>,
	Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
	"Leonidas S. Barbosa" <leosilva@linux.vnet.ibm.com>,
	Fionnuala Gunter <fin@linux.vnet.ibm.com>
Subject: Re: [v2 PATCH 6/8] crypto: caam - Convert GCM to new AEAD interface
Date: Thu, 18 Jun 2015 14:18:21 +0300	[thread overview]
Message-ID: <5582A8FD.30705@freescale.com> (raw)
In-Reply-To: <20150618061734.GA28418@gondor.apana.org.au>

On 6/18/2015 9:17 AM, Herbert Xu wrote:
>>> +static void init_gcm_job(struct aead_request *req,
>>> +			 struct aead_edesc *edesc,
>>> +			 bool all_contig, bool encrypt)
>>> +{
>>> +	struct crypto_aead *aead = crypto_aead_reqtfm(req);
>>> +	struct caam_ctx *ctx = crypto_aead_ctx(aead);
>>> +	unsigned int ivsize = crypto_aead_ivsize(aead);
>>> +	u32 *desc = edesc->hw_desc;
>>> +	bool generic_gcm = (ivsize == 12);
>>> +	unsigned int last;
>>> +
>>> +	init_aead_job(req, edesc, all_contig, encrypt);
>>> +
>>> +	/* BUG This should not be specific to generic GCM. */
>>
>> AFAICT, for non-generic GCM uses (RFC4106, RFC4543), cryptlen and/or
>> assoclen are always > 0. That's why the descriptors do not address these
>> cases.
> 
> Of course.  But with the algif_aead interface you need to at least
> ensure that you don't crash or do something silly should the user
> give you such an input.  So my question is what happens when it is
> zero? Does the hardware simply emit an error and recover, or does it
> hang/lock up/do something worse?

To make sure, I've tried this case on HW (with modified tcrypt tests):

caam_jr ffe301000.jr: 4000101c: DECO: desc idx 16: DECO Watchdog timer
timeout error
alg: aead: encryption failed on test 1 for rfc4106-gcm-aes-caam:
ret=-1073745948

caam_jr ffe301000.jr: 4000111c: DECO: desc idx 17: DECO Watchdog timer
timeout error
alg: aead: encryption failed on test 1 for rfc4543-gcm-aes-caam:
ret=-1073746204

The errors are reported by HW and handled by the driver.

> BTW does this actually work on your hardware now?

tcrypt tests pass.
I'll run more tests (IPsec) on my side and report back if I encounter
any issue.

Thanks,
Horia

  parent reply	other threads:[~2015-06-18 13:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-16  5:45 [v2 PATCH 0/8] crypto: aead - Convert gcm to new interface Herbert Xu
2015-06-16  5:54 ` [v2 PATCH 1/8] crypto: testmgr - Disable rfc4543 test Herbert Xu
2015-06-16  5:54 ` [v2 PATCH 2/8] crypto: gcm - Convert to new AEAD interface Herbert Xu
2015-06-16  5:54 ` [v2 PATCH 3/8] crypto: testmgr - Update rfc4543 test vectors Herbert Xu
2015-06-16  5:54 ` [v2 PATCH 4/8] crypto: nx - Convert GCM to new AEAD interface Herbert Xu
2015-06-16  5:54 ` [v2 PATCH 5/8] crypto: caam - Handle errors in dma_map_sg_chained Herbert Xu
2015-06-16  5:54 ` [v2 PATCH 6/8] crypto: caam - Convert GCM to new AEAD interface Herbert Xu
2015-06-17 17:02   ` Horia Geantă
2015-06-18  6:17     ` Herbert Xu
2015-06-18  6:25       ` [PATCH 1/2] crypto: caam - Reintroduce DESC_MAX_USED_BYTES Herbert Xu
2015-06-18  6:25       ` [PATCH 2/2] crypto: caam - Set last bit on src SG list Herbert Xu
2015-06-18 11:18       ` Horia Geantă [this message]
2015-06-19  0:05         ` [v2 PATCH 6/8] crypto: caam - Convert GCM to new AEAD interface Herbert Xu
2015-06-16  5:54 ` [v2 PATCH 7/8] Revert "crypto: testmgr - Disable rfc4543 test" Herbert Xu
2015-06-16  5:54 ` [v2 PATCH 8/8] crypto: testmgr - Add mcgrew test vectors for rfc4106 Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5582A8FD.30705@freescale.com \
    --to=horia.geanta@freescale.com \
    --cc=NiteshNarayanLal@freescale.com \
    --cc=cristian.stoica@freescale.com \
    --cc=fin@linux.vnet.ibm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jinyanjiang@gmail.com \
    --cc=leosilva@linux.vnet.ibm.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=ruchika.gupta@freescale.com \
    --cc=tudor.ambarus@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.