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

Function softreq_copy_salt

dpdk/drivers/crypto/nitrox/nitrox_sym_reqmgr.c:675–693  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673}
674
675static int
676softreq_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
695static int
696extract_combined_digest(struct nitrox_softreq *sr, struct nitrox_sglist *digest)

Callers 1

process_combined_dataFunction · 0.85

Calls 1

memcpyFunction · 0.50

Tested by

no test coverage detected