mirror_zfs/module/icp/algs/modes
Attila Fülöp 8d9752569b
ICP: AES-GCM: Unify gcm_init_ctx() and gmac_init_ctx()
gmac_init_ctx() duplicates most of the code in gcm_int_ctx() while
it just needs to set its own IV length and AAD tag length.

Introduce gcm_init_ctx_impl() which handles the GCM and GMAC
differences while reusing the duplicated code.

While here, fix a flaw where the AVX implementation would accept a
context using a byte swapped key schedule which it could not
handle. Also constify the IV and AAD pointers passed to
gcm_init{,_avx}().

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rob Norris <robn@despairlabs.com>
Signed-off-by: Attila Fülöp <attila@fueloep.org>
Closes #14529
2023-03-08 11:12:15 -08:00
..
cbc.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
ccm.c Cleanup: Use MIN() macro 2023-01-12 16:00:23 -08:00
ctr.c Cleanup: Address Clang's static analyzer's unused code complaints 2022-10-14 13:37:54 -07:00
ecb.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
gcm_generic.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
gcm_pclmulqdq.c Unify Assembler files between Linux and Windows 2023-01-17 11:09:19 -08:00
gcm.c ICP: AES-GCM: Unify gcm_init_ctx() and gmac_init_ctx() 2023-03-08 11:12:15 -08:00
modes.c icp: Prevent compilers from optimizing away memset() in gcm_clear_ctx() 2023-02-28 17:28:50 -08:00