[4/6] crypto/mvsam: add support for AES ECB

Message ID 1535118895-6505-5-git-send-email-tdu@semihalf.com
State Superseded, archived
Delegated to: akhil goyal
Headers show
Series
  • crypto/mvsam: add new features and fixes
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Tomasz Duszynski Aug. 24, 2018, 1:54 p.m.
Add support for AES128/192/256 in ECB mode.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Reviewed-by: Natalie Samsonov <nsamsono@marvell.com>
---
 drivers/crypto/mvsam/rte_mrvl_pmd.c     |  5 +++++
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 20 ++++++++++++++++++++
 2 files changed, 25 insertions(+)

Comments

Akhil Goyal Sept. 17, 2018, 1:59 p.m. | #1
On 8/24/2018 7:24 PM, Tomasz Duszynski wrote:
> Add support for AES128/192/256 in ECB mode.
>
> Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
> Reviewed-by: Natalie Samsonov <nsamsono@marvell.com>
> ---
>   drivers/crypto/mvsam/rte_mrvl_pmd.c     |  5 +++++
>   drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 20 ++++++++++++++++++++
>   2 files changed, 25 insertions(+)
>
> diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd.c b/drivers/crypto/mvsam/rte_mrvl_pmd.c
> index 5ef4139..08d4a23 100644
> --- a/drivers/crypto/mvsam/rte_mrvl_pmd.c
> +++ b/drivers/crypto/mvsam/rte_mrvl_pmd.c
> @@ -94,6 +94,11 @@ struct cipher_params_mapping cipher_map[RTE_CRYPTO_CIPHER_LIST_END] = {
>   		.cipher_alg = SAM_CIPHER_AES,
>   		.cipher_mode = SAM_CIPHER_CTR,
>   		.max_key_len = BITS2BYTES(256) },
> +	[RTE_CRYPTO_CIPHER_AES_ECB] = {
> +		.supported = ALGO_SUPPORTED,
> +		.cipher_alg = SAM_CIPHER_AES,
> +		.cipher_mode = SAM_CIPHER_ECB,
> +		.max_key_len = BITS2BYTES(256) },
>   };
>   
>   /**
> diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
> index d253b8f..3d3bbf1 100644
> --- a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
> +++ b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
> @@ -298,6 +298,26 @@ static const struct rte_cryptodev_capabilities
>   			}, }
>   		}, }
>   	},
> +	{	/* AES ECB */
> +		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
> +		{.sym = {
> +			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
> +			{.cipher = {
> +				.algo = RTE_CRYPTO_CIPHER_AES_ECB,
> +				.block_size = 16,
> +				.key_size = {
> +					.min = 16,
> +					.max = 32,
> +					.increment = 8
> +				},
> +				.iv_size = {
> +					.min = 0,
> +					.max = 0,
> +					.increment = 0
> +				}
iv size may not be zero in this case and also in other patch for 3des. 
Please check
> +			}, }
> +		}, }
> +	},
>   	{	/* AES GCM */
>   		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
>   		{.sym = {
Andrzej Ostruszka Sept. 21, 2018, 2:46 p.m. | #2
Akhil

This is ECB mode so AFAIU there is no need for IV as this is not feed
forward/back type of algo and there is nothing extra needed by the first
block (same thing in ccp driver).

I'm leaving this as it is (same for 3DES).

On 17.09.2018 15:59, Akhil Goyal wrote:
> On 8/24/2018 7:24 PM, Tomasz Duszynski wrote:
[...]
>> +	[RTE_CRYPTO_CIPHER_AES_ECB] = {
[...]
>> +				.algo = RTE_CRYPTO_CIPHER_AES_ECB,
>> +				.block_size = 16,
[...]
>> +				.iv_size = {
>> +					.min = 0,
>> +					.max = 0,
>> +					.increment = 0
>> +				}
> iv size may not be zero in this case and also in other patch for 3des. 
> Please check

Patch

diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd.c b/drivers/crypto/mvsam/rte_mrvl_pmd.c
index 5ef4139..08d4a23 100644
--- a/drivers/crypto/mvsam/rte_mrvl_pmd.c
+++ b/drivers/crypto/mvsam/rte_mrvl_pmd.c
@@ -94,6 +94,11 @@  struct cipher_params_mapping cipher_map[RTE_CRYPTO_CIPHER_LIST_END] = {
 		.cipher_alg = SAM_CIPHER_AES,
 		.cipher_mode = SAM_CIPHER_CTR,
 		.max_key_len = BITS2BYTES(256) },
+	[RTE_CRYPTO_CIPHER_AES_ECB] = {
+		.supported = ALGO_SUPPORTED,
+		.cipher_alg = SAM_CIPHER_AES,
+		.cipher_mode = SAM_CIPHER_ECB,
+		.max_key_len = BITS2BYTES(256) },
 };
 
 /**
diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
index d253b8f..3d3bbf1 100644
--- a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
+++ b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
@@ -298,6 +298,26 @@  static const struct rte_cryptodev_capabilities
 			}, }
 		}, }
 	},
+	{	/* AES ECB */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+		{.sym = {
+			.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
+			{.cipher = {
+				.algo = RTE_CRYPTO_CIPHER_AES_ECB,
+				.block_size = 16,
+				.key_size = {
+					.min = 16,
+					.max = 32,
+					.increment = 8
+				},
+				.iv_size = {
+					.min = 0,
+					.max = 0,
+					.increment = 0
+				}
+			}, }
+		}, }
+	},
 	{	/* AES GCM */
 		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
 		{.sym = {