Use u64 for CCM data lengths
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Sun, 15 Dec 2013 18:07:54 +0000 (20:07 +0200)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Sun, 15 Dec 2013 18:07:54 +0000 (20:07 +0200)
commit110fed2d6b0bbc97cb5cc0a3a564e05fc42afa2d
treee2b4d1267f173747c9044500417993e4da8e8007
parentbfb43a17d8db571fca4ed433ee8be5c366745844
Use u64 for CCM data lengths

* cipher/cipher-ccm.c: Move code inside [HAVE_U64_TYPEDEF].
[HAVE_U64_TYPEDEF] (_gcry_cipher_ccm_set_lengths): Use 'u64' for
data lengths.
[!HAVE_U64_TYPEDEF] (_gcry_cipher_ccm_encrypt)
(_gcry_cipher_ccm_decrypt, _gcry_cipher_ccm_set_nonce)
(_gcry_cipher_ccm_authenticate, _gcry_cipher_ccm_get_tag)
(_gcry_cipher_ccm_check_tag): Dummy functions returning
GPG_ERROR_NOT_SUPPORTED.
* cipher/cipher-internal.h (gcry_cipher_handle.u_mode.ccm)
(_gcry_cipher_ccm_set_lengths): Move inside [HAVE_U64_TYPEDEF] and use
u64 instead of size_t for CCM data lengths.
* cipher/cipher.c (_gcry_cipher_open_internal, cipher_reset)
(_gcry_cipher_ctl) [!HAVE_U64_TYPEDEF]: Return GPG_ERR_NOT_SUPPORTED
for CCM.
(_gcry_cipher_ctl) [HAVE_U64_TYPEDEF]: Use u64 for
GCRYCTL_SET_CCM_LENGTHS length parameters.
* tests/basic.c: Do not use CCM if !HAVE_U64_TYPEDEF.
* tests/bench-slope.c: Ditto.
* tests/benchmark.c: Ditto.
--

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
cipher/cipher-ccm.c
cipher/cipher-internal.h
cipher/cipher.c
tests/basic.c
tests/bench-slope.c
tests/benchmark.c