| 673 | } |
| 674 | |
| 675 | static int |
| 676 | softreq_copy_salt(struct nitrox_softreq *sr) |
| 677 | { |
| 678 | struct nitrox_crypto_ctx *ctx = sr->ctx; |
| 679 | uint8_t *addr; |
| 680 | |
| 681 | if (unlikely(ctx->iv.length < AES_GCM_SALT_SIZE)) { |
| 682 | NITROX_LOG(ERR, "Invalid IV length %d\n", ctx->iv.length); |
| 683 | return -EINVAL; |
| 684 | } |
| 685 | |
| 686 | addr = rte_crypto_op_ctod_offset(sr->op, uint8_t *, ctx->iv.offset); |
| 687 | if (!memcmp(ctx->salt, addr, AES_GCM_SALT_SIZE)) |
| 688 | return 0; |
| 689 | |
| 690 | memcpy(ctx->salt, addr, AES_GCM_SALT_SIZE); |
| 691 | memcpy(ctx->fctx.crypto.iv, addr, AES_GCM_SALT_SIZE); |
| 692 | return 0; |
| 693 | } |
| 694 | |
| 695 | static int |
| 696 | extract_combined_digest(struct nitrox_softreq *sr, struct nitrox_sglist *digest) |
no test coverage detected