mirror_zfs/module/icp
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
..
algs ICP: AES-GCM: Unify gcm_init_ctx() and gmac_init_ctx() 2023-03-08 11:12:15 -08:00
api Cleanup: Remove unnecessary explicit casts of pointers from allocators 2023-01-12 15:59:12 -08:00
asm-aarch64 Add generic implementation handling and SHA2 impl 2023-03-02 13:52:21 -08:00
asm-arm/sha2 Add generic implementation handling and SHA2 impl 2023-03-02 13:52:21 -08:00
asm-ppc64 Add generic implementation handling and SHA2 impl 2023-03-02 13:52:21 -08:00
asm-x86_64 Restore ASMABI and other Unify work 2023-03-06 15:24:05 -08:00
core Cleanup: Remove unneeded semicolons 2023-01-12 16:00:30 -08:00
include Add generic implementation handling and SHA2 impl 2023-03-02 13:52:21 -08:00
io Add generic implementation handling and SHA2 impl 2023-03-02 13:52:21 -08:00
spi Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
illumos-crypto.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00