MCPcopy Create free account
hub / github.com/F-Stack/f-stack / check_cryptodev_capability

Function check_cryptodev_capability

dpdk/app/test/test_ipsec.c:248–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246}
247
248static int
249check_cryptodev_capability(const struct ipsec_unitest_params *ut,
250 uint8_t dev_id)
251{
252 struct rte_cryptodev_sym_capability_idx cap_idx;
253 const struct rte_cryptodev_symmetric_capability *cap;
254 int rc = -1;
255
256 cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
257 cap_idx.algo.auth = ut->auth_xform.auth.algo;
258 cap = rte_cryptodev_sym_capability_get(dev_id, &cap_idx);
259
260 if (cap != NULL) {
261 rc = rte_cryptodev_sym_capability_check_auth(cap,
262 ut->auth_xform.auth.key.length,
263 ut->auth_xform.auth.digest_length, 0);
264 if (rc == 0) {
265 cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
266 cap_idx.algo.cipher = ut->cipher_xform.cipher.algo;
267 cap = rte_cryptodev_sym_capability_get(
268 dev_id, &cap_idx);
269 if (cap != NULL)
270 rc = rte_cryptodev_sym_capability_check_cipher(
271 cap,
272 ut->cipher_xform.cipher.key.length,
273 ut->cipher_xform.cipher.iv.length);
274 }
275 }
276
277 return rc;
278}
279
280static int
281testsuite_setup(void)

Callers 1

testsuite_setupFunction · 0.85

Tested by

no test coverage detected