mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 19:57:43 +03:00
ICP: gcm: Allocate hash subkey table separately
While evaluating other assembler implementations it turns out that the precomputed hash subkey tables vary in size, from 8*16 bytes (avx2/avx512) up to 48*16 bytes (avx512-vaes), depending on the implementation. To be able to handle the size differences later, allocate `gcm_Htable` dynamically rather then having a fixed size array, and adapt consumers. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Attila Fülöp <attila@fueloep.org> Closes #11102
This commit is contained in:
@@ -152,6 +152,14 @@ crypto_free_mode_ctx(void *ctx)
|
||||
vmem_free(((gcm_ctx_t *)ctx)->gcm_pt_buf,
|
||||
((gcm_ctx_t *)ctx)->gcm_pt_buf_len);
|
||||
|
||||
#ifdef CAN_USE_GCM_ASM
|
||||
if (((gcm_ctx_t *)ctx)->gcm_Htable != NULL) {
|
||||
gcm_ctx_t *gcm_ctx = (gcm_ctx_t *)ctx;
|
||||
bzero(gcm_ctx->gcm_Htable, gcm_ctx->gcm_htab_len);
|
||||
kmem_free(gcm_ctx->gcm_Htable, gcm_ctx->gcm_htab_len);
|
||||
}
|
||||
#endif
|
||||
|
||||
kmem_free(ctx, sizeof (gcm_ctx_t));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user