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 |
*/ |
76512f2d8 crypto: tcrypt - ... |
24 |
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
1ce5a04d9 crypto: tcrypt - ... |
25 |
#include <crypto/aead.h> |
18e33e6d5 crypto: hash - Mo... |
26 |
#include <crypto/hash.h> |
7166e589d crypto: tcrypt - ... |
27 |
#include <crypto/skcipher.h> |
cba83564d [CRYPTO] tcrypt: ... |
28 |
#include <linux/err.h> |
daf0944cf crypto: tcrypt - ... |
29 |
#include <linux/fips.h> |
1da177e4c Linux-2.6.12-rc2 |
30 |
#include <linux/init.h> |
5a0e3ad6a include cleanup: ... |
31 |
#include <linux/gfp.h> |
1da177e4c Linux-2.6.12-rc2 |
32 |
#include <linux/module.h> |
378f058cc [PATCH] Use sg_se... |
33 |
#include <linux/scatterlist.h> |
1da177e4c Linux-2.6.12-rc2 |
34 |
#include <linux/string.h> |
1da177e4c Linux-2.6.12-rc2 |
35 |
#include <linux/moduleparam.h> |
ebfd9bcf1 [CRYPTO]: Add cip... |
36 |
#include <linux/jiffies.h> |
6a17944ca [CRYPTO]: Use CPU... |
37 38 |
#include <linux/timex.h> #include <linux/interrupt.h> |
1da177e4c Linux-2.6.12-rc2 |
39 40 41 |
#include "tcrypt.h" /* |
f139cfa7c crypto: tcrypt - ... |
42 |
* Need slab memory for testing (size in number of pages). |
1da177e4c Linux-2.6.12-rc2 |
43 |
*/ |
f139cfa7c crypto: tcrypt - ... |
44 |
#define TVMEMSIZE 4 |
1da177e4c Linux-2.6.12-rc2 |
45 46 |
/* |
da7f033dd crypto: cryptomgr... |
47 |
* Used by test_cipher_speed() |
1da177e4c Linux-2.6.12-rc2 |
48 49 50 |
*/ #define ENCRYPT 1 #define DECRYPT 0 |
1da177e4c Linux-2.6.12-rc2 |
51 |
|
f074f7b10 crypto: tcrypt - ... |
52 |
#define MAX_DIGEST_SIZE 64 |
ebfd9bcf1 [CRYPTO]: Add cip... |
53 |
/* |
263a8df0d crypto: tcrypt - ... |
54 55 56 57 58 |
* 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... |
59 60 |
* Used by test_cipher_speed() */ |
6a17944ca [CRYPTO]: Use CPU... |
61 |
static unsigned int sec; |
ebfd9bcf1 [CRYPTO]: Add cip... |
62 |
|
a873a5f1c crypto: tcrypt - ... |
63 64 |
static char *alg = NULL; static u32 type; |
7be380f72 crypto: tcrypt - ... |
65 |
static u32 mask; |
1da177e4c Linux-2.6.12-rc2 |
66 |
static int mode; |
f139cfa7c crypto: tcrypt - ... |
67 |
static char *tvmem[TVMEMSIZE]; |
1da177e4c Linux-2.6.12-rc2 |
68 69 |
static char *check[] = { |
cd12fb906 [CRYPTO] sha256-g... |
70 71 72 |
"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: ... |
73 |
"khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt", |
2998db37b [CRYPTO] tcrypt: ... |
74 |
"camellia", "seed", "salsa20", "rmd128", "rmd160", "rmd256", "rmd320", |
c594f9aec MLK-19365: crypto... |
75 |
"lzo", "cts", "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 |
return 0; } static int test_aead_cycles(struct aead_request *req, int enc, int blen) { unsigned long cycles = 0; int ret = 0; int i; |
53f52d7ae crypto: tcrypt - ... |
133 134 135 |
/* Warm-up run. */ for (i = 0; i < 4; i++) { if (enc) |
1425d2d17 crypto: tcrypt - ... |
136 |
ret = do_one_aead_op(req, crypto_aead_encrypt(req)); |
53f52d7ae crypto: tcrypt - ... |
137 |
else |
1425d2d17 crypto: tcrypt - ... |
138 |
ret = do_one_aead_op(req, crypto_aead_decrypt(req)); |
53f52d7ae crypto: tcrypt - ... |
139 140 141 142 143 144 145 146 147 148 149 |
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 - ... |
150 |
ret = do_one_aead_op(req, crypto_aead_encrypt(req)); |
53f52d7ae crypto: tcrypt - ... |
151 |
else |
1425d2d17 crypto: tcrypt - ... |
152 |
ret = do_one_aead_op(req, crypto_aead_decrypt(req)); |
53f52d7ae crypto: tcrypt - ... |
153 154 155 156 157 158 159 160 161 |
end = get_cycles(); if (ret) goto out; cycles += end - start; } out: |
53f52d7ae crypto: tcrypt - ... |
162 163 164 165 166 167 168 |
if (ret == 0) printk("1 operation in %lu cycles (%d bytes) ", (cycles + 4) / 8, blen); return ret; } |
d5dc39274 [CRYPTO] tcrypt: ... |
169 |
static u32 block_sizes[] = { 16, 64, 256, 1024, 8192, 0 }; |
53f52d7ae crypto: tcrypt - ... |
170 171 172 173 174 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 |
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 - ... |
207 208 209 |
if (np > XBUFSIZE) { rem = PAGE_SIZE; np = XBUFSIZE; |
c47689931 crypto: tcrypt - ... |
210 211 |
} else { rem = buflen % PAGE_SIZE; |
53f52d7ae crypto: tcrypt - ... |
212 |
} |
c47689931 crypto: tcrypt - ... |
213 |
|
31267270a crypto: tcrypt - ... |
214 |
sg_init_table(sg, np + 1); |
3a570cfe7 crypto: tcrypt - ... |
215 216 |
if (rem) np--; |
c47689931 crypto: tcrypt - ... |
217 |
for (k = 0; k < np; k++) |
31267270a crypto: tcrypt - ... |
218 |
sg_set_buf(&sg[k + 1], xbuf[k], PAGE_SIZE); |
c47689931 crypto: tcrypt - ... |
219 |
|
3a570cfe7 crypto: tcrypt - ... |
220 221 |
if (rem) sg_set_buf(&sg[k + 1], xbuf[k], rem); |
53f52d7ae crypto: tcrypt - ... |
222 |
} |
3e3dc25fe crypto: Resolve s... |
223 |
static void test_aead_speed(const char *algo, int enc, unsigned int secs, |
53f52d7ae crypto: tcrypt - ... |
224 225 226 227 228 229 230 231 232 233 |
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 - ... |
234 235 236 |
struct scatterlist *sgout; const char *e; void *assoc; |
96692a730 crypto: tcrypt - ... |
237 |
char *iv; |
53f52d7ae crypto: tcrypt - ... |
238 239 240 241 242 |
char *xbuf[XBUFSIZE]; char *xoutbuf[XBUFSIZE]; char *axbuf[XBUFSIZE]; unsigned int *b_size; unsigned int iv_len; |
1425d2d17 crypto: tcrypt - ... |
243 |
struct tcrypt_result result; |
53f52d7ae crypto: tcrypt - ... |
244 |
|
96692a730 crypto: tcrypt - ... |
245 246 247 |
iv = kzalloc(MAX_IVLEN, GFP_KERNEL); if (!iv) return; |
ac5f863f8 crypto: tcrypt - ... |
248 249 250 |
if (aad_size >= PAGE_SIZE) { pr_err("associate data length (%u) too big ", aad_size); |
96692a730 crypto: tcrypt - ... |
251 |
goto out_noxbuf; |
ac5f863f8 crypto: tcrypt - ... |
252 |
} |
53f52d7ae crypto: tcrypt - ... |
253 254 255 256 257 258 259 260 261 262 263 |
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 - ... |
264 |
sg = kmalloc(sizeof(*sg) * 9 * 2, GFP_KERNEL); |
53f52d7ae crypto: tcrypt - ... |
265 266 |
if (!sg) goto out_nosg; |
a3f2185a2 crypto: tcrypt - ... |
267 |
sgout = &sg[9]; |
53f52d7ae crypto: tcrypt - ... |
268 |
|
5e4b8c1fc crypto: aead - Re... |
269 |
tfm = crypto_alloc_aead(algo, 0, 0); |
53f52d7ae crypto: tcrypt - ... |
270 271 272 273 274 |
if (IS_ERR(tfm)) { pr_err("alg: aead: Failed to load transform for %s: %ld ", algo, PTR_ERR(tfm)); |
a2ea6ed6a crypto: tcrypt - ... |
275 |
goto out_notfm; |
53f52d7ae crypto: tcrypt - ... |
276 |
} |
1425d2d17 crypto: tcrypt - ... |
277 |
init_completion(&result.completion); |
263a8df0d crypto: tcrypt - ... |
278 279 280 281 |
printk(KERN_INFO " testing speed of %s (%s) %s ", algo, get_driver_name(crypto_aead, tfm), e); |
53f52d7ae crypto: tcrypt - ... |
282 283 284 285 286 |
req = aead_request_alloc(tfm, GFP_KERNEL); if (!req) { pr_err("alg: aead: Failed to allocate request for %s ", algo); |
6af1f93e2 crypto: tcrypt - ... |
287 |
goto out_noreq; |
53f52d7ae crypto: tcrypt - ... |
288 |
} |
1425d2d17 crypto: tcrypt - ... |
289 290 |
aead_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG, tcrypt_complete, &result); |
53f52d7ae crypto: tcrypt - ... |
291 292 293 294 295 |
i = 0; do { b_size = aead_sizes; do { assoc = axbuf[0]; |
ac5f863f8 crypto: tcrypt - ... |
296 |
memset(assoc, 0xff, aad_size); |
53f52d7ae crypto: tcrypt - ... |
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 |
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 - ... |
318 |
memset(iv, 0xff, iv_len); |
53f52d7ae crypto: tcrypt - ... |
319 320 321 322 323 324 325 326 327 328 329 330 331 332 |
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 - ... |
333 |
sg_init_aead(sg, xbuf, |
6479a108b crypto: tcrypt - ... |
334 |
*b_size + (enc ? 0 : authsize)); |
53f52d7ae crypto: tcrypt - ... |
335 |
|
31267270a crypto: tcrypt - ... |
336 |
sg_init_aead(sgout, xoutbuf, |
53f52d7ae crypto: tcrypt - ... |
337 |
*b_size + (enc ? authsize : 0)); |
31267270a crypto: tcrypt - ... |
338 339 |
sg_set_buf(&sg[0], assoc, aad_size); sg_set_buf(&sgout[0], assoc, aad_size); |
6479a108b crypto: tcrypt - ... |
340 341 342 |
aead_request_set_crypt(req, sg, sgout, *b_size + (enc ? 0 : authsize), 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 |
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; } |
0c8496c52 crypto: tcrypt - ... |
716 717 |
if (speed[i].klen) crypto_ahash_setkey(tfm, tvmem[0], speed[i].klen); |
beb63da73 crypto: tcrypt - ... |
718 719 720 721 722 |
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... |
723 |
if (secs) |
beb63da73 crypto: tcrypt - ... |
724 |
ret = test_ahash_jiffies(req, speed[i].blen, |
3e3dc25fe crypto: Resolve s... |
725 |
speed[i].plen, output, secs); |
beb63da73 crypto: tcrypt - ... |
726 727 728 729 730 731 732 733 734 735 |
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 - ... |
736 737 738 |
kfree(output); out_nomem: |
beb63da73 crypto: tcrypt - ... |
739 740 741 742 743 |
ahash_request_free(req); out: crypto_free_ahash(tfm); } |
0660511c0 crypto: tcrypt - ... |
744 745 746 747 748 749 750 751 752 753 754 |
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 - ... |
755 |
static inline int do_one_acipher_op(struct skcipher_request *req, int ret) |
3f3baf359 crypto: tcrypt - ... |
756 757 758 |
{ if (ret == -EINPROGRESS || ret == -EBUSY) { struct tcrypt_result *tr = req->base.data; |
8a45ac12e crypto: testmgr -... |
759 |
wait_for_completion(&tr->completion); |
16735d022 tree-wide: use re... |
760 |
reinit_completion(&tr->completion); |
8a45ac12e crypto: testmgr -... |
761 |
ret = tr->err; |
3f3baf359 crypto: tcrypt - ... |
762 763 764 765 |
} return ret; } |
7166e589d crypto: tcrypt - ... |
766 |
static int test_acipher_jiffies(struct skcipher_request *req, int enc, |
3e3dc25fe crypto: Resolve s... |
767 |
int blen, int secs) |
3f3baf359 crypto: tcrypt - ... |
768 769 770 771 |
{ unsigned long start, end; int bcount; int ret; |
3e3dc25fe crypto: Resolve s... |
772 |
for (start = jiffies, end = start + secs * HZ, bcount = 0; |
3f3baf359 crypto: tcrypt - ... |
773 774 775 |
time_before(jiffies, end); bcount++) { if (enc) ret = do_one_acipher_op(req, |
7166e589d crypto: tcrypt - ... |
776 |
crypto_skcipher_encrypt(req)); |
3f3baf359 crypto: tcrypt - ... |
777 778 |
else ret = do_one_acipher_op(req, |
7166e589d crypto: tcrypt - ... |
779 |
crypto_skcipher_decrypt(req)); |
3f3baf359 crypto: tcrypt - ... |
780 781 782 783 784 785 786 |
if (ret) return ret; } pr_cont("%d operations in %d seconds (%ld bytes) ", |
3e3dc25fe crypto: Resolve s... |
787 |
bcount, secs, (long)bcount * blen); |
3f3baf359 crypto: tcrypt - ... |
788 789 |
return 0; } |
7166e589d crypto: tcrypt - ... |
790 |
static int test_acipher_cycles(struct skcipher_request *req, int enc, |
3f3baf359 crypto: tcrypt - ... |
791 792 793 794 795 796 797 798 799 800 |
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 - ... |
801 |
crypto_skcipher_encrypt(req)); |
3f3baf359 crypto: tcrypt - ... |
802 803 |
else ret = do_one_acipher_op(req, |
7166e589d crypto: tcrypt - ... |
804 |
crypto_skcipher_decrypt(req)); |
3f3baf359 crypto: tcrypt - ... |
805 806 807 808 809 810 811 812 813 814 815 816 |
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 - ... |
817 |
crypto_skcipher_encrypt(req)); |
3f3baf359 crypto: tcrypt - ... |
818 819 |
else ret = do_one_acipher_op(req, |
7166e589d crypto: tcrypt - ... |
820 |
crypto_skcipher_decrypt(req)); |
3f3baf359 crypto: tcrypt - ... |
821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 |
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 - ... |
837 838 839 |
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 - ... |
840 |
{ |
de1975334 crypto: atmel - a... |
841 |
unsigned int ret, i, j, k, iv_len; |
3f3baf359 crypto: tcrypt - ... |
842 843 844 |
struct tcrypt_result tresult; const char *key; char iv[128]; |
7166e589d crypto: tcrypt - ... |
845 846 |
struct skcipher_request *req; struct crypto_skcipher *tfm; |
3f3baf359 crypto: tcrypt - ... |
847 848 849 850 851 852 853 |
const char *e; u32 *b_size; if (enc == ENCRYPT) e = "encryption"; else e = "decryption"; |
3f3baf359 crypto: tcrypt - ... |
854 |
init_completion(&tresult.completion); |
7166e589d crypto: tcrypt - ... |
855 |
tfm = crypto_alloc_skcipher(algo, 0, async ? 0 : CRYPTO_ALG_ASYNC); |
3f3baf359 crypto: tcrypt - ... |
856 857 858 859 860 861 862 |
if (IS_ERR(tfm)) { pr_err("failed to load transform for %s: %ld ", algo, PTR_ERR(tfm)); return; } |
263a8df0d crypto: tcrypt - ... |
863 864 865 |
pr_info(" testing speed of async %s (%s) %s ", algo, |
7166e589d crypto: tcrypt - ... |
866 |
get_driver_name(crypto_skcipher, tfm), e); |
263a8df0d crypto: tcrypt - ... |
867 |
|
7166e589d crypto: tcrypt - ... |
868 |
req = skcipher_request_alloc(tfm, GFP_KERNEL); |
3f3baf359 crypto: tcrypt - ... |
869 870 871 872 873 874 |
if (!req) { pr_err("tcrypt: skcipher: Failed to allocate request for %s ", algo); goto out; } |
7166e589d crypto: tcrypt - ... |
875 876 |
skcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG, tcrypt_complete, &tresult); |
3f3baf359 crypto: tcrypt - ... |
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 905 |
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 - ... |
906 |
crypto_skcipher_clear_flags(tfm, ~0); |
3f3baf359 crypto: tcrypt - ... |
907 |
|
7166e589d crypto: tcrypt - ... |
908 |
ret = crypto_skcipher_setkey(tfm, key, *keysize); |
3f3baf359 crypto: tcrypt - ... |
909 910 911 |
if (ret) { pr_err("setkey() failed flags=%x ", |
7166e589d crypto: tcrypt - ... |
912 |
crypto_skcipher_get_flags(tfm)); |
3f3baf359 crypto: tcrypt - ... |
913 914 |
goto out_free_req; } |
de1975334 crypto: atmel - a... |
915 |
k = *keysize + *b_size; |
007ee8dec crypto: tcrypt - ... |
916 |
sg_init_table(sg, DIV_ROUND_UP(k, PAGE_SIZE)); |
de1975334 crypto: atmel - a... |
917 918 |
if (k > PAGE_SIZE) { sg_set_buf(sg, tvmem[0] + *keysize, |
3f3baf359 crypto: tcrypt - ... |
919 |
PAGE_SIZE - *keysize); |
de1975334 crypto: atmel - a... |
920 921 922 923 924 925 926 927 928 929 930 931 |
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 - ... |
932 |
} |
7166e589d crypto: tcrypt - ... |
933 |
iv_len = crypto_skcipher_ivsize(tfm); |
3f3baf359 crypto: tcrypt - ... |
934 935 |
if (iv_len) memset(&iv, 0xff, iv_len); |
7166e589d crypto: tcrypt - ... |
936 |
skcipher_request_set_crypt(req, sg, sg, *b_size, iv); |
3f3baf359 crypto: tcrypt - ... |
937 |
|
3e3dc25fe crypto: Resolve s... |
938 |
if (secs) |
3f3baf359 crypto: tcrypt - ... |
939 |
ret = test_acipher_jiffies(req, enc, |
3e3dc25fe crypto: Resolve s... |
940 |
*b_size, secs); |
3f3baf359 crypto: tcrypt - ... |
941 942 943 944 945 946 947 |
else ret = test_acipher_cycles(req, enc, *b_size); if (ret) { pr_err("%s() failed flags=%x ", e, |
7166e589d crypto: tcrypt - ... |
948 |
crypto_skcipher_get_flags(tfm)); |
3f3baf359 crypto: tcrypt - ... |
949 950 951 952 953 954 955 956 957 |
break; } b_size++; i++; } while (*b_size); keysize++; } while (*keysize); out_free_req: |
7166e589d crypto: tcrypt - ... |
958 |
skcipher_request_free(req); |
3f3baf359 crypto: tcrypt - ... |
959 |
out: |
7166e589d crypto: tcrypt - ... |
960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 |
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 - ... |
977 |
} |
ef2736fc7 [CRYPTO]: White s... |
978 |
static void test_available(void) |
1da177e4c Linux-2.6.12-rc2 |
979 980 |
{ char **name = check; |
ef2736fc7 [CRYPTO]: White s... |
981 |
|
1da177e4c Linux-2.6.12-rc2 |
982 983 |
while (*name) { printk("alg %s ", *name); |
6158efc09 [CRYPTO] tcrypt: ... |
984 |
printk(crypto_has_alg(*name, 0, 0) ? |
e4d5b79c6 [CRYPTO] users: U... |
985 986 987 |
"found " : "not found "); |
1da177e4c Linux-2.6.12-rc2 |
988 |
name++; |
ef2736fc7 [CRYPTO]: White s... |
989 |
} |
1da177e4c Linux-2.6.12-rc2 |
990 |
} |
01b323245 crypto: tcrypt - ... |
991 992 |
static inline int tcrypt_test(const char *alg) { |
4e033a6bc crypto: tcrypt - ... |
993 |
int ret; |
76512f2d8 crypto: tcrypt - ... |
994 995 |
pr_debug("testing %s ", alg); |
4e033a6bc crypto: tcrypt - ... |
996 997 998 999 1000 |
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 - ... |
1001 |
} |
8606813a6 crypto: tcrypt - ... |
1002 |
static int do_test(const char *alg, u32 type, u32 mask, int m) |
01b323245 crypto: tcrypt - ... |
1003 1004 |
{ int i; |
4e033a6bc crypto: tcrypt - ... |
1005 |
int ret = 0; |
01b323245 crypto: tcrypt - ... |
1006 1007 |
switch (m) { |
1da177e4c Linux-2.6.12-rc2 |
1008 |
case 0: |
8606813a6 crypto: tcrypt - ... |
1009 1010 1011 1012 1013 1014 |
if (alg) { if (!crypto_has_alg(alg, type, mask ?: CRYPTO_ALG_TYPE_MASK)) ret = -ENOENT; break; } |
01b323245 crypto: tcrypt - ... |
1015 |
for (i = 1; i < 200; i++) |
8606813a6 crypto: tcrypt - ... |
1016 |
ret += do_test(NULL, 0, 0, i); |
1da177e4c Linux-2.6.12-rc2 |
1017 1018 1019 |
break; case 1: |
4e033a6bc crypto: tcrypt - ... |
1020 |
ret += tcrypt_test("md5"); |
1da177e4c Linux-2.6.12-rc2 |
1021 1022 1023 |
break; case 2: |
4e033a6bc crypto: tcrypt - ... |
1024 |
ret += tcrypt_test("sha1"); |
1da177e4c Linux-2.6.12-rc2 |
1025 1026 1027 |
break; case 3: |
4e033a6bc crypto: tcrypt - ... |
1028 1029 |
ret += tcrypt_test("ecb(des)"); ret += tcrypt_test("cbc(des)"); |
8163fc30d crypto: testmgr -... |
1030 |
ret += tcrypt_test("ctr(des)"); |
1da177e4c Linux-2.6.12-rc2 |
1031 1032 1033 |
break; case 4: |
4e033a6bc crypto: tcrypt - ... |
1034 1035 |
ret += tcrypt_test("ecb(des3_ede)"); ret += tcrypt_test("cbc(des3_ede)"); |
e080b17a8 crypto: testmgr -... |
1036 |
ret += tcrypt_test("ctr(des3_ede)"); |
1da177e4c Linux-2.6.12-rc2 |
1037 1038 1039 |
break; case 5: |
4e033a6bc crypto: tcrypt - ... |
1040 |
ret += tcrypt_test("md4"); |
1da177e4c Linux-2.6.12-rc2 |
1041 |
break; |
ef2736fc7 [CRYPTO]: White s... |
1042 |
|
1da177e4c Linux-2.6.12-rc2 |
1043 |
case 6: |
4e033a6bc crypto: tcrypt - ... |
1044 |
ret += tcrypt_test("sha256"); |
1da177e4c Linux-2.6.12-rc2 |
1045 |
break; |
ef2736fc7 [CRYPTO]: White s... |
1046 |
|
1da177e4c Linux-2.6.12-rc2 |
1047 |
case 7: |
4e033a6bc crypto: tcrypt - ... |
1048 1049 |
ret += tcrypt_test("ecb(blowfish)"); ret += tcrypt_test("cbc(blowfish)"); |
85b63e342 crypto: testmgr -... |
1050 |
ret += tcrypt_test("ctr(blowfish)"); |
1da177e4c Linux-2.6.12-rc2 |
1051 1052 1053 |
break; case 8: |
4e033a6bc crypto: tcrypt - ... |
1054 1055 |
ret += tcrypt_test("ecb(twofish)"); ret += tcrypt_test("cbc(twofish)"); |
573da6208 crypto: testmgr -... |
1056 |
ret += tcrypt_test("ctr(twofish)"); |
bee3a90ef crypto: tcrypt - ... |
1057 |
ret += tcrypt_test("lrw(twofish)"); |
131f75416 crypto: tcrypt - ... |
1058 |
ret += tcrypt_test("xts(twofish)"); |
1da177e4c Linux-2.6.12-rc2 |
1059 |
break; |
ef2736fc7 [CRYPTO]: White s... |
1060 |
|
1da177e4c Linux-2.6.12-rc2 |
1061 |
case 9: |
4e033a6bc crypto: tcrypt - ... |
1062 |
ret += tcrypt_test("ecb(serpent)"); |
9d25917d4 crypto: testmgr -... |
1063 1064 |
ret += tcrypt_test("cbc(serpent)"); ret += tcrypt_test("ctr(serpent)"); |
87aae4bfb crypto: tcrypt - ... |
1065 |
ret += tcrypt_test("lrw(serpent)"); |
5209c07ac crypto: tcrypt - ... |
1066 |
ret += tcrypt_test("xts(serpent)"); |
1da177e4c Linux-2.6.12-rc2 |
1067 1068 1069 |
break; case 10: |
4e033a6bc crypto: tcrypt - ... |
1070 1071 1072 1073 1074 1075 |
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 |
1076 1077 1078 |
break; case 11: |
4e033a6bc crypto: tcrypt - ... |
1079 |
ret += tcrypt_test("sha384"); |
1da177e4c Linux-2.6.12-rc2 |
1080 |
break; |
ef2736fc7 [CRYPTO]: White s... |
1081 |
|
1da177e4c Linux-2.6.12-rc2 |
1082 |
case 12: |
4e033a6bc crypto: tcrypt - ... |
1083 |
ret += tcrypt_test("sha512"); |
1da177e4c Linux-2.6.12-rc2 |
1084 1085 1086 |
break; case 13: |
4e033a6bc crypto: tcrypt - ... |
1087 |
ret += tcrypt_test("deflate"); |
1da177e4c Linux-2.6.12-rc2 |
1088 1089 1090 |
break; case 14: |
4e033a6bc crypto: tcrypt - ... |
1091 |
ret += tcrypt_test("ecb(cast5)"); |
a2c582609 crypto: testmgr -... |
1092 1093 |
ret += tcrypt_test("cbc(cast5)"); ret += tcrypt_test("ctr(cast5)"); |
1da177e4c Linux-2.6.12-rc2 |
1094 1095 1096 |
break; case 15: |
4e033a6bc crypto: tcrypt - ... |
1097 |
ret += tcrypt_test("ecb(cast6)"); |
9b8b04051 crypto: testmgr -... |
1098 1099 1100 1101 |
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 |
1102 1103 1104 |
break; case 16: |
4e033a6bc crypto: tcrypt - ... |
1105 |
ret += tcrypt_test("ecb(arc4)"); |
1da177e4c Linux-2.6.12-rc2 |
1106 1107 1108 |
break; case 17: |
4e033a6bc crypto: tcrypt - ... |
1109 |
ret += tcrypt_test("michael_mic"); |
1da177e4c Linux-2.6.12-rc2 |
1110 1111 1112 |
break; case 18: |
4e033a6bc crypto: tcrypt - ... |
1113 |
ret += tcrypt_test("crc32c"); |
1da177e4c Linux-2.6.12-rc2 |
1114 1115 1116 |
break; case 19: |
4e033a6bc crypto: tcrypt - ... |
1117 |
ret += tcrypt_test("ecb(tea)"); |
1da177e4c Linux-2.6.12-rc2 |
1118 1119 1120 |
break; case 20: |
4e033a6bc crypto: tcrypt - ... |
1121 |
ret += tcrypt_test("ecb(xtea)"); |
1da177e4c Linux-2.6.12-rc2 |
1122 1123 1124 |
break; case 21: |
4e033a6bc crypto: tcrypt - ... |
1125 |
ret += tcrypt_test("ecb(khazad)"); |
1da177e4c Linux-2.6.12-rc2 |
1126 1127 1128 |
break; case 22: |
4e033a6bc crypto: tcrypt - ... |
1129 |
ret += tcrypt_test("wp512"); |
1da177e4c Linux-2.6.12-rc2 |
1130 1131 1132 |
break; case 23: |
4e033a6bc crypto: tcrypt - ... |
1133 |
ret += tcrypt_test("wp384"); |
1da177e4c Linux-2.6.12-rc2 |
1134 1135 1136 |
break; case 24: |
4e033a6bc crypto: tcrypt - ... |
1137 |
ret += tcrypt_test("wp256"); |
1da177e4c Linux-2.6.12-rc2 |
1138 1139 1140 |
break; case 25: |
4e033a6bc crypto: tcrypt - ... |
1141 |
ret += tcrypt_test("ecb(tnepres)"); |
1da177e4c Linux-2.6.12-rc2 |
1142 1143 1144 |
break; case 26: |
4e033a6bc crypto: tcrypt - ... |
1145 1146 |
ret += tcrypt_test("ecb(anubis)"); ret += tcrypt_test("cbc(anubis)"); |
1da177e4c Linux-2.6.12-rc2 |
1147 1148 1149 |
break; case 27: |
4e033a6bc crypto: tcrypt - ... |
1150 |
ret += tcrypt_test("tgr192"); |
1da177e4c Linux-2.6.12-rc2 |
1151 1152 1153 |
break; case 28: |
4e033a6bc crypto: tcrypt - ... |
1154 |
ret += tcrypt_test("tgr160"); |
1da177e4c Linux-2.6.12-rc2 |
1155 1156 1157 |
break; case 29: |
4e033a6bc crypto: tcrypt - ... |
1158 |
ret += tcrypt_test("tgr128"); |
1da177e4c Linux-2.6.12-rc2 |
1159 |
break; |
2998db37b [CRYPTO] tcrypt: ... |
1160 |
|
fb4f10ed5 [CRYPTO]: Fix XTE... |
1161 |
case 30: |
4e033a6bc crypto: tcrypt - ... |
1162 |
ret += tcrypt_test("ecb(xeta)"); |
fb4f10ed5 [CRYPTO]: Fix XTE... |
1163 |
break; |
1da177e4c Linux-2.6.12-rc2 |
1164 |
|
90831639a [CRYPTO] fcrypt: ... |
1165 |
case 31: |
4e033a6bc crypto: tcrypt - ... |
1166 |
ret += tcrypt_test("pcbc(fcrypt)"); |
90831639a [CRYPTO] fcrypt: ... |
1167 |
break; |
02ab5a705 [CRYPTO] camellia... |
1168 |
case 32: |
4e033a6bc crypto: tcrypt - ... |
1169 1170 |
ret += tcrypt_test("ecb(camellia)"); ret += tcrypt_test("cbc(camellia)"); |
54216bbd7 crypto: tcrypt - ... |
1171 1172 1173 |
ret += tcrypt_test("ctr(camellia)"); ret += tcrypt_test("lrw(camellia)"); ret += tcrypt_test("xts(camellia)"); |
02ab5a705 [CRYPTO] camellia... |
1174 |
break; |
93b5e86a6 crypto: add CMAC ... |
1175 |
|
cd12fb906 [CRYPTO] sha256-g... |
1176 |
case 33: |
4e033a6bc crypto: tcrypt - ... |
1177 |
ret += tcrypt_test("sha224"); |
cd12fb906 [CRYPTO] sha256-g... |
1178 |
break; |
02ab5a705 [CRYPTO] camellia... |
1179 |
|
2407d6087 [CRYPTO] salsa20:... |
1180 |
case 34: |
4e033a6bc crypto: tcrypt - ... |
1181 |
ret += tcrypt_test("salsa20"); |
2407d6087 [CRYPTO] salsa20:... |
1182 |
break; |
8df213d9b [CRYPTO] tcrypt: ... |
1183 |
case 35: |
4e033a6bc crypto: tcrypt - ... |
1184 |
ret += tcrypt_test("gcm(aes)"); |
8df213d9b [CRYPTO] tcrypt: ... |
1185 |
break; |
0b77abb3b [CRYPTO] lzo: Add... |
1186 |
case 36: |
4e033a6bc crypto: tcrypt - ... |
1187 |
ret += tcrypt_test("lzo"); |
0b77abb3b [CRYPTO] lzo: Add... |
1188 |
break; |
93cc74e07 [CRYPTO] tcrypt: ... |
1189 |
case 37: |
4e033a6bc crypto: tcrypt - ... |
1190 |
ret += tcrypt_test("ccm(aes)"); |
93cc74e07 [CRYPTO] tcrypt: ... |
1191 |
break; |
76cb95217 [CRYPTO] cts: Add... |
1192 |
case 38: |
4e033a6bc crypto: tcrypt - ... |
1193 |
ret += tcrypt_test("cts(cbc(aes))"); |
76cb95217 [CRYPTO] cts: Add... |
1194 |
break; |
fd4adf1a0 [CRYPTO] tcrypt: ... |
1195 |
case 39: |
4e033a6bc crypto: tcrypt - ... |
1196 |
ret += tcrypt_test("rmd128"); |
fd4adf1a0 [CRYPTO] tcrypt: ... |
1197 1198 1199 |
break; case 40: |
4e033a6bc crypto: tcrypt - ... |
1200 |
ret += tcrypt_test("rmd160"); |
fd4adf1a0 [CRYPTO] tcrypt: ... |
1201 |
break; |
2998db37b [CRYPTO] tcrypt: ... |
1202 |
case 41: |
4e033a6bc crypto: tcrypt - ... |
1203 |
ret += tcrypt_test("rmd256"); |
2998db37b [CRYPTO] tcrypt: ... |
1204 1205 1206 |
break; case 42: |
4e033a6bc crypto: tcrypt - ... |
1207 |
ret += tcrypt_test("rmd320"); |
01b323245 crypto: tcrypt - ... |
1208 1209 1210 |
break; case 43: |
4e033a6bc crypto: tcrypt - ... |
1211 |
ret += tcrypt_test("ecb(seed)"); |
2998db37b [CRYPTO] tcrypt: ... |
1212 |
break; |
5d667322a crypto: testmgr -... |
1213 |
case 45: |
4e033a6bc crypto: tcrypt - ... |
1214 |
ret += tcrypt_test("rfc4309(ccm(aes))"); |
5d667322a crypto: testmgr -... |
1215 |
break; |
54216bbd7 crypto: tcrypt - ... |
1216 1217 1218 |
case 46: ret += tcrypt_test("ghash"); break; |
68411521c Reinstate "crypto... |
1219 1220 1221 |
case 47: ret += tcrypt_test("crct10dif"); break; |
79cc6ab89 crypto: sha3 - Ad... |
1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 |
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 |
1237 |
case 100: |
4e033a6bc crypto: tcrypt - ... |
1238 |
ret += tcrypt_test("hmac(md5)"); |
1da177e4c Linux-2.6.12-rc2 |
1239 |
break; |
ef2736fc7 [CRYPTO]: White s... |
1240 |
|
1da177e4c Linux-2.6.12-rc2 |
1241 |
case 101: |
4e033a6bc crypto: tcrypt - ... |
1242 |
ret += tcrypt_test("hmac(sha1)"); |
1da177e4c Linux-2.6.12-rc2 |
1243 |
break; |
ef2736fc7 [CRYPTO]: White s... |
1244 |
|
1da177e4c Linux-2.6.12-rc2 |
1245 |
case 102: |
4e033a6bc crypto: tcrypt - ... |
1246 |
ret += tcrypt_test("hmac(sha256)"); |
1da177e4c Linux-2.6.12-rc2 |
1247 |
break; |
a28091ae1 [CRYPTO] tcrypt: ... |
1248 |
case 103: |
4e033a6bc crypto: tcrypt - ... |
1249 |
ret += tcrypt_test("hmac(sha384)"); |
a28091ae1 [CRYPTO] tcrypt: ... |
1250 1251 1252 |
break; case 104: |
4e033a6bc crypto: tcrypt - ... |
1253 |
ret += tcrypt_test("hmac(sha512)"); |
a28091ae1 [CRYPTO] tcrypt: ... |
1254 |
break; |
38ed9ab23 [CRYPTO] tcrypt: ... |
1255 |
|
cd12fb906 [CRYPTO] sha256-g... |
1256 |
case 105: |
4e033a6bc crypto: tcrypt - ... |
1257 |
ret += tcrypt_test("hmac(sha224)"); |
cd12fb906 [CRYPTO] sha256-g... |
1258 |
break; |
1da177e4c Linux-2.6.12-rc2 |
1259 |
|
38ed9ab23 [CRYPTO] tcrypt: ... |
1260 |
case 106: |
4e033a6bc crypto: tcrypt - ... |
1261 |
ret += tcrypt_test("xcbc(aes)"); |
38ed9ab23 [CRYPTO] tcrypt: ... |
1262 |
break; |
fd4adf1a0 [CRYPTO] tcrypt: ... |
1263 |
case 107: |
4e033a6bc crypto: tcrypt - ... |
1264 |
ret += tcrypt_test("hmac(rmd128)"); |
fd4adf1a0 [CRYPTO] tcrypt: ... |
1265 1266 1267 |
break; case 108: |
4e033a6bc crypto: tcrypt - ... |
1268 |
ret += tcrypt_test("hmac(rmd160)"); |
fd4adf1a0 [CRYPTO] tcrypt: ... |
1269 |
break; |
f1939f7c5 crypto: vmac - Ne... |
1270 1271 1272 |
case 109: ret += tcrypt_test("vmac(aes)"); break; |
93b5e86a6 crypto: add CMAC ... |
1273 |
|
98eca72fa crypto: sha3 - Ad... |
1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 |
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 -... |
1289 |
case 150: |
4e033a6bc crypto: tcrypt - ... |
1290 |
ret += tcrypt_test("ansi_cprng"); |
e08ca2da3 crypto: testmgr -... |
1291 |
break; |
69435b94d crypto: rfc4106 -... |
1292 1293 1294 |
case 151: ret += tcrypt_test("rfc4106(gcm(aes))"); break; |
e9b7441a9 crypto: testmgr -... |
1295 1296 1297 |
case 152: ret += tcrypt_test("rfc4543(gcm(aes))"); break; |
93b5e86a6 crypto: add CMAC ... |
1298 1299 1300 1301 1302 1303 1304 |
case 153: ret += tcrypt_test("cmac(aes)"); break; case 154: ret += tcrypt_test("cmac(des3_ede)"); break; |
bbf9c8934 crypto: caam - fi... |
1305 1306 1307 |
case 155: ret += tcrypt_test("authenc(hmac(sha1),cbc(aes))"); break; |
bca4feb0d crypto: testmgr -... |
1308 1309 1310 1311 1312 1313 1314 |
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 -... |
1315 1316 1317 1318 1319 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 |
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... |
1345 |
case 200: |
cba83564d [CRYPTO] tcrypt: ... |
1346 |
test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1347 |
speed_template_16_24_32); |
cba83564d [CRYPTO] tcrypt: ... |
1348 |
test_cipher_speed("ecb(aes)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1349 |
speed_template_16_24_32); |
cba83564d [CRYPTO] tcrypt: ... |
1350 |
test_cipher_speed("cbc(aes)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1351 |
speed_template_16_24_32); |
cba83564d [CRYPTO] tcrypt: ... |
1352 |
test_cipher_speed("cbc(aes)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1353 |
speed_template_16_24_32); |
f3d1044cd [CRYPTO] tcrypt: ... |
1354 |
test_cipher_speed("lrw(aes)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1355 |
speed_template_32_40_48); |
f3d1044cd [CRYPTO] tcrypt: ... |
1356 |
test_cipher_speed("lrw(aes)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1357 |
speed_template_32_40_48); |
f19f5111c [CRYPTO] xts: XTS... |
1358 |
test_cipher_speed("xts(aes)", ENCRYPT, sec, NULL, 0, |
b66ad0b7a crypto: tcrypt - ... |
1359 |
speed_template_32_64); |
f19f5111c [CRYPTO] xts: XTS... |
1360 |
test_cipher_speed("xts(aes)", DECRYPT, sec, NULL, 0, |
b66ad0b7a crypto: tcrypt - ... |
1361 |
speed_template_32_64); |
1503a24f5 crypto: tcrypt - ... |
1362 1363 1364 1365 |
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 - ... |
1366 1367 1368 1369 |
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... |
1370 1371 1372 |
break; case 201: |
cba83564d [CRYPTO] tcrypt: ... |
1373 |
test_cipher_speed("ecb(des3_ede)", ENCRYPT, sec, |
da7f033dd crypto: cryptomgr... |
1374 |
des3_speed_template, DES3_SPEED_VECTORS, |
477035c2a [CRYPTO] tcrypt: ... |
1375 |
speed_template_24); |
cba83564d [CRYPTO] tcrypt: ... |
1376 |
test_cipher_speed("ecb(des3_ede)", DECRYPT, sec, |
da7f033dd crypto: cryptomgr... |
1377 |
des3_speed_template, DES3_SPEED_VECTORS, |
477035c2a [CRYPTO] tcrypt: ... |
1378 |
speed_template_24); |
cba83564d [CRYPTO] tcrypt: ... |
1379 |
test_cipher_speed("cbc(des3_ede)", ENCRYPT, sec, |
da7f033dd crypto: cryptomgr... |
1380 |
des3_speed_template, DES3_SPEED_VECTORS, |
477035c2a [CRYPTO] tcrypt: ... |
1381 |
speed_template_24); |
cba83564d [CRYPTO] tcrypt: ... |
1382 |
test_cipher_speed("cbc(des3_ede)", DECRYPT, sec, |
da7f033dd crypto: cryptomgr... |
1383 |
des3_speed_template, DES3_SPEED_VECTORS, |
477035c2a [CRYPTO] tcrypt: ... |
1384 |
speed_template_24); |
87131507e crypto: tcrypt - ... |
1385 1386 1387 1388 1389 1390 |
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... |
1391 1392 1393 |
break; case 202: |
cba83564d [CRYPTO] tcrypt: ... |
1394 |
test_cipher_speed("ecb(twofish)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1395 |
speed_template_16_24_32); |
cba83564d [CRYPTO] tcrypt: ... |
1396 |
test_cipher_speed("ecb(twofish)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1397 |
speed_template_16_24_32); |
cba83564d [CRYPTO] tcrypt: ... |
1398 |
test_cipher_speed("cbc(twofish)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1399 |
speed_template_16_24_32); |
cba83564d [CRYPTO] tcrypt: ... |
1400 |
test_cipher_speed("cbc(twofish)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1401 |
speed_template_16_24_32); |
ee5002a54 crypto: tcrypt - ... |
1402 1403 1404 1405 |
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 - ... |
1406 1407 1408 1409 |
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 - ... |
1410 1411 1412 1413 |
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... |
1414 1415 1416 |
break; case 203: |
cba83564d [CRYPTO] tcrypt: ... |
1417 |
test_cipher_speed("ecb(blowfish)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1418 |
speed_template_8_32); |
cba83564d [CRYPTO] tcrypt: ... |
1419 |
test_cipher_speed("ecb(blowfish)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1420 |
speed_template_8_32); |
cba83564d [CRYPTO] tcrypt: ... |
1421 |
test_cipher_speed("cbc(blowfish)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1422 |
speed_template_8_32); |
cba83564d [CRYPTO] tcrypt: ... |
1423 |
test_cipher_speed("cbc(blowfish)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1424 |
speed_template_8_32); |
7d47b86cf crypto: tcrypt - ... |
1425 1426 1427 1428 |
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... |
1429 1430 1431 |
break; case 204: |
cba83564d [CRYPTO] tcrypt: ... |
1432 |
test_cipher_speed("ecb(des)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1433 |
speed_template_8); |
cba83564d [CRYPTO] tcrypt: ... |
1434 |
test_cipher_speed("ecb(des)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1435 |
speed_template_8); |
cba83564d [CRYPTO] tcrypt: ... |
1436 |
test_cipher_speed("cbc(des)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1437 |
speed_template_8); |
cba83564d [CRYPTO] tcrypt: ... |
1438 |
test_cipher_speed("cbc(des)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1439 |
speed_template_8); |
ebfd9bcf1 [CRYPTO]: Add cip... |
1440 |
break; |
02ab5a705 [CRYPTO] camellia... |
1441 1442 |
case 205: test_cipher_speed("ecb(camellia)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1443 |
speed_template_16_24_32); |
02ab5a705 [CRYPTO] camellia... |
1444 |
test_cipher_speed("ecb(camellia)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1445 |
speed_template_16_24_32); |
02ab5a705 [CRYPTO] camellia... |
1446 |
test_cipher_speed("cbc(camellia)", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1447 |
speed_template_16_24_32); |
02ab5a705 [CRYPTO] camellia... |
1448 |
test_cipher_speed("cbc(camellia)", DECRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1449 |
speed_template_16_24_32); |
4de593378 crypto: tcrypt - ... |
1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 |
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... |
1462 |
break; |
5de8f1b56 [CRYPTO] tcrypt: ... |
1463 1464 |
case 206: test_cipher_speed("salsa20", ENCRYPT, sec, NULL, 0, |
477035c2a [CRYPTO] tcrypt: ... |
1465 |
speed_template_16_32); |
5de8f1b56 [CRYPTO] tcrypt: ... |
1466 |
break; |
7fb7fe446 crypto: tcrypt - ... |
1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 |
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 - ... |
1480 1481 1482 1483 |
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 - ... |
1484 1485 1486 1487 |
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 - ... |
1488 |
break; |
31b4cd290 crypto: testmgr -... |
1489 1490 1491 1492 |
case 208: test_cipher_speed("ecb(arc4)", ENCRYPT, sec, NULL, 0, speed_template_8); break; |
a2c582609 crypto: testmgr -... |
1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 |
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 -... |
1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 |
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 - ... |
1529 1530 |
case 211: test_aead_speed("rfc4106(gcm(aes))", ENCRYPT, sec, |
34a1c740e crypto: tcrypt - ... |
1531 |
NULL, 0, 16, 16, aead_speed_template_20); |
1425d2d17 crypto: tcrypt - ... |
1532 |
test_aead_speed("gcm(aes)", ENCRYPT, sec, |
f18611da8 crypto: tcrypt - ... |
1533 |
NULL, 0, 16, 8, speed_template_16_24_32); |
53f52d7ae crypto: tcrypt - ... |
1534 |
break; |
4e4aab63d crypto: tcrypt - ... |
1535 1536 |
case 212: test_aead_speed("rfc4309(ccm(aes))", ENCRYPT, sec, |
34a1c740e crypto: tcrypt - ... |
1537 |
NULL, 0, 16, 16, aead_speed_template_19); |
4e4aab63d crypto: tcrypt - ... |
1538 |
break; |
2dce063a3 crypto: tcrypt - ... |
1539 1540 1541 1542 1543 1544 1545 1546 1547 |
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: ... |
1548 |
case 300: |
8606813a6 crypto: tcrypt - ... |
1549 1550 1551 1552 |
if (alg) { test_hash_speed(alg, sec, generic_hash_speed_template); break; } |
e80579285 [CRYPTO] tcrypt: ... |
1553 1554 1555 |
/* fall through */ case 301: |
e9d41164e [CRYPTO] tcrypt: ... |
1556 |
test_hash_speed("md4", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1557 1558 1559 |
if (mode > 300 && mode < 400) break; case 302: |
e9d41164e [CRYPTO] tcrypt: ... |
1560 |
test_hash_speed("md5", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1561 1562 1563 |
if (mode > 300 && mode < 400) break; case 303: |
e9d41164e [CRYPTO] tcrypt: ... |
1564 |
test_hash_speed("sha1", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1565 1566 1567 |
if (mode > 300 && mode < 400) break; case 304: |
e9d41164e [CRYPTO] tcrypt: ... |
1568 |
test_hash_speed("sha256", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1569 1570 1571 |
if (mode > 300 && mode < 400) break; case 305: |
e9d41164e [CRYPTO] tcrypt: ... |
1572 |
test_hash_speed("sha384", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1573 1574 1575 |
if (mode > 300 && mode < 400) break; case 306: |
e9d41164e [CRYPTO] tcrypt: ... |
1576 |
test_hash_speed("sha512", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1577 1578 1579 |
if (mode > 300 && mode < 400) break; case 307: |
e9d41164e [CRYPTO] tcrypt: ... |
1580 |
test_hash_speed("wp256", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1581 1582 1583 |
if (mode > 300 && mode < 400) break; case 308: |
e9d41164e [CRYPTO] tcrypt: ... |
1584 |
test_hash_speed("wp384", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1585 1586 1587 |
if (mode > 300 && mode < 400) break; case 309: |
e9d41164e [CRYPTO] tcrypt: ... |
1588 |
test_hash_speed("wp512", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1589 1590 1591 |
if (mode > 300 && mode < 400) break; case 310: |
e9d41164e [CRYPTO] tcrypt: ... |
1592 |
test_hash_speed("tgr128", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1593 1594 1595 |
if (mode > 300 && mode < 400) break; case 311: |
e9d41164e [CRYPTO] tcrypt: ... |
1596 |
test_hash_speed("tgr160", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1597 1598 1599 |
if (mode > 300 && mode < 400) break; case 312: |
e9d41164e [CRYPTO] tcrypt: ... |
1600 |
test_hash_speed("tgr192", sec, generic_hash_speed_template); |
e80579285 [CRYPTO] tcrypt: ... |
1601 |
if (mode > 300 && mode < 400) break; |
cd12fb906 [CRYPTO] sha256-g... |
1602 1603 1604 |
case 313: test_hash_speed("sha224", sec, generic_hash_speed_template); if (mode > 300 && mode < 400) break; |
fd4adf1a0 [CRYPTO] tcrypt: ... |
1605 1606 1607 1608 1609 1610 1611 |
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: ... |
1612 1613 1614 1615 1616 1617 1618 |
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 - ... |
1619 1620 1621 |
case 318: test_hash_speed("ghash-generic", sec, hash_speed_template_16); if (mode > 300 && mode < 400) break; |
e3899e4df crypto: tcrypt - ... |
1622 1623 1624 |
case 319: test_hash_speed("crc32c", sec, generic_hash_speed_template); if (mode > 300 && mode < 400) break; |
68411521c Reinstate "crypto... |
1625 1626 1627 |
case 320: test_hash_speed("crct10dif", sec, generic_hash_speed_template); if (mode > 300 && mode < 400) break; |
2dce063a3 crypto: tcrypt - ... |
1628 1629 1630 |
case 321: test_hash_speed("poly1305", sec, poly1305_speed_template); if (mode > 300 && mode < 400) break; |
79cc6ab89 crypto: sha3 - Ad... |
1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 |
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: ... |
1646 1647 |
case 399: break; |
beb63da73 crypto: tcrypt - ... |
1648 |
case 400: |
8606813a6 crypto: tcrypt - ... |
1649 1650 1651 1652 |
if (alg) { test_ahash_speed(alg, sec, generic_hash_speed_template); break; } |
beb63da73 crypto: tcrypt - ... |
1653 1654 1655 1656 1657 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 |
/* 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... |
1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 |
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 - ... |
1738 1739 1740 1741 1742 1743 1744 |
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... |
1745 |
|
14009c4bd crypto: tcrypt - ... |
1746 1747 1748 |
case 424: test_mb_ahash_speed("sha512", sec, generic_hash_speed_template); if (mode > 400 && mode < 500) break; |
beb63da73 crypto: tcrypt - ... |
1749 1750 |
case 499: break; |
3f3baf359 crypto: tcrypt - ... |
1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 |
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, |
b66ad0b7a crypto: tcrypt - ... |
1765 |
speed_template_32_64); |
3f3baf359 crypto: tcrypt - ... |
1766 |
test_acipher_speed("xts(aes)", DECRYPT, sec, NULL, 0, |
b66ad0b7a crypto: tcrypt - ... |
1767 |
speed_template_32_64); |
1503a24f5 crypto: tcrypt - ... |
1768 1769 1770 1771 |
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 - ... |
1772 1773 1774 1775 |
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... |
1776 1777 1778 1779 1780 1781 1782 1783 |
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... |
1784 1785 1786 1787 |
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 - ... |
1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 |
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... |
1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 |
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 - ... |
1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 |
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... |
1826 1827 1828 1829 1830 1831 1832 1833 |
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 - ... |
1834 |
break; |
7fb7fe446 crypto: tcrypt - ... |
1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 |
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 - ... |
1848 1849 1850 1851 |
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 - ... |
1852 1853 1854 1855 |
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 - ... |
1856 |
break; |
107778b59 crypto: twofish -... |
1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 |
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 -... |
1879 1880 1881 1882 |
case 505: test_acipher_speed("ecb(arc4)", ENCRYPT, sec, NULL, 0, speed_template_8); break; |
a2c582609 crypto: testmgr -... |
1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 |
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 -... |
1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 |
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 - ... |
1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 |
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 - ... |
1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 |
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 |
1955 1956 1957 |
case 1000: test_available(); break; |
1da177e4c Linux-2.6.12-rc2 |
1958 |
} |
4e033a6bc crypto: tcrypt - ... |
1959 1960 |
return ret; |
1da177e4c Linux-2.6.12-rc2 |
1961 |
} |
3af5b90bd [CRYPTO] all: Cle... |
1962 |
static int __init tcrypt_mod_init(void) |
1da177e4c Linux-2.6.12-rc2 |
1963 |
{ |
e3a4ea4fd [CRYPTO] tcrypt: ... |
1964 |
int err = -ENOMEM; |
f139cfa7c crypto: tcrypt - ... |
1965 |
int i; |
e3a4ea4fd [CRYPTO] tcrypt: ... |
1966 |
|
f139cfa7c crypto: tcrypt - ... |
1967 1968 1969 1970 1971 |
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 |
1972 |
|
8606813a6 crypto: tcrypt - ... |
1973 |
err = do_test(alg, type, mask, mode); |
a873a5f1c crypto: tcrypt - ... |
1974 |
|
4e033a6bc crypto: tcrypt - ... |
1975 1976 1977 1978 |
if (err) { printk(KERN_ERR "tcrypt: one or more tests failed! "); goto err_free_tv; |
76512f2d8 crypto: tcrypt - ... |
1979 1980 1981 |
} else { pr_debug("all tests passed "); |
4e033a6bc crypto: tcrypt - ... |
1982 |
} |
14fdf477a [CRYPTO] tcrypt: ... |
1983 |
|
4e033a6bc crypto: tcrypt - ... |
1984 1985 1986 1987 |
/* 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: ... |
1988 1989 1990 |
* => we don't need it in the memory, do we? * -- mludvig */ |
4e033a6bc crypto: tcrypt - ... |
1991 1992 |
if (!fips_enabled) err = -EAGAIN; |
e3a4ea4fd [CRYPTO] tcrypt: ... |
1993 |
|
f139cfa7c crypto: tcrypt - ... |
1994 1995 1996 |
err_free_tv: for (i = 0; i < TVMEMSIZE && tvmem[i]; i++) free_page((unsigned long)tvmem[i]); |
e3a4ea4fd [CRYPTO] tcrypt: ... |
1997 1998 |
return err; |
1da177e4c Linux-2.6.12-rc2 |
1999 2000 2001 2002 2003 2004 |
} /* * If an init function is provided, an exit function must also be provided * to allow module unload. */ |
3af5b90bd [CRYPTO] all: Cle... |
2005 |
static void __exit tcrypt_mod_fini(void) { } |
1da177e4c Linux-2.6.12-rc2 |
2006 |
|
3af5b90bd [CRYPTO] all: Cle... |
2007 2008 |
module_init(tcrypt_mod_init); module_exit(tcrypt_mod_fini); |
1da177e4c Linux-2.6.12-rc2 |
2009 |
|
a873a5f1c crypto: tcrypt - ... |
2010 2011 |
module_param(alg, charp, 0); module_param(type, uint, 0); |
7be380f72 crypto: tcrypt - ... |
2012 |
module_param(mask, uint, 0); |
1da177e4c Linux-2.6.12-rc2 |
2013 |
module_param(mode, int, 0); |
ebfd9bcf1 [CRYPTO]: Add cip... |
2014 |
module_param(sec, uint, 0); |
6a17944ca [CRYPTO]: Use CPU... |
2015 2016 |
MODULE_PARM_DESC(sec, "Length in seconds of speed tests " "(defaults to zero which uses CPU cycles instead)"); |
1da177e4c Linux-2.6.12-rc2 |
2017 2018 2019 2020 |
MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Quick & dirty crypto testing module"); MODULE_AUTHOR("James Morris <jmorris@intercode.com.au>"); |