crypto/virtio: support HMAC-SHA1

The AES-CBC with HMAC-SHA1 has been supported now.

Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
This commit is contained in:
Jay Zhou 2018-04-17 17:23:24 +08:00 committed by Pablo de Lara
parent 5889e1ff44
commit 8144eada32
2 changed files with 24 additions and 1 deletions

View File

@ -6,6 +6,27 @@
#define _VIRTIO_CRYPTO_CAPABILITIES_H_
#define VIRTIO_SYM_CAPABILITIES \
{ /* SHA1 HMAC */ \
.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, \
{.sym = { \
.xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, \
{.auth = { \
.algo = RTE_CRYPTO_AUTH_SHA1_HMAC, \
.block_size = 64, \
.key_size = { \
.min = 1, \
.max = 64, \
.increment = 1 \
}, \
.digest_size = { \
.min = 1, \
.max = 20, \
.increment = 1 \
}, \
.iv_size = { 0 } \
}, } \
}, } \
}, \
{ /* AES CBC */ \
.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, \
{.sym = { \

View File

@ -1196,11 +1196,13 @@ virtio_crypto_sym_pad_auth_param(
}
switch (auth_xform->algo) {
case RTE_CRYPTO_AUTH_SHA1_HMAC:
*algo = VIRTIO_CRYPTO_MAC_HMAC_SHA1;
break;
default:
VIRTIO_CRYPTO_SESSION_LOG_ERR(
"Crypto: Undefined Hash algo %u specified",
auth_xform->algo);
*algo = VIRTIO_CRYPTO_NO_MAC;
return -1;
}