diff options
author | Martin Willi <martin@revosec.ch> | 2014-01-31 15:53:38 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2014-03-31 15:56:12 +0200 |
commit | e5d73b0dfa6bc57b2ed8745df4409308eeaf272e (patch) | |
tree | 245ca1455caf0fa3c8e22e8916ad7d4474f82c34 /src/libstrongswan/crypto/crypto_factory.h | |
parent | e12eec10089a4a18a15ccb511aa1200ad59e8044 (diff) | |
download | strongswan-e5d73b0dfa6bc57b2ed8745df4409308eeaf272e.tar.bz2 strongswan-e5d73b0dfa6bc57b2ed8745df4409308eeaf272e.tar.xz |
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.
Diffstat (limited to 'src/libstrongswan/crypto/crypto_factory.h')
-rw-r--r-- | src/libstrongswan/crypto/crypto_factory.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstrongswan/crypto/crypto_factory.h b/src/libstrongswan/crypto/crypto_factory.h index 281dc256f..7865bcb15 100644 --- a/src/libstrongswan/crypto/crypto_factory.h +++ b/src/libstrongswan/crypto/crypto_factory.h @@ -46,7 +46,7 @@ typedef crypter_t* (*crypter_constructor_t)(encryption_algorithm_t algo, * Constructor function for aead transforms */ typedef aead_t* (*aead_constructor_t)(encryption_algorithm_t algo, - size_t key_size); + size_t key_size, size_t salt_size); /** * Constructor function for signers */ @@ -100,10 +100,12 @@ struct crypto_factory_t { * * @param algo encryption algorithm * @param key_size length of the key in bytes + * @param salt_size size of salt, implicit part of the nonce * @return aead_t instance, NULL if not supported */ aead_t* (*create_aead)(crypto_factory_t *this, - encryption_algorithm_t algo, size_t key_size); + encryption_algorithm_t algo, + size_t key_size, size_t salt_size); /** * Create a symmetric signer instance. |