Home GnuPG

Calculate OCB L-tables when setting key instead of when setting nonce

Description

Calculate OCB L-tables when setting key instead of when setting nonce

* cipher/cipher-internal.h (gcry_cipher_handle): Mark areas of
u_mode.ocb that are and are not cleared by gcry_cipher_reset.
(_gcry_cipher_ocb_setkey): New.
* cipher/cipher-ocb.c (_gcry_cipher_ocb_set_nonce): Split
L-table generation to ...
(_gcry_cipher_ocb_setkey): ... this new function.
* cipher/cipher.c (cipher_setkey): Add handling for OCB mode.
(cipher_reset): Do not clear L-values for OCB mode.

OCB L-tables do not depend on nonce value, but only on cipher key.

  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>

Details

Provenance
jukiviliAuthored on Jan 27 2019, 10:19 AM
Parents
rC08e0650c2198: chacha20-amd64-avx2: optimize output xoring
Branches
Unknown
Tags
Unknown