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

Function outb_cpu_crypto_prepare

dpdk/lib/ipsec/esp_outb.c:496–530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

494
495
496static inline uint32_t
497outb_cpu_crypto_prepare(const struct rte_ipsec_sa *sa, uint32_t *pofs,
498 uint32_t plen, void *iv)
499{
500 uint64_t *ivp = iv;
501 struct aead_gcm_iv *gcm;
502 struct aead_ccm_iv *ccm;
503 struct aead_chacha20_poly1305_iv *chacha20_poly1305;
504 struct aesctr_cnt_blk *ctr;
505 uint32_t clen;
506
507 switch (sa->algo_type) {
508 case ALGO_TYPE_AES_GCM:
509 gcm = iv;
510 aead_gcm_iv_fill(gcm, ivp[0], sa->salt);
511 break;
512 case ALGO_TYPE_AES_CCM:
513 ccm = iv;
514 aead_ccm_iv_fill(ccm, ivp[0], sa->salt);
515 break;
516 case ALGO_TYPE_CHACHA20_POLY1305:
517 chacha20_poly1305 = iv;
518 aead_chacha20_poly1305_iv_fill(chacha20_poly1305,
519 ivp[0], sa->salt);
520 break;
521 case ALGO_TYPE_AES_CTR:
522 ctr = iv;
523 aes_ctr_cnt_blk_fill(ctr, ivp[0], sa->salt);
524 break;
525 }
526
527 *pofs += sa->ctp.auth.offset;
528 clen = plen + sa->ctp.auth.length;
529 return clen;
530}
531
532static uint16_t
533cpu_outb_pkt_prepare(const struct rte_ipsec_session *ss,

Callers 1

cpu_outb_pkt_prepareFunction · 0.85

Calls 4

aead_gcm_iv_fillFunction · 0.85
aead_ccm_iv_fillFunction · 0.85
aes_ctr_cnt_blk_fillFunction · 0.85

Tested by

no test coverage detected