crypto/aesni_mb: support AES-CCM-256
authorPablo de Lara <pablo.de.lara.guarch@intel.com>
Fri, 9 Oct 2020 12:18:59 +0000 (12:18 +0000)
committerAkhil Goyal <akhil.goyal@nxp.com>
Wed, 14 Oct 2020 20:22:06 +0000 (22:22 +0200)
This patch adds support for AES-CCM-256 when using AESNI-MB

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
doc/guides/cryptodevs/features/aesni_mb.ini
doc/guides/rel_notes/release_20_11.rst
drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c

index 78d2dbd..1883217 100644 (file)
@@ -65,6 +65,7 @@ KASUMI F9    = Y
 ;
 [AEAD]
 AES CCM (128)     = Y
+AES CCM (256)     = Y
 AES GCM (128)     = Y
 AES GCM (192)     = Y
 AES GCM (256)     = Y
index 097b255..c07eadc 100644 (file)
@@ -159,6 +159,7 @@ New Features
   * Added support for SNOW3G-UEA2/UIA2 algorithms.
   * Added support for KASUMI-F8/F9 algorithms.
   * Added support for Chacha20-Poly1305.
+  * Added support for AES-256 CCM algorithm.
 
 * **Updated the aesni_gcm crypto PMD.**
 
index 42c2320..db09109 100644 (file)
@@ -686,6 +686,12 @@ aesni_mb_set_session_aead_parameters(const MB_MGR *mb_mgr,
                                        sess->cipher.expanded_aes_keys.encode,
                                        sess->cipher.expanded_aes_keys.decode);
                        break;
+               case AES_256_BYTES:
+                       sess->cipher.key_length_in_bytes = AES_256_BYTES;
+                       IMB_AES_KEYEXP_256(mb_mgr, xform->aead.key.data,
+                                       sess->cipher.expanded_aes_keys.encode,
+                                       sess->cipher.expanded_aes_keys.decode);
+                       break;
                default:
                        AESNI_MB_LOG(ERR, "Invalid cipher key length");
                        return -EINVAL;
index 81d3332..fc7fdfe 100644 (file)
@@ -400,8 +400,13 @@ static const struct rte_cryptodev_capabilities aesni_mb_pmd_capabilities[] = {
                                .block_size = 16,
                                .key_size = {
                                        .min = 16,
+#if IMB_VERSION(0, 54, 2) <= IMB_VERSION_NUM
+                                       .max = 32,
+                                       .increment = 16
+#else
                                        .max = 16,
                                        .increment = 0
+#endif
                                },
                                .digest_size = {
                                        .min = 4,