aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/tcrypt.c15
-rw-r--r--crypto/tcrypt.h20
2 files changed, 35 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
diff --git a/crypto/tcrypt.h b/crypto/tcrypt.h
index 6cc1b856871b..f0bfee1bb293 100644
--- a/crypto/tcrypt.h
+++ b/crypto/tcrypt.h
@@ -61,12 +61,14 @@ static u8 speed_template_32_40_48[] = {32, 40, 48, 0};
61static u8 speed_template_32_48[] = {32, 48, 0}; 61static u8 speed_template_32_48[] = {32, 48, 0};
62static u8 speed_template_32_48_64[] = {32, 48, 64, 0}; 62static u8 speed_template_32_48_64[] = {32, 48, 64, 0};
63static u8 speed_template_32_64[] = {32, 64, 0}; 63static u8 speed_template_32_64[] = {32, 64, 0};
64static u8 speed_template_32[] = {32, 0};
64 65
65/* 66/*
66 * AEAD speed tests 67 * AEAD speed tests
67 */ 68 */
68static u8 aead_speed_template_19[] = {19, 0}; 69static u8 aead_speed_template_19[] = {19, 0};
69static u8 aead_speed_template_20[] = {20, 0}; 70static u8 aead_speed_template_20[] = {20, 0};
71static u8 aead_speed_template_36[] = {36, 0};
70 72
71/* 73/*
72 * Digest speed tests 74 * Digest speed tests
@@ -127,4 +129,22 @@ static struct hash_speed hash_speed_template_16[] = {
127 { .blen = 0, .plen = 0, .klen = 0, } 129 { .blen = 0, .plen = 0, .klen = 0, }
128}; 130};
129 131
132static struct hash_speed poly1305_speed_template[] = {
133 { .blen = 96, .plen = 16, },
134 { .blen = 96, .plen = 32, },
135 { .blen = 96, .plen = 96, },
136 { .blen = 288, .plen = 16, },
137 { .blen = 288, .plen = 32, },
138 { .blen = 288, .plen = 288, },
139 { .blen = 1056, .plen = 32, },
140 { .blen = 1056, .plen = 1056, },
141 { .blen = 2080, .plen = 32, },
142 { .blen = 2080, .plen = 2080, },
143 { .blen = 4128, .plen = 4128, },
144 { .blen = 8224, .plen = 8224, },
145
146 /* End marker */
147 { .blen = 0, .plen = 0, }
148};
149
130#endif /* _CRYPTO_TCRYPT_H */ 150#endif /* _CRYPTO_TCRYPT_H */