diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2013-11-20 15:44:27 +0200 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2013-11-21 11:58:09 +0200 |
commit | dbfa651618693da7ea73b4d2d00d4efd411bfb46 (patch) | |
tree | 64bfe4135eb663dacc8459af97fef7ad1e4b5142 /cipher/mac.c | |
parent | fb1e52e3fe231671de546eacd6becd31c26c4f7b (diff) | |
download | libgcrypt-dbfa651618693da7ea73b4d2d00d4efd411bfb46.tar.gz |
GCM: Move gcm_table initialization to setkey
* cipher/cipher-gcm.c: Change all 'c->u_iv.iv' to
'c->u_mode.gcm.u_ghash_key.key'.
(_gcry_cipher_gcm_setkey): New.
(_gcry_cipher_gcm_initiv): Move ghash initialization to function above.
* cipher/cipher-internal.h (gcry_cipher_handle): Add
'u_mode.gcm.u_ghash_key'; Reorder 'u_mode.gcm' members for partial
clearing in gcry_cipher_reset.
(_gcry_cipher_gcm_setkey): New prototype.
* cipher/cipher.c (cipher_setkey): Add GCM setkey.
(cipher_reset): Clear 'u_mode' only partially for GCM.
--
GHASH tables can be generated at setkey time. No need to regenerate
for every new IV.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'cipher/mac.c')
0 files changed, 0 insertions, 0 deletions