diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2019-05-31 17:18:09 +0300 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2019-06-05 22:08:59 +0300 |
commit | daedbbb5541cd8ecda1459d3b843ea4d92788762 (patch) | |
tree | 7f50f1d6b6391a77a73d5fc202053c7139dfd044 /cipher/rijndael-internal.h | |
parent | c6ffa216976d80a13486b13f64d6776cdb8b6ccf (diff) | |
download | libgcrypt-daedbbb5541cd8ecda1459d3b843ea4d92788762.tar.gz |
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>
Diffstat (limited to 'cipher/rijndael-internal.h')
-rw-r--r-- | cipher/rijndael-internal.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cipher/rijndael-internal.h b/cipher/rijndael-internal.h index 876d55fe..78b08e8f 100644 --- a/cipher/rijndael-internal.h +++ b/cipher/rijndael-internal.h @@ -29,11 +29,13 @@ #define BLOCKSIZE (128/8) -/* Helper macro to force alignment to 16 bytes. */ +/* Helper macro to force alignment to 16 or 64 bytes. */ #ifdef HAVE_GCC_ATTRIBUTE_ALIGNED # define ATTR_ALIGNED_16 __attribute__ ((aligned (16))) +# define ATTR_ALIGNED_64 __attribute__ ((aligned (64))) #else # define ATTR_ALIGNED_16 +# define ATTR_ALIGNED_64 #endif |