Blame view
crypto/tcrypt.c
50.8 KB
ef2736fc7 [CRYPTO]: White s... |
1 |
/* |
1da177e4c Linux-2.6.12-rc2 |
2 3 4 5 6 7 8 |
* Quick & dirty crypto testing module. * * This will only exist until we have a better testing mechanism * (e.g. a char device). * * Copyright (c) 2002 James Morris <jmorris@intercode.com.au> * Copyright (c) 2002 Jean-Francois Dive <jef@linuxbe.org> |
e3a4ea4fd [CRYPTO] tcrypt: ... |
9 |
* Copyright (c) 2007 Nokia Siemens Networks |
1da177e4c Linux-2.6.12-rc2 |
10 |
* |
69435b94d crypto: rfc4106 -... |
11 12 13 14 15 16 17 |
* Updated RFC4106 AES-GCM testing. * Authors: Aidan O'Mahony (aidan.o.mahony@intel.com) * Adrian Hoban <adrian.hoban@intel.com> * Gabriele Paoloni <gabriele.paoloni@intel.com> * Tadeusz Struk (tadeusz.struk@intel.com) * Copyright (c) 2010, Intel Corporation. * |
1da177e4c Linux-2.6.12-rc2 |
18 19 |
* This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free |
ef2736fc7 [CRYPTO]: White s... |
20 |
* Software Foundation; either version 2 of the License, or (at your option) |
1da177e4c Linux-2.6.12-rc2 |
21 22 |
* any later version. * |
1da177e4c Linux-2.6.12-rc2 |
23 |
*/ |
1ce5a04d9 crypto: tcrypt - ... |
24 |
#include <crypto/aead.h> |
18e33e6d5 crypto: hash - Mo... |
25 |
#include <crypto/hash.h> |
7166e589d crypto: tcrypt - ... |
26 |
#include <crypto/skcipher.h> |
cba83564d [CRYPTO] tcrypt: ... |
27 |
#include <linux/err.h> |
daf0944cf crypto: tcrypt - ... |
28 |
#include <linux/fips.h> |
1da177e4c Linux-2.6.12-rc2 |
29 |
#include <linux/init.h> |
5a0e3ad6a include cleanup: ... |
30 |
#include <linux/gfp.h> |
1da177e4c Linux-2.6.12-rc2 |
31 |
#include <linux/module.h> |
378f058cc [PATCH] Use sg_se... |
32 |
#include <linux/scatterlist.h> |
1da177e4c Linux-2.6.12-rc2 |
33 |
#include <linux/string.h> |
1da177e4c Linux-2.6.12-rc2 |
34 |
#include <linux/moduleparam.h> |
ebfd9bcf1 [CRYPTO]: Add cip... |
35 |
#include <linux/jiffies.h> |
6a17944ca [CRYPTO]: Use CPU... |
36 37 |
#include <linux/timex.h> #include <linux/interrupt.h> |
1da177e4c Linux-2.6.12-rc2 |
38 39 40 |
#include "tcrypt.h" /* |
f139cfa7c crypto: tcrypt - ... |
41 |
* Need slab memory for testing (size in number of pages). |
1da177e4c Linux-2.6.12-rc2 |
42 |
*/ |
f139cfa7c crypto: tcrypt - ... |
43 |
#define TVMEMSIZE 4 |
1da177e4c Linux-2.6.12-rc2 |
44 45 |
/* |
da7f033dd crypto: cryptomgr... |
46 |
* Used by test_cipher_speed() |
1da177e4c Linux-2.6.12-rc2 |
47 48 49 |
*/ #define ENCRYPT 1 #define DECRYPT 0 |
1da177e4c Linux-2.6.12-rc2 |
50 |
|
f074f7b10 crypto: tcrypt - ... |
51 |
#define MAX_DIGEST_SIZE 64 |
ebfd9bcf1 [CRYPTO]: Add cip... |
52 |
/* |
263a8df0d crypto: tcrypt - ... |
53 54 55 56 57 |
* return a string with the driver name */ #define get_driver_name(tfm_type, tfm) crypto_tfm_alg_driver_name(tfm_type ## _tfm(tfm)) /* |
ebfd9bcf1 [CRYPTO]: Add cip... |
58 59 |
* Used by test_cipher_speed() */ |
6a17944ca [CRYPTO]: Use CPU... |
60 |
static unsigned int sec; |
ebfd9bcf1 [CRYPTO]: Add cip... |
61 |
|
a873a5f1c crypto: tcrypt - ... |
62 63 |
static char *alg = NULL; static u32 type; |
7be380f72 crypto: tcrypt - ... |
64 |
static u32 mask; |
1da177e4c Linux-2.6.12-rc2 |
65 |
static int mode; |
f139cfa7c crypto: tcrypt - ... |
66 |
static char *tvmem[TVMEMSIZE]; |
1da177e4c Linux-2.6.12-rc2 |
67 68 |
static char *check[] = { |
cd12fb906 [CRYPTO] sha256-g... |
69 70 71 |
"des", "md5", "des3_ede", "rot13", "sha1", "sha224", "sha256", "blowfish", "twofish", "serpent", "sha384", "sha512", "md4", "aes", "cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea", |
90831639a [CRYPTO] fcrypt: ... |
72 |
"khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt", |
2998db37b [CRYPTO] tcrypt: ... |
73 |
"camellia", "seed", "salsa20", "rmd128", "rmd160", "rmd256", "rmd320", |
79cc6ab89 crypto: sha3 - Ad... |
74 75 |
"lzo", "cts", "zlib", "sha3-224", "sha3-256", "sha3-384", "sha3-512", NULL |
1da177e4c Linux-2.6.12-rc2 |
76 |
}; |
1425d2d17 crypto: tcrypt - ... |
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
struct tcrypt_result { struct completion completion; int err; }; static void tcrypt_complete(struct crypto_async_request *req, int err) { struct tcrypt_result *res = req->data; if (err == -EINPROGRESS) return; res->err = err; complete(&res->completion); } |
1425d2d17 crypto: tcrypt - ... |
92 93 94 95 96 97 98 99 100 101 102 103 104 |
static inline int do_one_aead_op(struct aead_request *req, int ret) { if (ret == -EINPROGRESS || ret == -EBUSY) { struct tcrypt_result *tr = req->base.data; ret = wait_for_completion_interruptible(&tr->completion); if (!ret) ret = tr->err; reinit_completion(&tr->completion); } return ret; } |
53f52d7ae crypto: tcrypt - ... |
105 |
static int test_aead_jiffies(struct aead_request *req, int enc, |
3e3dc25fe crypto: Resolve s... |
106 |
int blen, int secs) |
53f52d7ae crypto: tcrypt - ... |
107 108 109 110 |
{ unsigned long start, end; int bcount; int ret; |
3e3dc25fe crypto: Resolve s... |
111 |
for (start = jiffies, end = start + secs * HZ, bcount = 0; |
53f52d7ae crypto: tcrypt - ... |
112 113 |
time_before(jiffies, end); bcount++) { if (enc) |
1425d2d17 crypto: tcrypt - ... |
114 |
ret = do_one_aead_op(req, crypto_aead_encrypt(req)); |
53f52d7ae crypto: tcrypt - ... |
115 |
else |
1425d2d17 crypto: tcrypt - ... |
116 |
ret = do_one_aead_op(req, crypto_aead_decrypt(req)); |
53f52d7ae crypto: tcrypt - ... |
117 118 119 120 121 122 123 |
if (ret) return ret; } printk("%d operations in %d seconds (%ld bytes) ", |
3e3dc25fe crypto: Resolve s... |
124 |
bcount, secs, (long)bcount * blen); |
53f52d7ae crypto: tcrypt - ... |
125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
return 0; } static int test_aead_cycles(struct aead_request *req, int enc, int blen) { unsigned long cycles = 0; int ret = 0; int i; local_irq_disable(); /* Warm-up run. */ for (i = 0; i < 4; i++) { if (enc) |
1425d2d17 crypto: tcrypt - ... |
139 |
ret = do_one_aead_op(req, crypto_aead_encrypt(req)); |
53f52d7ae crypto: tcrypt - ... |
140 |
else |
1425d2d17 crypto: tcrypt - ... |
141 |
ret = do_one_aead_op(req, crypto_aead_decrypt(req)); |
53f52d7ae crypto: tcrypt - ... |
142 143 144 145 146 147 148 149 150 151 152 |
if (ret) goto out; } /* The real thing. */ for (i = 0; i < 8; i++) { cycles_t start, end; start = get_cycles(); if (enc) |
1425d2d17 crypto: tcrypt - ... |
153 |
ret = do_one_aead_op(req, crypto_aead_encrypt(req)); |
53f52d7ae crypto: tcrypt - ... |
154 |
else |
1425d2d17 crypto: tcrypt - ... |
155 |
ret = do_one_aead_op(req, crypto_aead_decrypt(req)); |
53f52d7ae crypto: tcrypt - ... |
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
end = get_cycles(); if (ret) goto out; cycles += end - start; } out: local_irq_enable(); if (ret == 0) printk("1 operation in %lu cycles (%d bytes) ", (cycles + 4) / 8, blen); return ret; } |
d5dc39274 [CRYPTO] tcrypt: ... |
174 |
static u32 block_sizes[] = { 16, 64, 256, 1024, 8192, 0 }; |
53f52d7ae crypto: tcrypt - ... |
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
static u32 aead_sizes[] = { 16, 64, 256, 512, 1024, 2048, 4096, 8192, 0 }; #define XBUFSIZE 8 #define MAX_IVLEN 32 static int testmgr_alloc_buf(char *buf[XBUFSIZE]) { int i; for (i = 0; i < XBUFSIZE; i++) { buf[i] = (void *)__get_free_page(GFP_KERNEL); if (!buf[i]) goto err_free_buf; } return 0; err_free_buf: while (i-- > 0) free_page((unsigned long)buf[i]); return -ENOMEM; } static void testmgr_free_buf(char *buf[XBUFSIZE]) { int i; for (i = 0; i < XBUFSIZE; i++) free_page((unsigned long)buf[i]); } static void sg_init_aead(struct scatterlist *sg, char *xbuf[XBUFSIZE], unsigned int buflen) { int np = (buflen + PAGE_SIZE - 1)/PAGE_SIZE; int k, rem; |
53f52d7ae crypto: tcrypt - ... |
212 213 214 |
if (np > XBUFSIZE) { rem = PAGE_SIZE; np = XBUFSIZE; |
c47689931 crypto: tcrypt - ... |
215 216 |
} else { rem = buflen % PAGE_SIZE; |
53f52d7ae crypto: tcrypt - ... |
217 |
} |
c47689931 crypto: tcrypt - ... |
218 |
|
31267270a crypto: tcrypt - ... |
219 |
sg_init_table(sg, np + 1); |
c47689931 crypto: tcrypt - ... |
220 221 |
np--; for (k = 0; k < np; k++) |
31267270a crypto: tcrypt - ... |
222 |
sg_set_buf(&sg[k + 1], xbuf[k], PAGE_SIZE); |
c47689931 crypto: tcrypt - ... |
223 |
|
31267270a crypto: tcrypt - ... |
224 |
sg_set_buf(&sg[k + 1], xbuf[k], rem); |
53f52d7ae crypto: tcrypt - ... |
225 |
} |
3e3dc25fe crypto: Resolve s... |
226 |
static void test_aead_speed(const char *algo, int enc, unsigned int secs, |
53f52d7ae crypto: tcrypt - ... |
227 228 229 230 231 232 233 234 235 236 |
struct aead_speed_template *template, unsigned int tcount, u8 authsize, unsigned int aad_size, u8 *keysize) { unsigned int i, j; struct crypto_aead *tfm; int ret = -ENOMEM; const char *key; struct aead_request *req; struct scatterlist *sg; |
53f52d7ae crypto: tcrypt - ... |
237 238 239 |
struct scatterlist *sgout; const char *e; void *assoc; |
96692a730 crypto: tcrypt - ... |
240 |
char *iv; |
53f52d7ae crypto: tcrypt - ... |
241 242 243 244 245 |
char *xbuf[XBUFSIZE]; char *xoutbuf[XBUFSIZE]; char *axbuf[XBUFSIZE]; unsigned int *b_size; unsigned int iv_len; |
1425d2d17 crypto: tcrypt - ... |
246 |
struct tcrypt_result result; |
53f52d7ae crypto: tcrypt - ... |
247 |
|
96692a730 crypto: tcrypt - ... |
248 249 250 |
iv = kzalloc(MAX_IVLEN, GFP_KERNEL); if (!iv) return; |
ac5f863f8 crypto: tcrypt - ... |
251 252 253 |
if (aad_size >= PAGE_SIZE) { pr_err("associate data length (%u) too big ", aad_size); |
96692a730 crypto: tcrypt - ... |
254 |
goto out_noxbuf; |
ac5f863f8 crypto: tcrypt - ... |
255 |
} |
53f52d7ae crypto: tcrypt - ... |
256 257 258 259 260 261 262 263 264 265 266 |
if (enc == ENCRYPT) e = "encryption"; else e = "decryption"; if (testmgr_alloc_buf(xbuf)) goto out_noxbuf; if (testmgr_alloc_buf(axbuf)) goto out_noaxbuf; if (testmgr_alloc_buf(xoutbuf)) goto out_nooutbuf; |
a3f2185a2 crypto: tcrypt - ... |
267 |
sg = kmalloc(sizeof(*sg) * 9 * 2, GFP_KERNEL); |
53f52d7ae crypto: tcrypt - ... |
268 269 |
if (!sg) goto out_nosg; |
a3f2185a2 crypto: tcrypt - ... |
270 |
sgout = &sg[9]; |
53f52d7ae crypto: tcrypt - ... |
271 |
|
5e4b8c1fc crypto: aead - Re... |
272 |
tfm = crypto_alloc_aead(algo, 0, 0); |
53f52d7ae crypto: tcrypt - ... |
273 274 275 276 277 |
if (IS_ERR(tfm)) { pr_err("alg: aead: Failed to load transform for %s: %ld ", algo, PTR_ERR(tfm)); |
a2ea6ed6a crypto: tcrypt - ... |
278 |
goto out_notfm; |
53f52d7ae crypto: tcrypt - ... |
279 |
} |
1425d2d17 crypto: tcrypt - ... |
280 |
init_completion(&result.completion); |
263a8df0d crypto: tcrypt - ... |
281 282 283 284 |
printk(KERN_INFO " testing speed of %s (%s) %s ", algo, get_driver_name(crypto_aead, tfm), e); |
53f52d7ae crypto: tcrypt - ... |
285 286 287 288 289 |
req = aead_request_alloc(tfm, GFP_KERNEL); if (!req) { pr_err("alg: aead: Failed to allocate request for %s ", algo); |
6af1f93e2 crypto: tcrypt - ... |
290 |
goto out_noreq; |
53f52d7ae crypto: tcrypt - ... |
291 |
} |
1425d2d17 crypto: tcrypt - ... |
292 293 |
aead_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG, tcrypt_complete, &result); |
53f52d7ae crypto: tcrypt - ... |
294 295 296 297 298 |
i = 0; do { b_size = aead_sizes; do { assoc = axbuf[0]; |
ac5f863f8 crypto: tcrypt - ... |
299 |
memset(assoc, 0xff, aad_size); |
53f52d7ae crypto: tcrypt - ... |
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 |
if ((*keysize + *b_size) > TVMEMSIZE * PAGE_SIZE) { pr_err("template (%u) too big for tvmem (%lu) ", *keysize + *b_size, TVMEMSIZE * PAGE_SIZE); goto out; } key = tvmem[0]; for (j = 0; j < tcount; j++) { if (template[j].klen == *keysize) { key = template[j].key; break; } } ret = crypto_aead_setkey(tfm, key, *keysize); ret = crypto_aead_setauthsize(tfm, authsize); iv_len = crypto_aead_ivsize(tfm); if (iv_len) |
96692a730 crypto: tcrypt - ... |
321 |
memset(iv, 0xff, iv_len); |
53f52d7ae crypto: tcrypt - ... |
322 323 324 325 326 327 328 329 330 331 332 333 334 335 |
crypto_aead_clear_flags(tfm, ~0); printk(KERN_INFO "test %u (%d bit key, %d byte blocks): ", i, *keysize * 8, *b_size); memset(tvmem[0], 0xff, PAGE_SIZE); if (ret) { pr_err("setkey() failed flags=%x ", crypto_aead_get_flags(tfm)); goto out; } |
31267270a crypto: tcrypt - ... |
336 |
sg_init_aead(sg, xbuf, |
53f52d7ae crypto: tcrypt - ... |
337 |
*b_size + (enc ? authsize : 0)); |
31267270a crypto: tcrypt - ... |
338 |
sg_init_aead(sgout, xoutbuf, |
53f52d7ae crypto: tcrypt - ... |
339 |
*b_size + (enc ? authsize : 0)); |
31267270a crypto: tcrypt - ... |
340 341 |
sg_set_buf(&sg[0], assoc, aad_size); sg_set_buf(&sgout[0], assoc, aad_size); |
53f52d7ae crypto: tcrypt - ... |
342 |
aead_request_set_crypt(req, sg, sgout, *b_size, iv); |
a3f2185a2 crypto: tcrypt - ... |
343 |
aead_request_set_ad(req, aad_size); |
53f52d7ae crypto: tcrypt - ... |
344 |
|
3e3dc25fe crypto: Resolve s... |
345 346 347 |
if (secs) ret = test_aead_jiffies(req, enc, *b_size, secs); |
53f52d7ae crypto: tcrypt - ... |
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 |
else ret = test_aead_cycles(req, enc, *b_size); if (ret) { pr_err("%s() failed return code=%d ", e, ret); break; } b_size++; i++; } while (*b_size); keysize++; } while (*keysize); out: |
6af1f93e2 crypto: tcrypt - ... |
363 364 |
aead_request_free(req); out_noreq: |
53f52d7ae crypto: tcrypt - ... |
365 |
crypto_free_aead(tfm); |
a2ea6ed6a crypto: tcrypt - ... |
366 |
out_notfm: |
53f52d7ae crypto: tcrypt - ... |
367 368 369 370 371 372 373 374 |
kfree(sg); out_nosg: testmgr_free_buf(xoutbuf); out_nooutbuf: testmgr_free_buf(axbuf); out_noaxbuf: testmgr_free_buf(xbuf); out_noxbuf: |
96692a730 crypto: tcrypt - ... |
375 |
kfree(iv); |
53f52d7ae crypto: tcrypt - ... |
376 377 |
return; } |
d5dc39274 [CRYPTO] tcrypt: ... |
378 |
|
beb63da73 crypto: tcrypt - ... |
379 380 381 382 383 384 385 386 387 388 |
static void test_hash_sg_init(struct scatterlist *sg) { int i; sg_init_table(sg, TVMEMSIZE); for (i = 0; i < TVMEMSIZE; i++) { sg_set_buf(sg + i, tvmem[i], PAGE_SIZE); memset(tvmem[i], 0xff, PAGE_SIZE); } } |
beb63da73 crypto: tcrypt - ... |
389 390 391 392 |
static inline int do_one_ahash_op(struct ahash_request *req, int ret) { if (ret == -EINPROGRESS || ret == -EBUSY) { struct tcrypt_result *tr = req->base.data; |
8a45ac12e crypto: testmgr -... |
393 |
wait_for_completion(&tr->completion); |
16735d022 tree-wide: use re... |
394 |
reinit_completion(&tr->completion); |
8a45ac12e crypto: testmgr -... |
395 |
ret = tr->err; |
beb63da73 crypto: tcrypt - ... |
396 397 398 |
} return ret; } |
72259deb3 crypto: tcrypt - ... |
399 400 401 402 403 404 405 |
struct test_mb_ahash_data { struct scatterlist sg[TVMEMSIZE]; char result[64]; struct ahash_request *req; struct tcrypt_result tresult; char *xbuf[XBUFSIZE]; }; |
087bcd225 crypto: tcrypt - ... |
406 407 |
static void test_mb_ahash_speed(const char *algo, unsigned int sec, |
72259deb3 crypto: tcrypt - ... |
408 |
struct hash_speed *speed) |
087bcd225 crypto: tcrypt - ... |
409 |
{ |
72259deb3 crypto: tcrypt - ... |
410 |
struct test_mb_ahash_data *data; |
087bcd225 crypto: tcrypt - ... |
411 |
struct crypto_ahash *tfm; |
72259deb3 crypto: tcrypt - ... |
412 |
unsigned long start, end; |
f8de55b62 crypto: tcrypt - ... |
413 |
unsigned long cycles; |
72259deb3 crypto: tcrypt - ... |
414 415 416 417 418 419 |
unsigned int i, j, k; int ret; data = kzalloc(sizeof(*data) * 8, GFP_KERNEL); if (!data) return; |
087bcd225 crypto: tcrypt - ... |
420 421 422 423 424 425 |
tfm = crypto_alloc_ahash(algo, 0, 0); if (IS_ERR(tfm)) { pr_err("failed to load transform for %s: %ld ", algo, PTR_ERR(tfm)); |
72259deb3 crypto: tcrypt - ... |
426 |
goto free_data; |
087bcd225 crypto: tcrypt - ... |
427 |
} |
72259deb3 crypto: tcrypt - ... |
428 |
|
087bcd225 crypto: tcrypt - ... |
429 |
for (i = 0; i < 8; ++i) { |
72259deb3 crypto: tcrypt - ... |
430 431 |
if (testmgr_alloc_buf(data[i].xbuf)) goto out; |
087bcd225 crypto: tcrypt - ... |
432 |
|
72259deb3 crypto: tcrypt - ... |
433 |
init_completion(&data[i].tresult.completion); |
087bcd225 crypto: tcrypt - ... |
434 |
|
72259deb3 crypto: tcrypt - ... |
435 436 |
data[i].req = ahash_request_alloc(tfm, GFP_KERNEL); if (!data[i].req) { |
f83f5b12e crypto: tcrypt - ... |
437 438 439 |
pr_err("alg: hash: Failed to allocate request for %s ", algo); |
72259deb3 crypto: tcrypt - ... |
440 |
goto out; |
087bcd225 crypto: tcrypt - ... |
441 |
} |
087bcd225 crypto: tcrypt - ... |
442 |
|
72259deb3 crypto: tcrypt - ... |
443 444 445 |
ahash_request_set_callback(data[i].req, 0, tcrypt_complete, &data[i].tresult); test_hash_sg_init(data[i].sg); |
087bcd225 crypto: tcrypt - ... |
446 |
} |
72259deb3 crypto: tcrypt - ... |
447 448 449 450 |
pr_info(" testing speed of multibuffer %s (%s) ", algo, get_driver_name(crypto_ahash, tfm)); |
087bcd225 crypto: tcrypt - ... |
451 452 |
for (i = 0; speed[i].blen != 0; i++) { |
72259deb3 crypto: tcrypt - ... |
453 454 455 |
/* For some reason this only tests digests. */ if (speed[i].blen != speed[i].plen) continue; |
087bcd225 crypto: tcrypt - ... |
456 |
if (speed[i].blen > TVMEMSIZE * PAGE_SIZE) { |
f83f5b12e crypto: tcrypt - ... |
457 458 459 460 |
pr_err("template (%u) too big for tvmem (%lu) ", speed[i].blen, TVMEMSIZE * PAGE_SIZE); goto out; |
087bcd225 crypto: tcrypt - ... |
461 462 463 464 |
} if (speed[i].klen) crypto_ahash_setkey(tfm, tvmem[0], speed[i].klen); |
72259deb3 crypto: tcrypt - ... |
465 466 467 |
for (k = 0; k < 8; k++) ahash_request_set_crypt(data[k].req, data[k].sg, data[k].result, speed[i].blen); |
087bcd225 crypto: tcrypt - ... |
468 |
|
72259deb3 crypto: tcrypt - ... |
469 470 |
pr_info("test%3u " "(%5u byte blocks,%5u bytes per update,%4u updates): ", |
087bcd225 crypto: tcrypt - ... |
471 472 |
i, speed[i].blen, speed[i].plen, speed[i].blen / speed[i].plen); |
72259deb3 crypto: tcrypt - ... |
473 474 475 476 |
start = get_cycles(); for (k = 0; k < 8; k++) { ret = crypto_ahash_digest(data[k].req); |
d13cd11fb crypto: tcrypt - ... |
477 478 |
if (ret == -EINPROGRESS) { ret = 0; |
087bcd225 crypto: tcrypt - ... |
479 |
continue; |
d13cd11fb crypto: tcrypt - ... |
480 |
} |
72259deb3 crypto: tcrypt - ... |
481 482 483 484 485 486 |
if (ret) break; complete(&data[k].tresult.completion); data[k].tresult.err = 0; |
087bcd225 crypto: tcrypt - ... |
487 |
} |
087bcd225 crypto: tcrypt - ... |
488 |
|
72259deb3 crypto: tcrypt - ... |
489 490 |
for (j = 0; j < k; j++) { struct tcrypt_result *tr = &data[j].tresult; |
087bcd225 crypto: tcrypt - ... |
491 |
|
72259deb3 crypto: tcrypt - ... |
492 493 494 |
wait_for_completion(&tr->completion); if (tr->err) ret = tr->err; |
087bcd225 crypto: tcrypt - ... |
495 |
} |
72259deb3 crypto: tcrypt - ... |
496 497 498 499 500 501 502 503 504 505 506 |
end = get_cycles(); cycles = end - start; pr_cont("%6lu cycles/operation, %4lu cycles/byte ", cycles, cycles / (8 * speed[i].blen)); if (ret) { pr_err("At least one hashing failed ret=%d ", ret); break; } |
087bcd225 crypto: tcrypt - ... |
507 |
} |
087bcd225 crypto: tcrypt - ... |
508 509 510 |
out: for (k = 0; k < 8; ++k) |
72259deb3 crypto: tcrypt - ... |
511 |
ahash_request_free(data[k].req); |
087bcd225 crypto: tcrypt - ... |
512 |
for (k = 0; k < 8; ++k) |
72259deb3 crypto: tcrypt - ... |
513 514 515 516 517 518 |
testmgr_free_buf(data[k].xbuf); crypto_free_ahash(tfm); free_data: kfree(data); |
087bcd225 crypto: tcrypt - ... |
519 |
} |
beb63da73 crypto: tcrypt - ... |
520 |
static int test_ahash_jiffies_digest(struct ahash_request *req, int blen, |
3e3dc25fe crypto: Resolve s... |
521 |
char *out, int secs) |
beb63da73 crypto: tcrypt - ... |
522 523 524 525 |
{ unsigned long start, end; int bcount; int ret; |
3e3dc25fe crypto: Resolve s... |
526 |
for (start = jiffies, end = start + secs * HZ, bcount = 0; |
beb63da73 crypto: tcrypt - ... |
527 528 529 530 531 532 533 534 |
time_before(jiffies, end); bcount++) { ret = do_one_ahash_op(req, crypto_ahash_digest(req)); if (ret) return ret; } printk("%6u opers/sec, %9lu bytes/sec ", |
3e3dc25fe crypto: Resolve s... |
535 |
bcount / secs, ((long)bcount * blen) / secs); |
beb63da73 crypto: tcrypt - ... |
536 537 538 539 540 |
return 0; } static int test_ahash_jiffies(struct ahash_request *req, int blen, |
3e3dc25fe crypto: Resolve s... |
541 |
int plen, char *out, int secs) |
beb63da73 crypto: tcrypt - ... |
542 543 544 545 546 547 |
{ unsigned long start, end; int bcount, pcount; int ret; if (plen == blen) |
3e3dc25fe crypto: Resolve s... |
548 |
return test_ahash_jiffies_digest(req, blen, out, secs); |
beb63da73 crypto: tcrypt - ... |
549 |
|
3e3dc25fe crypto: Resolve s... |
550 |
for (start = jiffies, end = start + secs * HZ, bcount = 0; |
beb63da73 crypto: tcrypt - ... |
551 |
time_before(jiffies, end); bcount++) { |
43a9607d8 crypto: tcrypt - ... |
552 |
ret = do_one_ahash_op(req, crypto_ahash_init(req)); |
beb63da73 crypto: tcrypt - ... |
553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 |
if (ret) return ret; for (pcount = 0; pcount < blen; pcount += plen) { ret = do_one_ahash_op(req, crypto_ahash_update(req)); if (ret) return ret; } /* we assume there is enough space in 'out' for the result */ ret = do_one_ahash_op(req, crypto_ahash_final(req)); if (ret) return ret; } pr_cont("%6u opers/sec, %9lu bytes/sec ", |
3e3dc25fe crypto: Resolve s... |
568 |
bcount / secs, ((long)bcount * blen) / secs); |
beb63da73 crypto: tcrypt - ... |
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 |
return 0; } static int test_ahash_cycles_digest(struct ahash_request *req, int blen, char *out) { unsigned long cycles = 0; int ret, i; /* Warm-up run. */ for (i = 0; i < 4; i++) { ret = do_one_ahash_op(req, crypto_ahash_digest(req)); if (ret) goto out; } /* The real thing. */ for (i = 0; i < 8; i++) { cycles_t start, end; start = get_cycles(); ret = do_one_ahash_op(req, crypto_ahash_digest(req)); if (ret) goto out; end = get_cycles(); cycles += end - start; } out: if (ret) return ret; pr_cont("%6lu cycles/operation, %4lu cycles/byte ", cycles / 8, cycles / (8 * blen)); return 0; } static int test_ahash_cycles(struct ahash_request *req, int blen, int plen, char *out) { unsigned long cycles = 0; int i, pcount, ret; if (plen == blen) return test_ahash_cycles_digest(req, blen, out); /* Warm-up run. */ for (i = 0; i < 4; i++) { |
43a9607d8 crypto: tcrypt - ... |
623 |
ret = do_one_ahash_op(req, crypto_ahash_init(req)); |
beb63da73 crypto: tcrypt - ... |
624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 |
if (ret) goto out; for (pcount = 0; pcount < blen; pcount += plen) { ret = do_one_ahash_op(req, crypto_ahash_update(req)); if (ret) goto out; } ret = do_one_ahash_op(req, crypto_ahash_final(req)); if (ret) goto out; } /* The real thing. */ for (i = 0; i < 8; i++) { cycles_t start, end; start = get_cycles(); |
43a9607d8 crypto: tcrypt - ... |
641 |
ret = do_one_ahash_op(req, crypto_ahash_init(req)); |
beb63da73 crypto: tcrypt - ... |
642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 |
if (ret) goto out; for (pcount = 0; pcount < blen; pcount += plen) { ret = do_one_ahash_op(req, crypto_ahash_update(req)); if (ret) goto out; } ret = do_one_ahash_op(req, crypto_ahash_final(req)); if (ret) goto out; end = get_cycles(); cycles += end - start; } out: if (ret) return ret; pr_cont("%6lu cycles/operation, %4lu cycles/byte ", cycles / 8, cycles / (8 * blen)); return 0; } |
0660511c0 crypto: tcrypt - ... |
668 669 |
static void test_ahash_speed_common(const char *algo, unsigned int secs, struct hash_speed *speed, unsigned mask) |
beb63da73 crypto: tcrypt - ... |
670 671 672 673 674 |
{ struct scatterlist sg[TVMEMSIZE]; struct tcrypt_result tresult; struct ahash_request *req; struct crypto_ahash *tfm; |
f074f7b10 crypto: tcrypt - ... |
675 |
char *output; |
beb63da73 crypto: tcrypt - ... |
676 |
int i, ret; |
0660511c0 crypto: tcrypt - ... |
677 |
tfm = crypto_alloc_ahash(algo, 0, mask); |
beb63da73 crypto: tcrypt - ... |
678 679 680 681 682 683 |
if (IS_ERR(tfm)) { pr_err("failed to load transform for %s: %ld ", algo, PTR_ERR(tfm)); return; } |
263a8df0d crypto: tcrypt - ... |
684 685 686 687 |
printk(KERN_INFO " testing speed of async %s (%s) ", algo, get_driver_name(crypto_ahash, tfm)); |
f074f7b10 crypto: tcrypt - ... |
688 689 690 691 |
if (crypto_ahash_digestsize(tfm) > MAX_DIGEST_SIZE) { pr_err("digestsize(%u) > %d ", crypto_ahash_digestsize(tfm), MAX_DIGEST_SIZE); |
beb63da73 crypto: tcrypt - ... |
692 693 694 695 696 697 698 699 700 701 702 703 704 705 |
goto out; } test_hash_sg_init(sg); req = ahash_request_alloc(tfm, GFP_KERNEL); if (!req) { pr_err("ahash request allocation failure "); goto out; } init_completion(&tresult.completion); ahash_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG, tcrypt_complete, &tresult); |
f074f7b10 crypto: tcrypt - ... |
706 707 708 |
output = kmalloc(MAX_DIGEST_SIZE, GFP_KERNEL); if (!output) goto out_nomem; |
beb63da73 crypto: tcrypt - ... |
709 710 711 712 713 714 715 716 717 718 719 720 721 |
for (i = 0; speed[i].blen != 0; i++) { if (speed[i].blen > TVMEMSIZE * PAGE_SIZE) { pr_err("template (%u) too big for tvmem (%lu) ", speed[i].blen, TVMEMSIZE * PAGE_SIZE); break; } pr_info("test%3u " "(%5u byte blocks,%5u bytes per update,%4u updates): ", i, speed[i].blen, speed[i].plen, speed[i].blen / speed[i].plen); ahash_request_set_crypt(req, sg, output, speed[i].plen); |
3e3dc25fe crypto: Resolve s... |
722 |
if (secs) |
beb63da73 crypto: tcrypt - ... |
723 |
ret = test_ahash_jiffies(req, speed[i].blen, |
3e3dc25fe crypto: Resolve s... |
724 |
speed[i].plen, output, secs); |
beb63da73 crypto: tcrypt - ... |
725 726 727 728 729 730 731 732 733 734 |
else ret = test_ahash_cycles(req, speed[i].blen, speed[i].plen, output); if (ret) { pr_err("hashing failed ret=%d ", ret); break; } } |
f074f7b10 crypto: tcrypt - ... |
735 736 737 |
kfree(output); out_nomem: |
beb63da73 crypto: tcrypt - ... |
738 739 740 741 742 |
ahash_request_free(req); out: crypto_free_ahash(tfm); } |
0660511c0 crypto: tcrypt - ... |
743 744 745 746 747 748 749 750 751 752 753 |
static void test_ahash_speed(const char *algo, unsigned int secs, struct hash_speed *speed) { return test_ahash_speed_common(algo, secs, speed, 0); } static void test_hash_speed(const char *algo, unsigned int secs, struct hash_speed *speed) { return test_ahash_speed_common(algo, secs, speed, CRYPTO_ALG_ASYNC); } |
7166e589d crypto: tcrypt - ... |
754 |
static inline int do_one_acipher_op(struct skcipher_request *req, int ret) |
3f3baf359 crypto: tcrypt - ... |
755 756 757 |
{ if (ret == -EINPROGRESS || ret == -EBUSY) { struct tcrypt_result *tr = req->base.data; |
8a45ac12e crypto: testmgr -... |
758 |
wait_for_completion(&tr->completion); |
16735d022 tree-wide: use re... |
759 |
reinit_completion(&tr->completion); |
8a45ac12e crypto: testmgr -... |
760 |
ret = tr->err; |
3f3baf359 crypto: tcrypt - ... |
761 762 763 764 |
} return ret; } |
7166e589d crypto: tcrypt - ... |
765 |
static int test_acipher_jiffies(struct skcipher_request *req, int enc, |
3e3dc25fe crypto: Resolve s... |
766 |
int blen, int secs) |
3f3baf359 crypto: tcrypt - ... |
767 768 769 770 |
{ unsigned long start, end; int bcount; int ret; |
3e3dc25fe crypto: Resolve s... |
771 |
for (start = jiffies, end = start + secs * HZ, bcount = 0; |
3f3baf359 crypto: tcrypt - ... |
772 773 774 |
time_before(jiffies, end); bcount++) { if (enc) ret = do_one_acipher_op(req, |
7166e589d crypto: tcrypt - ... |
775 |
crypto_skcipher_encrypt(req)); |
3f3baf359 crypto: tcrypt - ... |
776 777 |
else ret = do_one_acipher_op(req, |
7166e589d crypto: tcrypt - ... |
778 |
crypto_skcipher_decrypt(req)); |
3f3baf359 crypto: tcrypt - ... |
779 780 781 782 783 784 785 |
if (ret) return ret; } pr_cont("%d operations in %d seconds (%ld bytes) ", |
3e3dc25fe crypto: Resolve s... |
786 |
bcount, secs, (long)bcount * blen); |
3f3baf359 crypto: tcrypt - ... |
787 788 |
return 0; } |
7166e589d crypto: tcrypt - ... |
789 |
static int test_acipher_cycles(struct skcipher_request *req, int enc, |
3f3baf359 crypto: tcrypt - ... |
790 791 792 793 794 795 796 797 798 799 |
int blen) { unsigned long cycles = 0; int ret = 0; int i; /* Warm-up run. */ for (i = 0; i < 4; i++) { if (enc) ret = do_one_acipher_op(req, |
7166e589d crypto: tcrypt - ... |
800 |
crypto_skcipher_encrypt(req)); |
3f3baf359 crypto: tcrypt - ... |
801 802 |
else ret = do_one_acipher_op(req, |
7166e589d crypto: tcrypt - ... |
803 |
crypto_skcipher_decrypt(req)); |
3f3baf359 crypto: tcrypt - ... |
804 805 806 807 808 809 810 811 812 813 814 815 |
if (ret) goto out; } /* The real thing. */ for (i = 0; i < 8; i++) { cycles_t start, end; start = get_cycles(); if (enc) ret = do_one_acipher_op(req, |
7166e589d crypto: tcrypt - ... |
816 |
crypto_skcipher_encrypt(req)); |
3f3baf359 crypto: tcrypt - ... |
817 818 |
else ret = do_one_acipher_op(req, |
7166e589d crypto: tcrypt - ... |
819 |
crypto_skcipher_decrypt(req)); |
3f3baf359 crypto: tcrypt - ... |
820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 |
end = get_cycles(); if (ret) goto out; cycles += end - start; } out: if (ret == 0) pr_cont("1 operation in %lu cycles (%d bytes) ", (cycles + 4) / 8, blen); return ret; } |
7166e589d crypto: tcrypt - ... |
836 837 838 |
static void test_skcipher_speed(const char *algo, int enc, unsigned int secs, struct cipher_speed_template *template, unsigned int tcount, u8 *keysize, bool async) |
3f3baf359 crypto: tcrypt - ... |
839 |
{ |
de1975334 crypto: atmel - a... |
840 |
unsigned int ret, i, j, k, iv_len; |
3f3baf359 crypto: tcrypt - ... |
841 842 843 |
struct tcrypt_result tresult; const char *key; char iv[128]; |
7166e589d crypto: tcrypt - ... |
844 845 |
struct skcipher_request *req; struct crypto_skcipher *tfm; |
3f3baf359 crypto: tcrypt - ... |
846 847 848 849 850 851 852 |
const char *e; u32 *b_size; if (enc == ENCRYPT) e = "encryption"; else e = "decryption"; |
3f3baf359 crypto: tcrypt - ... |
853 |
init_completion(&tresult.completion); |
7166e589d crypto: tcrypt - ... |
854 |
tfm = crypto_alloc_skcipher(algo, 0, async ? 0 : CRYPTO_ALG_ASYNC); |
3f3baf359 crypto: tcrypt - ... |
855 856 857 858 859 860 861 |
if (IS_ERR(tfm)) { pr_err("failed to load transform for %s: %ld ", algo, PTR_ERR(tfm)); return; } |
263a8df0d crypto: tcrypt - ... |
862 863 864 |
pr_info(" testing speed of async %s (%s) %s ", algo, |
7166e589d crypto: tcrypt - ... |
865 |
get_driver_name(crypto_skcipher, tfm), e); |
263a8df0d crypto: tcrypt - ... |
866 |
|
7166e589d crypto: tcrypt - ... |
867 |
req = skcipher_request_alloc(tfm, GFP_KERNEL); |
3f3baf359 crypto: tcrypt - ... |
868 869 870 871 872 873 |
if (!req) { pr_err("tcrypt: skcipher: Failed to allocate request for %s ", algo); goto out; } |
7166e589d crypto: tcrypt - ... |
874 875 |
skcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG, tcrypt_complete, &tresult); |
3f3baf359 crypto: tcrypt - ... |
876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 |
i = 0; do { b_size = block_sizes; do { struct scatterlist sg[TVMEMSIZE]; if ((*keysize + *b_size) > TVMEMSIZE * PAGE_SIZE) { pr_err("template (%u) too big for " "tvmem (%lu) ", *keysize + *b_size, TVMEMSIZE * PAGE_SIZE); goto out_free_req; } pr_info("test %u (%d bit key, %d byte blocks): ", i, *keysize * 8, *b_size); memset(tvmem[0], 0xff, PAGE_SIZE); /* set key, plain text and IV */ key = tvmem[0]; for (j = 0; j < tcount; j++) { if (template[j].klen == *keysize) { key = template[j].key; break; } } |
7166e589d crypto: tcrypt - ... |
905 |
crypto_skcipher_clear_flags(tfm, ~0); |
3f3baf359 crypto: tcrypt - ... |
906 |
|
7166e589d crypto: tcrypt - ... |
907 |
ret = crypto_skcipher_setkey(tfm, key, *keysize); |
3f3baf359 crypto: tcrypt - ... |
908 909 910 |
if (ret) { pr_err("setkey() failed flags=%x ", |
7166e589d crypto: tcrypt - ... |
911 |
crypto_skcipher_get_flags(tfm)); |
3f3baf359 crypto: tcrypt - ... |
912 913 |
goto out_free_req; } |
de1975334 crypto: atmel - a... |
914 |
k = *keysize + *b_size; |
007ee8dec crypto: tcrypt - ... |
915 |
sg_init_table(sg, DIV_ROUND_UP(k, PAGE_SIZE)); |
de1975334 crypto: atmel - a... |
916 917 |
if (k > PAGE_SIZE) { sg_set_buf(sg, tvmem[0] + *keysize, |
3f3baf359 crypto: tcrypt - ... |
918 |
PAGE_SIZE - *keysize); |
de1975334 crypto: atmel - a... |
919 920 921 922 923 924 925 926 927 928 929 930 |
k -= PAGE_SIZE; j = 1; while (k > PAGE_SIZE) { sg_set_buf(sg + j, tvmem[j], PAGE_SIZE); memset(tvmem[j], 0xff, PAGE_SIZE); j++; k -= PAGE_SIZE; } sg_set_buf(sg + j, tvmem[j], k); memset(tvmem[j], 0xff, k); } else { sg_set_buf(sg, tvmem[0] + *keysize, *b_size); |
3f3baf359 crypto: tcrypt - ... |
931 |
} |
7166e589d crypto: tcrypt - ... |
932 |
iv_len = crypto_skcipher_ivsize(tfm); |
3f3baf359 crypto: tcrypt - ... |
933 934 |
if (iv_len) memset(&iv, 0xff, iv_len); |
7166e589d crypto: tcrypt - ... |
935 |
skcipher_request_set_crypt(req, sg, sg, *b_size, iv); |
3f3baf359 crypto: tcrypt - ... |
936 |
|
3e3dc25fe crypto: Resolve s... |
937 |
if (secs) |
3f3baf359 crypto: tcrypt - ... |
938 |
ret = test_acipher_jiffies(req, enc, |
3e3dc25fe crypto: Resolve s... |
939 |
*b_size, secs); |
3f3baf359 crypto: tcrypt - ... |
940 941 942 943 944 945 946 |
else ret = test_acipher_cycles(req, enc, *b_size); if (ret) { pr_err("%s() failed flags=%x ", e, |
7166e589d crypto: tcrypt - ... |
947 |
crypto_skcipher_get_flags(tfm)); |
3f3baf359 crypto: tcrypt - ... |
948 949 950 951 952 953 954 955 956 |
break; } b_size++; i++; } while (*b_size); keysize++; } while (*keysize); out_free_req: |
7166e589d crypto: tcrypt - ... |
957 |
skcipher_request_free(req); |
3f3baf359 crypto: tcrypt - ... |
958 |
out: |
7166e589d crypto: tcrypt - ... |
959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 |
crypto_free_skcipher(tfm); } static void test_acipher_speed(const char *algo, int enc, unsigned int secs, struct cipher_speed_template *template, unsigned int tcount, u8 *keysize) { return test_skcipher_speed(algo, enc, secs, template, tcount, keysize, true); } static void test_cipher_speed(const char *algo, int enc, unsigned int secs, struct cipher_speed_template *template, unsigned int tcount, u8 *keysize) { return test_skcipher_speed(algo, enc, secs, template, tcount, keysize, false); |
3f3baf359 crypto: tcrypt - ... |
976 |
} |
ef2736fc7 [CRYPTO]: White s... |
977 |
static void test_available(void) |
1da177e4c Linux-2.6.12-rc2 |
978 979 |
{ char **name = check; |
ef2736fc7 [CRYPTO]: White s... |
980 |
|
1da177e4c Linux-2.6.12-rc2 |
981 982 |
while (*name) { printk("alg %s ", *name); |
6158efc09 [CRYPTO] tcrypt: ... |
983 |
printk(crypto_has_alg(*name, 0, 0) ? |
e4d5b79c6 [CRYPTO] users: U... |
984 985 986 |
"found " : "not found "); |
1da177e4c Linux-2.6.12-rc2 |
987 |
name++; |
ef2736fc7 [CRYPTO]: White s... |
988 |
} |
1da177e4c Linux-2.6.12-rc2 |
989 |
} |
01b323245 crypto: tcrypt - ... |
990 991 |
static inline int tcrypt_test(const char *alg) { |
4e033a6bc crypto: tcrypt - ... |
992 993 994 995 996 997 998 |
int ret; ret = alg_test(alg, alg, 0, 0); /* non-fips algs return -EINVAL in fips mode */ if (fips_enabled && ret == -EINVAL) ret = 0; return ret; |
01b323245 crypto: tcrypt - ... |
999 |
} |
8606813a6 crypto: tcrypt - ... |
1000 |
static int do_test(const char *alg, u32 type, u32 mask, int m) |
01b323245 crypto: tcrypt - ... |
1001 1002 |
{ int i; |
4e033a6bc crypto: tcrypt - ... |
1003 |
int ret = 0; |
01b323245 crypto: tcrypt - ... |
1004 1005 |
switch (m) { |
1da177e4c Linux-2.6.12-rc2 |
1006 |
case 0: |
8606813a6 crypto: tcrypt - ... |
1007 1008 1009 1010 1011 1012 |
if (alg) { if (!crypto_has_alg(alg, type, mask ?: CRYPTO_ALG_TYPE_MASK)) ret = -ENOENT; break; } |
01b323245 crypto: tcrypt - ... |
1013 |
for (i = 1; i < 200; i++) |
8606813a6 crypto: tcrypt - ... |
1014 |
ret += do_test(NULL, 0, 0, i); |
1da177e4c Linux-2.6.12-rc2 |
1015 1016 1017 |
break; case 1: |
4e033a6bc crypto: tcrypt - ... |
1018 |
ret += tcrypt_test("md5"); |
1da177e4c Linux-2.6.12-rc2 |
1019 1020 1021 |
break; case 2: |
4e033a6bc crypto: tcrypt - ... |
1022 |
ret += tcrypt_test("sha1"); |
1da177e4c Linux-2.6.12-rc2 |
1023 1024 1025 |
break; case 3: |
4e033a6bc crypto: tcrypt - ... |
1026 1027 |
ret += tcrypt_test("ecb(des)"); ret += tcrypt_test("cbc(des)"); |
8163fc30d crypto: testmgr -... |
1028 |
ret += tcrypt_test("ctr(des)"); |
1da177e4c Linux-2.6.12-rc2 |
1029 1030 1031 |
break; case 4: |
4e033a6bc crypto: tcrypt - ... |
1032 1033 |
ret += tcrypt_test("ecb(des3_ede)"); ret += tcrypt_test("cbc(des3_ede)"); |
e080b17a8 crypto: testmgr -... |
1034 |
ret += tcrypt_test("ctr(des3_ede)"); |
1da177e4c Linux-2.6.12-rc2 |
1035 1036 1037 |
break; case 5: |
4e033a6bc crypto: tcrypt - ... |
1038 |
ret += tcrypt_test("md4"); |
1da177e4c Linux-2.6.12-rc2 |
1039 |
break; |
ef2736fc7 [CRYPTO]: White s... |
1040 |
|
1da177e4c Linux-2.6.12-rc2 |
1041 |
case 6: |
4e033a6bc crypto: tcrypt - ... |
1042 |
ret += tcrypt_test("sha256"); |
1da177e4c Linux-2.6.12-rc2 |
1043 |
break; |
ef2736fc7 [CRYPTO]: White s... |
1044 |
|
1da177e4c Linux-2.6.12-rc2 |
1045 |
case 7: |
4e033a6bc crypto: tcrypt - ... |
1046 1047 |
ret += tcrypt_test("ecb(blowfish)"); ret += tcrypt_test("cbc(blowfish)"); |
85b63e342 crypto: testmgr -... |
1048 |
ret += tcrypt_test("ctr(blowfish)"); |
1da177e4c Linux-2.6.12-rc2 |
1049 1050 1051 |
break; case 8: |
4e033a6bc crypto: tcrypt - ... |
1052 1053 |
ret += tcrypt_test("ecb(twofish)"); ret += tcrypt_test("cbc(twofish)"); |
573da6208 crypto: testmgr -... |
1054 |
ret += tcrypt_test("ctr(twofish)"); |
bee3a90ef crypto: tcrypt - ... |
1055 |
ret += tcrypt_test("lrw(twofish)"); |
131f75416 crypto: tcrypt - ... |
1056 |
ret += tcrypt_test("xts(twofish)"); |
1da177e4c Linux-2.6.12-rc2 |
1057 |
break; |
ef2736fc7 [CRYPTO]: White s... |
1058 |
|
1da177e4c Linux-2.6.12-rc2 |
1059 |
case 9: |
4e033a6bc crypto: tcrypt - ... |
1060 |
ret += tcrypt_test("ecb(serpent)"); |
9d25917d4 crypto: testmgr -... |
1061 1062 |
ret += tcrypt_test("cbc(serpent)"); ret += tcrypt_test("ctr(serpent)"); |
87aae4bfb crypto: tcrypt - ... |
1063 |
ret += tcrypt_test("lrw(serpent)"); |
5209c07ac crypto: tcrypt - ... |
1064 |
ret += tcrypt_test("xts(serpent)"); |
1da177e4c Linux-2.6.12-rc2 |
1065 1066 1067 |
break; case 10: |
4e033a6bc crypto: tcrypt - ... |
1068 1069 1070 1071 1072 1073 |
ret += tcrypt_test("ecb(aes)"); ret += tcrypt_test("cbc(aes)"); ret += tcrypt_test("lrw(aes)"); ret += tcrypt_test("xts(aes)"); ret += tcrypt_test("ctr(aes)"); ret += tcrypt_test("rfc3686(ctr(aes))"); |
1da177e4c Linux-2.6.12-rc2 |
1074 1075 1076 |
break; case 11: |
4e033a6bc crypto: tcrypt - ... |
1077 |
ret += tcrypt_test("sha384"); |
1da177e4c Linux-2.6.12-rc2 |
1078 |
break; |
ef2736fc7 [CRYPTO]: White s... |
1079 |
|
1da177e4c Linux-2.6.12-rc2 |
1080 |
case 12: |
4e033a6bc crypto: tcrypt - ... |
1081 |
ret += tcrypt_test("sha512"); |
1da177e4c Linux-2.6.12-rc2 |
1082 1083 1084 |
break; case 13: |
4e033a6bc crypto: tcrypt - ... |
1085 |
ret += tcrypt_test("deflate"); |
1da177e4c Linux-2.6.12-rc2 |
1086 1087 1088 |
break; case 14: |
4e033a6bc crypto: tcrypt - ... |
1089 |
ret += tcrypt_test("ecb(cast5)"); |
a2c582609 crypto: testmgr -... |
1090 1091 |
ret += tcrypt_test("cbc(cast5)"); ret += tcrypt_test("ctr(cast5)"); |
1da177e4c Linux-2.6.12-rc2 |
1092 1093 1094 |
break; case 15: |
4e033a6bc crypto: tcrypt - ... |
1095 |
ret += tcrypt_test("ecb(cast6)"); |
9b8b04051 crypto: testmgr -... |
1096 1097 1098 1099 |
ret += tcrypt_test("cbc(cast6)"); ret += tcrypt_test("ctr(cast6)"); ret += tcrypt_test("lrw(cast6)"); ret += tcrypt_test("xts(cast6)"); |
1da177e4c Linux-2.6.12-rc2 |
1100 1101 1102 |
break; case 16: |
4e033a6bc crypto: tcrypt - ... |
1103 |
ret += tcrypt_test("ecb(arc4)"); |
1da177e4c Linux-2.6.12-rc2 |
1104 1105 1106 |
break; case 17: |
4e033a6bc crypto: tcrypt - ... |
1107 |
ret += tcrypt_test("michael_mic"); |
1da177e4c Linux-2.6.12-rc2 |
1108 1109 1110 |
break; case 18: |
4e033a6bc crypto: tcrypt - ... |
1111 |
ret += tcrypt_test("crc32c"); |
1da177e4c Linux-2.6.12-rc2 |
1112 1113 1114 |
break; case 19: |
4e033a6bc crypto: tcrypt - ... |
1115 |
ret += tcrypt_test("ecb(tea)"); |
1da177e4c Linux-2.6.12-rc2 |
1116 1117 1118 |
break; case 20: |
4e033a6bc crypto: tcrypt - ... |
1119 |
ret += tcrypt_test("ecb(xtea)"); |
1da177e4c Linux-2.6.12-rc2 |
1120 1121 1122 |
break; case 21: |
4e033a6bc crypto: tcrypt - ... |
1123 |
ret += tcrypt_test("ecb(khazad)"); |
1da177e4c Linux-2.6.12-rc2 |
1124 1125 1126 |
break; case 22: |
4e033a6bc crypto: tcrypt - ... |
1127 |
ret += tcrypt_test("wp512"); |
1da177e4c Linux-2.6.12-rc2 |
1128 1129 1130 |
break; case 23: |
4e033a6bc crypto: tcrypt - ... |
1131 |
ret += tcrypt_test("wp384"); |
1da177e4c Linux-2.6.12-rc2 |
1132 1133 1134 |
break; case 24: |
4e033a6bc crypto: tcrypt - ... |
1135 |
ret += tcrypt_test("wp256"); |
1da177e4c Linux-2.6.12-rc2 |
1136 1137 1138 |
break; case 25: |
4e033a6bc crypto: tcrypt - ... |
1139 |
ret += tcrypt_test("ecb(tnepres)"); |
1da177e4c Linux-2.6.12-rc2 |
1140 1141 1142 |
break; case 26: |
4e033a6bc crypto: tcrypt - ... |
1143 1144 |
ret += tcrypt_test("ecb(anubis)"); ret += tcrypt_test("cbc(anubis)"); |
1da177e4c Linux-2.6.12-rc2 |
1145 1146 1147 |
break; case 27: |
4e033a6bc crypto: tcrypt - ... |
1148 |
ret += tcrypt_test("tgr192"); |
1da177e4c Linux-2.6.12-rc2 |
1149 1150 1151 |
break; case 28: |
4e033a6bc crypto: tcrypt - ... |
1152 |
ret += tcrypt_test("tgr160"); |
1da177e4c Linux-2.6.12-rc2 |
1153 1154 1155 |
break; case 29: |
4e033a6bc crypto: tcrypt - ... |
1156 |
ret += tcrypt_test("tgr128"); |
1da177e4c Linux-2.6.12-rc2 |
1157 |
break; |
2998db37b [CRYPTO] tcrypt: ... |
1158 |
|
fb4f10ed5 [CRYPTO]: Fix XTE... |
1159 |
case 30: |
4e033a6bc crypto: tcrypt - ... |
1160 |
ret += tcrypt_test("ecb(xeta)"); |
fb4f10ed5 [CRYPTO]: Fix XTE... |
1161 |
break; |
1da177e4c Linux-2.6.12-rc2 |
1162 |
|
90831639a [CRYPTO] fcrypt: ... |
1163 |
case 31: |
4e033a6bc crypto: tcrypt - ... |
1164 |
ret += tcrypt_test("pcbc(fcrypt)"); |
90831639a [CRYPTO] fcrypt: ... |
1165 |
break; |
02ab5a705 [CRYPTO] camellia... |
1166 |
case 32: |
4e033a6bc crypto: tcrypt - ... |
1167 1168 |
ret += tcrypt_test("ecb(camellia)"); ret += tcrypt_test("cbc(camellia)"); |
54216bbd7 crypto: tcrypt - ... |
1169 1170 1171 |
ret += tcrypt_test("ctr(camellia)"); ret += tcrypt_test("lrw(camellia)"); ret += tcrypt_test("xts(camellia)"); |
02ab5a705 [CRYPTO] camellia... |
1172 |
break; |
93b5e86a6 crypto: add CMAC ... |
1173 |
|
cd12fb906 [CRYPTO] sha256-g... |
1174 |
case 33: |
4e033a6bc crypto: tcrypt - ... |
1175 |
ret += tcrypt_test("sha224"); |
cd12fb906 [CRYPTO] sha256-g... |
1176 |
break; |
02ab5a705 [CRYPTO] camellia... |
1177 |
|
2407d6087 [CRYPTO] salsa20:... |
1178 |
case 34: |
4e033a6bc crypto: tcrypt - ... |
1179 |
ret += tcrypt_test("salsa20"); |
2407d6087 [CRYPTO] salsa20:... |
1180 |
break; |
8df213d9b [CRYPTO] tcrypt: ... |
1181 |
case 35: |
4e033a6bc crypto: tcrypt - ... |
1182 |
ret += tcrypt_test("gcm(aes)"); |
8df213d9b [CRYPTO] tcrypt: ... |
1183 |
break; |
0b77abb3b [CRYPTO] lzo: Add... |
1184 |
case 36: |
4e033a6bc crypto: tcrypt - ... |
1185 |
ret += tcrypt_test("lzo"); |
0b77abb3b [CRYPTO] lzo: Add... |
1186 |
break; |
93cc74e07 [CRYPTO] tcrypt: ... |
1187 |
case 37: |
4e033a6bc crypto: tcrypt - ... |
1188 |
ret += tcrypt_test("ccm(aes)"); |
93cc74e07 [CRYPTO] tcrypt: ... |
1189 |
break; |
76cb95217 [CRYPTO] cts: Add... |
1190 |
case 38: |
4e033a6bc crypto: tcrypt - ... |
1191 |
ret += tcrypt_test("cts(cbc(aes))"); |
76cb95217 [CRYPTO] cts: Add... |
1192 |
break; |
fd4adf1a0 [CRYPTO] tcrypt: ... |
1193 |
case 39: |
4e033a6bc crypto: tcrypt - ... |
1194 |
ret += tcrypt_test("rmd128"); |
fd4adf1a0 [CRYPTO] tcrypt: ... |
1195 1196 1197 |
break; case 40: |
4e033a6bc crypto: tcrypt - ... |
1198 |
ret += tcrypt_test("rmd160"); |
fd4adf1a0 [CRYPTO] tcrypt: ... |
1199 |
break; |
2998db37b [CRYPTO] tcrypt: ... |
1200 |
case 41: |
4e033a6bc crypto: tcrypt - ... |
1201 |
ret += tcrypt_test("rmd256"); |
2998db37b [CRYPTO] tcrypt: ... |
1202 1203 1204 |
break; case 42: |
4e033a6bc crypto: tcrypt - ... |
1205 |
ret += tcrypt_test("rmd320"); |
01b323245 crypto: tcrypt - ... |
1206 1207 1208 |
break; case 43: |
4e033a6bc crypto: tcrypt - ... |
1209 |
ret += tcrypt_test("ecb(seed)"); |
2998db37b [CRYPTO] tcrypt: ... |
1210 |
break; |
0c01aed50 crypto: testmgr -... |
1211 |
case 44: |
4e033a6bc crypto: tcrypt - ... |
1212 |
ret += tcrypt_test("zlib"); |
0c01aed50 crypto: testmgr -... |
1213 |
break; |
5d667322a crypto: testmgr -... |
1214 |
case 45: |
4e033a6bc crypto: tcrypt - ... |
1215 |
ret += tcrypt_test("rfc4309(ccm(aes))"); |
5d667322a crypto: testmgr -... |
1216 |
break; |
54216bbd7 crypto: tcrypt - ... |
1217 1218 1219 |
case 46: ret += tcrypt_test("ghash"); break; |
68411521c Reinstate "crypto... |
1220 1221 1222 |
case 47: ret += tcrypt_test("crct10dif"); break; |
79cc6ab89 crypto: sha3 - Ad... |
1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 |
case 48: ret += tcrypt_test("sha3-224"); break; case 49: ret += tcrypt_test("sha3-256"); break; case 50: ret += tcrypt_test("sha3-384"); break; case 51: ret += tcrypt_test("sha3-512"); break; |
1da177e4c Linux-2.6.12-rc2 |
1238 |
case 100: |
4e033a6bc crypto: tcrypt - ... |
1239 |
ret += tcrypt_test("hmac(md5)"); |
1da177e4c Linux-2.6.12-rc2 |
1240 |
break; |
ef2736fc7 [CRYPTO]: White s... |
1241 |
|
1da177e4c Linux-2.6.12-rc2 |
1242 |
case 101: |
4e033a6bc crypto: tcrypt - ... |
1243 |
ret += tcrypt_test("hmac(sha1)"); |
1da177e4c Linux-2.6.12-rc2 |
1244 |
break; |
ef2736fc7 [CRYPTO]: White s... |
1245 |
|
1da177e4c Linux-2.6.12-rc2 |
1246 |
case 102: |
4e033a6bc crypto: tcrypt - ... |
1247 |
ret += tcrypt_test("hmac(sha256)"); |
1da177e4c Linux-2.6.12-rc2 |
1248 |
break; |
a28091ae1 [CRYPTO] tcrypt: ... |
1249 |
case 103: |
4e033a6bc crypto: tcrypt - ... |
1250 |
ret += tcrypt_test("hmac(sha384)"); |
a28091ae1 [CRYPTO] tcrypt: ... |
1251 1252 1253 |
break; case 104: |
4e033a6bc crypto: tcrypt - ... |
1254 |
ret += tcrypt_test("hmac(sha512)"); |
a28091ae1 [CRYPTO] tcrypt: ... |
1255 |
break; |
38ed9ab23 [CRYPTO] tcrypt: ... |
1256 |
|
cd12fb906 [CRYPTO] sha256-g... |
1257 |
case 105: |
4e033a6bc crypto: tcrypt - ... |
1258 |
ret += tcrypt_test("hmac(sha224)"); |
cd12fb906 [CRYPTO] sha256-g... |
1259 |
break; |
1da177e4c Linux-2.6.12-rc2 |
1260 |
|
38ed9ab23 [CRYPTO] tcrypt: ... |
1261 |
case 106: |
4e033a6bc crypto: tcrypt - ... |
1262 |
ret += tcrypt_test("xcbc(aes)"); |
38ed9ab23 [CRYPTO] tcrypt: ... |
1263 |
break; |
fd4adf1a0 [CRYPTO] tcrypt: ... |
1264 |
case 107: |
4e033a6bc crypto: tcrypt - ... |
1265 |
ret += tcrypt_test("hmac(rmd128)"); |
fd4adf1a0 [CRYPTO] tcrypt: ... |
1266 1267 1268 |
break; case 108: |
4e033a6bc crypto: tcrypt - ... |
1269 |
ret += tcrypt_test("hmac(rmd160)"); |
fd4adf1a0 [CRYPTO] tcrypt: ... |
1270 |
break; |
f1939f7c5 crypto: vmac - Ne... |
1271 1272 1273 |
case 109: ret += tcrypt_test("vmac(aes)"); break; |
93b5e86a6 crypto: add CMAC ... |
1274 |
|
a482b081a crypto: testmgr -... |
1275 1276 1277 |
case 110: ret += tcrypt_test("hmac(crc32)"); break; |
f1939f7c5 crypto: vmac - Ne... |
1278 |
|
98eca72fa crypto: sha3 - Ad... |
1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 |
case 111: ret += tcrypt_test("hmac(sha3-224)"); break; case 112: ret += tcrypt_test("hmac(sha3-256)"); break; case 113: ret += tcrypt_test("hmac(sha3-384)"); break; case 114: ret += tcrypt_test("hmac(sha3-512)"); break; |
e08ca2da3 crypto: testmgr -... |
1294 |
case 150: |
4e033a6bc crypto: tcrypt - ... |
1295 |
ret += tcrypt_test("ansi_cprng"); |
e08ca2da3 crypto: testmgr -... |
1296 |
break; |
69435b94d crypto: rfc4106 -... |
1297 1298 1299 |
case 151: ret += tcrypt_test("rfc4106(gcm(aes))"); break; |
e9b7441a9 crypto: testmgr -... |
1300 1301 1302 |
case 152: ret += tcrypt_test("rfc4543(gcm(aes))"); break; |
93b5e86a6 crypto: add CMAC ... |
1303 1304 1305 1306 1307 1308 1309 |
case 153: ret += tcrypt_test("cmac(aes)"); break; case 154: ret += tcrypt_test("cmac(des3_ede)"); break; |
bbf9c8934 crypto: caam - fi... |
1310 1311 1312 |
case 155: ret += tcrypt_test("authenc(hmac(sha1),cbc(aes))"); break; |
bca4feb0d crypto: testmgr -... |
1313 1314 1315 1316 1317 1318 1319 |
case 156: ret += tcrypt_test("authenc(hmac(md5),ecb(cipher_null))"); break; case 157: ret += tcrypt_test("authenc(hmac(sha1),ecb(cipher_null))"); break; |
5208ed2ca crypto: testmgr -... |
1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 |
case 181: ret += tcrypt_test("authenc(hmac(sha1),cbc(des))"); break; case 182: ret += tcrypt_test("authenc(hmac(sha1),cbc(des3_ede))"); break; case 183: ret += tcrypt_test("authenc(hmac(sha224),cbc(des))"); break; case 184: ret += tcrypt_test("authenc(hmac(sha224),cbc(des3_ede))"); break; case 185: ret += tcrypt_test("authenc(hmac(sha256),cbc(des))"); break; case 186: ret += tcrypt_test("authenc(hmac(sha256),cbc(des3_ede))"); break; case 187: ret += tcrypt_test("authenc(hmac(sha384),cbc(des))"); break; case 188: ret += tcrypt_test("authenc(hmac(sha384),cbc(des3_ede))"); break; case 189: ret += tcrypt_test("authenc(hmac(sha512),cbc(des))"); break; case 190: ret += tcrypt_test("authenc(hmac(sha512),cbc(des3_ede))"); break; |
ebfd9bcf1 [CRYPTO]: Add cip... |
1350 |
case 200: |
cba83564d [CRYPTO] tcrypt: ... |
1351 |
test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1352 |
speed_template_16_24_32); |
cba83564d [CRYPTO] tcrypt: ... |
1353 |
test_cipher_speed("ecb(aes)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1354 |
speed_template_16_24_32); |
cba83564d [CRYPTO] tcrypt: ... |
1355 |
test_cipher_speed("cbc(aes)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1356 |
speed_template_16_24_32); |
cba83564d [CRYPTO] tcrypt: ... |
1357 |
test_cipher_speed("cbc(aes)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1358 |
speed_template_16_24_32); |
f3d1044cd [CRYPTO] tcrypt: ... |
1359 |
test_cipher_speed("lrw(aes)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1360 |
speed_template_32_40_48); |
f3d1044cd [CRYPTO] tcrypt: ... |
1361 |
test_cipher_speed("lrw(aes)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1362 |
speed_template_32_40_48); |
f19f5111c [CRYPTO] xts: XTS... |
1363 |
test_cipher_speed("xts(aes)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1364 |
speed_template_32_48_64); |
f19f5111c [CRYPTO] xts: XTS... |
1365 |
test_cipher_speed("xts(aes)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1366 |
speed_template_32_48_64); |
1503a24f5 crypto: tcrypt - ... |
1367 1368 1369 1370 |
test_cipher_speed("cts(cbc(aes))", ENCRYPT, sec, NULL, 0, speed_template_16_24_32); test_cipher_speed("cts(cbc(aes))", DECRYPT, sec, NULL, 0, speed_template_16_24_32); |
9996e3421 crypto: tcrypt - ... |
1371 1372 1373 1374 |
test_cipher_speed("ctr(aes)", ENCRYPT, sec, NULL, 0, speed_template_16_24_32); test_cipher_speed("ctr(aes)", DECRYPT, sec, NULL, 0, speed_template_16_24_32); |
ebfd9bcf1 [CRYPTO]: Add cip... |
1375 1376 1377 |
break; case 201: |
cba83564d [CRYPTO] tcrypt: ... |
1378 |
test_cipher_speed("ecb(des3_ede)", ENCRYPT, sec, |
da7f033dd crypto: cryptomgr... |
1379 |
des3_speed_template, DES3_SPEED_VECTORS, |
477035c2a [CRYPTO] tcrypt: ... |
1380 |
speed_template_24); |
cba83564d [CRYPTO] tcrypt: ... |
1381 |
test_cipher_speed("ecb(des3_ede)", DECRYPT, sec, |
da7f033dd crypto: cryptomgr... |
1382 |
des3_speed_template, DES3_SPEED_VECTORS, |
477035c2a [CRYPTO] tcrypt: ... |
1383 |
speed_template_24); |
cba83564d [CRYPTO] tcrypt: ... |
1384 |
test_cipher_speed("cbc(des3_ede)", ENCRYPT, sec, |
da7f033dd crypto: cryptomgr... |
1385 |
des3_speed_template, DES3_SPEED_VECTORS, |
477035c2a [CRYPTO] tcrypt: ... |
1386 |
speed_template_24); |
cba83564d [CRYPTO] tcrypt: ... |
1387 |
test_cipher_speed("cbc(des3_ede)", DECRYPT, sec, |
da7f033dd crypto: cryptomgr... |
1388 |
des3_speed_template, DES3_SPEED_VECTORS, |
477035c2a [CRYPTO] tcrypt: ... |
1389 |
speed_template_24); |
87131507e crypto: tcrypt - ... |
1390 1391 1392 1393 1394 1395 |
test_cipher_speed("ctr(des3_ede)", ENCRYPT, sec, des3_speed_template, DES3_SPEED_VECTORS, speed_template_24); test_cipher_speed("ctr(des3_ede)", DECRYPT, sec, des3_speed_template, DES3_SPEED_VECTORS, speed_template_24); |
ebfd9bcf1 [CRYPTO]: Add cip... |
1396 1397 1398 |
break; case 202: |
cba83564d [CRYPTO] tcrypt: ... |
1399 |
test_cipher_speed("ecb(twofish)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1400 |
speed_template_16_24_32); |
cba83564d [CRYPTO] tcrypt: ... |
1401 |
test_cipher_speed("ecb(twofish)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1402 |
speed_template_16_24_32); |
cba83564d [CRYPTO] tcrypt: ... |
1403 |
test_cipher_speed("cbc(twofish)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1404 |
speed_template_16_24_32); |
cba83564d [CRYPTO] tcrypt: ... |
1405 |
test_cipher_speed("cbc(twofish)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1406 |
speed_template_16_24_32); |
ee5002a54 crypto: tcrypt - ... |
1407 1408 1409 1410 |
test_cipher_speed("ctr(twofish)", ENCRYPT, sec, NULL, 0, speed_template_16_24_32); test_cipher_speed("ctr(twofish)", DECRYPT, sec, NULL, 0, speed_template_16_24_32); |
bee3a90ef crypto: tcrypt - ... |
1411 1412 1413 1414 |
test_cipher_speed("lrw(twofish)", ENCRYPT, sec, NULL, 0, speed_template_32_40_48); test_cipher_speed("lrw(twofish)", DECRYPT, sec, NULL, 0, speed_template_32_40_48); |
131f75416 crypto: tcrypt - ... |
1415 1416 1417 1418 |
test_cipher_speed("xts(twofish)", ENCRYPT, sec, NULL, 0, speed_template_32_48_64); test_cipher_speed("xts(twofish)", DECRYPT, sec, NULL, 0, speed_template_32_48_64); |
ebfd9bcf1 [CRYPTO]: Add cip... |
1419 1420 1421 |
break; case 203: |
cba83564d [CRYPTO] tcrypt: ... |
1422 |
test_cipher_speed("ecb(blowfish)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1423 |
speed_template_8_32); |
cba83564d [CRYPTO] tcrypt: ... |
1424 |
test_cipher_speed("ecb(blowfish)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1425 |
speed_template_8_32); |
cba83564d [CRYPTO] tcrypt: ... |
1426 |
test_cipher_speed("cbc(blowfish)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1427 |
speed_template_8_32); |
cba83564d [CRYPTO] tcrypt: ... |
1428 |
test_cipher_speed("cbc(blowfish)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1429 |
speed_template_8_32); |
7d47b86cf crypto: tcrypt - ... |
1430 1431 1432 1433 |
test_cipher_speed("ctr(blowfish)", ENCRYPT, sec, NULL, 0, speed_template_8_32); test_cipher_speed("ctr(blowfish)", DECRYPT, sec, NULL, 0, speed_template_8_32); |
ebfd9bcf1 [CRYPTO]: Add cip... |
1434 1435 1436 |
break; case 204: |
cba83564d [CRYPTO] tcrypt: ... |
1437 |
test_cipher_speed("ecb(des)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1438 |
speed_template_8); |
cba83564d [CRYPTO] tcrypt: ... |
1439 |
test_cipher_speed("ecb(des)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1440 |
speed_template_8); |
cba83564d [CRYPTO] tcrypt: ... |
1441 |
test_cipher_speed("cbc(des)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1442 |
speed_template_8); |
cba83564d [CRYPTO] tcrypt: ... |
1443 |
test_cipher_speed("cbc(des)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1444 |
speed_template_8); |
ebfd9bcf1 [CRYPTO]: Add cip... |
1445 |
break; |
02ab5a705 [CRYPTO] camellia... |
1446 1447 |
case 205: test_cipher_speed("ecb(camellia)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1448 |
speed_template_16_24_32); |
02ab5a705 [CRYPTO] camellia... |
1449 |
test_cipher_speed("ecb(camellia)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1450 |
speed_template_16_24_32); |
02ab5a705 [CRYPTO] camellia... |
1451 |
test_cipher_speed("cbc(camellia)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1452 |
speed_template_16_24_32); |
02ab5a705 [CRYPTO] camellia... |
1453 |
test_cipher_speed("cbc(camellia)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1454 |
speed_template_16_24_32); |
4de593378 crypto: tcrypt - ... |
1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 |
test_cipher_speed("ctr(camellia)", ENCRYPT, sec, NULL, 0, speed_template_16_24_32); test_cipher_speed("ctr(camellia)", DECRYPT, sec, NULL, 0, speed_template_16_24_32); test_cipher_speed("lrw(camellia)", ENCRYPT, sec, NULL, 0, speed_template_32_40_48); test_cipher_speed("lrw(camellia)", DECRYPT, sec, NULL, 0, speed_template_32_40_48); test_cipher_speed("xts(camellia)", ENCRYPT, sec, NULL, 0, speed_template_32_48_64); test_cipher_speed("xts(camellia)", DECRYPT, sec, NULL, 0, speed_template_32_48_64); |
02ab5a705 [CRYPTO] camellia... |
1467 |
break; |
5de8f1b56 [CRYPTO] tcrypt: ... |
1468 1469 |
case 206: test_cipher_speed("salsa20", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1470 |
speed_template_16_32); |
5de8f1b56 [CRYPTO] tcrypt: ... |
1471 |
break; |
7fb7fe446 crypto: tcrypt - ... |
1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 |
case 207: test_cipher_speed("ecb(serpent)", ENCRYPT, sec, NULL, 0, speed_template_16_32); test_cipher_speed("ecb(serpent)", DECRYPT, sec, NULL, 0, speed_template_16_32); test_cipher_speed("cbc(serpent)", ENCRYPT, sec, NULL, 0, speed_template_16_32); test_cipher_speed("cbc(serpent)", DECRYPT, sec, NULL, 0, speed_template_16_32); test_cipher_speed("ctr(serpent)", ENCRYPT, sec, NULL, 0, speed_template_16_32); test_cipher_speed("ctr(serpent)", DECRYPT, sec, NULL, 0, speed_template_16_32); |
87aae4bfb crypto: tcrypt - ... |
1485 1486 1487 1488 |
test_cipher_speed("lrw(serpent)", ENCRYPT, sec, NULL, 0, speed_template_32_48); test_cipher_speed("lrw(serpent)", DECRYPT, sec, NULL, 0, speed_template_32_48); |
5209c07ac crypto: tcrypt - ... |
1489 1490 1491 1492 |
test_cipher_speed("xts(serpent)", ENCRYPT, sec, NULL, 0, speed_template_32_64); test_cipher_speed("xts(serpent)", DECRYPT, sec, NULL, 0, speed_template_32_64); |
7fb7fe446 crypto: tcrypt - ... |
1493 |
break; |
31b4cd290 crypto: testmgr -... |
1494 1495 1496 1497 |
case 208: test_cipher_speed("ecb(arc4)", ENCRYPT, sec, NULL, 0, speed_template_8); break; |
a2c582609 crypto: testmgr -... |
1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 |
case 209: test_cipher_speed("ecb(cast5)", ENCRYPT, sec, NULL, 0, speed_template_8_16); test_cipher_speed("ecb(cast5)", DECRYPT, sec, NULL, 0, speed_template_8_16); test_cipher_speed("cbc(cast5)", ENCRYPT, sec, NULL, 0, speed_template_8_16); test_cipher_speed("cbc(cast5)", DECRYPT, sec, NULL, 0, speed_template_8_16); test_cipher_speed("ctr(cast5)", ENCRYPT, sec, NULL, 0, speed_template_8_16); test_cipher_speed("ctr(cast5)", DECRYPT, sec, NULL, 0, speed_template_8_16); break; |
9b8b04051 crypto: testmgr -... |
1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 |
case 210: test_cipher_speed("ecb(cast6)", ENCRYPT, sec, NULL, 0, speed_template_16_32); test_cipher_speed("ecb(cast6)", DECRYPT, sec, NULL, 0, speed_template_16_32); test_cipher_speed("cbc(cast6)", ENCRYPT, sec, NULL, 0, speed_template_16_32); test_cipher_speed("cbc(cast6)", DECRYPT, sec, NULL, 0, speed_template_16_32); test_cipher_speed("ctr(cast6)", ENCRYPT, sec, NULL, 0, speed_template_16_32); test_cipher_speed("ctr(cast6)", DECRYPT, sec, NULL, 0, speed_template_16_32); test_cipher_speed("lrw(cast6)", ENCRYPT, sec, NULL, 0, speed_template_32_48); test_cipher_speed("lrw(cast6)", DECRYPT, sec, NULL, 0, speed_template_32_48); test_cipher_speed("xts(cast6)", ENCRYPT, sec, NULL, 0, speed_template_32_64); test_cipher_speed("xts(cast6)", DECRYPT, sec, NULL, 0, speed_template_32_64); break; |
53f52d7ae crypto: tcrypt - ... |
1534 1535 |
case 211: test_aead_speed("rfc4106(gcm(aes))", ENCRYPT, sec, |
34a1c740e crypto: tcrypt - ... |
1536 |
NULL, 0, 16, 16, aead_speed_template_20); |
1425d2d17 crypto: tcrypt - ... |
1537 |
test_aead_speed("gcm(aes)", ENCRYPT, sec, |
f18611da8 crypto: tcrypt - ... |
1538 |
NULL, 0, 16, 8, speed_template_16_24_32); |
53f52d7ae crypto: tcrypt - ... |
1539 |
break; |
4e4aab63d crypto: tcrypt - ... |
1540 1541 |
case 212: test_aead_speed("rfc4309(ccm(aes))", ENCRYPT, sec, |
34a1c740e crypto: tcrypt - ... |
1542 |
NULL, 0, 16, 16, aead_speed_template_19); |
4e4aab63d crypto: tcrypt - ... |
1543 |
break; |
2dce063a3 crypto: tcrypt - ... |
1544 1545 1546 1547 1548 1549 1550 1551 1552 |
case 213: test_aead_speed("rfc7539esp(chacha20,poly1305)", ENCRYPT, sec, NULL, 0, 16, 8, aead_speed_template_36); break; case 214: test_cipher_speed("chacha20", ENCRYPT, sec, NULL, 0, speed_template_32); break; |
e80579285 [CRYPTO] tcrypt: ... |
1553 |
case 300: |
8606813a6 crypto: tcrypt - ... |
1554 1555 1556 1557 |
if (alg) { test_hash_speed(alg, sec, generic_hash_speed_template); break; } |
e80579285 [CRYPTO] tcrypt: ... |
1558 1559 1560 |
/* fall through */ case 301: |
e9d41164e [CRYPTO] tcrypt: ... |
1561 |
test_hash_speed("md4", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1562 1563 1564 |
if (mode > 300 && mode < 400) break; case 302: |
e9d41164e [CRYPTO] tcrypt: ... |
1565 |
test_hash_speed("md5", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1566 1567 1568 |
if (mode > 300 && mode < 400) break; case 303: |
e9d41164e [CRYPTO] tcrypt: ... |
1569 |
test_hash_speed("sha1", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1570 1571 1572 |
if (mode > 300 && mode < 400) break; case 304: |
e9d41164e [CRYPTO] tcrypt: ... |
1573 |
test_hash_speed("sha256", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1574 1575 1576 |
if (mode > 300 && mode < 400) break; case 305: |
e9d41164e [CRYPTO] tcrypt: ... |
1577 |
test_hash_speed("sha384", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1578 1579 1580 |
if (mode > 300 && mode < 400) break; case 306: |
e9d41164e [CRYPTO] tcrypt: ... |
1581 |
test_hash_speed("sha512", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1582 1583 1584 |
if (mode > 300 && mode < 400) break; case 307: |
e9d41164e [CRYPTO] tcrypt: ... |
1585 |
test_hash_speed("wp256", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1586 1587 1588 |
if (mode > 300 && mode < 400) break; case 308: |
e9d41164e [CRYPTO] tcrypt: ... |
1589 |
test_hash_speed("wp384", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1590 1591 1592 |
if (mode > 300 && mode < 400) break; case 309: |
e9d41164e [CRYPTO] tcrypt: ... |
1593 |
test_hash_speed("wp512", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1594 1595 1596 |
if (mode > 300 && mode < 400) break; case 310: |
e9d41164e [CRYPTO] tcrypt: ... |
1597 |
test_hash_speed("tgr128", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1598 1599 1600 |
if (mode > 300 && mode < 400) break; case 311: |
e9d41164e [CRYPTO] tcrypt: ... |
1601 |
test_hash_speed("tgr160", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1602 1603 1604 |
if (mode > 300 && mode < 400) break; case 312: |
e9d41164e [CRYPTO] tcrypt: ... |
1605 |
test_hash_speed("tgr192", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1606 |
if (mode > 300 && mode < 400) break; |
cd12fb906 [CRYPTO] sha256-g... |
1607 1608 1609 |
case 313: test_hash_speed("sha224", sec, generic_hash_speed_template); if (mode > 300 && mode < 400) break; |
fd4adf1a0 [CRYPTO] tcrypt: ... |
1610 1611 1612 1613 1614 1615 1616 |
case 314: test_hash_speed("rmd128", sec, generic_hash_speed_template); if (mode > 300 && mode < 400) break; case 315: test_hash_speed("rmd160", sec, generic_hash_speed_template); if (mode > 300 && mode < 400) break; |
2998db37b [CRYPTO] tcrypt: ... |
1617 1618 1619 1620 1621 1622 1623 |
case 316: test_hash_speed("rmd256", sec, generic_hash_speed_template); if (mode > 300 && mode < 400) break; case 317: test_hash_speed("rmd320", sec, generic_hash_speed_template); if (mode > 300 && mode < 400) break; |
18bcc9194 crypto: tcrypt - ... |
1624 1625 1626 |
case 318: test_hash_speed("ghash-generic", sec, hash_speed_template_16); if (mode > 300 && mode < 400) break; |
e3899e4df crypto: tcrypt - ... |
1627 1628 1629 |
case 319: test_hash_speed("crc32c", sec, generic_hash_speed_template); if (mode > 300 && mode < 400) break; |
68411521c Reinstate "crypto... |
1630 1631 1632 |
case 320: test_hash_speed("crct10dif", sec, generic_hash_speed_template); if (mode > 300 && mode < 400) break; |
2dce063a3 crypto: tcrypt - ... |
1633 1634 1635 |
case 321: test_hash_speed("poly1305", sec, poly1305_speed_template); if (mode > 300 && mode < 400) break; |
79cc6ab89 crypto: sha3 - Ad... |
1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 |
case 322: test_hash_speed("sha3-224", sec, generic_hash_speed_template); if (mode > 300 && mode < 400) break; case 323: test_hash_speed("sha3-256", sec, generic_hash_speed_template); if (mode > 300 && mode < 400) break; case 324: test_hash_speed("sha3-384", sec, generic_hash_speed_template); if (mode > 300 && mode < 400) break; case 325: test_hash_speed("sha3-512", sec, generic_hash_speed_template); if (mode > 300 && mode < 400) break; |
e80579285 [CRYPTO] tcrypt: ... |
1651 1652 |
case 399: break; |
beb63da73 crypto: tcrypt - ... |
1653 |
case 400: |
8606813a6 crypto: tcrypt - ... |
1654 1655 1656 1657 |
if (alg) { test_ahash_speed(alg, sec, generic_hash_speed_template); break; } |
beb63da73 crypto: tcrypt - ... |
1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 |
/* fall through */ case 401: test_ahash_speed("md4", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; case 402: test_ahash_speed("md5", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; case 403: test_ahash_speed("sha1", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; case 404: test_ahash_speed("sha256", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; case 405: test_ahash_speed("sha384", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; case 406: test_ahash_speed("sha512", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; case 407: test_ahash_speed("wp256", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; case 408: test_ahash_speed("wp384", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; case 409: test_ahash_speed("wp512", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; case 410: test_ahash_speed("tgr128", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; case 411: test_ahash_speed("tgr160", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; case 412: test_ahash_speed("tgr192", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; case 413: test_ahash_speed("sha224", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; case 414: test_ahash_speed("rmd128", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; case 415: test_ahash_speed("rmd160", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; case 416: test_ahash_speed("rmd256", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; case 417: test_ahash_speed("rmd320", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; |
79cc6ab89 crypto: sha3 - Ad... |
1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 |
case 418: test_ahash_speed("sha3-224", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; case 419: test_ahash_speed("sha3-256", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; case 420: test_ahash_speed("sha3-384", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; case 421: test_ahash_speed("sha3-512", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; |
087bcd225 crypto: tcrypt - ... |
1743 1744 1745 1746 1747 1748 1749 |
case 422: test_mb_ahash_speed("sha1", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; case 423: test_mb_ahash_speed("sha256", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; |
79cc6ab89 crypto: sha3 - Ad... |
1750 |
|
14009c4bd crypto: tcrypt - ... |
1751 1752 1753 |
case 424: test_mb_ahash_speed("sha512", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; |
beb63da73 crypto: tcrypt - ... |
1754 1755 |
case 499: break; |
3f3baf359 crypto: tcrypt - ... |
1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 |
case 500: test_acipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0, speed_template_16_24_32); test_acipher_speed("ecb(aes)", DECRYPT, sec, NULL, 0, speed_template_16_24_32); test_acipher_speed("cbc(aes)", ENCRYPT, sec, NULL, 0, speed_template_16_24_32); test_acipher_speed("cbc(aes)", DECRYPT, sec, NULL, 0, speed_template_16_24_32); test_acipher_speed("lrw(aes)", ENCRYPT, sec, NULL, 0, speed_template_32_40_48); test_acipher_speed("lrw(aes)", DECRYPT, sec, NULL, 0, speed_template_32_40_48); test_acipher_speed("xts(aes)", ENCRYPT, sec, NULL, 0, speed_template_32_48_64); test_acipher_speed("xts(aes)", DECRYPT, sec, NULL, 0, speed_template_32_48_64); |
1503a24f5 crypto: tcrypt - ... |
1773 1774 1775 1776 |
test_acipher_speed("cts(cbc(aes))", ENCRYPT, sec, NULL, 0, speed_template_16_24_32); test_acipher_speed("cts(cbc(aes))", DECRYPT, sec, NULL, 0, speed_template_16_24_32); |
3f3baf359 crypto: tcrypt - ... |
1777 1778 1779 1780 |
test_acipher_speed("ctr(aes)", ENCRYPT, sec, NULL, 0, speed_template_16_24_32); test_acipher_speed("ctr(aes)", DECRYPT, sec, NULL, 0, speed_template_16_24_32); |
de1975334 crypto: atmel - a... |
1781 1782 1783 1784 1785 1786 1787 1788 |
test_acipher_speed("cfb(aes)", ENCRYPT, sec, NULL, 0, speed_template_16_24_32); test_acipher_speed("cfb(aes)", DECRYPT, sec, NULL, 0, speed_template_16_24_32); test_acipher_speed("ofb(aes)", ENCRYPT, sec, NULL, 0, speed_template_16_24_32); test_acipher_speed("ofb(aes)", DECRYPT, sec, NULL, 0, speed_template_16_24_32); |
69d3150cf crypto: ctr - mak... |
1789 1790 1791 1792 |
test_acipher_speed("rfc3686(ctr(aes))", ENCRYPT, sec, NULL, 0, speed_template_20_28_36); test_acipher_speed("rfc3686(ctr(aes))", DECRYPT, sec, NULL, 0, speed_template_20_28_36); |
3f3baf359 crypto: tcrypt - ... |
1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 |
break; case 501: test_acipher_speed("ecb(des3_ede)", ENCRYPT, sec, des3_speed_template, DES3_SPEED_VECTORS, speed_template_24); test_acipher_speed("ecb(des3_ede)", DECRYPT, sec, des3_speed_template, DES3_SPEED_VECTORS, speed_template_24); test_acipher_speed("cbc(des3_ede)", ENCRYPT, sec, des3_speed_template, DES3_SPEED_VECTORS, speed_template_24); test_acipher_speed("cbc(des3_ede)", DECRYPT, sec, des3_speed_template, DES3_SPEED_VECTORS, speed_template_24); |
de1975334 crypto: atmel - a... |
1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 |
test_acipher_speed("cfb(des3_ede)", ENCRYPT, sec, des3_speed_template, DES3_SPEED_VECTORS, speed_template_24); test_acipher_speed("cfb(des3_ede)", DECRYPT, sec, des3_speed_template, DES3_SPEED_VECTORS, speed_template_24); test_acipher_speed("ofb(des3_ede)", ENCRYPT, sec, des3_speed_template, DES3_SPEED_VECTORS, speed_template_24); test_acipher_speed("ofb(des3_ede)", DECRYPT, sec, des3_speed_template, DES3_SPEED_VECTORS, speed_template_24); |
3f3baf359 crypto: tcrypt - ... |
1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 |
break; case 502: test_acipher_speed("ecb(des)", ENCRYPT, sec, NULL, 0, speed_template_8); test_acipher_speed("ecb(des)", DECRYPT, sec, NULL, 0, speed_template_8); test_acipher_speed("cbc(des)", ENCRYPT, sec, NULL, 0, speed_template_8); test_acipher_speed("cbc(des)", DECRYPT, sec, NULL, 0, speed_template_8); |
de1975334 crypto: atmel - a... |
1831 1832 1833 1834 1835 1836 1837 1838 |
test_acipher_speed("cfb(des)", ENCRYPT, sec, NULL, 0, speed_template_8); test_acipher_speed("cfb(des)", DECRYPT, sec, NULL, 0, speed_template_8); test_acipher_speed("ofb(des)", ENCRYPT, sec, NULL, 0, speed_template_8); test_acipher_speed("ofb(des)", DECRYPT, sec, NULL, 0, speed_template_8); |
3f3baf359 crypto: tcrypt - ... |
1839 |
break; |
7fb7fe446 crypto: tcrypt - ... |
1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 |
case 503: test_acipher_speed("ecb(serpent)", ENCRYPT, sec, NULL, 0, speed_template_16_32); test_acipher_speed("ecb(serpent)", DECRYPT, sec, NULL, 0, speed_template_16_32); test_acipher_speed("cbc(serpent)", ENCRYPT, sec, NULL, 0, speed_template_16_32); test_acipher_speed("cbc(serpent)", DECRYPT, sec, NULL, 0, speed_template_16_32); test_acipher_speed("ctr(serpent)", ENCRYPT, sec, NULL, 0, speed_template_16_32); test_acipher_speed("ctr(serpent)", DECRYPT, sec, NULL, 0, speed_template_16_32); |
87aae4bfb crypto: tcrypt - ... |
1853 1854 1855 1856 |
test_acipher_speed("lrw(serpent)", ENCRYPT, sec, NULL, 0, speed_template_32_48); test_acipher_speed("lrw(serpent)", DECRYPT, sec, NULL, 0, speed_template_32_48); |
5209c07ac crypto: tcrypt - ... |
1857 1858 1859 1860 |
test_acipher_speed("xts(serpent)", ENCRYPT, sec, NULL, 0, speed_template_32_64); test_acipher_speed("xts(serpent)", DECRYPT, sec, NULL, 0, speed_template_32_64); |
7fb7fe446 crypto: tcrypt - ... |
1861 |
break; |
107778b59 crypto: twofish -... |
1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 |
case 504: test_acipher_speed("ecb(twofish)", ENCRYPT, sec, NULL, 0, speed_template_16_24_32); test_acipher_speed("ecb(twofish)", DECRYPT, sec, NULL, 0, speed_template_16_24_32); test_acipher_speed("cbc(twofish)", ENCRYPT, sec, NULL, 0, speed_template_16_24_32); test_acipher_speed("cbc(twofish)", DECRYPT, sec, NULL, 0, speed_template_16_24_32); test_acipher_speed("ctr(twofish)", ENCRYPT, sec, NULL, 0, speed_template_16_24_32); test_acipher_speed("ctr(twofish)", DECRYPT, sec, NULL, 0, speed_template_16_24_32); test_acipher_speed("lrw(twofish)", ENCRYPT, sec, NULL, 0, speed_template_32_40_48); test_acipher_speed("lrw(twofish)", DECRYPT, sec, NULL, 0, speed_template_32_40_48); test_acipher_speed("xts(twofish)", ENCRYPT, sec, NULL, 0, speed_template_32_48_64); test_acipher_speed("xts(twofish)", DECRYPT, sec, NULL, 0, speed_template_32_48_64); break; |
31b4cd290 crypto: testmgr -... |
1884 1885 1886 1887 |
case 505: test_acipher_speed("ecb(arc4)", ENCRYPT, sec, NULL, 0, speed_template_8); break; |
a2c582609 crypto: testmgr -... |
1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 |
case 506: test_acipher_speed("ecb(cast5)", ENCRYPT, sec, NULL, 0, speed_template_8_16); test_acipher_speed("ecb(cast5)", DECRYPT, sec, NULL, 0, speed_template_8_16); test_acipher_speed("cbc(cast5)", ENCRYPT, sec, NULL, 0, speed_template_8_16); test_acipher_speed("cbc(cast5)", DECRYPT, sec, NULL, 0, speed_template_8_16); test_acipher_speed("ctr(cast5)", ENCRYPT, sec, NULL, 0, speed_template_8_16); test_acipher_speed("ctr(cast5)", DECRYPT, sec, NULL, 0, speed_template_8_16); break; |
9b8b04051 crypto: testmgr -... |
1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 |
case 507: test_acipher_speed("ecb(cast6)", ENCRYPT, sec, NULL, 0, speed_template_16_32); test_acipher_speed("ecb(cast6)", DECRYPT, sec, NULL, 0, speed_template_16_32); test_acipher_speed("cbc(cast6)", ENCRYPT, sec, NULL, 0, speed_template_16_32); test_acipher_speed("cbc(cast6)", DECRYPT, sec, NULL, 0, speed_template_16_32); test_acipher_speed("ctr(cast6)", ENCRYPT, sec, NULL, 0, speed_template_16_32); test_acipher_speed("ctr(cast6)", DECRYPT, sec, NULL, 0, speed_template_16_32); test_acipher_speed("lrw(cast6)", ENCRYPT, sec, NULL, 0, speed_template_32_48); test_acipher_speed("lrw(cast6)", DECRYPT, sec, NULL, 0, speed_template_32_48); test_acipher_speed("xts(cast6)", ENCRYPT, sec, NULL, 0, speed_template_32_64); test_acipher_speed("xts(cast6)", DECRYPT, sec, NULL, 0, speed_template_32_64); break; |
bf9c51818 crypto: tcrypt - ... |
1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 |
case 508: test_acipher_speed("ecb(camellia)", ENCRYPT, sec, NULL, 0, speed_template_16_32); test_acipher_speed("ecb(camellia)", DECRYPT, sec, NULL, 0, speed_template_16_32); test_acipher_speed("cbc(camellia)", ENCRYPT, sec, NULL, 0, speed_template_16_32); test_acipher_speed("cbc(camellia)", DECRYPT, sec, NULL, 0, speed_template_16_32); test_acipher_speed("ctr(camellia)", ENCRYPT, sec, NULL, 0, speed_template_16_32); test_acipher_speed("ctr(camellia)", DECRYPT, sec, NULL, 0, speed_template_16_32); test_acipher_speed("lrw(camellia)", ENCRYPT, sec, NULL, 0, speed_template_32_48); test_acipher_speed("lrw(camellia)", DECRYPT, sec, NULL, 0, speed_template_32_48); test_acipher_speed("xts(camellia)", ENCRYPT, sec, NULL, 0, speed_template_32_64); test_acipher_speed("xts(camellia)", DECRYPT, sec, NULL, 0, speed_template_32_64); break; |
ad8b7c3e9 crypto: tcrypt - ... |
1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 |
case 509: test_acipher_speed("ecb(blowfish)", ENCRYPT, sec, NULL, 0, speed_template_8_32); test_acipher_speed("ecb(blowfish)", DECRYPT, sec, NULL, 0, speed_template_8_32); test_acipher_speed("cbc(blowfish)", ENCRYPT, sec, NULL, 0, speed_template_8_32); test_acipher_speed("cbc(blowfish)", DECRYPT, sec, NULL, 0, speed_template_8_32); test_acipher_speed("ctr(blowfish)", ENCRYPT, sec, NULL, 0, speed_template_8_32); test_acipher_speed("ctr(blowfish)", DECRYPT, sec, NULL, 0, speed_template_8_32); break; |
1da177e4c Linux-2.6.12-rc2 |
1960 1961 1962 |
case 1000: test_available(); break; |
1da177e4c Linux-2.6.12-rc2 |
1963 |
} |
4e033a6bc crypto: tcrypt - ... |
1964 1965 |
return ret; |
1da177e4c Linux-2.6.12-rc2 |
1966 |
} |
3af5b90bd [CRYPTO] all: Cle... |
1967 |
static int __init tcrypt_mod_init(void) |
1da177e4c Linux-2.6.12-rc2 |
1968 |
{ |
e3a4ea4fd [CRYPTO] tcrypt: ... |
1969 |
int err = -ENOMEM; |
f139cfa7c crypto: tcrypt - ... |
1970 |
int i; |
e3a4ea4fd [CRYPTO] tcrypt: ... |
1971 |
|
f139cfa7c crypto: tcrypt - ... |
1972 1973 1974 1975 1976 |
for (i = 0; i < TVMEMSIZE; i++) { tvmem[i] = (void *)__get_free_page(GFP_KERNEL); if (!tvmem[i]) goto err_free_tv; } |
1da177e4c Linux-2.6.12-rc2 |
1977 |
|
8606813a6 crypto: tcrypt - ... |
1978 |
err = do_test(alg, type, mask, mode); |
a873a5f1c crypto: tcrypt - ... |
1979 |
|
4e033a6bc crypto: tcrypt - ... |
1980 1981 1982 1983 1984 |
if (err) { printk(KERN_ERR "tcrypt: one or more tests failed! "); goto err_free_tv; } |
14fdf477a [CRYPTO] tcrypt: ... |
1985 |
|
4e033a6bc crypto: tcrypt - ... |
1986 1987 1988 1989 |
/* We intentionaly return -EAGAIN to prevent keeping the module, * unless we're running in fips mode. It does all its work from * init() and doesn't offer any runtime functionality, but in * the fips case, checking for a successful load is helpful. |
14fdf477a [CRYPTO] tcrypt: ... |
1990 1991 1992 |
* => we don't need it in the memory, do we? * -- mludvig */ |
4e033a6bc crypto: tcrypt - ... |
1993 1994 |
if (!fips_enabled) err = -EAGAIN; |
e3a4ea4fd [CRYPTO] tcrypt: ... |
1995 |
|
f139cfa7c crypto: tcrypt - ... |
1996 1997 1998 |
err_free_tv: for (i = 0; i < TVMEMSIZE && tvmem[i]; i++) free_page((unsigned long)tvmem[i]); |
e3a4ea4fd [CRYPTO] tcrypt: ... |
1999 2000 |
return err; |
1da177e4c Linux-2.6.12-rc2 |
2001 2002 2003 2004 2005 2006 |
} /* * If an init function is provided, an exit function must also be provided * to allow module unload. */ |
3af5b90bd [CRYPTO] all: Cle... |
2007 |
static void __exit tcrypt_mod_fini(void) { } |
1da177e4c Linux-2.6.12-rc2 |
2008 |
|
3af5b90bd [CRYPTO] all: Cle... |
2009 2010 |
module_init(tcrypt_mod_init); module_exit(tcrypt_mod_fini); |
1da177e4c Linux-2.6.12-rc2 |
2011 |
|
a873a5f1c crypto: tcrypt - ... |
2012 2013 |
module_param(alg, charp, 0); module_param(type, uint, 0); |
7be380f72 crypto: tcrypt - ... |
2014 |
module_param(mask, uint, 0); |
1da177e4c Linux-2.6.12-rc2 |
2015 |
module_param(mode, int, 0); |
ebfd9bcf1 [CRYPTO]: Add cip... |
2016 |
module_param(sec, uint, 0); |
6a17944ca [CRYPTO]: Use CPU... |
2017 2018 |
MODULE_PARM_DESC(sec, "Length in seconds of speed tests " "(defaults to zero which uses CPU cycles instead)"); |
1da177e4c Linux-2.6.12-rc2 |
2019 2020 2021 2022 |
MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Quick & dirty crypto testing module"); MODULE_AUTHOR("James Morris <jmorris@intercode.com.au>"); |