DPDK patches and discussions
 help / color / mirror / Atom feed
From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
To: "Kusztal, ArkadiuszX" <arkadiuszx.kusztal@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "Trahe, Fiona" <fiona.trahe@intel.com>,
	"Jain, Deepak K" <deepak.k.jain@intel.com>,
	"Griffin, John" <john.griffin@intel.com>
Subject: Re: [dpdk-dev] [PATCH 1/3] crypto/aesni_gcm: move pre-counter block to GCM driver
Date: Tue, 20 Sep 2016 21:37:35 +0000	[thread overview]
Message-ID: <E115CCD9D858EF4F90C690B0DCB4D8973C9FAD3E@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <1472126563-31268-2-git-send-email-arkadiuszx.kusztal@intel.com>

Hi Arek,

> -----Original Message-----
> From: Kusztal, ArkadiuszX
> Sent: Thursday, August 25, 2016 5:03 AM
> To: dev@dpdk.org
> Cc: Trahe, Fiona; Jain, Deepak K; De Lara Guarch, Pablo; Griffin, John;
> Kusztal, ArkadiuszX
> Subject: [PATCH 1/3] crypto/aesni_gcm: move pre-counter block to GCM
> driver
> 
> This patch moves computing of pre-counter block into the AESNI-GCM
> driver so it can be moved from test files.
> 
> Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
> ---
>  drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
> b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
> index dc0b033..d8b6287 100644
> --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
> +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
> @@ -230,11 +230,16 @@ process_gcm_crypto_op(struct aesni_gcm_qp
> *qp, struct rte_crypto_sym_op *op,
>  					op->cipher.data.offset);
> 
>  	/* sanity checks */
> -	if (op->cipher.iv.length != 16 && op->cipher.iv.length != 0) {
> +	if (op->cipher.iv.length != 16 && op->cipher.iv.length != 12 &&
> +			op->cipher.iv.length != 0) {
>  		GCM_LOG_ERR("iv");
>  		return -1;
>  	}
> 
> +	if (op->cipher.iv.length == 12) {
> +		op->cipher.iv.data[15] = 1;
> +	}

Is this correct? In the second patch, you are removing code that set this byte when IV length was 16,
so I would expect this to be the same. Also, if length is 12, then data[15] looks like overflow.
Probably a comment would be useful here.

> +
>  	if (op->auth.aad.length != 12 && op->auth.aad.length != 8 &&
>  			op->auth.aad.length != 0) {
>  		GCM_LOG_ERR("iv");
> --
> 2.1.0

  reply	other threads:[~2016-09-20 21:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-25 12:02 [dpdk-dev] [PATCH 0/3] Fix compability issues between crypto drivers for GCM test cases Arek Kusztal
2016-08-25 12:02 ` [dpdk-dev] [PATCH 1/3] crypto/aesni_gcm: move pre-counter block to GCM driver Arek Kusztal
2016-09-20 21:37   ` De Lara Guarch, Pablo [this message]
2016-09-21 10:41     ` Kusztal, ArkadiuszX
2016-08-25 12:02 ` [dpdk-dev] [PATCH 2/3] app/test: move pre-counter block computation from test files Arek Kusztal
2016-08-25 12:02 ` [dpdk-dev] [PATCH 3/3] app/test: fix verification of digest in GCM crypto test Arek Kusztal
2016-08-25 20:38 ` [dpdk-dev] [PATCH 0/3] Fix compability issues between crypto drivers for GCM test cases Jain, Deepak K

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=E115CCD9D858EF4F90C690B0DCB4D8973C9FAD3E@IRSMSX108.ger.corp.intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=arkadiuszx.kusztal@intel.com \
    --cc=deepak.k.jain@intel.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@intel.com \
    --cc=john.griffin@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).