[v1,2/3] crypto/ipsec_mb: add HMAC SM3 algorithm support
Checks
Commit Message
This patch introduces HMAC SM3 algorithm support to the AESNI_MB PMD.
Signed-off-by: Brian Dooley <brian.dooley@intel.com>
---
drivers/crypto/ipsec_mb/pmd_aesni_mb.c | 3 +++
drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h | 24 ++++++++++++++++++++-
2 files changed, 26 insertions(+), 1 deletion(-)
@@ -381,6 +381,9 @@ aesni_mb_set_session_auth_parameters(IMB_MGR *mb_mgr,
case RTE_CRYPTO_AUTH_SM3:
sess->template_job.hash_alg = IMB_AUTH_SM3;
break;
+ case RTE_CRYPTO_AUTH_SM3_HMAC:
+ sess->template_job.hash_alg = IMB_AUTH_HMAC_SM3;
+ break;
#endif
default:
IPSEC_MB_LOG(ERR,
@@ -753,6 +753,27 @@ static const struct rte_cryptodev_capabilities aesni_mb_capabilities[] = {
}, }
}, }
},
+ { /* HMAC SM3 */
+ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+ {.sym = {
+ .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
+ {.auth = {
+ .algo = RTE_CRYPTO_AUTH_SM3_HMAC,
+ .block_size = 64,
+ .key_size = {
+ .min = 1,
+ .max = 65535,
+ .increment = 1
+ },
+ .digest_size = {
+ .min = 32,
+ .max = 32,
+ .increment = 1
+ },
+ .iv_size = { 0 }
+ }, }
+ }, }
+ },
RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
};
@@ -863,7 +884,8 @@ static const unsigned int auth_digest_byte_lengths[] = {
[IMB_AUTH_SNOW3G_UIA2_BITLEN] = 4,
[IMB_AUTH_KASUMI_UIA1] = 4,
#if IMB_VERSION(1, 5, 0) <= IMB_VERSION_NUM
- [IMB_AUTH_SM3] = 32
+ [IMB_AUTH_SM3] = 32,
+ [IMB_AUTH_HMAC_SM3] = 32,
#endif
/**< Vector mode dependent pointer table of the multi-buffer APIs */