aead: Support custom AEAD salt sizes
authorMartin Willi <martin@revosec.ch>
Fri, 31 Jan 2014 14:53:38 +0000 (15:53 +0100)
committerMartin Willi <martin@revosec.ch>
Mon, 31 Mar 2014 13:56:12 +0000 (15:56 +0200)
commite5d73b0dfa6bc57b2ed8745df4409308eeaf272e
tree245ca1455caf0fa3c8e22e8916ad7d4474f82c34
parente12eec10089a4a18a15ccb511aa1200ad59e8044
aead: Support custom AEAD salt sizes

The salt, or often called implicit nonce, varies between AEAD algorithms and
their use in protocols. For IKE and ESP, GCM uses 4 bytes, while CCM uses
3 bytes. With TLS, however, AEAD mode uses 4 bytes for both GCM and CCM.

Our GCM backends currently support 4 bytes and CCM 3 bytes only. This is fine
until we go for CCM mode support in TLS, which requires 4 byte nonces.
17 files changed:
scripts/aes-test.c
scripts/crypt_burn.c
src/libcharon/sa/ikev2/keymat_v2.c
src/libipsec/esp_context.c
src/libstrongswan/crypto/aead.h
src/libstrongswan/crypto/crypto_factory.c
src/libstrongswan/crypto/crypto_factory.h
src/libstrongswan/crypto/crypto_tester.c
src/libstrongswan/crypto/crypto_tester.h
src/libstrongswan/plugins/ccm/ccm_aead.c
src/libstrongswan/plugins/ccm/ccm_aead.h
src/libstrongswan/plugins/gcm/gcm_aead.c
src/libstrongswan/plugins/gcm/gcm_aead.h
src/libstrongswan/plugins/openssl/openssl_gcm.c
src/libstrongswan/plugins/openssl/openssl_gcm.h
src/libstrongswan/plugins/test_vectors/test_vectors/aes_ccm.c
src/libstrongswan/plugins/test_vectors/test_vectors/aes_gcm.c