| 486 | } |
| 487 | |
| 488 | static void |
| 489 | process_cpu_crypt_auth_op(uint8_t dev_id, struct rte_crypto_op *op) |
| 490 | { |
| 491 | int32_t n, st; |
| 492 | struct rte_crypto_sym_op *sop; |
| 493 | union rte_crypto_sym_ofs ofs; |
| 494 | struct rte_crypto_sgl sgl; |
| 495 | struct rte_crypto_sym_vec symvec; |
| 496 | struct rte_crypto_va_iova_ptr iv_ptr, digest_ptr; |
| 497 | struct rte_crypto_vec vec[UINT8_MAX]; |
| 498 | |
| 499 | sop = op->sym; |
| 500 | |
| 501 | n = rte_crypto_mbuf_to_vec(sop->m_src, sop->auth.data.offset, |
| 502 | sop->auth.data.length, vec, RTE_DIM(vec)); |
| 503 | |
| 504 | if (n < 0 || n != sop->m_src->nb_segs) { |
| 505 | op->status = RTE_CRYPTO_OP_STATUS_ERROR; |
| 506 | return; |
| 507 | } |
| 508 | |
| 509 | sgl.vec = vec; |
| 510 | sgl.num = n; |
| 511 | symvec.src_sgl = &sgl; |
| 512 | symvec.iv = &iv_ptr; |
| 513 | symvec.digest = &digest_ptr; |
| 514 | symvec.status = &st; |
| 515 | symvec.num = 1; |
| 516 | |
| 517 | iv_ptr.va = rte_crypto_op_ctod_offset(op, void *, IV_OFFSET); |
| 518 | digest_ptr.va = (void *)sop->auth.digest.data; |
| 519 | |
| 520 | ofs.raw = 0; |
| 521 | ofs.ofs.cipher.head = sop->cipher.data.offset - sop->auth.data.offset; |
| 522 | ofs.ofs.cipher.tail = (sop->auth.data.offset + sop->auth.data.length) - |
| 523 | (sop->cipher.data.offset + sop->cipher.data.length); |
| 524 | |
| 525 | n = rte_cryptodev_sym_cpu_crypto_process(dev_id, sop->session, ofs, |
| 526 | &symvec); |
| 527 | |
| 528 | if (n != 1) |
| 529 | op->status = RTE_CRYPTO_OP_STATUS_AUTH_FAILED; |
| 530 | else |
| 531 | op->status = RTE_CRYPTO_OP_STATUS_SUCCESS; |
| 532 | } |
| 533 | |
| 534 | static struct rte_crypto_op * |
| 535 | process_crypto_request(uint8_t dev_id, struct rte_crypto_op *op) |
no test coverage detected