aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/crypto/crypto_tester.h
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2014-01-31 15:53:38 +0100
committerMartin Willi <martin@revosec.ch>2014-03-31 15:56:12 +0200
commite5d73b0dfa6bc57b2ed8745df4409308eeaf272e (patch)
tree245ca1455caf0fa3c8e22e8916ad7d4474f82c34 /src/libstrongswan/crypto/crypto_tester.h
parente12eec10089a4a18a15ccb511aa1200ad59e8044 (diff)
downloadstrongswan-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_tester.h')
-rw-r--r--src/libstrongswan/crypto/crypto_tester.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libstrongswan/crypto/crypto_tester.h b/src/libstrongswan/crypto/crypto_tester.h
index 9ac665929..add3b1cdf 100644
--- a/src/libstrongswan/crypto/crypto_tester.h
+++ b/src/libstrongswan/crypto/crypto_tester.h
@@ -54,6 +54,8 @@ struct aead_test_vector_t {
encryption_algorithm_t alg;
/** key length to use, in bytes */
size_t key_size;
+ /** salt length to use, in bytes */
+ size_t salt_size;
/** encryption key of test vector */
u_char *key;
/** initialization vector, using crypters blocksize bytes */
@@ -150,13 +152,15 @@ struct crypto_tester_t {
*
* @param alg algorithm to test
* @param key_size key size to test, 0 for default
+ * @param salt_size salt length to test, 0 for default
* @param create constructor function for the aead transform
* @param speed speed test result, NULL to omit
* @return TRUE if test passed
*/
bool (*test_aead)(crypto_tester_t *this, encryption_algorithm_t alg,
- size_t key_size, aead_constructor_t create,
- u_int *speed, const char *plugin_name);
+ size_t key_size, size_t salt_size,
+ aead_constructor_t create,
+ u_int *speed, const char *plugin_name);
/**
* Test a signer algorithm.
*