Optimize OCB set_key and set_nonce
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Thu, 28 Mar 2019 21:25:52 +0000 (23:25 +0200)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Thu, 28 Mar 2019 21:59:47 +0000 (23:59 +0200)
commitefd700e31dc8e1e386d367d1b682000977e0c810
tree79620940c21aa3d9eca4baacf991cf9119c063cb
parenteacbd59b1333b95858886999c8049e04bf72ad74
Optimize OCB set_key and set_nonce

* cipher/cipher-ocb.c (double_block): Change to input/output
host-endian block instead of big-endian buffer.
(double_block_cpy): Remove.
(bit_copy): Use fixed length copy and 'u64' for calculations.
(ocb_get_L_big): Handle block endian conversions for double_block.
(_gcry_cipher_ocb_setkey): Handle block endian conversions for
double_block.
(_gcry_cipher_ocb_set_nonce): Set full length of 'ktop' to zero; Drop
length parameter for bit_copy.
--

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
cipher/cipher-ocb.c