aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto/ccree/cc_aead.h
diff options
context:
space:
mode:
authorGilad Ben-Yossef <gilad@benyossef.com>2020-03-08 17:57:09 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2020-03-12 23:00:16 +1100
commit0eae14a067c5b2596c5a1049561cbc86b990c7ce (patch)
treec9b3dc666ab2d371b31830089c292d191cc5729b /drivers/crypto/ccree/cc_aead.h
parentcrypto: ccree - use crypto_ipsec_check_assoclen() (diff)
downloadlinux-dev-0eae14a067c5b2596c5a1049561cbc86b990c7ce.tar.xz
linux-dev-0eae14a067c5b2596c5a1049561cbc86b990c7ce.zip
crypto: ccree - refactor AEAD IV in AAD handling
Our handling of ciphers with IV trailing the AAD was correct but overly complicated. Refactor to simplify and possibly save one DMA burst. This has the added bonus of behaving the same as the generic rfc4543 implementation for none compliants inputs where the IV in the iv field was not the same as the IV in the AAD. There should be no change in behaviour with correct inputs. Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ccree/cc_aead.h')
-rw-r--r--drivers/crypto/ccree/cc_aead.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/crypto/ccree/cc_aead.h b/drivers/crypto/ccree/cc_aead.h
index f12169b57f9d..b69591550730 100644
--- a/drivers/crypto/ccree/cc_aead.h
+++ b/drivers/crypto/ccree/cc_aead.h
@@ -66,7 +66,7 @@ struct aead_req_ctx {
/* used to prevent cache coherence problem */
u8 backup_mac[MAX_MAC_SIZE];
u8 *backup_iv; /* store orig iv */
- u32 assoclen; /* internal assoclen */
+ u32 assoclen; /* size of AAD buffer to authenticate */
dma_addr_t mac_buf_dma_addr; /* internal ICV DMA buffer */
/* buffer for internal ccm configurations */
dma_addr_t ccm_iv0_dma_addr;
@@ -79,7 +79,6 @@ struct aead_req_ctx {
dma_addr_t gcm_iv_inc2_dma_addr;
dma_addr_t hkey_dma_addr; /* Phys. address of hkey */
dma_addr_t gcm_block_len_dma_addr; /* Phys. address of gcm block len */
- bool is_gcm4543;
u8 *icv_virt_addr; /* Virt. address of ICV */
struct async_gen_req_ctx gen_ctx;