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

Function process_combined_data

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

Source from the content-addressed store, hash-verified

722}
723
724static int
725process_combined_data(struct nitrox_softreq *sr)
726{
727 int err;
728 struct nitrox_sglist digest;
729 struct rte_crypto_op *op = sr->op;
730
731 if (sr->ctx->aead_algo == RTE_CRYPTO_AEAD_AES_GCM) {
732 err = softreq_copy_salt(sr);
733 if (unlikely(err))
734 return err;
735
736 softreq_copy_iv(sr, AES_GCM_SALT_SIZE);
737 } else if (sr->ctx->aead_algo == RTE_CRYPTO_AEAD_AES_CCM) {
738 union {
739 uint8_t value;
740 struct {
741#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
742 uint8_t rsvd: 1;
743 uint8_t adata: 1;
744 uint8_t mstar: 3;
745 uint8_t lstar: 3;
746#else
747 uint8_t lstar: 3;
748 uint8_t mstar: 3;
749 uint8_t adata: 1;
750 uint8_t rsvd: 1;
751#endif
752 };
753 } flags;
754 uint8_t L;
755 uint8_t *iv_addr;
756
757 flags.value = 0;
758 flags.rsvd = 0;
759 flags.adata = (sr->ctx->aad_length > 0) ? 1 : 0;
760 flags.mstar = (sr->ctx->digest_length - 2) / 2;
761 L = 15 - sr->ctx->iv.length;
762 flags.lstar = L - 1;
763 iv_addr = rte_crypto_op_ctod_offset(sr->op, uint8_t *,
764 sr->ctx->iv.offset);
765 /* initialize IV flags */
766 iv_addr[0] = flags.value;
767 /* initialize IV counter to 0 */
768 memset(&iv_addr[1] + sr->ctx->iv.length, 0, L);
769 sr->iv.virt = rte_crypto_op_ctod_offset(sr->op, uint8_t *,
770 sr->ctx->iv.offset);
771 sr->iv.iova = rte_crypto_op_ctophys_offset(sr->op,
772 sr->ctx->iv.offset);
773 sr->iv.len = 16;
774 } else {
775 return -EINVAL;
776 }
777
778 err = extract_combined_digest(sr, &digest);
779 if (unlikely(err))
780 return err;
781

Callers 1

process_softreqFunction · 0.85

Calls 7

softreq_copy_saltFunction · 0.85
softreq_copy_ivFunction · 0.85
memsetFunction · 0.85
extract_combined_digestFunction · 0.85
create_aead_inbufFunction · 0.85
create_aead_outbufFunction · 0.85
create_aead_gphFunction · 0.85

Tested by

no test coverage detected