All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Fix iv sizes in crypto drivers capabilities
@ 2016-12-23  8:10 Arek Kusztal
  2016-12-23  8:10 ` [PATCH 1/3] crypto/aesni_gcm: fix J0 padding bytes for GCM Arek Kusztal
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arek Kusztal @ 2016-12-23  8:10 UTC (permalink / raw)
  To: dev
  Cc: fiona.trahe, pablo.de.lara.guarch, john.griffin, deepak.k.jain,
	declan.doherty, Arek Kusztal

This patchset fixes iv (initialization vector) size values in qat
and aesni gcm pmds to be conformant with nist SP800-38D.

Arek Kusztal (3):
  crypto/aesni_gcm: fix J0 padding bytes for GCM
  crypto/aesni_gcm: fix iv size in PMD capabilities
  crypto/qat: fix iv size in PMD capabilities

 drivers/crypto/aesni_gcm/aesni_gcm_pmd.c     | 4 +++-
 drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c | 4 ++--
 drivers/crypto/qat/qat_crypto.c              | 4 ++--
 3 files changed, 7 insertions(+), 5 deletions(-)

-- 
2.1.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] crypto/aesni_gcm: fix J0 padding bytes for GCM
  2016-12-23  8:10 [PATCH 0/3] Fix iv sizes in crypto drivers capabilities Arek Kusztal
@ 2016-12-23  8:10 ` Arek Kusztal
  2016-12-23  8:10 ` [PATCH 2/3] crypto/aesni_gcm: fix iv size in PMD capabilities Arek Kusztal
  2016-12-23  8:10 ` [PATCH 3/3] crypto/qat: " Arek Kusztal
  2 siblings, 0 replies; 4+ messages in thread
From: Arek Kusztal @ 2016-12-23  8:10 UTC (permalink / raw)
  To: dev
  Cc: fiona.trahe, pablo.de.lara.guarch, john.griffin, deepak.k.jain,
	declan.doherty, Arek Kusztal

This commit fixes pre-counter block (J0) padding by clearing
four most significant bytes before setting initial counter value.

Fixes: b2bb3597470c ("crypto/aesni_gcm: move pre-counter block to driver")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
index dba5e15..af3d60f 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
@@ -40,6 +40,7 @@
 #include <rte_vdev.h>
 #include <rte_malloc.h>
 #include <rte_cpuflags.h>
+#include <rte_byteorder.h>
 
 #include "aesni_gcm_pmd_private.h"
 
@@ -241,7 +242,8 @@ process_gcm_crypto_op(struct aesni_gcm_qp *qp, struct rte_crypto_sym_op *op,
 	 * to set BE LSB to 1, driver expects that 16B is allocated
 	 */
 	if (op->cipher.iv.length == 12) {
-		op->cipher.iv.data[15] = 1;
+		uint32_t *iv_padd = (uint32_t *)&op->cipher.iv.data[12];
+		*iv_padd = rte_bswap32(1);
 	}
 
 	if (op->auth.aad.length != 12 && op->auth.aad.length != 8 &&
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] crypto/aesni_gcm: fix iv size in PMD capabilities
  2016-12-23  8:10 [PATCH 0/3] Fix iv sizes in crypto drivers capabilities Arek Kusztal
  2016-12-23  8:10 ` [PATCH 1/3] crypto/aesni_gcm: fix J0 padding bytes for GCM Arek Kusztal
@ 2016-12-23  8:10 ` Arek Kusztal
  2016-12-23  8:10 ` [PATCH 3/3] crypto/qat: " Arek Kusztal
  2 siblings, 0 replies; 4+ messages in thread
From: Arek Kusztal @ 2016-12-23  8:10 UTC (permalink / raw)
  To: dev
  Cc: fiona.trahe, pablo.de.lara.guarch, john.griffin, deepak.k.jain,
	declan.doherty, Arek Kusztal

This patch sets iv size in aesni gcm PMD to 12 bytes to be
conformant with nist SP800-38D.

Fixes: eec136f3c54f ("aesni_gcm: add driver for AES-GCM crypto operations")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
index e824d4b..c51f82a 100644
--- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
+++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
@@ -77,8 +77,8 @@ static const struct rte_cryptodev_capabilities aesni_gcm_pmd_capabilities[] = {
 					.increment = 0
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.min = 12,
+					.max = 12,
 					.increment = 0
 				}
 			}, }
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] crypto/qat: fix iv size in PMD capabilities
  2016-12-23  8:10 [PATCH 0/3] Fix iv sizes in crypto drivers capabilities Arek Kusztal
  2016-12-23  8:10 ` [PATCH 1/3] crypto/aesni_gcm: fix J0 padding bytes for GCM Arek Kusztal
  2016-12-23  8:10 ` [PATCH 2/3] crypto/aesni_gcm: fix iv size in PMD capabilities Arek Kusztal
@ 2016-12-23  8:10 ` Arek Kusztal
  2 siblings, 0 replies; 4+ messages in thread
From: Arek Kusztal @ 2016-12-23  8:10 UTC (permalink / raw)
  To: dev
  Cc: fiona.trahe, pablo.de.lara.guarch, john.griffin, deepak.k.jain,
	declan.doherty, Arek Kusztal

This patch sets iv size in qat PMD to 12 bytes to be
conformant with nist SP800-38D.

Fixes: 26c2e4ad5ad4 ("cryptodev: add capabilities discovery")
---
 drivers/crypto/qat/qat_crypto.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c
index fa78c60..0b714ad 100644
--- a/drivers/crypto/qat/qat_crypto.c
+++ b/drivers/crypto/qat/qat_crypto.c
@@ -303,8 +303,8 @@ static const struct rte_cryptodev_capabilities qat_pmd_capabilities[] = {
 					.increment = 8
 				},
 				.iv_size = {
-					.min = 16,
-					.max = 16,
+					.min = 12,
+					.max = 12,
 					.increment = 0
 				}
 			}, }
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-12-23  8:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-23  8:10 [PATCH 0/3] Fix iv sizes in crypto drivers capabilities Arek Kusztal
2016-12-23  8:10 ` [PATCH 1/3] crypto/aesni_gcm: fix J0 padding bytes for GCM Arek Kusztal
2016-12-23  8:10 ` [PATCH 2/3] crypto/aesni_gcm: fix iv size in PMD capabilities Arek Kusztal
2016-12-23  8:10 ` [PATCH 3/3] crypto/qat: " Arek Kusztal

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.