Fix in-place encryption for OCB mode
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Sat, 28 Feb 2015 16:04:34 +0000 (18:04 +0200)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Sat, 28 Feb 2015 16:04:34 +0000 (18:04 +0200)
commit5e66a4f8d5a63f58caeee367433dd8dd32346083
treea535c3d472f3f8e501f43b721030aadc8c216ebd
parent505decf5369970219ddc9e78a20f97c623957b78
Fix in-place encryption for OCB mode

* cipher/cipher-ocb.c (ocb_checksum): New.
(ocb_crypt): Move checksum calculation outside main crypt loop, do
checksum calculation for encryption before inbuf is overwritten.
* tests/basic.c (check_ocb_cipher): Rename to ...
(do_check_ocb_cipher): ... to this and add argument for testing
in-place encryption/decryption.
(check_ocb_cipher): New.
--

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