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

Function ccp_do_ghash_final

freebsd/crypto/ccp/ccp_hardware.c:1797–1828  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1795}
1796
1797static int __must_check
1798ccp_do_ghash_final(struct ccp_queue *qp, struct ccp_session *s)
1799{
1800 struct ccp_desc *desc;
1801
1802 if (ccp_queue_get_ring_space(qp) == 0)
1803 return (EAGAIN);
1804
1805 desc = &qp->desc_ring[qp->cq_tail];
1806
1807 desc->engine = CCP_ENGINE_AES;
1808 desc->aes.mode = CCP_AES_MODE_GHASH;
1809 desc->aes.type = s->blkcipher.cipher_type;
1810 desc->aes.encrypt = CCP_AES_MODE_GHASH_FINAL;
1811
1812 desc->length = GMAC_BLOCK_LEN;
1813
1814 desc->src_lo = ccp_queue_lsb_address(qp, LSB_ENTRY_GHASH_IN);
1815 desc->src_mem = CCP_MEMTYPE_SB;
1816
1817 desc->lsb_ctx_id = ccp_queue_lsb_entry(qp, LSB_ENTRY_IV);
1818
1819 desc->key_lo = ccp_queue_lsb_address(qp, LSB_ENTRY_KEY);
1820 desc->key_mem = CCP_MEMTYPE_SB;
1821
1822 desc->dst_lo = ccp_queue_lsb_address(qp, LSB_ENTRY_GHASH);
1823 desc->dst_mem = CCP_MEMTYPE_SB;
1824
1825 qp->cq_tail = (qp->cq_tail + 1) %
1826 (1 << qp->cq_softc->ring_size_order);
1827 return (0);
1828}
1829
1830static void
1831ccp_gcm_done(struct ccp_queue *qp, struct ccp_session *s, void *vcrp,

Callers 1

ccp_gcmFunction · 0.85

Calls 3

ccp_queue_get_ring_spaceFunction · 0.85
ccp_queue_lsb_addressFunction · 0.85
ccp_queue_lsb_entryFunction · 0.85

Tested by

no test coverage detected