crypto/dpaa2_sec: fix HMAC supported key sizes
authorAkhil Goyal <akhil.goyal@nxp.com>
Thu, 27 Jul 2017 11:54:08 +0000 (17:24 +0530)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Thu, 27 Jul 2017 14:24:53 +0000 (16:24 +0200)
For HMAC algorithms (MD5-HMAC, SHAx-HMAC), the supported
key sizes are not a fixed value, but a range between
1 and the block size.

Fixes: 623326dded3a ("crypto/dpaa2_sec: introduce poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h

index e104f71..3849a05 100644 (file)
@@ -200,9 +200,9 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
                                .algo = RTE_CRYPTO_AUTH_MD5_HMAC,
                                .block_size = 64,
                                .key_size = {
-                                       .min = 64,
+                                       .min = 1,
                                        .max = 64,
-                                       .increment = 0
+                                       .increment = 1
                                },
                                .digest_size = {
                                        .min = 16,
@@ -221,9 +221,9 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
                                .algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
                                .block_size = 64,
                                .key_size = {
-                                       .min = 64,
+                                       .min = 1,
                                        .max = 64,
-                                       .increment = 0
+                                       .increment = 1
                                },
                                .digest_size = {
                                        .min = 20,
@@ -242,9 +242,9 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
                                .algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
                                .block_size = 64,
                                .key_size = {
-                                       .min = 64,
+                                       .min = 1,
                                        .max = 64,
-                                       .increment = 0
+                                       .increment = 1
                                },
                                .digest_size = {
                                        .min = 28,
@@ -263,9 +263,9 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
                                .algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
                                .block_size = 64,
                                .key_size = {
-                                       .min = 64,
+                                       .min = 1,
                                        .max = 64,
-                                       .increment = 0
+                                       .increment = 1
                                },
                                .digest_size = {
                                                .min = 32,
@@ -284,9 +284,9 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
                                .algo = RTE_CRYPTO_AUTH_SHA384_HMAC,
                                .block_size = 128,
                                .key_size = {
-                                       .min = 128,
+                                       .min = 1,
                                        .max = 128,
-                                       .increment = 0
+                                       .increment = 1
                                },
                                .digest_size = {
                                        .min = 48,
@@ -305,9 +305,9 @@ static const struct rte_cryptodev_capabilities dpaa2_sec_capabilities[] = {
                                .algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
                                .block_size = 128,
                                .key_size = {
-                                       .min = 128,
+                                       .min = 1,
                                        .max = 128,
-                                       .increment = 0
+                                       .increment = 1
                                },
                                .digest_size = {
                                        .min = 64,