Simplify OCB offset calculation for parallel implementations
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Tue, 11 Aug 2015 04:22:16 +0000 (07:22 +0300)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Wed, 12 Aug 2015 14:41:42 +0000 (17:41 +0300)
commit24ebf53f1e8a8afa27dcd768339bda70a740bb03
tree2086fe6cd7e7d5c0cb24181fdaf332946aa3f69c
parente11895da1f4af9782d89e92ba2e6b1a63235b54b
Simplify OCB offset calculation for parallel implementations

* cipher/camellia-glue.c (_gcry_camellia_ocb_crypt)
(_gcry_camellia_ocb_auth): Precalculate Ls array always, instead of
just if 'blkn % <parallel blocks> == 0'.
* cipher/serpent.c (_gcry_serpent_ocb_crypt)
(_gcry_serpent_ocb_auth): Ditto.
* cipher/rijndael-aesni.c (get_l): Remove low-bit checks.
(aes_ocb_enc, aes_ocb_dec, _gcry_aes_aesni_ocb_auth): Handle leading
blocks until block counter is multiple of 4, so that parallel block
processing loop can use 'c->u_mode.ocb.L' array directly.
* tests/basic.c (check_ocb_cipher_largebuf): Rename to...
(check_ocb_cipher_largebuf_split): ...this and add option to process
large buffer as two split buffers.
(check_ocb_cipher_largebuf): New.
--

Patch simplifies source and reduce object size.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
cipher/camellia-glue.c
cipher/rijndael-aesni.c
cipher/serpent.c
tests/basic.c