aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/tcrypt.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@tglx.tec.linutronix.de>2005-06-26 17:20:36 -0400
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-06-26 17:20:36 -0400
commit7ca6448dbfb398bba36eda3c01bc14b86c3675be (patch)
tree82d934ebf07f22a2c64c3b6d82ec24082878b43a /crypto/tcrypt.h
parentf1f67a9874f1a4bba1adff6d694aa52e5f52ff1a (diff)
parent7d681b23d6cc14a8c026ea6756242cb522cbbcae (diff)
Merge with rsync://fileserver/linux
Update to Linus latest
Diffstat (limited to 'crypto/tcrypt.h')
-rw-r--r--crypto/tcrypt.h449
1 files changed, 262 insertions, 187 deletions
diff --git a/crypto/tcrypt.h b/crypto/tcrypt.h
index a3097afae593..c01a0ce9b40a 100644
--- a/crypto/tcrypt.h
+++ b/crypto/tcrypt.h
@@ -9,10 +9,11 @@
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify it 10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the Free 11 * under the terms of the GNU General Public License as published by the Free
12 * Software Foundation; either version 2 of the License, or (at your option) 12 * Software Foundation; either version 2 of the License, or (at your option)
13 * any later version. 13 * any later version.
14 * 14 *
15 * 14 - 09 - 2003 Changes by Kartikey Mahendra Bhatt 15 * 2004-08-09 Cipher speed tests by Reyk Floeter <reyk@vantronix.net>
16 * 2003-09-14 Changes by Kartikey Mahendra Bhatt
16 * 17 *
17 */ 18 */
18#ifndef _CRYPTO_TCRYPT_H 19#ifndef _CRYPTO_TCRYPT_H
@@ -29,19 +30,19 @@ struct hash_testvec {
29 unsigned char psize; 30 unsigned char psize;
30 char digest[MAX_DIGEST_SIZE]; 31 char digest[MAX_DIGEST_SIZE];
31 unsigned char np; 32 unsigned char np;
32 unsigned char tap[MAX_TAP]; 33 unsigned char tap[MAX_TAP];
33 char key[128]; /* only used with keyed hash algorithms */ 34 char key[128]; /* only used with keyed hash algorithms */
34 unsigned char ksize; 35 unsigned char ksize;
35}; 36};
36 37
37struct hmac_testvec { 38struct hmac_testvec {
38 char key[128]; 39 char key[128];
39 unsigned char ksize; 40 unsigned char ksize;
40 char plaintext[128]; 41 char plaintext[128];
41 unsigned char psize; 42 unsigned char psize;
42 char digest[MAX_DIGEST_SIZE]; 43 char digest[MAX_DIGEST_SIZE];
43 unsigned char np; 44 unsigned char np;
44 unsigned char tap[MAX_TAP]; 45 unsigned char tap[MAX_TAP];
45}; 46};
46 47
47struct cipher_testvec { 48struct cipher_testvec {
@@ -55,7 +56,12 @@ struct cipher_testvec {
55 char result[48]; 56 char result[48];
56 unsigned char rlen; 57 unsigned char rlen;
57 int np; 58 int np;
58 unsigned char tap[MAX_TAP]; 59 unsigned char tap[MAX_TAP];
60};
61
62struct cipher_speed {
63 unsigned char klen;
64 unsigned int blen;
59}; 65};
60 66
61/* 67/*
@@ -155,7 +161,7 @@ static struct hash_testvec md5_tv_template[] = {
155#define SHA1_TEST_VECTORS 2 161#define SHA1_TEST_VECTORS 2
156 162
157static struct hash_testvec sha1_tv_template[] = { 163static struct hash_testvec sha1_tv_template[] = {
158 { 164 {
159 .plaintext = "abc", 165 .plaintext = "abc",
160 .psize = 3, 166 .psize = 3,
161 .digest = { 0xa9, 0x99, 0x3e, 0x36, 0x47, 0x06, 0x81, 0x6a, 0xba, 0x3e, 167 .digest = { 0xa9, 0x99, 0x3e, 0x36, 0x47, 0x06, 0x81, 0x6a, 0xba, 0x3e,
@@ -175,8 +181,8 @@ static struct hash_testvec sha1_tv_template[] = {
175 */ 181 */
176#define SHA256_TEST_VECTORS 2 182#define SHA256_TEST_VECTORS 2
177 183
178static struct hash_testvec sha256_tv_template[] = { 184static struct hash_testvec sha256_tv_template[] = {
179 { 185 {
180 .plaintext = "abc", 186 .plaintext = "abc",
181 .psize = 3, 187 .psize = 3,
182 .digest = { 0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea, 188 .digest = { 0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea,
@@ -201,7 +207,7 @@ static struct hash_testvec sha256_tv_template[] = {
201#define SHA384_TEST_VECTORS 4 207#define SHA384_TEST_VECTORS 4
202 208
203static struct hash_testvec sha384_tv_template[] = { 209static struct hash_testvec sha384_tv_template[] = {
204 { 210 {
205 .plaintext= "abc", 211 .plaintext= "abc",
206 .psize = 3, 212 .psize = 3,
207 .digest = { 0xcb, 0x00, 0x75, 0x3f, 0x45, 0xa3, 0x5e, 0x8b, 213 .digest = { 0xcb, 0x00, 0x75, 0x3f, 0x45, 0xa3, 0x5e, 0x8b,
@@ -221,7 +227,7 @@ static struct hash_testvec sha384_tv_template[] = {
221 0x5f, 0xe9, 0x5b, 0x1f, 0xe3, 0xc8, 0x45, 0x2b}, 227 0x5f, 0xe9, 0x5b, 0x1f, 0xe3, 0xc8, 0x45, 0x2b},
222 }, { 228 }, {
223 .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn" 229 .plaintext = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn"
224 "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu", 230 "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
225 .psize = 112, 231 .psize = 112,
226 .digest = { 0x09, 0x33, 0x0c, 0x33, 0xf7, 0x11, 0x47, 0xe8, 232 .digest = { 0x09, 0x33, 0x0c, 0x33, 0xf7, 0x11, 0x47, 0xe8,
227 0x3d, 0x19, 0x2f, 0xc7, 0x82, 0xcd, 0x1b, 0x47, 233 0x3d, 0x19, 0x2f, 0xc7, 0x82, 0xcd, 0x1b, 0x47,
@@ -250,7 +256,7 @@ static struct hash_testvec sha384_tv_template[] = {
250#define SHA512_TEST_VECTORS 4 256#define SHA512_TEST_VECTORS 4
251 257
252static struct hash_testvec sha512_tv_template[] = { 258static struct hash_testvec sha512_tv_template[] = {
253 { 259 {
254 .plaintext = "abc", 260 .plaintext = "abc",
255 .psize = 3, 261 .psize = 3,
256 .digest = { 0xdd, 0xaf, 0x35, 0xa1, 0x93, 0x61, 0x7a, 0xba, 262 .digest = { 0xdd, 0xaf, 0x35, 0xa1, 0x93, 0x61, 0x7a, 0xba,
@@ -303,14 +309,14 @@ static struct hash_testvec sha512_tv_template[] = {
303 309
304 310
305/* 311/*
306 * WHIRLPOOL test vectors from Whirlpool package 312 * WHIRLPOOL test vectors from Whirlpool package
307 * by Vincent Rijmen and Paulo S. L. M. Barreto as part of the NESSIE 313 * by Vincent Rijmen and Paulo S. L. M. Barreto as part of the NESSIE
308 * submission 314 * submission
309 */ 315 */
310#define WP512_TEST_VECTORS 8 316#define WP512_TEST_VECTORS 8
311 317
312static struct hash_testvec wp512_tv_template[] = { 318static struct hash_testvec wp512_tv_template[] = {
313 { 319 {
314 .plaintext = "", 320 .plaintext = "",
315 .psize = 0, 321 .psize = 0,
316 .digest = { 0x19, 0xFA, 0x61, 0xD7, 0x55, 0x22, 0xA4, 0x66, 322 .digest = { 0x19, 0xFA, 0x61, 0xD7, 0x55, 0x22, 0xA4, 0x66,
@@ -348,13 +354,13 @@ static struct hash_testvec wp512_tv_template[] = {
348 }, { 354 }, {
349 .plaintext = "message digest", 355 .plaintext = "message digest",
350 .psize = 14, 356 .psize = 14,
351 .digest = { 0x37, 0x8C, 0x84, 0xA4, 0x12, 0x6E, 0x2D, 0xC6, 357 .digest = { 0x37, 0x8C, 0x84, 0xA4, 0x12, 0x6E, 0x2D, 0xC6,
352 0xE5, 0x6D, 0xCC, 0x74, 0x58, 0x37, 0x7A, 0xAC, 358 0xE5, 0x6D, 0xCC, 0x74, 0x58, 0x37, 0x7A, 0xAC,
353 0x83, 0x8D, 0x00, 0x03, 0x22, 0x30, 0xF5, 0x3C, 359 0x83, 0x8D, 0x00, 0x03, 0x22, 0x30, 0xF5, 0x3C,
354 0xE1, 0xF5, 0x70, 0x0C, 0x0F, 0xFB, 0x4D, 0x3B, 360 0xE1, 0xF5, 0x70, 0x0C, 0x0F, 0xFB, 0x4D, 0x3B,
355 0x84, 0x21, 0x55, 0x76, 0x59, 0xEF, 0x55, 0xC1, 361 0x84, 0x21, 0x55, 0x76, 0x59, 0xEF, 0x55, 0xC1,
356 0x06, 0xB4, 0xB5, 0x2A, 0xC5, 0xA4, 0xAA, 0xA6, 362 0x06, 0xB4, 0xB5, 0x2A, 0xC5, 0xA4, 0xAA, 0xA6,
357 0x92, 0xED, 0x92, 0x00, 0x52, 0x83, 0x8F, 0x33, 363 0x92, 0xED, 0x92, 0x00, 0x52, 0x83, 0x8F, 0x33,
358 0x62, 0xE8, 0x6D, 0xBD, 0x37, 0xA8, 0x90, 0x3E }, 364 0x62, 0xE8, 0x6D, 0xBD, 0x37, 0xA8, 0x90, 0x3E },
359 }, { 365 }, {
360 .plaintext = "abcdefghijklmnopqrstuvwxyz", 366 .plaintext = "abcdefghijklmnopqrstuvwxyz",
@@ -394,7 +400,7 @@ static struct hash_testvec wp512_tv_template[] = {
394 }, { 400 }, {
395 .plaintext = "abcdbcdecdefdefgefghfghighijhijk", 401 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
396 .psize = 32, 402 .psize = 32,
397 .digest = { 0x2A, 0x98, 0x7E, 0xA4, 0x0F, 0x91, 0x70, 0x61, 403 .digest = { 0x2A, 0x98, 0x7E, 0xA4, 0x0F, 0x91, 0x70, 0x61,
398 0xF5, 0xD6, 0xF0, 0xA0, 0xE4, 0x64, 0x4F, 0x48, 404 0xF5, 0xD6, 0xF0, 0xA0, 0xE4, 0x64, 0x4F, 0x48,
399 0x8A, 0x7A, 0x5A, 0x52, 0xDE, 0xEE, 0x65, 0x62, 405 0x8A, 0x7A, 0x5A, 0x52, 0xDE, 0xEE, 0x65, 0x62,
400 0x07, 0xC5, 0x62, 0xF9, 0x88, 0xE9, 0x5C, 0x69, 406 0x07, 0xC5, 0x62, 0xF9, 0x88, 0xE9, 0x5C, 0x69,
@@ -408,7 +414,7 @@ static struct hash_testvec wp512_tv_template[] = {
408#define WP384_TEST_VECTORS 8 414#define WP384_TEST_VECTORS 8
409 415
410static struct hash_testvec wp384_tv_template[] = { 416static struct hash_testvec wp384_tv_template[] = {
411 { 417 {
412 .plaintext = "", 418 .plaintext = "",
413 .psize = 0, 419 .psize = 0,
414 .digest = { 0x19, 0xFA, 0x61, 0xD7, 0x55, 0x22, 0xA4, 0x66, 420 .digest = { 0x19, 0xFA, 0x61, 0xD7, 0x55, 0x22, 0xA4, 0x66,
@@ -440,11 +446,11 @@ static struct hash_testvec wp384_tv_template[] = {
440 }, { 446 }, {
441 .plaintext = "message digest", 447 .plaintext = "message digest",
442 .psize = 14, 448 .psize = 14,
443 .digest = { 0x37, 0x8C, 0x84, 0xA4, 0x12, 0x6E, 0x2D, 0xC6, 449 .digest = { 0x37, 0x8C, 0x84, 0xA4, 0x12, 0x6E, 0x2D, 0xC6,
444 0xE5, 0x6D, 0xCC, 0x74, 0x58, 0x37, 0x7A, 0xAC, 450 0xE5, 0x6D, 0xCC, 0x74, 0x58, 0x37, 0x7A, 0xAC,
445 0x83, 0x8D, 0x00, 0x03, 0x22, 0x30, 0xF5, 0x3C, 451 0x83, 0x8D, 0x00, 0x03, 0x22, 0x30, 0xF5, 0x3C,
446 0xE1, 0xF5, 0x70, 0x0C, 0x0F, 0xFB, 0x4D, 0x3B, 452 0xE1, 0xF5, 0x70, 0x0C, 0x0F, 0xFB, 0x4D, 0x3B,
447 0x84, 0x21, 0x55, 0x76, 0x59, 0xEF, 0x55, 0xC1, 453 0x84, 0x21, 0x55, 0x76, 0x59, 0xEF, 0x55, 0xC1,
448 0x06, 0xB4, 0xB5, 0x2A, 0xC5, 0xA4, 0xAA, 0xA6 }, 454 0x06, 0xB4, 0xB5, 0x2A, 0xC5, 0xA4, 0xAA, 0xA6 },
449 }, { 455 }, {
450 .plaintext = "abcdefghijklmnopqrstuvwxyz", 456 .plaintext = "abcdefghijklmnopqrstuvwxyz",
@@ -478,7 +484,7 @@ static struct hash_testvec wp384_tv_template[] = {
478 }, { 484 }, {
479 .plaintext = "abcdbcdecdefdefgefghfghighijhijk", 485 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
480 .psize = 32, 486 .psize = 32,
481 .digest = { 0x2A, 0x98, 0x7E, 0xA4, 0x0F, 0x91, 0x70, 0x61, 487 .digest = { 0x2A, 0x98, 0x7E, 0xA4, 0x0F, 0x91, 0x70, 0x61,
482 0xF5, 0xD6, 0xF0, 0xA0, 0xE4, 0x64, 0x4F, 0x48, 488 0xF5, 0xD6, 0xF0, 0xA0, 0xE4, 0x64, 0x4F, 0x48,
483 0x8A, 0x7A, 0x5A, 0x52, 0xDE, 0xEE, 0x65, 0x62, 489 0x8A, 0x7A, 0x5A, 0x52, 0xDE, 0xEE, 0x65, 0x62,
484 0x07, 0xC5, 0x62, 0xF9, 0x88, 0xE9, 0x5C, 0x69, 490 0x07, 0xC5, 0x62, 0xF9, 0x88, 0xE9, 0x5C, 0x69,
@@ -490,7 +496,7 @@ static struct hash_testvec wp384_tv_template[] = {
490#define WP256_TEST_VECTORS 8 496#define WP256_TEST_VECTORS 8
491 497
492static struct hash_testvec wp256_tv_template[] = { 498static struct hash_testvec wp256_tv_template[] = {
493 { 499 {
494 .plaintext = "", 500 .plaintext = "",
495 .psize = 0, 501 .psize = 0,
496 .digest = { 0x19, 0xFA, 0x61, 0xD7, 0x55, 0x22, 0xA4, 0x66, 502 .digest = { 0x19, 0xFA, 0x61, 0xD7, 0x55, 0x22, 0xA4, 0x66,
@@ -516,9 +522,9 @@ static struct hash_testvec wp256_tv_template[] = {
516 }, { 522 }, {
517 .plaintext = "message digest", 523 .plaintext = "message digest",
518 .psize = 14, 524 .psize = 14,
519 .digest = { 0x37, 0x8C, 0x84, 0xA4, 0x12, 0x6E, 0x2D, 0xC6, 525 .digest = { 0x37, 0x8C, 0x84, 0xA4, 0x12, 0x6E, 0x2D, 0xC6,
520 0xE5, 0x6D, 0xCC, 0x74, 0x58, 0x37, 0x7A, 0xAC, 526 0xE5, 0x6D, 0xCC, 0x74, 0x58, 0x37, 0x7A, 0xAC,
521 0x83, 0x8D, 0x00, 0x03, 0x22, 0x30, 0xF5, 0x3C, 527 0x83, 0x8D, 0x00, 0x03, 0x22, 0x30, 0xF5, 0x3C,
522 0xE1, 0xF5, 0x70, 0x0C, 0x0F, 0xFB, 0x4D, 0x3B }, 528 0xE1, 0xF5, 0x70, 0x0C, 0x0F, 0xFB, 0x4D, 0x3B },
523 }, { 529 }, {
524 .plaintext = "abcdefghijklmnopqrstuvwxyz", 530 .plaintext = "abcdefghijklmnopqrstuvwxyz",
@@ -546,7 +552,7 @@ static struct hash_testvec wp256_tv_template[] = {
546 }, { 552 }, {
547 .plaintext = "abcdbcdecdefdefgefghfghighijhijk", 553 .plaintext = "abcdbcdecdefdefgefghfghighijhijk",
548 .psize = 32, 554 .psize = 32,
549 .digest = { 0x2A, 0x98, 0x7E, 0xA4, 0x0F, 0x91, 0x70, 0x61, 555 .digest = { 0x2A, 0x98, 0x7E, 0xA4, 0x0F, 0x91, 0x70, 0x61,
550 0xF5, 0xD6, 0xF0, 0xA0, 0xE4, 0x64, 0x4F, 0x48, 556 0xF5, 0xD6, 0xF0, 0xA0, 0xE4, 0x64, 0x4F, 0x48,
551 0x8A, 0x7A, 0x5A, 0x52, 0xDE, 0xEE, 0x65, 0x62, 557 0x8A, 0x7A, 0x5A, 0x52, 0xDE, 0xEE, 0x65, 0x62,
552 0x07, 0xC5, 0x62, 0xF9, 0x88, 0xE9, 0x5C, 0x69 }, 558 0x07, 0xC5, 0x62, 0xF9, 0x88, 0xE9, 0x5C, 0x69 },
@@ -554,7 +560,7 @@ static struct hash_testvec wp256_tv_template[] = {
554}; 560};
555 561
556/* 562/*
557 * TIGER test vectors from Tiger website 563 * TIGER test vectors from Tiger website
558 */ 564 */
559#define TGR192_TEST_VECTORS 6 565#define TGR192_TEST_VECTORS 6
560 566
@@ -693,7 +699,7 @@ static struct hash_testvec tgr128_tv_template[] = {
693#define HMAC_MD5_TEST_VECTORS 7 699#define HMAC_MD5_TEST_VECTORS 7
694 700
695static struct hmac_testvec hmac_md5_tv_template[] = 701static struct hmac_testvec hmac_md5_tv_template[] =
696{ 702{
697 { 703 {
698 .key = { [0 ... 15] = 0x0b }, 704 .key = { [0 ... 15] = 0x0b },
699 .ksize = 16, 705 .ksize = 16,
@@ -756,7 +762,7 @@ static struct hmac_testvec hmac_md5_tv_template[] =
756 */ 762 */
757#define HMAC_SHA1_TEST_VECTORS 7 763#define HMAC_SHA1_TEST_VECTORS 7
758 764
759static struct hmac_testvec hmac_sha1_tv_template[] = { 765static struct hmac_testvec hmac_sha1_tv_template[] = {
760 { 766 {
761 .key = { [0 ... 19] = 0x0b }, 767 .key = { [0 ... 19] = 0x0b },
762 .ksize = 20, 768 .ksize = 20,
@@ -766,11 +772,11 @@ static struct hmac_testvec hmac_sha1_tv_template[] = {
766 0xe2, 0x8b, 0xc0, 0xb6, 0xfb, 0x37, 0x8c, 0x8e, 0xf1, 772 0xe2, 0x8b, 0xc0, 0xb6, 0xfb, 0x37, 0x8c, 0x8e, 0xf1,
767 0x46, 0xbe }, 773 0x46, 0xbe },
768 }, { 774 }, {
769 .key = { 'J', 'e', 'f', 'e' }, 775 .key = { 'J', 'e', 'f', 'e' },
770 .ksize = 4, 776 .ksize = 4,
771 .plaintext = "what do ya want for nothing?", 777 .plaintext = "what do ya want for nothing?",
772 .psize = 28, 778 .psize = 28,
773 .digest = { 0xef, 0xfc, 0xdf, 0x6a, 0xe5, 0xeb, 0x2f, 0xa2, 0xd2, 0x74, 779 .digest = { 0xef, 0xfc, 0xdf, 0x6a, 0xe5, 0xeb, 0x2f, 0xa2, 0xd2, 0x74,
774 0x16, 0xd5, 0xf1, 0x84, 0xdf, 0x9c, 0x25, 0x9a, 0x7c, 0x79 }, 780 0x16, 0xd5, 0xf1, 0x84, 0xdf, 0x9c, 0x25, 0x9a, 0x7c, 0x79 },
775 .np = 2, 781 .np = 2,
776 .tap = { 14, 14 } 782 .tap = { 14, 14 }
@@ -779,30 +785,30 @@ static struct hmac_testvec hmac_sha1_tv_template[] = {
779 .ksize = 20, 785 .ksize = 20,
780 .plaintext = { [0 ... 49] = 0xdd }, 786 .plaintext = { [0 ... 49] = 0xdd },
781 .psize = 50, 787 .psize = 50,
782 .digest = { 0x12, 0x5d, 0x73, 0x42, 0xb9, 0xac, 0x11, 0xcd, 0x91, 0xa3, 788 .digest = { 0x12, 0x5d, 0x73, 0x42, 0xb9, 0xac, 0x11, 0xcd, 0x91, 0xa3,
783 0x9a, 0xf4, 0x8a, 0xa1, 0x7b, 0x4f, 0x63, 0xf1, 0x75, 0xd3 }, 789 0x9a, 0xf4, 0x8a, 0xa1, 0x7b, 0x4f, 0x63, 0xf1, 0x75, 0xd3 },
784 }, { 790 }, {
785 .key = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 791 .key = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
786 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 792 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
787 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19 }, 793 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19 },
788 .ksize = 25, 794 .ksize = 25,
789 .plaintext = { [0 ... 49] = 0xcd }, 795 .plaintext = { [0 ... 49] = 0xcd },
790 .psize = 50, 796 .psize = 50,
791 .digest = { 0x4c, 0x90, 0x07, 0xf4, 0x02, 0x62, 0x50, 0xc6, 0xbc, 0x84, 797 .digest = { 0x4c, 0x90, 0x07, 0xf4, 0x02, 0x62, 0x50, 0xc6, 0xbc, 0x84,
792 0x14, 0xf9, 0xbf, 0x50, 0xc8, 0x6c, 0x2d, 0x72, 0x35, 0xda }, 798 0x14, 0xf9, 0xbf, 0x50, 0xc8, 0x6c, 0x2d, 0x72, 0x35, 0xda },
793 }, { 799 }, {
794 .key = { [0 ... 19] = 0x0c }, 800 .key = { [0 ... 19] = 0x0c },
795 .ksize = 20, 801 .ksize = 20,
796 .plaintext = "Test With Truncation", 802 .plaintext = "Test With Truncation",
797 .psize = 20, 803 .psize = 20,
798 .digest = { 0x4c, 0x1a, 0x03, 0x42, 0x4b, 0x55, 0xe0, 0x7f, 0xe7, 0xf2, 804 .digest = { 0x4c, 0x1a, 0x03, 0x42, 0x4b, 0x55, 0xe0, 0x7f, 0xe7, 0xf2,
799 0x7b, 0xe1, 0xd5, 0x8b, 0xb9, 0x32, 0x4a, 0x9a, 0x5a, 0x04 }, 805 0x7b, 0xe1, 0xd5, 0x8b, 0xb9, 0x32, 0x4a, 0x9a, 0x5a, 0x04 },
800 }, { 806 }, {
801 .key = { [0 ... 79] = 0xaa }, 807 .key = { [0 ... 79] = 0xaa },
802 .ksize = 80, 808 .ksize = 80,
803 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First", 809 .plaintext = "Test Using Larger Than Block-Size Key - Hash Key First",
804 .psize = 54, 810 .psize = 54,
805 .digest = { 0xaa, 0x4a, 0xe5, 0xe1, 0x52, 0x72, 0xd0, 0x0e, 0x95, 0x70, 811 .digest = { 0xaa, 0x4a, 0xe5, 0xe1, 0x52, 0x72, 0xd0, 0x0e, 0x95, 0x70,
806 0x56, 0x37, 0xce, 0x8a, 0x3b, 0x55, 0xed, 0x40, 0x21, 0x12 }, 812 0x56, 0x37, 0xce, 0x8a, 0x3b, 0x55, 0xed, 0x40, 0x21, 0x12 },
807 }, { 813 }, {
808 .key = { [0 ... 79] = 0xaa }, 814 .key = { [0 ... 79] = 0xaa },
@@ -810,7 +816,7 @@ static struct hmac_testvec hmac_sha1_tv_template[] = {
810 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One " 816 .plaintext = "Test Using Larger Than Block-Size Key and Larger Than One "
811 "Block-Size Data", 817 "Block-Size Data",
812 .psize = 73, 818 .psize = 73,
813 .digest = { 0xe8, 0xe9, 0x9d, 0x0f, 0x45, 0x23, 0x7d, 0x78, 0x6d, 0x6b, 819 .digest = { 0xe8, 0xe9, 0x9d, 0x0f, 0x45, 0x23, 0x7d, 0x78, 0x6d, 0x6b,
814 0xba, 0xa7, 0x96, 0x5c, 0x78, 0x08, 0xbb, 0xff, 0x1a, 0x91 }, 820 0xba, 0xa7, 0x96, 0x5c, 0x78, 0x08, 0xbb, 0xff, 0x1a, 0x91 },
815 }, 821 },
816}; 822};
@@ -1011,7 +1017,7 @@ static struct cipher_testvec des_enc_tv_template[] = {
1011 0xf7, 0x9c, 0x89, 0x2a, 0x33, 0x8f, 0x4a, 0x8b }, 1017 0xf7, 0x9c, 0x89, 0x2a, 0x33, 0x8f, 0x4a, 0x8b },
1012 .rlen = 32, 1018 .rlen = 32,
1013 .np = 3, 1019 .np = 3,
1014 .tap = { 14, 10, 8 } 1020 .tap = { 14, 10, 8 }
1015 }, { 1021 }, {
1016 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, 1022 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1017 .klen = 8, 1023 .klen = 8,
@@ -1024,7 +1030,7 @@ static struct cipher_testvec des_enc_tv_template[] = {
1024 0xb4, 0x99, 0x26, 0xf7, 0x1f, 0xe1, 0xd4, 0x90 }, 1030 0xb4, 0x99, 0x26, 0xf7, 0x1f, 0xe1, 0xd4, 0x90 },
1025 .rlen = 24, 1031 .rlen = 24,
1026 .np = 4, 1032 .np = 4,
1027 .tap = { 2, 1, 3, 18 } 1033 .tap = { 2, 1, 3, 18 }
1028 }, { 1034 }, {
1029 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, 1035 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1030 .klen = 8, 1036 .klen = 8,
@@ -1035,7 +1041,7 @@ static struct cipher_testvec des_enc_tv_template[] = {
1035 0xf7, 0x9c, 0x89, 0x2a, 0x33, 0x8f, 0x4a, 0x8b }, 1041 0xf7, 0x9c, 0x89, 0x2a, 0x33, 0x8f, 0x4a, 0x8b },
1036 .rlen = 16, 1042 .rlen = 16,
1037 .np = 5, 1043 .np = 5,
1038 .tap = { 2, 2, 2, 2, 8 } 1044 .tap = { 2, 2, 2, 2, 8 }
1039 }, { 1045 }, {
1040 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, 1046 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1041 .klen = 8, 1047 .klen = 8,
@@ -1044,7 +1050,7 @@ static struct cipher_testvec des_enc_tv_template[] = {
1044 .result = { 0xc9, 0x57, 0x44, 0x25, 0x6a, 0x5e, 0xd3, 0x1d }, 1050 .result = { 0xc9, 0x57, 0x44, 0x25, 0x6a, 0x5e, 0xd3, 0x1d },
1045 .rlen = 8, 1051 .rlen = 8,
1046 .np = 8, 1052 .np = 8,
1047 .tap = { 1, 1, 1, 1, 1, 1, 1, 1 } 1053 .tap = { 1, 1, 1, 1, 1, 1, 1, 1 }
1048 }, 1054 },
1049}; 1055};
1050 1056
@@ -1057,7 +1063,7 @@ static struct cipher_testvec des_dec_tv_template[] = {
1057 .result = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xe7 }, 1063 .result = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xe7 },
1058 .rlen = 8, 1064 .rlen = 8,
1059 }, { /* Sbox test from NBS */ 1065 }, { /* Sbox test from NBS */
1060 .key = { 0x7c, 0xa1, 0x10, 0x45, 0x4a, 0x1a, 0x6e, 0x57 }, 1066 .key = { 0x7c, 0xa1, 0x10, 0x45, 0x4a, 0x1a, 0x6e, 0x57 },
1061 .klen = 8, 1067 .klen = 8,
1062 .input = { 0x69, 0x0f, 0x5b, 0x0d, 0x9a, 0x26, 0x93, 0x9b }, 1068 .input = { 0x69, 0x0f, 0x5b, 0x0d, 0x9a, 0x26, 0x93, 0x9b },
1063 .ilen = 8, 1069 .ilen = 8,
@@ -1092,19 +1098,19 @@ static struct cipher_testvec des_cbc_enc_tv_template[] = {
1092 { /* From OpenSSL */ 1098 { /* From OpenSSL */
1093 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, 1099 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef},
1094 .klen = 8, 1100 .klen = 8,
1095 .iv = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10}, 1101 .iv = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10},
1096 .input = { 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x20, 1102 .input = { 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x20,
1097 0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74, 1103 0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74,
1098 0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20 }, 1104 0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20 },
1099 .ilen = 24, 1105 .ilen = 24,
1100 .result = { 0xcc, 0xd1, 0x73, 0xff, 0xab, 0x20, 0x39, 0xf4, 1106 .result = { 0xcc, 0xd1, 0x73, 0xff, 0xab, 0x20, 0x39, 0xf4,
1101 0xac, 0xd8, 0xae, 0xfd, 0xdf, 0xd8, 0xa1, 0xeb, 1107 0xac, 0xd8, 0xae, 0xfd, 0xdf, 0xd8, 0xa1, 0xeb,
1102 0x46, 0x8e, 0x91, 0x15, 0x78, 0x88, 0xba, 0x68 }, 1108 0x46, 0x8e, 0x91, 0x15, 0x78, 0x88, 0xba, 0x68 },
1103 .rlen = 24, 1109 .rlen = 24,
1104 }, { /* FIPS Pub 81 */ 1110 }, { /* FIPS Pub 81 */
1105 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, 1111 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1106 .klen = 8, 1112 .klen = 8,
1107 .iv = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef }, 1113 .iv = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef },
1108 .input = { 0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74 }, 1114 .input = { 0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74 },
1109 .ilen = 8, 1115 .ilen = 8,
1110 .result = { 0xe5, 0xc7, 0xcd, 0xde, 0x87, 0x2b, 0xf2, 0x7c }, 1116 .result = { 0xe5, 0xc7, 0xcd, 0xde, 0x87, 0x2b, 0xf2, 0x7c },
@@ -1117,7 +1123,7 @@ static struct cipher_testvec des_cbc_enc_tv_template[] = {
1117 .ilen = 8, 1123 .ilen = 8,
1118 .result = { 0x43, 0xe9, 0x34, 0x00, 0x8c, 0x38, 0x9c, 0x0f }, 1124 .result = { 0x43, 0xe9, 0x34, 0x00, 0x8c, 0x38, 0x9c, 0x0f },
1119 .rlen = 8, 1125 .rlen = 8,
1120 }, { 1126 }, {
1121 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, 1127 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1122 .klen = 8, 1128 .klen = 8,
1123 .iv = { 0x43, 0xe9, 0x34, 0x00, 0x8c, 0x38, 0x9c, 0x0f }, 1129 .iv = { 0x43, 0xe9, 0x34, 0x00, 0x8c, 0x38, 0x9c, 0x0f },
@@ -1125,18 +1131,18 @@ static struct cipher_testvec des_cbc_enc_tv_template[] = {
1125 .ilen = 8, 1131 .ilen = 8,
1126 .result = { 0x68, 0x37, 0x88, 0x49, 0x9a, 0x7c, 0x05, 0xf6 }, 1132 .result = { 0x68, 0x37, 0x88, 0x49, 0x9a, 0x7c, 0x05, 0xf6 },
1127 .rlen = 8, 1133 .rlen = 8,
1128 }, { /* Copy of openssl vector for chunk testing */ 1134 }, { /* Copy of openssl vector for chunk testing */
1129 /* From OpenSSL */ 1135 /* From OpenSSL */
1130 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, 1136 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef},
1131 .klen = 8, 1137 .klen = 8,
1132 .iv = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10}, 1138 .iv = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10},
1133 .input = { 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x20, 1139 .input = { 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x20,
1134 0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74, 1140 0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74,
1135 0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20 }, 1141 0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20 },
1136 .ilen = 24, 1142 .ilen = 24,
1137 .result = { 0xcc, 0xd1, 0x73, 0xff, 0xab, 0x20, 0x39, 0xf4, 1143 .result = { 0xcc, 0xd1, 0x73, 0xff, 0xab, 0x20, 0x39, 0xf4,
1138 0xac, 0xd8, 0xae, 0xfd, 0xdf, 0xd8, 0xa1, 0xeb, 1144 0xac, 0xd8, 0xae, 0xfd, 0xdf, 0xd8, 0xa1, 0xeb,
1139 0x46, 0x8e, 0x91, 0x15, 0x78, 0x88, 0xba, 0x68 }, 1145 0x46, 0x8e, 0x91, 0x15, 0x78, 0x88, 0xba, 0x68 },
1140 .rlen = 24, 1146 .rlen = 24,
1141 .np = 2, 1147 .np = 2,
1142 .tap = { 13, 11 } 1148 .tap = { 13, 11 }
@@ -1155,24 +1161,24 @@ static struct cipher_testvec des_cbc_dec_tv_template[] = {
1155 }, { 1161 }, {
1156 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, 1162 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1157 .klen = 8, 1163 .klen = 8,
1158 .iv = { 0xe5, 0xc7, 0xcd, 0xde, 0x87, 0x2b, 0xf2, 0x7c }, 1164 .iv = { 0xe5, 0xc7, 0xcd, 0xde, 0x87, 0x2b, 0xf2, 0x7c },
1159 .input = { 0x43, 0xe9, 0x34, 0x00, 0x8c, 0x38, 0x9c, 0x0f }, 1165 .input = { 0x43, 0xe9, 0x34, 0x00, 0x8c, 0x38, 0x9c, 0x0f },
1160 .ilen = 8, 1166 .ilen = 8,
1161 .result = { 0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20 }, 1167 .result = { 0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20 },
1162 .rlen = 8, 1168 .rlen = 8,
1163 }, { 1169 }, {
1164 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, 1170 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1165 .klen = 8, 1171 .klen = 8,
1166 .iv = { 0x43, 0xe9, 0x34, 0x00, 0x8c, 0x38, 0x9c, 0x0f }, 1172 .iv = { 0x43, 0xe9, 0x34, 0x00, 0x8c, 0x38, 0x9c, 0x0f },
1167 .input = { 0x68, 0x37, 0x88, 0x49, 0x9a, 0x7c, 0x05, 0xf6 }, 1173 .input = { 0x68, 0x37, 0x88, 0x49, 0x9a, 0x7c, 0x05, 0xf6 },
1168 .ilen = 8, 1174 .ilen = 8,
1169 .result = { 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20 }, 1175 .result = { 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20 },
1170 .rlen = 8, 1176 .rlen = 8,
1171 }, { /* Copy of above, for chunk testing */ 1177 }, { /* Copy of above, for chunk testing */
1172 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, 1178 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1173 .klen = 8, 1179 .klen = 8,
1174 .iv = { 0x43, 0xe9, 0x34, 0x00, 0x8c, 0x38, 0x9c, 0x0f }, 1180 .iv = { 0x43, 0xe9, 0x34, 0x00, 0x8c, 0x38, 0x9c, 0x0f },
1175 .input = { 0x68, 0x37, 0x88, 0x49, 0x9a, 0x7c, 0x05, 0xf6 }, 1181 .input = { 0x68, 0x37, 0x88, 0x49, 0x9a, 0x7c, 0x05, 0xf6 },
1176 .ilen = 8, 1182 .ilen = 8,
1177 .result = { 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20 }, 1183 .result = { 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6c, 0x6c, 0x20 },
1178 .rlen = 8, 1184 .rlen = 8,
@@ -1276,7 +1282,7 @@ static struct cipher_testvec bf_enc_tv_template[] = {
1276 .ilen = 8, 1282 .ilen = 8,
1277 .result = { 0xe8, 0x7a, 0x24, 0x4e, 0x2c, 0xc8, 0x5e, 0x82 }, 1283 .result = { 0xe8, 0x7a, 0x24, 0x4e, 0x2c, 0xc8, 0x5e, 0x82 },
1278 .rlen = 8, 1284 .rlen = 8,
1279 }, { /* Vary the keylength... */ 1285 }, { /* Vary the keylength... */
1280 .key = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87, 1286 .key = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87,
1281 0x78, 0x69, 0x5a, 0x4b, 0x3c, 0x2d, 0x1e, 0x0f }, 1287 0x78, 0x69, 0x5a, 0x4b, 0x3c, 0x2d, 0x1e, 0x0f },
1282 .klen = 16, 1288 .klen = 16,
@@ -1297,9 +1303,9 @@ static struct cipher_testvec bf_enc_tv_template[] = {
1297 .key = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87, 1303 .key = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87,
1298 0x78, 0x69, 0x5a, 0x4b, 0x3c, 0x2d, 0x1e, 0x0f, 1304 0x78, 0x69, 0x5a, 0x4b, 0x3c, 0x2d, 0x1e, 0x0f,
1299 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 1305 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
1300 0x04, 0x68, 0x91, 0x04, 0xc2, 0xfd, 0x3b, 0x2f, 1306 0x04, 0x68, 0x91, 0x04, 0xc2, 0xfd, 0x3b, 0x2f,
1301 0x58, 0x40, 0x23, 0x64, 0x1a, 0xba, 0x61, 0x76, 1307 0x58, 0x40, 0x23, 0x64, 0x1a, 0xba, 0x61, 0x76,
1302 0x1f, 0x1f, 0x1f, 0x1f, 0x0e, 0x0e, 0x0e, 0x0e, 1308 0x1f, 0x1f, 0x1f, 0x1f, 0x0e, 0x0e, 0x0e, 0x0e,
1303 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, 1309 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
1304 .klen = 56, 1310 .klen = 56,
1305 .input = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, 1311 .input = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
@@ -1331,7 +1337,7 @@ static struct cipher_testvec bf_dec_tv_template[] = {
1331 .ilen = 8, 1337 .ilen = 8,
1332 .result = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, 1338 .result = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
1333 .rlen = 8, 1339 .rlen = 8,
1334 }, { /* Vary the keylength... */ 1340 }, { /* Vary the keylength... */
1335 .key = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87, 1341 .key = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87,
1336 0x78, 0x69, 0x5a, 0x4b, 0x3c, 0x2d, 0x1e, 0x0f }, 1342 0x78, 0x69, 0x5a, 0x4b, 0x3c, 0x2d, 0x1e, 0x0f },
1337 .klen = 16, 1343 .klen = 16,
@@ -1352,9 +1358,9 @@ static struct cipher_testvec bf_dec_tv_template[] = {
1352 .key = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87, 1358 .key = { 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87,
1353 0x78, 0x69, 0x5a, 0x4b, 0x3c, 0x2d, 0x1e, 0x0f, 1359 0x78, 0x69, 0x5a, 0x4b, 0x3c, 0x2d, 0x1e, 0x0f,
1354 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 1360 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
1355 0x04, 0x68, 0x91, 0x04, 0xc2, 0xfd, 0x3b, 0x2f, 1361 0x04, 0x68, 0x91, 0x04, 0xc2, 0xfd, 0x3b, 0x2f,
1356 0x58, 0x40, 0x23, 0x64, 0x1a, 0xba, 0x61, 0x76, 1362 0x58, 0x40, 0x23, 0x64, 0x1a, 0xba, 0x61, 0x76,
1357 0x1f, 0x1f, 0x1f, 0x1f, 0x0e, 0x0e, 0x0e, 0x0e, 1363 0x1f, 0x1f, 0x1f, 0x1f, 0x0e, 0x0e, 0x0e, 0x0e,
1358 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, 1364 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
1359 .klen = 56, 1365 .klen = 56,
1360 .input = { 0xc0, 0x45, 0x04, 0x01, 0x2e, 0x4e, 0x1f, 0x53 }, 1366 .input = { 0xc0, 0x45, 0x04, 0x01, 0x2e, 0x4e, 0x1f, 0x53 },
@@ -1369,7 +1375,7 @@ static struct cipher_testvec bf_cbc_enc_tv_template[] = {
1369 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 1375 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
1370 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 }, 1376 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 },
1371 .klen = 16, 1377 .klen = 16,
1372 .iv = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, 1378 .iv = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
1373 .input = { 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x20, 1379 .input = { 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x20,
1374 0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74, 1380 0x4e, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74,
1375 0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20, 1381 0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20,
@@ -1388,7 +1394,7 @@ static struct cipher_testvec bf_cbc_dec_tv_template[] = {
1388 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 1394 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
1389 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 }, 1395 0xf0, 0xe1, 0xd2, 0xc3, 0xb4, 0xa5, 0x96, 0x87 },
1390 .klen = 16, 1396 .klen = 16,
1391 .iv = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, 1397 .iv = { 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 },
1392 .input = { 0x6b, 0x77, 0xb4, 0xd6, 0x30, 0x06, 0xde, 0xe6, 1398 .input = { 0x6b, 0x77, 0xb4, 0xd6, 0x30, 0x06, 0xde, 0xe6,
1393 0x05, 0xb1, 0x56, 0xe2, 0x74, 0x03, 0x97, 0x93, 1399 0x05, 0xb1, 0x56, 0xe2, 0x74, 0x03, 0x97, 0x93,
1394 0x58, 0xde, 0xb9, 0xe7, 0x15, 0x46, 0x16, 0xd9, 1400 0x58, 0xde, 0xb9, 0xe7, 0x15, 0x46, 0x16, 0xd9,
@@ -1490,7 +1496,7 @@ static struct cipher_testvec tf_cbc_enc_tv_template[] = {
1490 .key = { [0 ... 15] = 0x00 }, 1496 .key = { [0 ... 15] = 0x00 },
1491 .klen = 16, 1497 .klen = 16,
1492 .iv = { 0x9f, 0x58, 0x9f, 0x5c, 0xf6, 0x12, 0x2c, 0x32, 1498 .iv = { 0x9f, 0x58, 0x9f, 0x5c, 0xf6, 0x12, 0x2c, 0x32,
1493 0xb6, 0xbf, 0xec, 0x2f, 0x2a, 0xe8, 0xc3, 0x5a }, 1499 0xb6, 0xbf, 0xec, 0x2f, 0x2a, 0xe8, 0xc3, 0x5a },
1494 .input = { [0 ... 15] = 0x00 }, 1500 .input = { [0 ... 15] = 0x00 },
1495 .ilen = 16, 1501 .ilen = 16,
1496 .result = { 0xd4, 0x91, 0xdb, 0x16, 0xe7, 0xb1, 0xc3, 0x9e, 1502 .result = { 0xd4, 0x91, 0xdb, 0x16, 0xe7, 0xb1, 0xc3, 0x9e,
@@ -1528,7 +1534,7 @@ static struct cipher_testvec tf_cbc_dec_tv_template[] = {
1528 .klen = 16, 1534 .klen = 16,
1529 .iv = { [0 ... 15] = 0x00 }, 1535 .iv = { [0 ... 15] = 0x00 },
1530 .input = { 0x9f, 0x58, 0x9f, 0x5c, 0xf6, 0x12, 0x2c, 0x32, 1536 .input = { 0x9f, 0x58, 0x9f, 0x5c, 0xf6, 0x12, 0x2c, 0x32,
1531 0xb6, 0xbf, 0xec, 0x2f, 0x2a, 0xe8, 0xc3, 0x5a }, 1537 0xb6, 0xbf, 0xec, 0x2f, 0x2a, 0xe8, 0xc3, 0x5a },
1532 .ilen = 16, 1538 .ilen = 16,
1533 .result = { [0 ... 15] = 0x00 }, 1539 .result = { [0 ... 15] = 0x00 },
1534 .rlen = 16, 1540 .rlen = 16,
@@ -1578,8 +1584,7 @@ static struct cipher_testvec tf_cbc_dec_tv_template[] = {
1578#define TNEPRES_ENC_TEST_VECTORS 4 1584#define TNEPRES_ENC_TEST_VECTORS 4
1579#define TNEPRES_DEC_TEST_VECTORS 4 1585#define TNEPRES_DEC_TEST_VECTORS 4
1580 1586
1581static struct cipher_testvec serpent_enc_tv_template[] = 1587static struct cipher_testvec serpent_enc_tv_template[] = {
1582{
1583 { 1588 {
1584 .input = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 1589 .input = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1585 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, 1590 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
@@ -1620,8 +1625,7 @@ static struct cipher_testvec serpent_enc_tv_template[] =
1620 }, 1625 },
1621}; 1626};
1622 1627
1623static struct cipher_testvec tnepres_enc_tv_template[] = 1628static struct cipher_testvec tnepres_enc_tv_template[] = {
1624{
1625 { /* KeySize=128, PT=0, I=1 */ 1629 { /* KeySize=128, PT=0, I=1 */
1626 .input = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 1630 .input = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1627 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 1631 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
@@ -1629,7 +1633,7 @@ static struct cipher_testvec tnepres_enc_tv_template[] =
1629 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 1633 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1630 .klen = 16, 1634 .klen = 16,
1631 .ilen = 16, 1635 .ilen = 16,
1632 .result = { 0x49, 0xaf, 0xbf, 0xad, 0x9d, 0x5a, 0x34, 0x05, 1636 .result = { 0x49, 0xaf, 0xbf, 0xad, 0x9d, 0x5a, 0x34, 0x05,
1633 0x2c, 0xd8, 0xff, 0xa5, 0x98, 0x6b, 0xd2, 0xdd }, 1637 0x2c, 0xd8, 0xff, 0xa5, 0x98, 0x6b, 0xd2, 0xdd },
1634 .rlen = 16, 1638 .rlen = 16,
1635 }, { /* KeySize=192, PT=0, I=1 */ 1639 }, { /* KeySize=192, PT=0, I=1 */
@@ -1640,7 +1644,7 @@ static struct cipher_testvec tnepres_enc_tv_template[] =
1640 .input = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 1644 .input = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1641 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 1645 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1642 .ilen = 16, 1646 .ilen = 16,
1643 .result = { 0xe7, 0x8e, 0x54, 0x02, 0xc7, 0x19, 0x55, 0x68, 1647 .result = { 0xe7, 0x8e, 0x54, 0x02, 0xc7, 0x19, 0x55, 0x68,
1644 0xac, 0x36, 0x78, 0xf7, 0xa3, 0xf6, 0x0c, 0x66 }, 1648 0xac, 0x36, 0x78, 0xf7, 0xa3, 0xf6, 0x0c, 0x66 },
1645 .rlen = 16, 1649 .rlen = 16,
1646 }, { /* KeySize=256, PT=0, I=1 */ 1650 }, { /* KeySize=256, PT=0, I=1 */
@@ -1652,7 +1656,7 @@ static struct cipher_testvec tnepres_enc_tv_template[] =
1652 .input = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 1656 .input = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1653 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 1657 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
1654 .ilen = 16, 1658 .ilen = 16,
1655 .result = { 0xab, 0xed, 0x96, 0xe7, 0x66, 0xbf, 0x28, 0xcb, 1659 .result = { 0xab, 0xed, 0x96, 0xe7, 0x66, 0xbf, 0x28, 0xcb,
1656 0xc0, 0xeb, 0xd2, 0x1a, 0x82, 0xef, 0x08, 0x19 }, 1660 0xc0, 0xeb, 0xd2, 0x1a, 0x82, 0xef, 0x08, 0x19 },
1657 .rlen = 16, 1661 .rlen = 16,
1658 }, { /* KeySize=256, I=257 */ 1662 }, { /* KeySize=256, I=257 */
@@ -1664,15 +1668,14 @@ static struct cipher_testvec tnepres_enc_tv_template[] =
1664 .input = { 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 1668 .input = { 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08,
1665 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 }, 1669 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 },
1666 .ilen = 16, 1670 .ilen = 16,
1667 .result = { 0x5c, 0xe7, 0x1c, 0x70, 0xd2, 0x88, 0x2e, 0x5b, 1671 .result = { 0x5c, 0xe7, 0x1c, 0x70, 0xd2, 0x88, 0x2e, 0x5b,
1668 0xb8, 0x32, 0xe4, 0x33, 0xf8, 0x9f, 0x26, 0xde }, 1672 0xb8, 0x32, 0xe4, 0x33, 0xf8, 0x9f, 0x26, 0xde },
1669 .rlen = 16, 1673 .rlen = 16,
1670 }, 1674 },
1671}; 1675};
1672 1676
1673 1677
1674static struct cipher_testvec serpent_dec_tv_template[] = 1678static struct cipher_testvec serpent_dec_tv_template[] = {
1675{
1676 { 1679 {
1677 .input = { 0x12, 0x07, 0xfc, 0xce, 0x9b, 0xd0, 0xd6, 0x47, 1680 .input = { 0x12, 0x07, 0xfc, 0xce, 0x9b, 0xd0, 0xd6, 0x47,
1678 0x6a, 0xe9, 0x8f, 0xbe, 0xd1, 0x43, 0xa0, 0xe2 }, 1681 0x6a, 0xe9, 0x8f, 0xbe, 0xd1, 0x43, 0xa0, 0xe2 },
@@ -1713,8 +1716,7 @@ static struct cipher_testvec serpent_dec_tv_template[] =
1713 }, 1716 },
1714}; 1717};
1715 1718
1716static struct cipher_testvec tnepres_dec_tv_template[] = 1719static struct cipher_testvec tnepres_dec_tv_template[] = {
1717{
1718 { 1720 {
1719 .input = { 0x41, 0xcc, 0x6b, 0x31, 0x59, 0x31, 0x45, 0x97, 1721 .input = { 0x41, 0xcc, 0x6b, 0x31, 0x59, 0x31, 0x45, 0x97,
1720 0x6d, 0x6f, 0xbb, 0x38, 0x4b, 0x37, 0x21, 0x28 }, 1722 0x6d, 0x6f, 0xbb, 0x38, 0x4b, 0x37, 0x21, 0x28 },
@@ -1726,7 +1728,7 @@ static struct cipher_testvec tnepres_dec_tv_template[] =
1726 .key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 1728 .key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1727 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, 1729 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
1728 .klen = 16, 1730 .klen = 16,
1729 .input = { 0xea, 0xf4, 0xd7, 0xfc, 0xd8, 0x01, 0x34, 0x47, 1731 .input = { 0xea, 0xf4, 0xd7, 0xfc, 0xd8, 0x01, 0x34, 0x47,
1730 0x81, 0x45, 0x0b, 0xfa, 0x0c, 0xd6, 0xad, 0x6e }, 1732 0x81, 0x45, 0x0b, 0xfa, 0x0c, 0xd6, 0xad, 0x6e },
1731 .ilen = 16, 1733 .ilen = 16,
1732 .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 1734 .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
@@ -1738,7 +1740,7 @@ static struct cipher_testvec tnepres_dec_tv_template[] =
1738 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 1740 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
1739 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }, 1741 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
1740 .klen = 32, 1742 .klen = 32,
1741 .input = { 0x64, 0xa9, 0x1a, 0x37, 0xed, 0x9f, 0xe7, 0x49, 1743 .input = { 0x64, 0xa9, 0x1a, 0x37, 0xed, 0x9f, 0xe7, 0x49,
1742 0xa8, 0x4e, 0x76, 0xd6, 0xf5, 0x0d, 0x78, 0xee }, 1744 0xa8, 0x4e, 0x76, 0xd6, 0xf5, 0x0d, 0x78, 0xee },
1743 .ilen = 16, 1745 .ilen = 16,
1744 .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 1746 .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
@@ -1747,7 +1749,7 @@ static struct cipher_testvec tnepres_dec_tv_template[] =
1747 }, { /* KeySize=128, I=121 */ 1749 }, { /* KeySize=128, I=121 */
1748 .key = { [15] = 0x80 }, 1750 .key = { [15] = 0x80 },
1749 .klen = 16, 1751 .klen = 16,
1750 .input = { 0x3d, 0xda, 0xbf, 0xc0, 0x06, 0xda, 0xab, 0x06, 1752 .input = { 0x3d, 0xda, 0xbf, 0xc0, 0x06, 0xda, 0xab, 0x06,
1751 0x46, 0x2a, 0xf4, 0xef, 0x81, 0x54, 0x4e, 0x26 }, 1753 0x46, 0x2a, 0xf4, 0xef, 0x81, 0x54, 0x4e, 0x26 },
1752 .ilen = 16, 1754 .ilen = 16,
1753 .result = { [0 ... 15] = 0x00 }, 1755 .result = { [0 ... 15] = 0x00 },
@@ -1760,58 +1762,56 @@ static struct cipher_testvec tnepres_dec_tv_template[] =
1760#define CAST6_ENC_TEST_VECTORS 3 1762#define CAST6_ENC_TEST_VECTORS 3
1761#define CAST6_DEC_TEST_VECTORS 3 1763#define CAST6_DEC_TEST_VECTORS 3
1762 1764
1763static struct cipher_testvec cast6_enc_tv_template[] = 1765static struct cipher_testvec cast6_enc_tv_template[] = {
1764{
1765 { 1766 {
1766 .key = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c, 1767 .key = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c,
1767 0x0a, 0xf7, 0x56, 0x47, 0xf2, 0x9f, 0x61, 0x5d }, 1768 0x0a, 0xf7, 0x56, 0x47, 0xf2, 0x9f, 0x61, 0x5d },
1768 .klen = 16, 1769 .klen = 16,
1769 .input = { [0 ... 15] = 0x00 }, 1770 .input = { [0 ... 15] = 0x00 },
1770 .ilen = 16, 1771 .ilen = 16,
1771 .result = { 0xc8, 0x42, 0xa0, 0x89, 0x72, 0xb4, 0x3d, 0x20, 1772 .result = { 0xc8, 0x42, 0xa0, 0x89, 0x72, 0xb4, 0x3d, 0x20,
1772 0x83, 0x6c, 0x91, 0xd1, 0xb7, 0x53, 0x0f, 0x6b }, 1773 0x83, 0x6c, 0x91, 0xd1, 0xb7, 0x53, 0x0f, 0x6b },
1773 .rlen = 16, 1774 .rlen = 16,
1774 }, { 1775 }, {
1775 .key = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c, 1776 .key = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c,
1776 0xbe, 0xd0, 0xac, 0x83, 0x94, 0x0a, 0xc2, 0x98, 1777 0xbe, 0xd0, 0xac, 0x83, 0x94, 0x0a, 0xc2, 0x98,
1777 0xba, 0xc7, 0x7a, 0x77, 0x17, 0x94, 0x28, 0x63 }, 1778 0xba, 0xc7, 0x7a, 0x77, 0x17, 0x94, 0x28, 0x63 },
1778 .klen = 24, 1779 .klen = 24,
1779 .input = { [0 ... 15] = 0x00 }, 1780 .input = { [0 ... 15] = 0x00 },
1780 .ilen = 16, 1781 .ilen = 16,
1781 .result = { 0x1b, 0x38, 0x6c, 0x02, 0x10, 0xdc, 0xad, 0xcb, 1782 .result = { 0x1b, 0x38, 0x6c, 0x02, 0x10, 0xdc, 0xad, 0xcb,
1782 0xdd, 0x0e, 0x41, 0xaa, 0x08, 0xa7, 0xa7, 0xe8 }, 1783 0xdd, 0x0e, 0x41, 0xaa, 0x08, 0xa7, 0xa7, 0xe8 },
1783 .rlen = 16, 1784 .rlen = 16,
1784 }, { 1785 }, {
1785 .key = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c, 1786 .key = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c,
1786 0xbe, 0xd0, 0xac, 0x83, 0x94, 0x0a, 0xc2, 0x98, 1787 0xbe, 0xd0, 0xac, 0x83, 0x94, 0x0a, 0xc2, 0x98,
1787 0x8d, 0x7c, 0x47, 0xce, 0x26, 0x49, 0x08, 0x46, 1788 0x8d, 0x7c, 0x47, 0xce, 0x26, 0x49, 0x08, 0x46,
1788 0x1c, 0xc1, 0xb5, 0x13, 0x7a, 0xe6, 0xb6, 0x04 }, 1789 0x1c, 0xc1, 0xb5, 0x13, 0x7a, 0xe6, 0xb6, 0x04 },
1789 .klen = 32, 1790 .klen = 32,
1790 .input = { [0 ... 15] = 0x00 }, 1791 .input = { [0 ... 15] = 0x00 },
1791 .ilen = 16, 1792 .ilen = 16,
1792 .result = { 0x4f, 0x6a, 0x20, 0x38, 0x28, 0x68, 0x97, 0xb9, 1793 .result = { 0x4f, 0x6a, 0x20, 0x38, 0x28, 0x68, 0x97, 0xb9,
1793 0xc9, 0x87, 0x01, 0x36, 0x55, 0x33, 0x17, 0xfa }, 1794 0xc9, 0x87, 0x01, 0x36, 0x55, 0x33, 0x17, 0xfa },
1794 .rlen = 16, 1795 .rlen = 16,
1795 }, 1796 },
1796}; 1797};
1797 1798
1798static struct cipher_testvec cast6_dec_tv_template[] = 1799static struct cipher_testvec cast6_dec_tv_template[] = {
1799{
1800 { 1800 {
1801 .key = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c, 1801 .key = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c,
1802 0x0a, 0xf7, 0x56, 0x47, 0xf2, 0x9f, 0x61, 0x5d }, 1802 0x0a, 0xf7, 0x56, 0x47, 0xf2, 0x9f, 0x61, 0x5d },
1803 .klen = 16, 1803 .klen = 16,
1804 .input = { 0xc8, 0x42, 0xa0, 0x89, 0x72, 0xb4, 0x3d, 0x20, 1804 .input = { 0xc8, 0x42, 0xa0, 0x89, 0x72, 0xb4, 0x3d, 0x20,
1805 0x83, 0x6c, 0x91, 0xd1, 0xb7, 0x53, 0x0f, 0x6b }, 1805 0x83, 0x6c, 0x91, 0xd1, 0xb7, 0x53, 0x0f, 0x6b },
1806 .ilen = 16, 1806 .ilen = 16,
1807 .result = { [0 ... 15] = 0x00 }, 1807 .result = { [0 ... 15] = 0x00 },
1808 .rlen = 16, 1808 .rlen = 16,
1809 }, { 1809 }, {
1810 .key = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c, 1810 .key = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c,
1811 0xbe, 0xd0, 0xac, 0x83, 0x94, 0x0a, 0xc2, 0x98, 1811 0xbe, 0xd0, 0xac, 0x83, 0x94, 0x0a, 0xc2, 0x98,
1812 0xba, 0xc7, 0x7a, 0x77, 0x17, 0x94, 0x28, 0x63 }, 1812 0xba, 0xc7, 0x7a, 0x77, 0x17, 0x94, 0x28, 0x63 },
1813 .klen = 24, 1813 .klen = 24,
1814 .input = { 0x1b, 0x38, 0x6c, 0x02, 0x10, 0xdc, 0xad, 0xcb, 1814 .input = { 0x1b, 0x38, 0x6c, 0x02, 0x10, 0xdc, 0xad, 0xcb,
1815 0xdd, 0x0e, 0x41, 0xaa, 0x08, 0xa7, 0xa7, 0xe8 }, 1815 0xdd, 0x0e, 0x41, 0xaa, 0x08, 0xa7, 0xa7, 0xe8 },
1816 .ilen = 16, 1816 .ilen = 16,
1817 .result = { [0 ... 15] = 0x00 }, 1817 .result = { [0 ... 15] = 0x00 },
@@ -1820,9 +1820,9 @@ static struct cipher_testvec cast6_dec_tv_template[] =
1820 .key = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c, 1820 .key = { 0x23, 0x42, 0xbb, 0x9e, 0xfa, 0x38, 0x54, 0x2c,
1821 0xbe, 0xd0, 0xac, 0x83, 0x94, 0x0a, 0xc2, 0x98, 1821 0xbe, 0xd0, 0xac, 0x83, 0x94, 0x0a, 0xc2, 0x98,
1822 0x8d, 0x7c, 0x47, 0xce, 0x26, 0x49, 0x08, 0x46, 1822 0x8d, 0x7c, 0x47, 0xce, 0x26, 0x49, 0x08, 0x46,
1823 0x1c, 0xc1, 0xb5, 0x13, 0x7a, 0xe6, 0xb6, 0x04 }, 1823 0x1c, 0xc1, 0xb5, 0x13, 0x7a, 0xe6, 0xb6, 0x04 },
1824 .klen = 32, 1824 .klen = 32,
1825 .input = { 0x4f, 0x6a, 0x20, 0x38, 0x28, 0x68, 0x97, 0xb9, 1825 .input = { 0x4f, 0x6a, 0x20, 0x38, 0x28, 0x68, 0x97, 0xb9,
1826 0xc9, 0x87, 0x01, 0x36, 0x55, 0x33, 0x17, 0xfa }, 1826 0xc9, 0x87, 0x01, 0x36, 0x55, 0x33, 0x17, 0xfa },
1827 .ilen = 16, 1827 .ilen = 16,
1828 .result = { [0 ... 15] = 0x00 }, 1828 .result = { [0 ... 15] = 0x00 },
@@ -1837,9 +1837,9 @@ static struct cipher_testvec cast6_dec_tv_template[] =
1837#define AES_ENC_TEST_VECTORS 3 1837#define AES_ENC_TEST_VECTORS 3
1838#define AES_DEC_TEST_VECTORS 3 1838#define AES_DEC_TEST_VECTORS 3
1839 1839
1840static struct cipher_testvec aes_enc_tv_template[] = { 1840static struct cipher_testvec aes_enc_tv_template[] = {
1841 { /* From FIPS-197 */ 1841 { /* From FIPS-197 */
1842 .key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 1842 .key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1843 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, 1843 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
1844 .klen = 16, 1844 .klen = 16,
1845 .input = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 1845 .input = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
@@ -1853,7 +1853,7 @@ static struct cipher_testvec aes_enc_tv_template[] = {
1853 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 1853 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
1854 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 }, 1854 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 },
1855 .klen = 24, 1855 .klen = 24,
1856 .input = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 1856 .input = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
1857 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }, 1857 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff },
1858 .ilen = 16, 1858 .ilen = 16,
1859 .result = { 0xdd, 0xa9, 0x7c, 0xa4, 0x86, 0x4c, 0xdf, 0xe0, 1859 .result = { 0xdd, 0xa9, 0x7c, 0xa4, 0x86, 0x4c, 0xdf, 0xe0,
@@ -1865,7 +1865,7 @@ static struct cipher_testvec aes_enc_tv_template[] = {
1865 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 1865 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
1866 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }, 1866 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f },
1867 .klen = 32, 1867 .klen = 32,
1868 .input = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 1868 .input = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
1869 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }, 1869 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff },
1870 .ilen = 16, 1870 .ilen = 16,
1871 .result = { 0x8e, 0xa2, 0xb7, 0xca, 0x51, 0x67, 0x45, 0xbf, 1871 .result = { 0x8e, 0xa2, 0xb7, 0xca, 0x51, 0x67, 0x45, 0xbf,
@@ -1874,9 +1874,9 @@ static struct cipher_testvec aes_enc_tv_template[] = {
1874 }, 1874 },
1875}; 1875};
1876 1876
1877static struct cipher_testvec aes_dec_tv_template[] = { 1877static struct cipher_testvec aes_dec_tv_template[] = {
1878 { /* From FIPS-197 */ 1878 { /* From FIPS-197 */
1879 .key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 1879 .key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1880 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, 1880 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
1881 .klen = 16, 1881 .klen = 16,
1882 .input = { 0x69, 0xc4, 0xe0, 0xd8, 0x6a, 0x7b, 0x04, 0x30, 1882 .input = { 0x69, 0xc4, 0xe0, 0xd8, 0x6a, 0x7b, 0x04, 0x30,
@@ -1893,8 +1893,8 @@ static struct cipher_testvec aes_dec_tv_template[] = {
1893 .input = { 0xdd, 0xa9, 0x7c, 0xa4, 0x86, 0x4c, 0xdf, 0xe0, 1893 .input = { 0xdd, 0xa9, 0x7c, 0xa4, 0x86, 0x4c, 0xdf, 0xe0,
1894 0x6e, 0xaf, 0x70, 0xa0, 0xec, 0x0d, 0x71, 0x91 }, 1894 0x6e, 0xaf, 0x70, 0xa0, 0xec, 0x0d, 0x71, 0x91 },
1895 .ilen = 16, 1895 .ilen = 16,
1896 .result = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 1896 .result = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
1897 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }, 1897 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff },
1898 .rlen = 16, 1898 .rlen = 16,
1899 }, { 1899 }, {
1900 .key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 1900 .key = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
@@ -1905,7 +1905,7 @@ static struct cipher_testvec aes_dec_tv_template[] = {
1905 .input = { 0x8e, 0xa2, 0xb7, 0xca, 0x51, 0x67, 0x45, 0xbf, 1905 .input = { 0x8e, 0xa2, 0xb7, 0xca, 0x51, 0x67, 0x45, 0xbf,
1906 0xea, 0xfc, 0x49, 0x90, 0x4b, 0x49, 0x60, 0x89 }, 1906 0xea, 0xfc, 0x49, 0x90, 0x4b, 0x49, 0x60, 0x89 },
1907 .ilen = 16, 1907 .ilen = 16,
1908 .result = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 1908 .result = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
1909 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }, 1909 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff },
1910 .rlen = 16, 1910 .rlen = 16,
1911 }, 1911 },
@@ -1915,8 +1915,7 @@ static struct cipher_testvec aes_dec_tv_template[] = {
1915#define CAST5_ENC_TEST_VECTORS 3 1915#define CAST5_ENC_TEST_VECTORS 3
1916#define CAST5_DEC_TEST_VECTORS 3 1916#define CAST5_DEC_TEST_VECTORS 3
1917 1917
1918static struct cipher_testvec cast5_enc_tv_template[] = 1918static struct cipher_testvec cast5_enc_tv_template[] = {
1919{
1920 { 1919 {
1921 .key = { 0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78, 1920 .key = { 0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78,
1922 0x23, 0x45, 0x67, 0x89, 0x34, 0x56, 0x78, 0x9a }, 1921 0x23, 0x45, 0x67, 0x89, 0x34, 0x56, 0x78, 0x9a },
@@ -1943,8 +1942,7 @@ static struct cipher_testvec cast5_enc_tv_template[] =
1943 }, 1942 },
1944}; 1943};
1945 1944
1946static struct cipher_testvec cast5_dec_tv_template[] = 1945static struct cipher_testvec cast5_dec_tv_template[] = {
1947{
1948 { 1946 {
1949 .key = { 0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78, 1947 .key = { 0x01, 0x23, 0x45, 0x67, 0x12, 0x34, 0x56, 0x78,
1950 0x23, 0x45, 0x67, 0x89, 0x34, 0x56, 0x78, 0x9a }, 1948 0x23, 0x45, 0x67, 0x89, 0x34, 0x56, 0x78, 0x9a },
@@ -1971,14 +1969,13 @@ static struct cipher_testvec cast5_dec_tv_template[] =
1971 }, 1969 },
1972}; 1970};
1973 1971
1974/* 1972/*
1975 * ARC4 test vectors from OpenSSL 1973 * ARC4 test vectors from OpenSSL
1976 */ 1974 */
1977#define ARC4_ENC_TEST_VECTORS 7 1975#define ARC4_ENC_TEST_VECTORS 7
1978#define ARC4_DEC_TEST_VECTORS 7 1976#define ARC4_DEC_TEST_VECTORS 7
1979 1977
1980static struct cipher_testvec arc4_enc_tv_template[] = 1978static struct cipher_testvec arc4_enc_tv_template[] = {
1981{
1982 { 1979 {
1983 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, 1980 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
1984 .klen = 8, 1981 .klen = 8,
@@ -2044,8 +2041,7 @@ static struct cipher_testvec arc4_enc_tv_template[] =
2044 }, 2041 },
2045}; 2042};
2046 2043
2047static struct cipher_testvec arc4_dec_tv_template[] = 2044static struct cipher_testvec arc4_dec_tv_template[] = {
2048{
2049 { 2045 {
2050 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }, 2046 .key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef },
2051 .klen = 8, 2047 .klen = 8,
@@ -2111,14 +2107,13 @@ static struct cipher_testvec arc4_dec_tv_template[] =
2111 }, 2107 },
2112}; 2108};
2113 2109
2114/* 2110/*
2115 * TEA test vectors 2111 * TEA test vectors
2116 */ 2112 */
2117#define TEA_ENC_TEST_VECTORS 4 2113#define TEA_ENC_TEST_VECTORS 4
2118#define TEA_DEC_TEST_VECTORS 4 2114#define TEA_DEC_TEST_VECTORS 4
2119 2115
2120static struct cipher_testvec tea_enc_tv_template[] = 2116static struct cipher_testvec tea_enc_tv_template[] = {
2121{
2122 { 2117 {
2123 .key = { [0 ... 15] = 0x00 }, 2118 .key = { [0 ... 15] = 0x00 },
2124 .klen = 16, 2119 .klen = 16,
@@ -2138,31 +2133,30 @@ static struct cipher_testvec tea_enc_tv_template[] =
2138 .key = { 0x09, 0x65, 0x43, 0x11, 0x66, 0x44, 0x39, 0x25, 2133 .key = { 0x09, 0x65, 0x43, 0x11, 0x66, 0x44, 0x39, 0x25,
2139 0x51, 0x3a, 0x16, 0x10, 0x0a, 0x08, 0x12, 0x6e }, 2134 0x51, 0x3a, 0x16, 0x10, 0x0a, 0x08, 0x12, 0x6e },
2140 .klen = 16, 2135 .klen = 16,
2141 .input = { 0x6c, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x74, 2136 .input = { 0x6c, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x74,
2142 0x65, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x63, 0x74 }, 2137 0x65, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x63, 0x74 },
2143 .ilen = 16, 2138 .ilen = 16,
2144 .result = { 0xbe, 0x7a, 0xbb, 0x81, 0x95, 0x2d, 0x1f, 0x1e, 2139 .result = { 0xbe, 0x7a, 0xbb, 0x81, 0x95, 0x2d, 0x1f, 0x1e,
2145 0xdd, 0x89, 0xa1, 0x25, 0x04, 0x21, 0xdf, 0x95 }, 2140 0xdd, 0x89, 0xa1, 0x25, 0x04, 0x21, 0xdf, 0x95 },
2146 .rlen = 16, 2141 .rlen = 16,
2147 }, { 2142 }, {
2148 .key = { 0x4d, 0x76, 0x32, 0x17, 0x05, 0x3f, 0x75, 0x2c, 2143 .key = { 0x4d, 0x76, 0x32, 0x17, 0x05, 0x3f, 0x75, 0x2c,
2149 0x5d, 0x04, 0x16, 0x36, 0x15, 0x72, 0x63, 0x2f }, 2144 0x5d, 0x04, 0x16, 0x36, 0x15, 0x72, 0x63, 0x2f },
2150 .klen = 16, 2145 .klen = 16,
2151 .input = { 0x54, 0x65, 0x61, 0x20, 0x69, 0x73, 0x20, 0x67, 2146 .input = { 0x54, 0x65, 0x61, 0x20, 0x69, 0x73, 0x20, 0x67,
2152 0x6f, 0x6f, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 2147 0x6f, 0x6f, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20,
2153 0x79, 0x6f, 0x75, 0x21, 0x21, 0x21, 0x20, 0x72, 2148 0x79, 0x6f, 0x75, 0x21, 0x21, 0x21, 0x20, 0x72,
2154 0x65, 0x61, 0x6c, 0x6c, 0x79, 0x21, 0x21, 0x21 }, 2149 0x65, 0x61, 0x6c, 0x6c, 0x79, 0x21, 0x21, 0x21 },
2155 .ilen = 32, 2150 .ilen = 32,
2156 .result = { 0xe0, 0x4d, 0x5d, 0x3c, 0xb7, 0x8c, 0x36, 0x47, 2151 .result = { 0xe0, 0x4d, 0x5d, 0x3c, 0xb7, 0x8c, 0x36, 0x47,
2157 0x94, 0x18, 0x95, 0x91, 0xa9, 0xfc, 0x49, 0xf8, 2152 0x94, 0x18, 0x95, 0x91, 0xa9, 0xfc, 0x49, 0xf8,
2158 0x44, 0xd1, 0x2d, 0xc2, 0x99, 0xb8, 0x08, 0x2a, 2153 0x44, 0xd1, 0x2d, 0xc2, 0x99, 0xb8, 0x08, 0x2a,
2159 0x07, 0x89, 0x73, 0xc2, 0x45, 0x92, 0xc6, 0x90 }, 2154 0x07, 0x89, 0x73, 0xc2, 0x45, 0x92, 0xc6, 0x90 },
2160 .rlen = 32, 2155 .rlen = 32,
2161 } 2156 }
2162}; 2157};
2163 2158
2164static struct cipher_testvec tea_dec_tv_template[] = 2159static struct cipher_testvec tea_dec_tv_template[] = {
2165{
2166 { 2160 {
2167 .key = { [0 ... 15] = 0x00 }, 2161 .key = { [0 ... 15] = 0x00 },
2168 .klen = 16, 2162 .klen = 16,
@@ -2183,9 +2177,9 @@ static struct cipher_testvec tea_dec_tv_template[] =
2183 0x51, 0x3a, 0x16, 0x10, 0x0a, 0x08, 0x12, 0x6e }, 2177 0x51, 0x3a, 0x16, 0x10, 0x0a, 0x08, 0x12, 0x6e },
2184 .klen = 16, 2178 .klen = 16,
2185 .input = { 0xbe, 0x7a, 0xbb, 0x81, 0x95, 0x2d, 0x1f, 0x1e, 2179 .input = { 0xbe, 0x7a, 0xbb, 0x81, 0x95, 0x2d, 0x1f, 0x1e,
2186 0xdd, 0x89, 0xa1, 0x25, 0x04, 0x21, 0xdf, 0x95 }, 2180 0xdd, 0x89, 0xa1, 0x25, 0x04, 0x21, 0xdf, 0x95 },
2187 .ilen = 16, 2181 .ilen = 16,
2188 .result = { 0x6c, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x74, 2182 .result = { 0x6c, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x74,
2189 0x65, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x63, 0x74 }, 2183 0x65, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x63, 0x74 },
2190 .rlen = 16, 2184 .rlen = 16,
2191 }, { 2185 }, {
@@ -2193,26 +2187,25 @@ static struct cipher_testvec tea_dec_tv_template[] =
2193 0x5d, 0x04, 0x16, 0x36, 0x15, 0x72, 0x63, 0x2f }, 2187 0x5d, 0x04, 0x16, 0x36, 0x15, 0x72, 0x63, 0x2f },
2194 .klen = 16, 2188 .klen = 16,
2195 .input = { 0xe0, 0x4d, 0x5d, 0x3c, 0xb7, 0x8c, 0x36, 0x47, 2189 .input = { 0xe0, 0x4d, 0x5d, 0x3c, 0xb7, 0x8c, 0x36, 0x47,
2196 0x94, 0x18, 0x95, 0x91, 0xa9, 0xfc, 0x49, 0xf8, 2190 0x94, 0x18, 0x95, 0x91, 0xa9, 0xfc, 0x49, 0xf8,
2197 0x44, 0xd1, 0x2d, 0xc2, 0x99, 0xb8, 0x08, 0x2a, 2191 0x44, 0xd1, 0x2d, 0xc2, 0x99, 0xb8, 0x08, 0x2a,
2198 0x07, 0x89, 0x73, 0xc2, 0x45, 0x92, 0xc6, 0x90 }, 2192 0x07, 0x89, 0x73, 0xc2, 0x45, 0x92, 0xc6, 0x90 },
2199 .ilen = 32, 2193 .ilen = 32,
2200 .result = { 0x54, 0x65, 0x61, 0x20, 0x69, 0x73, 0x20, 0x67, 2194 .result = { 0x54, 0x65, 0x61, 0x20, 0x69, 0x73, 0x20, 0x67,
2201 0x6f, 0x6f, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 2195 0x6f, 0x6f, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20,
2202 0x79, 0x6f, 0x75, 0x21, 0x21, 0x21, 0x20, 0x72, 2196 0x79, 0x6f, 0x75, 0x21, 0x21, 0x21, 0x20, 0x72,
2203 0x65, 0x61, 0x6c, 0x6c, 0x79, 0x21, 0x21, 0x21 }, 2197 0x65, 0x61, 0x6c, 0x6c, 0x79, 0x21, 0x21, 0x21 },
2204 .rlen = 32, 2198 .rlen = 32,
2205 } 2199 }
2206}; 2200};
2207 2201
2208/* 2202/*
2209 * XTEA test vectors 2203 * XTEA test vectors
2210 */ 2204 */
2211#define XTEA_ENC_TEST_VECTORS 4 2205#define XTEA_ENC_TEST_VECTORS 4
2212#define XTEA_DEC_TEST_VECTORS 4 2206#define XTEA_DEC_TEST_VECTORS 4
2213 2207
2214static struct cipher_testvec xtea_enc_tv_template[] = 2208static struct cipher_testvec xtea_enc_tv_template[] = {
2215{
2216 { 2209 {
2217 .key = { [0 ... 15] = 0x00 }, 2210 .key = { [0 ... 15] = 0x00 },
2218 .klen = 16, 2211 .klen = 16,
@@ -2232,31 +2225,30 @@ static struct cipher_testvec xtea_enc_tv_template[] =
2232 .key = { 0x09, 0x65, 0x43, 0x11, 0x66, 0x44, 0x39, 0x25, 2225 .key = { 0x09, 0x65, 0x43, 0x11, 0x66, 0x44, 0x39, 0x25,
2233 0x51, 0x3a, 0x16, 0x10, 0x0a, 0x08, 0x12, 0x6e }, 2226 0x51, 0x3a, 0x16, 0x10, 0x0a, 0x08, 0x12, 0x6e },
2234 .klen = 16, 2227 .klen = 16,
2235 .input = { 0x6c, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x74, 2228 .input = { 0x6c, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x74,
2236 0x65, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x63, 0x74 }, 2229 0x65, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x63, 0x74 },
2237 .ilen = 16, 2230 .ilen = 16,
2238 .result = { 0xe2, 0x04, 0xdb, 0xf2, 0x89, 0x85, 0x9e, 0xea, 2231 .result = { 0xe2, 0x04, 0xdb, 0xf2, 0x89, 0x85, 0x9e, 0xea,
2239 0x61, 0x35, 0xaa, 0xed, 0xb5, 0xcb, 0x71, 0x2c }, 2232 0x61, 0x35, 0xaa, 0xed, 0xb5, 0xcb, 0x71, 0x2c },
2240 .rlen = 16, 2233 .rlen = 16,
2241 }, { 2234 }, {
2242 .key = { 0x4d, 0x76, 0x32, 0x17, 0x05, 0x3f, 0x75, 0x2c, 2235 .key = { 0x4d, 0x76, 0x32, 0x17, 0x05, 0x3f, 0x75, 0x2c,
2243 0x5d, 0x04, 0x16, 0x36, 0x15, 0x72, 0x63, 0x2f }, 2236 0x5d, 0x04, 0x16, 0x36, 0x15, 0x72, 0x63, 0x2f },
2244 .klen = 16, 2237 .klen = 16,
2245 .input = { 0x54, 0x65, 0x61, 0x20, 0x69, 0x73, 0x20, 0x67, 2238 .input = { 0x54, 0x65, 0x61, 0x20, 0x69, 0x73, 0x20, 0x67,
2246 0x6f, 0x6f, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 2239 0x6f, 0x6f, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20,
2247 0x79, 0x6f, 0x75, 0x21, 0x21, 0x21, 0x20, 0x72, 2240 0x79, 0x6f, 0x75, 0x21, 0x21, 0x21, 0x20, 0x72,
2248 0x65, 0x61, 0x6c, 0x6c, 0x79, 0x21, 0x21, 0x21 }, 2241 0x65, 0x61, 0x6c, 0x6c, 0x79, 0x21, 0x21, 0x21 },
2249 .ilen = 32, 2242 .ilen = 32,
2250 .result = { 0x0b, 0x03, 0xcd, 0x8a, 0xbe, 0x95, 0xfd, 0xb1, 2243 .result = { 0x0b, 0x03, 0xcd, 0x8a, 0xbe, 0x95, 0xfd, 0xb1,
2251 0xc1, 0x44, 0x91, 0x0b, 0xa5, 0xc9, 0x1b, 0xb4, 2244 0xc1, 0x44, 0x91, 0x0b, 0xa5, 0xc9, 0x1b, 0xb4,
2252 0xa9, 0xda, 0x1e, 0x9e, 0xb1, 0x3e, 0x2a, 0x8f, 2245 0xa9, 0xda, 0x1e, 0x9e, 0xb1, 0x3e, 0x2a, 0x8f,
2253 0xea, 0xa5, 0x6a, 0x85, 0xd1, 0xf4, 0xa8, 0xa5 }, 2246 0xea, 0xa5, 0x6a, 0x85, 0xd1, 0xf4, 0xa8, 0xa5 },
2254 .rlen = 32, 2247 .rlen = 32,
2255 } 2248 }
2256}; 2249};
2257 2250
2258static struct cipher_testvec xtea_dec_tv_template[] = 2251static struct cipher_testvec xtea_dec_tv_template[] = {
2259{
2260 { 2252 {
2261 .key = { [0 ... 15] = 0x00 }, 2253 .key = { [0 ... 15] = 0x00 },
2262 .klen = 16, 2254 .klen = 16,
@@ -2276,24 +2268,24 @@ static struct cipher_testvec xtea_dec_tv_template[] =
2276 .key = { 0x09, 0x65, 0x43, 0x11, 0x66, 0x44, 0x39, 0x25, 2268 .key = { 0x09, 0x65, 0x43, 0x11, 0x66, 0x44, 0x39, 0x25,
2277 0x51, 0x3a, 0x16, 0x10, 0x0a, 0x08, 0x12, 0x6e }, 2269 0x51, 0x3a, 0x16, 0x10, 0x0a, 0x08, 0x12, 0x6e },
2278 .klen = 16, 2270 .klen = 16,
2279 .input = { 0xe2, 0x04, 0xdb, 0xf2, 0x89, 0x85, 0x9e, 0xea, 2271 .input = { 0xe2, 0x04, 0xdb, 0xf2, 0x89, 0x85, 0x9e, 0xea,
2280 0x61, 0x35, 0xaa, 0xed, 0xb5, 0xcb, 0x71, 0x2c }, 2272 0x61, 0x35, 0xaa, 0xed, 0xb5, 0xcb, 0x71, 0x2c },
2281 .ilen = 16, 2273 .ilen = 16,
2282 .result = { 0x6c, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x74, 2274 .result = { 0x6c, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x74,
2283 0x65, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x63, 0x74 }, 2275 0x65, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x63, 0x74 },
2284 .rlen = 16, 2276 .rlen = 16,
2285 }, { 2277 }, {
2286 .key = { 0x4d, 0x76, 0x32, 0x17, 0x05, 0x3f, 0x75, 0x2c, 2278 .key = { 0x4d, 0x76, 0x32, 0x17, 0x05, 0x3f, 0x75, 0x2c,
2287 0x5d, 0x04, 0x16, 0x36, 0x15, 0x72, 0x63, 0x2f }, 2279 0x5d, 0x04, 0x16, 0x36, 0x15, 0x72, 0x63, 0x2f },
2288 .klen = 16, 2280 .klen = 16,
2289 .input = { 0x0b, 0x03, 0xcd, 0x8a, 0xbe, 0x95, 0xfd, 0xb1, 2281 .input = { 0x0b, 0x03, 0xcd, 0x8a, 0xbe, 0x95, 0xfd, 0xb1,
2290 0xc1, 0x44, 0x91, 0x0b, 0xa5, 0xc9, 0x1b, 0xb4, 2282 0xc1, 0x44, 0x91, 0x0b, 0xa5, 0xc9, 0x1b, 0xb4,
2291 0xa9, 0xda, 0x1e, 0x9e, 0xb1, 0x3e, 0x2a, 0x8f, 2283 0xa9, 0xda, 0x1e, 0x9e, 0xb1, 0x3e, 0x2a, 0x8f,
2292 0xea, 0xa5, 0x6a, 0x85, 0xd1, 0xf4, 0xa8, 0xa5 }, 2284 0xea, 0xa5, 0x6a, 0x85, 0xd1, 0xf4, 0xa8, 0xa5 },
2293 .ilen = 32, 2285 .ilen = 32,
2294 .result = { 0x54, 0x65, 0x61, 0x20, 0x69, 0x73, 0x20, 0x67, 2286 .result = { 0x54, 0x65, 0x61, 0x20, 0x69, 0x73, 0x20, 0x67,
2295 0x6f, 0x6f, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 2287 0x6f, 0x6f, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20,
2296 0x79, 0x6f, 0x75, 0x21, 0x21, 0x21, 0x20, 0x72, 2288 0x79, 0x6f, 0x75, 0x21, 0x21, 0x21, 0x20, 0x72,
2297 0x65, 0x61, 0x6c, 0x6c, 0x79, 0x21, 0x21, 0x21 }, 2289 0x65, 0x61, 0x6c, 0x6c, 0x79, 0x21, 0x21, 0x21 },
2298 .rlen = 32, 2290 .rlen = 32,
2299 } 2291 }
@@ -2305,9 +2297,9 @@ static struct cipher_testvec xtea_dec_tv_template[] =
2305#define KHAZAD_ENC_TEST_VECTORS 5 2297#define KHAZAD_ENC_TEST_VECTORS 5
2306#define KHAZAD_DEC_TEST_VECTORS 5 2298#define KHAZAD_DEC_TEST_VECTORS 5
2307 2299
2308static struct cipher_testvec khazad_enc_tv_template[] = { 2300static struct cipher_testvec khazad_enc_tv_template[] = {
2309 { 2301 {
2310 .key = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 2302 .key = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2311 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 2303 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
2312 .klen = 16, 2304 .klen = 16,
2313 .input = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 2305 .input = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
@@ -2351,9 +2343,9 @@ static struct cipher_testvec khazad_enc_tv_template[] = {
2351 }, 2343 },
2352}; 2344};
2353 2345
2354static struct cipher_testvec khazad_dec_tv_template[] = { 2346static struct cipher_testvec khazad_dec_tv_template[] = {
2355 { 2347 {
2356 .key = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 2348 .key = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2357 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 2349 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
2358 .klen = 16, 2350 .klen = 16,
2359 .input = { 0X49, 0Xa4, 0Xce, 0X32, 0Xac, 0X19, 0X0e, 0X3f }, 2351 .input = { 0X49, 0Xa4, 0Xce, 0X32, 0Xac, 0X19, 0X0e, 0X3f },
@@ -2697,8 +2689,7 @@ static struct comp_testvec deflate_decomp_tv_template[] = {
2697 */ 2689 */
2698#define MICHAEL_MIC_TEST_VECTORS 6 2690#define MICHAEL_MIC_TEST_VECTORS 6
2699 2691
2700static struct hash_testvec michael_mic_tv_template[] = 2692static struct hash_testvec michael_mic_tv_template[] = {
2701{
2702 { 2693 {
2703 .key = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 2694 .key = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
2704 .ksize = 8, 2695 .ksize = 8,
@@ -2743,4 +2734,88 @@ static struct hash_testvec michael_mic_tv_template[] =
2743 } 2734 }
2744}; 2735};
2745 2736
2737/*
2738 * Cipher speed tests
2739 */
2740static struct cipher_speed aes_speed_template[] = {
2741 { .klen = 16, .blen = 16, },
2742 { .klen = 16, .blen = 64, },
2743 { .klen = 16, .blen = 256, },
2744 { .klen = 16, .blen = 1024, },
2745 { .klen = 16, .blen = 8192, },
2746 { .klen = 24, .blen = 16, },
2747 { .klen = 24, .blen = 64, },
2748 { .klen = 24, .blen = 256, },
2749 { .klen = 24, .blen = 1024, },
2750 { .klen = 24, .blen = 8192, },
2751 { .klen = 32, .blen = 16, },
2752 { .klen = 32, .blen = 64, },
2753 { .klen = 32, .blen = 256, },
2754 { .klen = 32, .blen = 1024, },
2755 { .klen = 32, .blen = 8192, },
2756
2757 /* End marker */
2758 { .klen = 0, .blen = 0, }
2759};
2760
2761static struct cipher_speed des3_ede_speed_template[] = {
2762 { .klen = 24, .blen = 16, },
2763 { .klen = 24, .blen = 64, },
2764 { .klen = 24, .blen = 256, },
2765 { .klen = 24, .blen = 1024, },
2766 { .klen = 24, .blen = 8192, },
2767
2768 /* End marker */
2769 { .klen = 0, .blen = 0, }
2770};
2771
2772static struct cipher_speed twofish_speed_template[] = {
2773 { .klen = 16, .blen = 16, },
2774 { .klen = 16, .blen = 64, },
2775 { .klen = 16, .blen = 256, },
2776 { .klen = 16, .blen = 1024, },
2777 { .klen = 16, .blen = 8192, },
2778 { .klen = 24, .blen = 16, },
2779 { .klen = 24, .blen = 64, },
2780 { .klen = 24, .blen = 256, },
2781 { .klen = 24, .blen = 1024, },
2782 { .klen = 24, .blen = 8192, },
2783 { .klen = 32, .blen = 16, },
2784 { .klen = 32, .blen = 64, },
2785 { .klen = 32, .blen = 256, },
2786 { .klen = 32, .blen = 1024, },
2787 { .klen = 32, .blen = 8192, },
2788
2789 /* End marker */
2790 { .klen = 0, .blen = 0, }
2791};
2792
2793static struct cipher_speed blowfish_speed_template[] = {
2794 /* Don't support blowfish keys > 256 bit in this test */
2795 { .klen = 8, .blen = 16, },
2796 { .klen = 8, .blen = 64, },
2797 { .klen = 8, .blen = 256, },
2798 { .klen = 8, .blen = 1024, },
2799 { .klen = 8, .blen = 8192, },
2800 { .klen = 32, .blen = 16, },
2801 { .klen = 32, .blen = 64, },
2802 { .klen = 32, .blen = 256, },
2803 { .klen = 32, .blen = 1024, },
2804 { .klen = 32, .blen = 8192, },
2805
2806 /* End marker */
2807 { .klen = 0, .blen = 0, }
2808};
2809
2810static struct cipher_speed des_speed_template[] = {
2811 { .klen = 8, .blen = 16, },
2812 { .klen = 8, .blen = 64, },
2813 { .klen = 8, .blen = 256, },
2814 { .klen = 8, .blen = 1024, },
2815 { .klen = 8, .blen = 8192, },
2816
2817 /* End marker */
2818 { .klen = 0, .blen = 0, }
2819};
2820
2746#endif /* _CRYPTO_TCRYPT_H */ 2821#endif /* _CRYPTO_TCRYPT_H */