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

Function common_capability_set

dpdk/app/test/test_cryptodev_crosscheck.c:264–315  ·  view source on GitHub ↗

Set the biggest common range for all capability fields */

Source from the content-addressed store, hash-verified

262
263/* Set the biggest common range for all capability fields */
264static int
265common_capability_set(struct rte_cryptodev_symmetric_capability *dst,
266 const struct rte_cryptodev_symmetric_capability *src)
267{
268 switch (src->xform_type) {
269 case RTE_CRYPTO_SYM_XFORM_AUTH:
270 if (dst->auth.algo != src->auth.algo)
271 return -ENOENT;
272 if (dst->auth.block_size != src->auth.block_size)
273 return -ENOENT;
274 if (common_range_set(&dst->auth.key_size, &src->auth.key_size))
275 return -ENOENT;
276 if (common_range_set(&dst->auth.digest_size, &src->auth.digest_size))
277 return -ENOENT;
278 if (common_range_set(&dst->auth.aad_size, &src->auth.aad_size))
279 return -ENOENT;
280 if (common_range_set(&dst->auth.iv_size, &src->auth.iv_size))
281 return -ENOENT;
282 break;
283 case RTE_CRYPTO_SYM_XFORM_CIPHER:
284 if (dst->cipher.algo != src->cipher.algo)
285 return -ENOENT;
286 if (dst->cipher.block_size != src->cipher.block_size)
287 return -ENOENT;
288 if (common_range_set(&dst->cipher.key_size, &src->cipher.key_size))
289 return -ENOENT;
290 if (common_range_set(&dst->cipher.iv_size, &src->cipher.iv_size))
291 return -ENOENT;
292 if (dst->cipher.dataunit_set != src->cipher.dataunit_set)
293 return -ENOENT;
294 break;
295 case RTE_CRYPTO_SYM_XFORM_AEAD:
296 if (dst->aead.algo != src->aead.algo)
297 return -ENOENT;
298 if (dst->aead.block_size != src->aead.block_size)
299 return -ENOENT;
300 if (common_range_set(&dst->aead.key_size, &src->aead.key_size))
301 return -ENOENT;
302 if (common_range_set(&dst->aead.digest_size, &src->aead.digest_size))
303 return -ENOENT;
304 if (common_range_set(&dst->aead.aad_size, &src->aead.aad_size))
305 return -ENOENT;
306 if (common_range_set(&dst->aead.iv_size, &src->aead.iv_size))
307 return -ENOENT;
308 break;
309 default:
310 RTE_LOG(ERR, USER1, "Unsupported xform_type!\n");
311 return -ENOENT;
312 }
313
314 return 0;
315}
316
317static int
318capabilities_inspect(void)

Callers 1

capabilities_inspectFunction · 0.85

Calls 1

common_range_setFunction · 0.85

Tested by

no test coverage detected