AES: move look-up tables to .data section and unshare between processes
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Fri, 31 May 2019 14:18:09 +0000 (17:18 +0300)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Wed, 5 Jun 2019 19:08:59 +0000 (22:08 +0300)
commitdaedbbb5541cd8ecda1459d3b843ea4d92788762
tree7f50f1d6b6391a77a73d5fc202053c7139dfd044
parentc6ffa216976d80a13486b13f64d6776cdb8b6ccf
AES: move look-up tables to .data section and unshare between processes

* cipher/rijndael-internal.h (ATTR_ALIGNED_64): New.
* cipher/rijndael-tables.h (encT): Move to 'enc_tables' structure.
(enc_tables): New structure for encryption table with counters before
and after.
(encT): New macro.
(dec_tables): Add counters before and after encryption table; Move
from .rodata to .data section.
(do_encrypt): Change 'encT' to 'enc_tables.T'.
(do_decrypt): Change '&dec_tables' to 'dec_tables.T'.
* cipher/cipher-gcm.c (prefetch_table): Make inline; Handle input
with length not multiple of 256.
(prefetch_enc, prefetch_dec): Modify pre- and post-table counters
to unshare look-up table pages between processes.
--

GnuPG-bug-id: 4541
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
cipher/rijndael-internal.h
cipher/rijndael-tables.h
cipher/rijndael.c