OpenWrt – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | /* |
2 | * Quick & dirty crypto testing module. |
||
3 | * |
||
4 | * This will only exist until we have a better testing mechanism |
||
5 | * (e.g. a char device). |
||
6 | * |
||
7 | * Copyright (c) 2002 James Morris <jmorris@intercode.com.au> |
||
8 | * Copyright (c) 2002 Jean-Francois Dive <jef@linuxbe.org> |
||
9 | * Copyright (c) 2007 Nokia Siemens Networks |
||
10 | * |
||
11 | * This program is free software; you can redistribute it and/or modify it |
||
12 | * under the terms of the GNU General Public License as published by the Free |
||
13 | * Software Foundation; either version 2 of the License, or (at your option) |
||
14 | * any later version. |
||
15 | * |
||
16 | */ |
||
17 | #ifndef _IFXMIPS_CRYPTO_TCRYPT_H |
||
18 | #define _IFXMIPS_CRYPTO_TCRYPT_H |
||
19 | |||
20 | struct cipher_speed_template { |
||
21 | const char *key; |
||
22 | unsigned int klen; |
||
23 | }; |
||
24 | |||
25 | struct hash_speed { |
||
26 | unsigned int blen; /* buffer length */ |
||
27 | unsigned int plen; /* per-update length */ |
||
28 | }; |
||
29 | |||
30 | /* |
||
31 | * DES test vectors. |
||
32 | */ |
||
33 | #define DES3_SPEED_VECTORS 1 |
||
34 | #define CRYPTO_ALG_TYPE_SPEED_TEST 0xB |
||
35 | |||
36 | static int alg_speed_test(const char *alg, const char *driver, |
||
37 | unsigned int sec, |
||
38 | struct cipher_speed_template *t, |
||
39 | unsigned int tcount, u8 *keysize); |
||
40 | |||
41 | static struct cipher_speed_template des3_speed_template[] = { |
||
42 | { |
||
43 | .key = "\x01\x23\x45\x67\x89\xab\xcd\xef" |
||
44 | "\x55\x55\x55\x55\x55\x55\x55\x55" |
||
45 | "\xfe\xdc\xba\x98\x76\x54\x32\x10", |
||
46 | .klen = 24, |
||
47 | } |
||
48 | }; |
||
49 | |||
50 | /* |
||
51 | * Cipher speed tests |
||
52 | */ |
||
53 | static u8 speed_template_8[] = {8, 0}; |
||
54 | static u8 speed_template_24[] = {24, 0}; |
||
55 | static u8 speed_template_8_32[] = {8, 32, 0}; |
||
56 | static u8 speed_template_16_32[] = {16, 32, 0}; |
||
57 | static u8 speed_template_16_24_32[] = {16, 24, 32, 0}; |
||
58 | static u8 speed_template_32_40_48[] = {32, 40, 48, 0}; |
||
59 | static u8 speed_template_32_48_64[] = {32, 48, 64, 0}; |
||
60 | |||
61 | /* |
||
62 | * Digest speed tests |
||
63 | */ |
||
64 | static struct hash_speed generic_hash_speed_template[] = { |
||
65 | { .blen = 16, .plen = 16, }, |
||
66 | { .blen = 64, .plen = 16, }, |
||
67 | { .blen = 64, .plen = 64, }, |
||
68 | { .blen = 256, .plen = 16, }, |
||
69 | { .blen = 256, .plen = 64, }, |
||
70 | { .blen = 256, .plen = 256, }, |
||
71 | { .blen = 1024, .plen = 16, }, |
||
72 | { .blen = 1024, .plen = 256, }, |
||
73 | { .blen = 1024, .plen = 1024, }, |
||
74 | { .blen = 2048, .plen = 16, }, |
||
75 | { .blen = 2048, .plen = 256, }, |
||
76 | { .blen = 2048, .plen = 1024, }, |
||
77 | { .blen = 2048, .plen = 2048, }, |
||
78 | { .blen = 4096, .plen = 16, }, |
||
79 | { .blen = 4096, .plen = 256, }, |
||
80 | { .blen = 4096, .plen = 1024, }, |
||
81 | { .blen = 4096, .plen = 4096, }, |
||
82 | { .blen = 8192, .plen = 16, }, |
||
83 | { .blen = 8192, .plen = 256, }, |
||
84 | { .blen = 8192, .plen = 1024, }, |
||
85 | { .blen = 8192, .plen = 4096, }, |
||
86 | { .blen = 8192, .plen = 8192, }, |
||
87 | |||
88 | /* End marker */ |
||
89 | { .blen = 0, .plen = 0, } |
||
90 | }; |
||
91 | |||
92 | #endif /* _CRYPTO_TCRYPT_H */ |