aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBalakrishna Garapati <balakrishna.garapati@linaro.org>2017-07-13 14:13:28 +0200
committerBalakrishna Garapati <balakrishna.garapati@linaro.org>2017-07-26 08:42:42 +0200
commit48ad99f7b4acca7577a17e259f1489cf4c7816d9 (patch)
tree0b052bf47fb5d452de1d61780ed132608ced8fd5
parentc2c3ed55057e1a8032da4cff3ef0b61d38b33d58 (diff)
downloadodp-dpdk-48ad99f7b4acca7577a17e259f1489cf4c7816d9.tar.gz
linux-dpdk:porting "crypto: add SHA-1 authentication support"
Signed-off-by: Balakrishna Garapati <balakrishna.garapati@linaro.org> Reviewed-and-tested-by: Matias Elo <matias.elo@nokia.com>
-rw-r--r--platform/linux-dpdk/odp_crypto.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/platform/linux-dpdk/odp_crypto.c b/platform/linux-dpdk/odp_crypto.c
index 443314a3..a869262b 100644
--- a/platform/linux-dpdk/odp_crypto.c
+++ b/platform/linux-dpdk/odp_crypto.c
@@ -136,6 +136,10 @@ static int auth_alg_odp_to_rte(odp_auth_alg_t auth_alg,
auth_xform->auth.algo = RTE_CRYPTO_AUTH_SHA256_HMAC;
auth_xform->auth.digest_length = 16;
break;
+ case ODP_AUTH_ALG_SHA1_HMAC:
+ auth_xform->auth.algo = RTE_CRYPTO_AUTH_SHA1_HMAC;
+ auth_xform->auth.digest_length = 20;
+ break;
case ODP_AUTH_ALG_AES_GCM:
#if ODP_DEPRECATED_API
case ODP_AUTH_ALG_AES128_GCM:
@@ -400,6 +404,10 @@ int odp_crypto_capability(odp_crypto_capability_t *capability)
hw_auths->bit.sha256_128 = 1;
#endif
}
+ if (cap_auth_algo ==
+ RTE_CRYPTO_AUTH_SHA1_HMAC) {
+ hw_auths->bit.sha1_hmac = 1;
+ }
}
cap = &dev_info.capabilities[++i];
}
@@ -467,6 +475,10 @@ int odp_crypto_capability(odp_crypto_capability_t *capability)
auths->bit.sha256_128 = 1;
#endif
}
+ if (cap_auth_algo ==
+ RTE_CRYPTO_AUTH_SHA1_HMAC) {
+ auths->bit.sha1_hmac = 1;
+ }
}
cap = &dev_info.capabilities[++i];
}
@@ -564,7 +576,7 @@ int odp_crypto_cipher_capability(odp_cipher_alg_t cipher,
int odp_crypto_auth_capability(odp_auth_alg_t auth,
odp_crypto_auth_capability_t dst[],
- int num_copy)
+ int num_copy)
{
odp_crypto_auth_capability_t src[num_copy];
int idx = 0, rc = 0;