| 494 | |
| 495 | |
| 496 | static inline uint32_t |
| 497 | outb_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 | |
| 532 | static uint16_t |
| 533 | cpu_outb_pkt_prepare(const struct rte_ipsec_session *ss, |
no test coverage detected