diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/benchmark-cipher.c | 19 | ||||
-rw-r--r-- | src/benchmark-tls.c | 6 |
2 files changed, 17 insertions, 8 deletions
diff --git a/src/benchmark-cipher.c b/src/benchmark-cipher.c index b620723a2a..0a4510f86d 100644 --- a/src/benchmark-cipher.c +++ b/src/benchmark-cipher.c @@ -48,7 +48,7 @@ cipher_mac_bench (int algo, int mac_algo, int size) gnutls_hmac_hd_t mac_ctx; void *_key, *_iv; gnutls_datum_t key, iv; - int blocksize = gnutls_cipher_get_block_size (algo); + int ivsize = gnutls_cipher_get_iv_size(algo); int keysize = gnutls_cipher_get_key_size (algo); int step = size*1024; struct benchmark_st st; @@ -58,13 +58,13 @@ cipher_mac_bench (int algo, int mac_algo, int size) return; memset (_key, 0xf0, keysize); - _iv = malloc (blocksize); + _iv = malloc (ivsize); if (_iv == NULL) return; - memset (_iv, 0xf0, blocksize); + memset (_iv, 0xf0, ivsize); iv.data = _iv; - iv.size = blocksize; + iv.size = ivsize; key.data = _key; key.size = keysize; @@ -118,7 +118,7 @@ cipher_bench (int algo, int size, int aead) gnutls_cipher_hd_t ctx; void *_key, *_iv; gnutls_datum_t key, iv; - int blocksize = gnutls_cipher_get_block_size (algo); + int ivsize = gnutls_cipher_get_iv_size(algo); int keysize = gnutls_cipher_get_key_size (algo); int step = size*1024; struct benchmark_st st; @@ -128,14 +128,14 @@ cipher_bench (int algo, int size, int aead) return; memset (_key, 0xf0, keysize); - _iv = malloc (blocksize); + _iv = malloc (ivsize); if (_iv == NULL) return; - memset (_iv, 0xf0, blocksize); + memset (_iv, 0xf0, ivsize); iv.data = _iv; if (aead) iv.size = 12; - else iv.size = blocksize; + else iv.size = ivsize; key.data = _key; key.size = keysize; @@ -212,6 +212,7 @@ void benchmark_cipher (int init, int debug_level) gnutls_rnd( GNUTLS_RND_NONCE, data, sizeof(data)); } + cipher_mac_bench ( GNUTLS_CIPHER_SALSA20R20_128, GNUTLS_MAC_SHA1, 16); cipher_mac_bench ( GNUTLS_CIPHER_AES_128_CBC, GNUTLS_MAC_SHA1, 16); cipher_mac_bench ( GNUTLS_CIPHER_AES_128_CBC, GNUTLS_MAC_SHA256, 16); cipher_bench ( GNUTLS_CIPHER_AES_128_GCM, 16, 1); @@ -226,5 +227,7 @@ void benchmark_cipher (int init, int debug_level) cipher_bench (GNUTLS_CIPHER_ARCFOUR, 16, 0); + cipher_bench ( GNUTLS_CIPHER_SALSA20R20_128, 16, 0); + gnutls_global_deinit(); } diff --git a/src/benchmark-tls.c b/src/benchmark-tls.c index 59b269a647..eb82c8e68e 100644 --- a/src/benchmark-tls.c +++ b/src/benchmark-tls.c @@ -52,6 +52,7 @@ const char* side = ""; #define PRIO_ARCFOUR_128_MD5 "NONE:+VERS-TLS1.0:+ARCFOUR-128:+MD5:+SIGN-ALL:+COMP-NULL:+ANON-DH" #define PRIO_AES_GCM "NONE:+VERS-TLS1.2:+AES-128-GCM:+AEAD:+SIGN-ALL:+COMP-NULL:+ANON-DH" #define PRIO_CAMELLIA_CBC_SHA1 "NONE:+VERS-TLS1.0:+CAMELLIA-128-CBC:+SHA1:+SIGN-ALL:+COMP-NULL:+ANON-DH" +#define PRIO_SALSA20R20_128_SHA1 "NONE:+VERS-TLS1.0:+SALSA20R20-128:+SHA1:+SIGN-ALL:+COMP-NULL:+ANON-DH" static const int rsa_bits = 1776, ec_bits = 192; @@ -426,6 +427,11 @@ void benchmark_tls(int debug_level, int ciphers) test_ciphersuite(PRIO_ARCFOUR_128_MD5, 8 * 1024); test_ciphersuite(PRIO_ARCFOUR_128_MD5, 15 * 1024); + test_ciphersuite(PRIO_SALSA20R20_128_SHA1, 1024); + test_ciphersuite(PRIO_SALSA20R20_128_SHA1, 4096); + test_ciphersuite(PRIO_SALSA20R20_128_SHA1, 8*1024); + test_ciphersuite(PRIO_SALSA20R20_128_SHA1, 15*1024); + test_ciphersuite(PRIO_AES_GCM, 1024); test_ciphersuite(PRIO_AES_GCM, 4096); test_ciphersuite(PRIO_AES_GCM, 8 * 1024); |