crypto/qat: fix HMAC supported key sizes
authorPablo de Lara <pablo.de.lara.guarch@intel.com>
Tue, 25 Jul 2017 05:24:57 +0000 (06:24 +0100)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Thu, 27 Jul 2017 14:43:27 +0000 (16:43 +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: 26c2e4ad5ad4 ("cryptodev: add capabilities discovery")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
drivers/crypto/qat/qat_crypto_capabilities.h

index 567e1ac..07da911 100644 (file)
@@ -43,9 +43,9 @@
                                .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,                      \
@@ -64,9 +64,9 @@
                                .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,                      \
@@ -85,9 +85,9 @@
                                .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,                      \
                                .algo = RTE_CRYPTO_AUTH_SHA384_HMAC,    \
                                .block_size = 64,                       \
                                .key_size = {                           \
-                                       .min = 128,                     \
+                                       .min = 1,                       \
                                        .max = 128,                     \
-                                       .increment = 0                  \
+                                       .increment = 1                  \
                                },                                      \
                                .digest_size = {                        \
                                        .min = 48,                      \
                                .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,                      \
                                .algo = RTE_CRYPTO_AUTH_MD5_HMAC,       \
                                .block_size = 64,                       \
                                .key_size = {                           \
-                                       .min = 8,                       \
+                                       .min = 1,                       \
                                        .max = 64,                      \
-                                       .increment = 8                  \
+                                       .increment = 1                  \
                                },                                      \
                                .digest_size = {                        \
                                        .min = 16,                      \