[3/6] crypto/mvsam: add support for HMAC SHA224

Message ID 1535118895-6505-4-git-send-email-tdu@semihalf.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series crypto/mvsam: add new features and fixes |

Checks

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

Commit Message

Tomasz Duszynski Aug. 24, 2018, 1:54 p.m. UTC
  Add support for the HMAC SHA224 authentication algorithm.

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

Comments

Akhil Goyal Sept. 17, 2018, 1:57 p.m. UTC | #1
Hi Tomasz,

On 8/24/2018 7:24 PM, Tomasz Duszynski wrote:
> Add support for the HMAC SHA224 authentication algorithm.
>
> Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
> Reviewed-by: Natalie Samsonov <nsamsono@marvell.com>
> ---
>   drivers/crypto/mvsam/rte_mrvl_pmd.c     |  3 +++
>   drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 21 +++++++++++++++++++++
>   2 files changed, 24 insertions(+)
>
> diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd.c b/drivers/crypto/mvsam/rte_mrvl_pmd.c
> index 9d130b1..5ef4139 100644
> --- a/drivers/crypto/mvsam/rte_mrvl_pmd.c
> +++ b/drivers/crypto/mvsam/rte_mrvl_pmd.c
> @@ -113,6 +113,9 @@ struct auth_params_mapping auth_map[RTE_CRYPTO_AUTH_LIST_END] = {
>   	[RTE_CRYPTO_AUTH_SHA1] = {
>   		.supported = ALGO_SUPPORTED,
>   		.auth_alg = SAM_AUTH_HASH_SHA1 },
> +	[RTE_CRYPTO_AUTH_SHA224_HMAC] = {
> +		.supported = ALGO_SUPPORTED,
> +		.auth_alg = SAM_AUTH_HMAC_SHA2_224 },
>   	[RTE_CRYPTO_AUTH_SHA224] = {
>   		.supported = ALGO_SUPPORTED,
>   		.auth_alg = SAM_AUTH_HASH_SHA2_224 },
> diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
> index e2cfc07..d253b8f 100644
> --- a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
> +++ b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
> @@ -97,6 +97,27 @@ static const struct rte_cryptodev_capabilities
>   			}, }
>   		}, }
>   	},
> +	{
> +		/* SHA224 HMAC */
> +		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
> +		{.sym = {
> +			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
> +			{.auth = {
> +				.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
> +				.block_size = 64,
> +				.key_size = {
> +					.min = 1,
> +					.max = 64,
> +					.increment = 1
> +				},
> +				.digest_size = {
> +					.min = 28,
> +					.max = 28,
> +					.increment = 0
> +				},
> +			}, }
> +		}, }
> +	},
>   	{	/* SHA224 */
>   		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
>   		{.sym = {
doc shall also be updated for each of the new algorithm supported.

Also please rephrase the subject as
crypto/mvsam: support for HMAC SHA224

Please change the subject for other patches as well.

Thanks,
Akhil
  
Andrzej Ostruszka Sept. 21, 2018, 2:49 p.m. UTC | #2
On 17.09.2018 15:57, Akhil Goyal wrote:
> Hi Tomasz,
> 
> On 8/24/2018 7:24 PM, Tomasz Duszynski wrote:
>> Add support for the HMAC SHA224 authentication algorithm.
[...]
>>   	{	/* SHA224 */
>>   		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
>>   		{.sym = {
> doc shall also be updated for each of the new algorithm supported.

Doc is updated in pending patch:
http://patches.dpdk.org/patch/44253/

> Also please rephrase the subject as
> crypto/mvsam: support for HMAC SHA224
> 
> Please change the subject for other patches as well.

Changed.
  

Patch

diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd.c b/drivers/crypto/mvsam/rte_mrvl_pmd.c
index 9d130b1..5ef4139 100644
--- a/drivers/crypto/mvsam/rte_mrvl_pmd.c
+++ b/drivers/crypto/mvsam/rte_mrvl_pmd.c
@@ -113,6 +113,9 @@  struct auth_params_mapping auth_map[RTE_CRYPTO_AUTH_LIST_END] = {
 	[RTE_CRYPTO_AUTH_SHA1] = {
 		.supported = ALGO_SUPPORTED,
 		.auth_alg = SAM_AUTH_HASH_SHA1 },
+	[RTE_CRYPTO_AUTH_SHA224_HMAC] = {
+		.supported = ALGO_SUPPORTED,
+		.auth_alg = SAM_AUTH_HMAC_SHA2_224 },
 	[RTE_CRYPTO_AUTH_SHA224] = {
 		.supported = ALGO_SUPPORTED,
 		.auth_alg = SAM_AUTH_HASH_SHA2_224 },
diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
index e2cfc07..d253b8f 100644
--- a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
+++ b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
@@ -97,6 +97,27 @@  static const struct rte_cryptodev_capabilities
 			}, }
 		}, }
 	},
+	{
+		/* SHA224 HMAC */
+		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+		{.sym = {
+			.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+			{.auth = {
+				.algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
+				.block_size = 64,
+				.key_size = {
+					.min = 1,
+					.max = 64,
+					.increment = 1
+				},
+				.digest_size = {
+					.min = 28,
+					.max = 28,
+					.increment = 0
+				},
+			}, }
+		}, }
+	},
 	{	/* SHA224 */
 		.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
 		{.sym = {