Add XTS cipher mode
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Fri, 6 Jan 2017 10:48:17 +0000 (12:48 +0200)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Fri, 6 Jan 2017 10:48:17 +0000 (12:48 +0200)
commit232a129b1f915fc54881506e4b07c89cf84932e6
tree21830feb80af49e2ab2ff344a647d0a0ec10aac5
parentaada604594fd42224d366d3cb98f67fd3b989cd6
Add XTS cipher mode

* cipher/Makefile.am: Add 'cipher-xts.c'.
* cipher/cipher-internal.h (gcry_cipher_handle): Add 'bulk.xts_crypt'
and 'u_mode.xts' members.
(_gcry_cipher_xts_crypt): New prototype.
* cipher/cipher-xts.c: New.
* cipher/cipher.c (_gcry_cipher_open_internal, cipher_setkey)
(cipher_reset, cipher_encrypt, cipher_decrypt): Add XTS mode handling.
* doc/gcrypt.texi: Add XTS mode to documentation.
* src/gcrypt.h.in (GCRY_CIPHER_MODE_XTS, GCRY_XTS_BLOCK_LEN): New.
* tests/basic.c (do_check_xts_cipher, check_xts_cipher): New.
(check_bulk_cipher_modes): Add XTS test-vectors.
(check_one_cipher_core, check_one_cipher, check_ciphers): Add XTS
testing support.
(check_cipher_modes): Add XTS test.
* tests/bench-slope.c (bench_xts_encrypt_init)
(bench_xts_encrypt_do_bench, bench_xts_decrypt_do_bench)
(xts_encrypt_ops, xts_decrypt_ops): New.
(cipher_modes, cipher_bench_one): Add XTS.
* tests/benchmark.c (cipher_bench): Add XTS testing.
--

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
cipher/Makefile.am
cipher/cipher-internal.h
cipher/cipher-xts.c [new file with mode: 0644]
cipher/cipher.c
doc/gcrypt.texi
src/gcrypt.h.in
tests/basic.c
tests/bench-slope.c
tests/benchmark.c