DPDK usage discussions
 help / color / mirror / Atom feed
From: "Trahe, Fiona" <fiona.trahe@intel.com>
To: Nubin Stanley <nubinstanley@gmail.com>,
	"users@dpdk.org" <users@dpdk.org>
Cc: "martin.varghese@nokia.com" <martin.varghese@nokia.com>,
	"Trahe, Fiona" <fiona.trahe@intel.com>
Subject: Re: [dpdk-users] AES GCM PMD Driver IV length support
Date: Thu, 8 Dec 2016 10:56:26 +0000	[thread overview]
Message-ID: <348A99DA5F5B7549AA880327E580B43589145195@IRSMSX101.ger.corp.intel.com> (raw)
In-Reply-To: <CAL53N-nP5CHE6FvQ1rZpx18BuYgBnzau+ErQNGBaKoKKLSiOVg@mail.gmail.com>

Hi Nubin,

> -----Original Message-----
> From: users [mailto:users-bounces@dpdk.org] On Behalf Of Nubin Stanley
> Sent: Thursday, December 8, 2016 9:21 AM
> To: users@dpdk.org
> Cc: martin.varghese@nokia.com
> Subject: [dpdk-users] AES GCM PMD Driver IV length support
> 
> Hi All
> 
> 
> 
> I see that the only IV size supported in AES GCM driver is 16bytes. For
> using AES-GCM-128  in IPsec, the IV length  has to be   12 bytes ( 4 (salt)
> + 8 (iv)).
> 
> 
> How should I handle this IPsec case with AES GCM PMD driver.
> 
> 
> 
> .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
> 
>         {.sym = {
> 
>             .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
> 
>             {.cipher = {
> 
>                 .algo = RTE_CRYPTO_CIPHER_AES_GCM,
> 
>                 .block_size = 16,
> 
>                 .key_size = {
> 
>                     .min = 16,
> 
>                     .max = 16,
> 
>                     .increment = 0
> 
>                 },
> 
>                 .iv_size = {
> 
>                     .min = 16,
> 
>                     .max = 16,
> 
>                     .increment = 0
> 
>                 }
> 
>             }, }
> 
>         }, }
> 
> 
> 
> Regards,
> Nubin Stanley


I found the following code in the PMD to handle an iv length of 12, so this looks like a bug in the capability data.
/* sanity checks */
	if (op->cipher.iv.length != 16 && op->cipher.iv.length != 12 &&
			op->cipher.iv.length != 0) {
		GCM_LOG_ERR("iv");
		return -1;
	}

	/*
	 * GCM working in 12B IV mode => 16B pre-counter block we need
	 * to set BE LSB to 1, driver expects that 16B is allocated
	 */
	if (op->cipher.iv.length == 12) {
		op->cipher.iv.data[15] = 1;
	}

Have you tried passing a 12-byte iv to the driver ?


  reply	other threads:[~2016-12-08 10:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-08  9:20 Nubin Stanley
2016-12-08 10:56 ` Trahe, Fiona [this message]
2016-12-09 11:00 Nubin Stanley

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=348A99DA5F5B7549AA880327E580B43589145195@IRSMSX101.ger.corp.intel.com \
    --to=fiona.trahe@intel.com \
    --cc=martin.varghese@nokia.com \
    --cc=nubinstanley@gmail.com \
    --cc=users@dpdk.org \
    /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).