aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/tcrypt.c
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2015-07-16 13:13:59 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2015-07-17 09:20:20 -0400
commit2dce063a31ae6cbaf39964663fc59d10bef38d15 (patch)
treec114a51fb0d5a23f44477a159aa3fd3cb329e4bd /crypto/tcrypt.c
parent747909223397e11743c81352b3e4fdd29346bbf9 (diff)
crypto: tcrypt - Add ChaCha20/Poly1305 speed tests
Adds individual ChaCha20 and Poly1305 and a combined rfc7539esp AEAD speed test using mode numbers 214, 321 and 213. For Poly1305 we add a specific speed template, as it expects the key prepended to the input data. Signed-off-by: Martin Willi <martin@strongswan.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/tcrypt.c')
-rw-r--r--crypto/tcrypt.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 73ed4f2c8e5d..e9a05ba2bfb4 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -1793,6 +1793,17 @@ static int do_test(const char *alg, u32 type, u32 mask, int m)
1793 NULL, 0, 16, 16, aead_speed_template_19); 1793 NULL, 0, 16, 16, aead_speed_template_19);
1794 break; 1794 break;
1795 1795
1796 case 213:
1797 test_aead_speed("rfc7539esp(chacha20,poly1305)", ENCRYPT, sec,
1798 NULL, 0, 16, 8, aead_speed_template_36);
1799 break;
1800
1801 case 214:
1802 test_cipher_speed("chacha20", ENCRYPT, sec, NULL, 0,
1803 speed_template_32);
1804 break;
1805
1806
1796 case 300: 1807 case 300:
1797 if (alg) { 1808 if (alg) {
1798 test_hash_speed(alg, sec, generic_hash_speed_template); 1809 test_hash_speed(alg, sec, generic_hash_speed_template);
@@ -1881,6 +1892,10 @@ static int do_test(const char *alg, u32 type, u32 mask, int m)
1881 test_hash_speed("crct10dif", sec, generic_hash_speed_template); 1892 test_hash_speed("crct10dif", sec, generic_hash_speed_template);
1882 if (mode > 300 && mode < 400) break; 1893 if (mode > 300 && mode < 400) break;
1883 1894
1895 case 321:
1896 test_hash_speed("poly1305", sec, poly1305_speed_template);
1897 if (mode > 300 && mode < 400) break;
1898
1884 case 399: 1899 case 399:
1885 break; 1900 break;
1886 1901