aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'crypto')
-rw-r--r--crypto/842.c182
-rw-r--r--crypto/Kconfig173
-rw-r--r--crypto/Makefile5
-rw-r--r--crypto/aes_generic.c1
-rw-r--r--crypto/ansi_cprng.c63
-rw-r--r--crypto/anubis.c1
-rw-r--r--crypto/blowfish_generic.c1
-rw-r--r--crypto/camellia_generic.c1
-rw-r--r--crypto/cast5_generic.c (renamed from crypto/cast5.c)80
-rw-r--r--crypto/cast6_generic.c (renamed from crypto/cast6.c)73
-rw-r--r--crypto/crypto_null.c57
-rw-r--r--crypto/crypto_user.c9
-rw-r--r--crypto/deflate.c1
-rw-r--r--crypto/des_generic.c25
-rw-r--r--crypto/fcrypt.c1
-rw-r--r--crypto/ghash-generic.c1
-rw-r--r--crypto/khazad.c1
-rw-r--r--crypto/krng.c1
-rw-r--r--crypto/lzo.c1
-rw-r--r--crypto/salsa20_generic.c1
-rw-r--r--crypto/seed.c1
-rw-r--r--crypto/serpent_generic.c53
-rw-r--r--crypto/sha256_generic.c25
-rw-r--r--crypto/sha512_generic.c20
-rw-r--r--crypto/shash.c36
-rw-r--r--crypto/tcrypt.c95
-rw-r--r--crypto/tcrypt.h1
-rw-r--r--crypto/tea.c41
-rw-r--r--crypto/testmgr.c472
-rw-r--r--crypto/testmgr.h3525
-rw-r--r--crypto/tgr192.c38
-rw-r--r--crypto/twofish_generic.c1
-rw-r--r--crypto/vmac.c10
-rw-r--r--crypto/wp512.c39
34 files changed, 4589 insertions, 446 deletions
diff --git a/crypto/842.c b/crypto/842.c
new file mode 100644
index 000000000000..65c7a89cfa09
--- /dev/null
+++ b/crypto/842.c
@@ -0,0 +1,182 @@
1/*
2 * Cryptographic API for the 842 compression algorithm.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 *
18 * Copyright (C) IBM Corporation, 2011
19 *
20 * Authors: Robert Jennings <rcj@linux.vnet.ibm.com>
21 * Seth Jennings <sjenning@linux.vnet.ibm.com>
22 */
23
24#include <linux/init.h>
25#include <linux/module.h>
26#include <linux/crypto.h>
27#include <linux/vmalloc.h>
28#include <linux/nx842.h>
29#include <linux/lzo.h>
30#include <linux/timer.h>
31
32static int nx842_uselzo;
33
34struct nx842_ctx {
35 void *nx842_wmem; /* working memory for 842/lzo */
36};
37
38enum nx842_crypto_type {
39 NX842_CRYPTO_TYPE_842,
40 NX842_CRYPTO_TYPE_LZO
41};
42
43#define NX842_SENTINEL 0xdeadbeef
44
45struct nx842_crypto_header {
46 unsigned int sentinel; /* debug */
47 enum nx842_crypto_type type;
48};
49
50static int nx842_init(struct crypto_tfm *tfm)
51{
52 struct nx842_ctx *ctx = crypto_tfm_ctx(tfm);
53 int wmemsize;
54
55 wmemsize = max_t(int, nx842_get_workmem_size(), LZO1X_MEM_COMPRESS);
56 ctx->nx842_wmem = kmalloc(wmemsize, GFP_NOFS);
57 if (!ctx->nx842_wmem)
58 return -ENOMEM;
59
60 return 0;
61}
62
63static void nx842_exit(struct crypto_tfm *tfm)
64{
65 struct nx842_ctx *ctx = crypto_tfm_ctx(tfm);
66
67 kfree(ctx->nx842_wmem);
68}
69
70static void nx842_reset_uselzo(unsigned long data)
71{
72 nx842_uselzo = 0;
73}
74
75static DEFINE_TIMER(failover_timer, nx842_reset_uselzo, 0, 0);
76
77static int nx842_crypto_compress(struct crypto_tfm *tfm, const u8 *src,
78 unsigned int slen, u8 *dst, unsigned int *dlen)
79{
80 struct nx842_ctx *ctx = crypto_tfm_ctx(tfm);
81 struct nx842_crypto_header *hdr;
82 unsigned int tmp_len = *dlen;
83 size_t lzodlen; /* needed for lzo */
84 int err;
85
86 *dlen = 0;
87 hdr = (struct nx842_crypto_header *)dst;
88 hdr->sentinel = NX842_SENTINEL; /* debug */
89 dst += sizeof(struct nx842_crypto_header);
90 tmp_len -= sizeof(struct nx842_crypto_header);
91 lzodlen = tmp_len;
92
93 if (likely(!nx842_uselzo)) {
94 err = nx842_compress(src, slen, dst, &tmp_len, ctx->nx842_wmem);
95
96 if (likely(!err)) {
97 hdr->type = NX842_CRYPTO_TYPE_842;
98 *dlen = tmp_len + sizeof(struct nx842_crypto_header);
99 return 0;
100 }
101
102 /* hardware failed */
103 nx842_uselzo = 1;
104
105 /* set timer to check for hardware again in 1 second */
106 mod_timer(&failover_timer, jiffies + msecs_to_jiffies(1000));
107 }
108
109 /* no hardware, use lzo */
110 err = lzo1x_1_compress(src, slen, dst, &lzodlen, ctx->nx842_wmem);
111 if (err != LZO_E_OK)
112 return -EINVAL;
113
114 hdr->type = NX842_CRYPTO_TYPE_LZO;
115 *dlen = lzodlen + sizeof(struct nx842_crypto_header);
116 return 0;
117}
118
119static int nx842_crypto_decompress(struct crypto_tfm *tfm, const u8 *src,
120 unsigned int slen, u8 *dst, unsigned int *dlen)
121{
122 struct nx842_ctx *ctx = crypto_tfm_ctx(tfm);
123 struct nx842_crypto_header *hdr;
124 unsigned int tmp_len = *dlen;
125 size_t lzodlen; /* needed for lzo */
126 int err;
127
128 *dlen = 0;
129 hdr = (struct nx842_crypto_header *)src;
130
131 if (unlikely(hdr->sentinel != NX842_SENTINEL))
132 return -EINVAL;
133
134 src += sizeof(struct nx842_crypto_header);
135 slen -= sizeof(struct nx842_crypto_header);
136
137 if (likely(hdr->type == NX842_CRYPTO_TYPE_842)) {
138 err = nx842_decompress(src, slen, dst, &tmp_len,
139 ctx->nx842_wmem);
140 if (err)
141 return -EINVAL;
142 *dlen = tmp_len;
143 } else if (hdr->type == NX842_CRYPTO_TYPE_LZO) {
144 lzodlen = tmp_len;
145 err = lzo1x_decompress_safe(src, slen, dst, &lzodlen);
146 if (err != LZO_E_OK)
147 return -EINVAL;
148 *dlen = lzodlen;
149 } else
150 return -EINVAL;
151
152 return 0;
153}
154
155static struct crypto_alg alg = {
156 .cra_name = "842",
157 .cra_flags = CRYPTO_ALG_TYPE_COMPRESS,
158 .cra_ctxsize = sizeof(struct nx842_ctx),
159 .cra_module = THIS_MODULE,
160 .cra_init = nx842_init,
161 .cra_exit = nx842_exit,
162 .cra_u = { .compress = {
163 .coa_compress = nx842_crypto_compress,
164 .coa_decompress = nx842_crypto_decompress } }
165};
166
167static int __init nx842_mod_init(void)
168{
169 del_timer(&failover_timer);
170 return crypto_register_alg(&alg);
171}
172
173static void __exit nx842_mod_exit(void)
174{
175 crypto_unregister_alg(&alg);
176}
177
178module_init(nx842_mod_init);
179module_exit(nx842_mod_exit);
180
181MODULE_LICENSE("GPL");
182MODULE_DESCRIPTION("842 Compression Algorithm");
diff --git a/crypto/Kconfig b/crypto/Kconfig
index a3238051b03e..50402dc0ea35 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -336,6 +336,15 @@ config CRYPTO_CRC32C_INTEL
336 gain performance compared with software implementation. 336 gain performance compared with software implementation.
337 Module will be crc32c-intel. 337 Module will be crc32c-intel.
338 338
339config CRYPTO_CRC32C_SPARC64
340 tristate "CRC32c CRC algorithm (SPARC64)"
341 depends on SPARC64
342 select CRYPTO_HASH
343 select CRC32
344 help
345 CRC32c CRC algorithm implemented using sparc64 crypto instructions,
346 when available.
347
339config CRYPTO_GHASH 348config CRYPTO_GHASH
340 tristate "GHASH digest algorithm" 349 tristate "GHASH digest algorithm"
341 select CRYPTO_GF128MUL 350 select CRYPTO_GF128MUL
@@ -354,6 +363,15 @@ config CRYPTO_MD5
354 help 363 help
355 MD5 message digest algorithm (RFC1321). 364 MD5 message digest algorithm (RFC1321).
356 365
366config CRYPTO_MD5_SPARC64
367 tristate "MD5 digest algorithm (SPARC64)"
368 depends on SPARC64
369 select CRYPTO_MD5
370 select CRYPTO_HASH
371 help
372 MD5 message digest algorithm (RFC1321) implemented
373 using sparc64 crypto instructions, when available.
374
357config CRYPTO_MICHAEL_MIC 375config CRYPTO_MICHAEL_MIC
358 tristate "Michael MIC keyed digest algorithm" 376 tristate "Michael MIC keyed digest algorithm"
359 select CRYPTO_HASH 377 select CRYPTO_HASH
@@ -433,6 +451,24 @@ config CRYPTO_SHA1_SSSE3
433 using Supplemental SSE3 (SSSE3) instructions or Advanced Vector 451 using Supplemental SSE3 (SSSE3) instructions or Advanced Vector
434 Extensions (AVX), when available. 452 Extensions (AVX), when available.
435 453
454config CRYPTO_SHA1_SPARC64
455 tristate "SHA1 digest algorithm (SPARC64)"
456 depends on SPARC64
457 select CRYPTO_SHA1
458 select CRYPTO_HASH
459 help
460 SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
461 using sparc64 crypto instructions, when available.
462
463config CRYPTO_SHA1_ARM
464 tristate "SHA1 digest algorithm (ARM-asm)"
465 depends on ARM
466 select CRYPTO_SHA1
467 select CRYPTO_HASH
468 help
469 SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
470 using optimized ARM assembler.
471
436config CRYPTO_SHA256 472config CRYPTO_SHA256
437 tristate "SHA224 and SHA256 digest algorithm" 473 tristate "SHA224 and SHA256 digest algorithm"
438 select CRYPTO_HASH 474 select CRYPTO_HASH
@@ -445,6 +481,15 @@ config CRYPTO_SHA256
445 This code also includes SHA-224, a 224 bit hash with 112 bits 481 This code also includes SHA-224, a 224 bit hash with 112 bits
446 of security against collision attacks. 482 of security against collision attacks.
447 483
484config CRYPTO_SHA256_SPARC64
485 tristate "SHA224 and SHA256 digest algorithm (SPARC64)"
486 depends on SPARC64
487 select CRYPTO_SHA256
488 select CRYPTO_HASH
489 help
490 SHA-256 secure hash standard (DFIPS 180-2) implemented
491 using sparc64 crypto instructions, when available.
492
448config CRYPTO_SHA512 493config CRYPTO_SHA512
449 tristate "SHA384 and SHA512 digest algorithms" 494 tristate "SHA384 and SHA512 digest algorithms"
450 select CRYPTO_HASH 495 select CRYPTO_HASH
@@ -457,6 +502,15 @@ config CRYPTO_SHA512
457 This code also includes SHA-384, a 384 bit hash with 192 bits 502 This code also includes SHA-384, a 384 bit hash with 192 bits
458 of security against collision attacks. 503 of security against collision attacks.
459 504
505config CRYPTO_SHA512_SPARC64
506 tristate "SHA384 and SHA512 digest algorithm (SPARC64)"
507 depends on SPARC64
508 select CRYPTO_SHA512
509 select CRYPTO_HASH
510 help
511 SHA-512 secure hash standard (DFIPS 180-2) implemented
512 using sparc64 crypto instructions, when available.
513
460config CRYPTO_TGR192 514config CRYPTO_TGR192
461 tristate "Tiger digest algorithms" 515 tristate "Tiger digest algorithms"
462 select CRYPTO_HASH 516 select CRYPTO_HASH
@@ -564,6 +618,8 @@ config CRYPTO_AES_NI_INTEL
564 select CRYPTO_CRYPTD 618 select CRYPTO_CRYPTD
565 select CRYPTO_ABLK_HELPER_X86 619 select CRYPTO_ABLK_HELPER_X86
566 select CRYPTO_ALGAPI 620 select CRYPTO_ALGAPI
621 select CRYPTO_LRW
622 select CRYPTO_XTS
567 help 623 help
568 Use Intel AES-NI instructions for AES algorithm. 624 Use Intel AES-NI instructions for AES algorithm.
569 625
@@ -588,6 +644,58 @@ config CRYPTO_AES_NI_INTEL
588 ECB, CBC, LRW, PCBC, XTS. The 64 bit version has additional 644 ECB, CBC, LRW, PCBC, XTS. The 64 bit version has additional
589 acceleration for CTR. 645 acceleration for CTR.
590 646
647config CRYPTO_AES_SPARC64
648 tristate "AES cipher algorithms (SPARC64)"
649 depends on SPARC64
650 select CRYPTO_CRYPTD
651 select CRYPTO_ALGAPI
652 help
653 Use SPARC64 crypto opcodes for AES algorithm.
654
655 AES cipher algorithms (FIPS-197). AES uses the Rijndael
656 algorithm.
657
658 Rijndael appears to be consistently a very good performer in
659 both hardware and software across a wide range of computing
660 environments regardless of its use in feedback or non-feedback
661 modes. Its key setup time is excellent, and its key agility is
662 good. Rijndael's very low memory requirements make it very well
663 suited for restricted-space environments, in which it also
664 demonstrates excellent performance. Rijndael's operations are
665 among the easiest to defend against power and timing attacks.
666
667 The AES specifies three key sizes: 128, 192 and 256 bits
668
669 See <http://csrc.nist.gov/encryption/aes/> for more information.
670
671 In addition to AES cipher algorithm support, the acceleration
672 for some popular block cipher mode is supported too, including
673 ECB and CBC.
674
675config CRYPTO_AES_ARM
676 tristate "AES cipher algorithms (ARM-asm)"
677 depends on ARM
678 select CRYPTO_ALGAPI
679 select CRYPTO_AES
680 help
681 Use optimized AES assembler routines for ARM platforms.
682
683 AES cipher algorithms (FIPS-197). AES uses the Rijndael
684 algorithm.
685
686 Rijndael appears to be consistently a very good performer in
687 both hardware and software across a wide range of computing
688 environments regardless of its use in feedback or non-feedback
689 modes. Its key setup time is excellent, and its key agility is
690 good. Rijndael's very low memory requirements make it very well
691 suited for restricted-space environments, in which it also
692 demonstrates excellent performance. Rijndael's operations are
693 among the easiest to defend against power and timing attacks.
694
695 The AES specifies three key sizes: 128, 192 and 256 bits
696
697 See <http://csrc.nist.gov/encryption/aes/> for more information.
698
591config CRYPTO_ANUBIS 699config CRYPTO_ANUBIS
592 tristate "Anubis cipher algorithm" 700 tristate "Anubis cipher algorithm"
593 select CRYPTO_ALGAPI 701 select CRYPTO_ALGAPI
@@ -685,6 +793,22 @@ config CRYPTO_CAMELLIA_X86_64
685 See also: 793 See also:
686 <https://info.isl.ntt.co.jp/crypt/eng/camellia/index_s.html> 794 <https://info.isl.ntt.co.jp/crypt/eng/camellia/index_s.html>
687 795
796config CRYPTO_CAMELLIA_SPARC64
797 tristate "Camellia cipher algorithm (SPARC64)"
798 depends on SPARC64
799 depends on CRYPTO
800 select CRYPTO_ALGAPI
801 help
802 Camellia cipher algorithm module (SPARC64).
803
804 Camellia is a symmetric key block cipher developed jointly
805 at NTT and Mitsubishi Electric Corporation.
806
807 The Camellia specifies three key sizes: 128, 192 and 256 bits.
808
809 See also:
810 <https://info.isl.ntt.co.jp/crypt/eng/camellia/index_s.html>
811
688config CRYPTO_CAST5 812config CRYPTO_CAST5
689 tristate "CAST5 (CAST-128) cipher algorithm" 813 tristate "CAST5 (CAST-128) cipher algorithm"
690 select CRYPTO_ALGAPI 814 select CRYPTO_ALGAPI
@@ -692,6 +816,20 @@ config CRYPTO_CAST5
692 The CAST5 encryption algorithm (synonymous with CAST-128) is 816 The CAST5 encryption algorithm (synonymous with CAST-128) is
693 described in RFC2144. 817 described in RFC2144.
694 818
819config CRYPTO_CAST5_AVX_X86_64
820 tristate "CAST5 (CAST-128) cipher algorithm (x86_64/AVX)"
821 depends on X86 && 64BIT
822 select CRYPTO_ALGAPI
823 select CRYPTO_CRYPTD
824 select CRYPTO_ABLK_HELPER_X86
825 select CRYPTO_CAST5
826 help
827 The CAST5 encryption algorithm (synonymous with CAST-128) is
828 described in RFC2144.
829
830 This module provides the Cast5 cipher algorithm that processes
831 sixteen blocks parallel using the AVX instruction set.
832
695config CRYPTO_CAST6 833config CRYPTO_CAST6
696 tristate "CAST6 (CAST-256) cipher algorithm" 834 tristate "CAST6 (CAST-256) cipher algorithm"
697 select CRYPTO_ALGAPI 835 select CRYPTO_ALGAPI
@@ -699,12 +837,38 @@ config CRYPTO_CAST6
699 The CAST6 encryption algorithm (synonymous with CAST-256) is 837 The CAST6 encryption algorithm (synonymous with CAST-256) is
700 described in RFC2612. 838 described in RFC2612.
701 839
840config CRYPTO_CAST6_AVX_X86_64
841 tristate "CAST6 (CAST-256) cipher algorithm (x86_64/AVX)"
842 depends on X86 && 64BIT
843 select CRYPTO_ALGAPI
844 select CRYPTO_CRYPTD
845 select CRYPTO_ABLK_HELPER_X86
846 select CRYPTO_GLUE_HELPER_X86
847 select CRYPTO_CAST6
848 select CRYPTO_LRW
849 select CRYPTO_XTS
850 help
851 The CAST6 encryption algorithm (synonymous with CAST-256) is
852 described in RFC2612.
853
854 This module provides the Cast6 cipher algorithm that processes
855 eight blocks parallel using the AVX instruction set.
856
702config CRYPTO_DES 857config CRYPTO_DES
703 tristate "DES and Triple DES EDE cipher algorithms" 858 tristate "DES and Triple DES EDE cipher algorithms"
704 select CRYPTO_ALGAPI 859 select CRYPTO_ALGAPI
705 help 860 help
706 DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3). 861 DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3).
707 862
863config CRYPTO_DES_SPARC64
864 tristate "DES and Triple DES EDE cipher algorithms (SPARC64)"
865 depends on SPARC64
866 select CRYPTO_ALGAPI
867 select CRYPTO_DES
868 help
869 DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3),
870 optimized using SPARC64 crypto opcodes.
871
708config CRYPTO_FCRYPT 872config CRYPTO_FCRYPT
709 tristate "FCrypt cipher algorithm" 873 tristate "FCrypt cipher algorithm"
710 select CRYPTO_ALGAPI 874 select CRYPTO_ALGAPI
@@ -1008,6 +1172,15 @@ config CRYPTO_LZO
1008 help 1172 help
1009 This is the LZO algorithm. 1173 This is the LZO algorithm.
1010 1174
1175config CRYPTO_842
1176 tristate "842 compression algorithm"
1177 depends on CRYPTO_DEV_NX_COMPRESS
1178 # 842 uses lzo if the hardware becomes unavailable
1179 select LZO_COMPRESS
1180 select LZO_DECOMPRESS
1181 help
1182 This is the 842 algorithm.
1183
1011comment "Random Number Generation" 1184comment "Random Number Generation"
1012 1185
1013config CRYPTO_ANSI_CPRNG 1186config CRYPTO_ANSI_CPRNG
diff --git a/crypto/Makefile b/crypto/Makefile
index 30f33d675330..a301ad2b258c 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -68,8 +68,8 @@ obj-$(CONFIG_CRYPTO_TWOFISH_COMMON) += twofish_common.o
68obj-$(CONFIG_CRYPTO_SERPENT) += serpent_generic.o 68obj-$(CONFIG_CRYPTO_SERPENT) += serpent_generic.o
69obj-$(CONFIG_CRYPTO_AES) += aes_generic.o 69obj-$(CONFIG_CRYPTO_AES) += aes_generic.o
70obj-$(CONFIG_CRYPTO_CAMELLIA) += camellia_generic.o 70obj-$(CONFIG_CRYPTO_CAMELLIA) += camellia_generic.o
71obj-$(CONFIG_CRYPTO_CAST5) += cast5.o 71obj-$(CONFIG_CRYPTO_CAST5) += cast5_generic.o
72obj-$(CONFIG_CRYPTO_CAST6) += cast6.o 72obj-$(CONFIG_CRYPTO_CAST6) += cast6_generic.o
73obj-$(CONFIG_CRYPTO_ARC4) += arc4.o 73obj-$(CONFIG_CRYPTO_ARC4) += arc4.o
74obj-$(CONFIG_CRYPTO_TEA) += tea.o 74obj-$(CONFIG_CRYPTO_TEA) += tea.o
75obj-$(CONFIG_CRYPTO_KHAZAD) += khazad.o 75obj-$(CONFIG_CRYPTO_KHAZAD) += khazad.o
@@ -82,6 +82,7 @@ obj-$(CONFIG_CRYPTO_MICHAEL_MIC) += michael_mic.o
82obj-$(CONFIG_CRYPTO_CRC32C) += crc32c.o 82obj-$(CONFIG_CRYPTO_CRC32C) += crc32c.o
83obj-$(CONFIG_CRYPTO_AUTHENC) += authenc.o authencesn.o 83obj-$(CONFIG_CRYPTO_AUTHENC) += authenc.o authencesn.o
84obj-$(CONFIG_CRYPTO_LZO) += lzo.o 84obj-$(CONFIG_CRYPTO_LZO) += lzo.o
85obj-$(CONFIG_CRYPTO_842) += 842.o
85obj-$(CONFIG_CRYPTO_RNG2) += rng.o 86obj-$(CONFIG_CRYPTO_RNG2) += rng.o
86obj-$(CONFIG_CRYPTO_RNG2) += krng.o 87obj-$(CONFIG_CRYPTO_RNG2) += krng.o
87obj-$(CONFIG_CRYPTO_ANSI_CPRNG) += ansi_cprng.o 88obj-$(CONFIG_CRYPTO_ANSI_CPRNG) += ansi_cprng.o
diff --git a/crypto/aes_generic.c b/crypto/aes_generic.c
index a68c73dae15a..47f2e5c71759 100644
--- a/crypto/aes_generic.c
+++ b/crypto/aes_generic.c
@@ -1448,7 +1448,6 @@ static struct crypto_alg aes_alg = {
1448 .cra_ctxsize = sizeof(struct crypto_aes_ctx), 1448 .cra_ctxsize = sizeof(struct crypto_aes_ctx),
1449 .cra_alignmask = 3, 1449 .cra_alignmask = 3,
1450 .cra_module = THIS_MODULE, 1450 .cra_module = THIS_MODULE,
1451 .cra_list = LIST_HEAD_INIT(aes_alg.cra_list),
1452 .cra_u = { 1451 .cra_u = {
1453 .cipher = { 1452 .cipher = {
1454 .cia_min_keysize = AES_MIN_KEY_SIZE, 1453 .cia_min_keysize = AES_MIN_KEY_SIZE,
diff --git a/crypto/ansi_cprng.c b/crypto/ansi_cprng.c
index 6ddd99e6114b..c0bb3778f1ae 100644
--- a/crypto/ansi_cprng.c
+++ b/crypto/ansi_cprng.c
@@ -382,26 +382,6 @@ static int cprng_reset(struct crypto_rng *tfm, u8 *seed, unsigned int slen)
382 return 0; 382 return 0;
383} 383}
384 384
385static struct crypto_alg rng_alg = {
386 .cra_name = "stdrng",
387 .cra_driver_name = "ansi_cprng",
388 .cra_priority = 100,
389 .cra_flags = CRYPTO_ALG_TYPE_RNG,
390 .cra_ctxsize = sizeof(struct prng_context),
391 .cra_type = &crypto_rng_type,
392 .cra_module = THIS_MODULE,
393 .cra_list = LIST_HEAD_INIT(rng_alg.cra_list),
394 .cra_init = cprng_init,
395 .cra_exit = cprng_exit,
396 .cra_u = {
397 .rng = {
398 .rng_make_random = cprng_get_random,
399 .rng_reset = cprng_reset,
400 .seedsize = DEFAULT_PRNG_KSZ + 2*DEFAULT_BLK_SZ,
401 }
402 }
403};
404
405#ifdef CONFIG_CRYPTO_FIPS 385#ifdef CONFIG_CRYPTO_FIPS
406static int fips_cprng_get_random(struct crypto_rng *tfm, u8 *rdata, 386static int fips_cprng_get_random(struct crypto_rng *tfm, u8 *rdata,
407 unsigned int dlen) 387 unsigned int dlen)
@@ -438,8 +418,27 @@ static int fips_cprng_reset(struct crypto_rng *tfm, u8 *seed, unsigned int slen)
438out: 418out:
439 return rc; 419 return rc;
440} 420}
421#endif
441 422
442static struct crypto_alg fips_rng_alg = { 423static struct crypto_alg rng_algs[] = { {
424 .cra_name = "stdrng",
425 .cra_driver_name = "ansi_cprng",
426 .cra_priority = 100,
427 .cra_flags = CRYPTO_ALG_TYPE_RNG,
428 .cra_ctxsize = sizeof(struct prng_context),
429 .cra_type = &crypto_rng_type,
430 .cra_module = THIS_MODULE,
431 .cra_init = cprng_init,
432 .cra_exit = cprng_exit,
433 .cra_u = {
434 .rng = {
435 .rng_make_random = cprng_get_random,
436 .rng_reset = cprng_reset,
437 .seedsize = DEFAULT_PRNG_KSZ + 2*DEFAULT_BLK_SZ,
438 }
439 }
440#ifdef CONFIG_CRYPTO_FIPS
441}, {
443 .cra_name = "fips(ansi_cprng)", 442 .cra_name = "fips(ansi_cprng)",
444 .cra_driver_name = "fips_ansi_cprng", 443 .cra_driver_name = "fips_ansi_cprng",
445 .cra_priority = 300, 444 .cra_priority = 300,
@@ -447,7 +446,6 @@ static struct crypto_alg fips_rng_alg = {
447 .cra_ctxsize = sizeof(struct prng_context), 446 .cra_ctxsize = sizeof(struct prng_context),
448 .cra_type = &crypto_rng_type, 447 .cra_type = &crypto_rng_type,
449 .cra_module = THIS_MODULE, 448 .cra_module = THIS_MODULE,
450 .cra_list = LIST_HEAD_INIT(rng_alg.cra_list),
451 .cra_init = cprng_init, 449 .cra_init = cprng_init,
452 .cra_exit = cprng_exit, 450 .cra_exit = cprng_exit,
453 .cra_u = { 451 .cra_u = {
@@ -457,33 +455,18 @@ static struct crypto_alg fips_rng_alg = {
457 .seedsize = DEFAULT_PRNG_KSZ + 2*DEFAULT_BLK_SZ, 455 .seedsize = DEFAULT_PRNG_KSZ + 2*DEFAULT_BLK_SZ,
458 } 456 }
459 } 457 }
460};
461#endif 458#endif
459} };
462 460
463/* Module initalization */ 461/* Module initalization */
464static int __init prng_mod_init(void) 462static int __init prng_mod_init(void)
465{ 463{
466 int rc = 0; 464 return crypto_register_algs(rng_algs, ARRAY_SIZE(rng_algs));
467
468 rc = crypto_register_alg(&rng_alg);
469#ifdef CONFIG_CRYPTO_FIPS
470 if (rc)
471 goto out;
472
473 rc = crypto_register_alg(&fips_rng_alg);
474
475out:
476#endif
477 return rc;
478} 465}
479 466
480static void __exit prng_mod_fini(void) 467static void __exit prng_mod_fini(void)
481{ 468{
482 crypto_unregister_alg(&rng_alg); 469 crypto_unregister_algs(rng_algs, ARRAY_SIZE(rng_algs));
483#ifdef CONFIG_CRYPTO_FIPS
484 crypto_unregister_alg(&fips_rng_alg);
485#endif
486 return;
487} 470}
488 471
489MODULE_LICENSE("GPL"); 472MODULE_LICENSE("GPL");
diff --git a/crypto/anubis.c b/crypto/anubis.c
index 77530d571c96..008c8a4fb67c 100644
--- a/crypto/anubis.c
+++ b/crypto/anubis.c
@@ -678,7 +678,6 @@ static struct crypto_alg anubis_alg = {
678 .cra_ctxsize = sizeof (struct anubis_ctx), 678 .cra_ctxsize = sizeof (struct anubis_ctx),
679 .cra_alignmask = 3, 679 .cra_alignmask = 3,
680 .cra_module = THIS_MODULE, 680 .cra_module = THIS_MODULE,
681 .cra_list = LIST_HEAD_INIT(anubis_alg.cra_list),
682 .cra_u = { .cipher = { 681 .cra_u = { .cipher = {
683 .cia_min_keysize = ANUBIS_MIN_KEY_SIZE, 682 .cia_min_keysize = ANUBIS_MIN_KEY_SIZE,
684 .cia_max_keysize = ANUBIS_MAX_KEY_SIZE, 683 .cia_max_keysize = ANUBIS_MAX_KEY_SIZE,
diff --git a/crypto/blowfish_generic.c b/crypto/blowfish_generic.c
index 6f269b5cfa3b..8baf5447d35b 100644
--- a/crypto/blowfish_generic.c
+++ b/crypto/blowfish_generic.c
@@ -115,7 +115,6 @@ static struct crypto_alg alg = {
115 .cra_ctxsize = sizeof(struct bf_ctx), 115 .cra_ctxsize = sizeof(struct bf_ctx),
116 .cra_alignmask = 3, 116 .cra_alignmask = 3,
117 .cra_module = THIS_MODULE, 117 .cra_module = THIS_MODULE,
118 .cra_list = LIST_HEAD_INIT(alg.cra_list),
119 .cra_u = { .cipher = { 118 .cra_u = { .cipher = {
120 .cia_min_keysize = BF_MIN_KEY_SIZE, 119 .cia_min_keysize = BF_MIN_KEY_SIZE,
121 .cia_max_keysize = BF_MAX_KEY_SIZE, 120 .cia_max_keysize = BF_MAX_KEY_SIZE,
diff --git a/crypto/camellia_generic.c b/crypto/camellia_generic.c
index f7aaaaf86982..75efa2052305 100644
--- a/crypto/camellia_generic.c
+++ b/crypto/camellia_generic.c
@@ -1072,7 +1072,6 @@ static struct crypto_alg camellia_alg = {
1072 .cra_ctxsize = sizeof(struct camellia_ctx), 1072 .cra_ctxsize = sizeof(struct camellia_ctx),
1073 .cra_alignmask = 3, 1073 .cra_alignmask = 3,
1074 .cra_module = THIS_MODULE, 1074 .cra_module = THIS_MODULE,
1075 .cra_list = LIST_HEAD_INIT(camellia_alg.cra_list),
1076 .cra_u = { 1075 .cra_u = {
1077 .cipher = { 1076 .cipher = {
1078 .cia_min_keysize = CAMELLIA_MIN_KEY_SIZE, 1077 .cia_min_keysize = CAMELLIA_MIN_KEY_SIZE,
diff --git a/crypto/cast5.c b/crypto/cast5_generic.c
index 4a230ddec877..bc525dbd8a4b 100644
--- a/crypto/cast5.c
+++ b/crypto/cast5_generic.c
@@ -4,8 +4,8 @@
4* Derived from GnuPG implementation of cast5. 4* Derived from GnuPG implementation of cast5.
5* 5*
6* Major Changes. 6* Major Changes.
7* Complete conformance to rfc2144. 7* Complete conformance to rfc2144.
8* Supports key size from 40 to 128 bits. 8* Supports key size from 40 to 128 bits.
9* 9*
10* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. 10* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
11* Copyright (C) 2003 Kartikey Mahendra Bhatt <kartik_me@hotmail.com>. 11* Copyright (C) 2003 Kartikey Mahendra Bhatt <kartik_me@hotmail.com>.
@@ -28,19 +28,10 @@
28#include <linux/errno.h> 28#include <linux/errno.h>
29#include <linux/string.h> 29#include <linux/string.h>
30#include <linux/types.h> 30#include <linux/types.h>
31#include <crypto/cast5.h>
31 32
32#define CAST5_BLOCK_SIZE 8
33#define CAST5_MIN_KEY_SIZE 5
34#define CAST5_MAX_KEY_SIZE 16
35 33
36struct cast5_ctx { 34const u32 cast5_s1[256] = {
37 u32 Km[16];
38 u8 Kr[16];
39 int rr; /* rr?number of rounds = 16:number of rounds = 12; (rfc 2144) */
40};
41
42
43static const u32 s1[256] = {
44 0x30fb40d4, 0x9fa0ff0b, 0x6beccd2f, 0x3f258c7a, 0x1e213f2f, 35 0x30fb40d4, 0x9fa0ff0b, 0x6beccd2f, 0x3f258c7a, 0x1e213f2f,
45 0x9c004dd3, 0x6003e540, 0xcf9fc949, 36 0x9c004dd3, 0x6003e540, 0xcf9fc949,
46 0xbfd4af27, 0x88bbbdb5, 0xe2034090, 0x98d09675, 0x6e63a0e0, 37 0xbfd4af27, 0x88bbbdb5, 0xe2034090, 0x98d09675, 0x6e63a0e0,
@@ -106,7 +97,8 @@ static const u32 s1[256] = {
106 0x1a69e783, 0x02cc4843, 0xa2f7c579, 0x429ef47d, 0x427b169c, 97 0x1a69e783, 0x02cc4843, 0xa2f7c579, 0x429ef47d, 0x427b169c,
107 0x5ac9f049, 0xdd8f0f00, 0x5c8165bf 98 0x5ac9f049, 0xdd8f0f00, 0x5c8165bf
108}; 99};
109static const u32 s2[256] = { 100EXPORT_SYMBOL_GPL(cast5_s1);
101const u32 cast5_s2[256] = {
110 0x1f201094, 0xef0ba75b, 0x69e3cf7e, 0x393f4380, 0xfe61cf7a, 102 0x1f201094, 0xef0ba75b, 0x69e3cf7e, 0x393f4380, 0xfe61cf7a,
111 0xeec5207a, 0x55889c94, 0x72fc0651, 103 0xeec5207a, 0x55889c94, 0x72fc0651,
112 0xada7ef79, 0x4e1d7235, 0xd55a63ce, 0xde0436ba, 0x99c430ef, 104 0xada7ef79, 0x4e1d7235, 0xd55a63ce, 0xde0436ba, 0x99c430ef,
@@ -172,7 +164,8 @@ static const u32 s2[256] = {
172 0x43d79572, 0x7e6dd07c, 0x06dfdf1e, 0x6c6cc4ef, 0x7160a539, 164 0x43d79572, 0x7e6dd07c, 0x06dfdf1e, 0x6c6cc4ef, 0x7160a539,
173 0x73bfbe70, 0x83877605, 0x4523ecf1 165 0x73bfbe70, 0x83877605, 0x4523ecf1
174}; 166};
175static const u32 s3[256] = { 167EXPORT_SYMBOL_GPL(cast5_s2);
168const u32 cast5_s3[256] = {
176 0x8defc240, 0x25fa5d9f, 0xeb903dbf, 0xe810c907, 0x47607fff, 169 0x8defc240, 0x25fa5d9f, 0xeb903dbf, 0xe810c907, 0x47607fff,
177 0x369fe44b, 0x8c1fc644, 0xaececa90, 170 0x369fe44b, 0x8c1fc644, 0xaececa90,
178 0xbeb1f9bf, 0xeefbcaea, 0xe8cf1950, 0x51df07ae, 0x920e8806, 171 0xbeb1f9bf, 0xeefbcaea, 0xe8cf1950, 0x51df07ae, 0x920e8806,
@@ -238,7 +231,8 @@ static const u32 s3[256] = {
238 0xf7baefd5, 0x4142ed9c, 0xa4315c11, 0x83323ec5, 0xdfef4636, 231 0xf7baefd5, 0x4142ed9c, 0xa4315c11, 0x83323ec5, 0xdfef4636,
239 0xa133c501, 0xe9d3531c, 0xee353783 232 0xa133c501, 0xe9d3531c, 0xee353783
240}; 233};
241static const u32 s4[256] = { 234EXPORT_SYMBOL_GPL(cast5_s3);
235const u32 cast5_s4[256] = {
242 0x9db30420, 0x1fb6e9de, 0xa7be7bef, 0xd273a298, 0x4a4f7bdb, 236 0x9db30420, 0x1fb6e9de, 0xa7be7bef, 0xd273a298, 0x4a4f7bdb,
243 0x64ad8c57, 0x85510443, 0xfa020ed1, 237 0x64ad8c57, 0x85510443, 0xfa020ed1,
244 0x7e287aff, 0xe60fb663, 0x095f35a1, 0x79ebf120, 0xfd059d43, 238 0x7e287aff, 0xe60fb663, 0x095f35a1, 0x79ebf120, 0xfd059d43,
@@ -304,6 +298,7 @@ static const u32 s4[256] = {
304 0x7ae5290c, 0x3cb9536b, 0x851e20fe, 0x9833557e, 0x13ecf0b0, 298 0x7ae5290c, 0x3cb9536b, 0x851e20fe, 0x9833557e, 0x13ecf0b0,
305 0xd3ffb372, 0x3f85c5c1, 0x0aef7ed2 299 0xd3ffb372, 0x3f85c5c1, 0x0aef7ed2
306}; 300};
301EXPORT_SYMBOL_GPL(cast5_s4);
307static const u32 s5[256] = { 302static const u32 s5[256] = {
308 0x7ec90c04, 0x2c6e74b9, 0x9b0e66df, 0xa6337911, 0xb86a7fff, 303 0x7ec90c04, 0x2c6e74b9, 0x9b0e66df, 0xa6337911, 0xb86a7fff,
309 0x1dd358f5, 0x44dd9d44, 0x1731167f, 304 0x1dd358f5, 0x44dd9d44, 0x1731167f,
@@ -569,17 +564,21 @@ static const u32 sb8[256] = {
569 0xeaee6801, 0x8db2a283, 0xea8bf59e 564 0xeaee6801, 0x8db2a283, 0xea8bf59e
570}; 565};
571 566
567#define s1 cast5_s1
568#define s2 cast5_s2
569#define s3 cast5_s3
570#define s4 cast5_s4
571
572#define F1(D, m, r) ((I = ((m) + (D))), (I = rol32(I, (r))), \ 572#define F1(D, m, r) ((I = ((m) + (D))), (I = rol32(I, (r))), \
573 (((s1[I >> 24] ^ s2[(I>>16)&0xff]) - s3[(I>>8)&0xff]) + s4[I&0xff])) 573 (((s1[I >> 24] ^ s2[(I>>16)&0xff]) - s3[(I>>8)&0xff]) + s4[I&0xff]))
574#define F2(D, m, r) ((I = ((m) ^ (D))), (I = rol32(I, (r))), \ 574#define F2(D, m, r) ((I = ((m) ^ (D))), (I = rol32(I, (r))), \
575 (((s1[I >> 24] - s2[(I>>16)&0xff]) + s3[(I>>8)&0xff]) ^ s4[I&0xff])) 575 (((s1[I >> 24] - s2[(I>>16)&0xff]) + s3[(I>>8)&0xff]) ^ s4[I&0xff]))
576#define F3(D, m, r) ((I = ((m) - (D))), (I = rol32(I, (r))), \ 576#define F3(D, m, r) ((I = ((m) - (D))), (I = rol32(I, (r))), \
577 (((s1[I >> 24] + s2[(I>>16)&0xff]) ^ s3[(I>>8)&0xff]) - s4[I&0xff])) 577 (((s1[I >> 24] + s2[(I>>16)&0xff]) ^ s3[(I>>8)&0xff]) - s4[I&0xff]))
578 578
579 579
580static void cast5_encrypt(struct crypto_tfm *tfm, u8 *outbuf, const u8 *inbuf) 580void __cast5_encrypt(struct cast5_ctx *c, u8 *outbuf, const u8 *inbuf)
581{ 581{
582 struct cast5_ctx *c = crypto_tfm_ctx(tfm);
583 const __be32 *src = (const __be32 *)inbuf; 582 const __be32 *src = (const __be32 *)inbuf;
584 __be32 *dst = (__be32 *)outbuf; 583 __be32 *dst = (__be32 *)outbuf;
585 u32 l, r, t; 584 u32 l, r, t;
@@ -628,10 +627,15 @@ static void cast5_encrypt(struct crypto_tfm *tfm, u8 *outbuf, const u8 *inbuf)
628 dst[0] = cpu_to_be32(r); 627 dst[0] = cpu_to_be32(r);
629 dst[1] = cpu_to_be32(l); 628 dst[1] = cpu_to_be32(l);
630} 629}
630EXPORT_SYMBOL_GPL(__cast5_encrypt);
631 631
632static void cast5_decrypt(struct crypto_tfm *tfm, u8 *outbuf, const u8 *inbuf) 632static void cast5_encrypt(struct crypto_tfm *tfm, u8 *outbuf, const u8 *inbuf)
633{
634 __cast5_encrypt(crypto_tfm_ctx(tfm), outbuf, inbuf);
635}
636
637void __cast5_decrypt(struct cast5_ctx *c, u8 *outbuf, const u8 *inbuf)
633{ 638{
634 struct cast5_ctx *c = crypto_tfm_ctx(tfm);
635 const __be32 *src = (const __be32 *)inbuf; 639 const __be32 *src = (const __be32 *)inbuf;
636 __be32 *dst = (__be32 *)outbuf; 640 __be32 *dst = (__be32 *)outbuf;
637 u32 l, r, t; 641 u32 l, r, t;
@@ -667,6 +671,12 @@ static void cast5_decrypt(struct crypto_tfm *tfm, u8 *outbuf, const u8 *inbuf)
667 dst[0] = cpu_to_be32(r); 671 dst[0] = cpu_to_be32(r);
668 dst[1] = cpu_to_be32(l); 672 dst[1] = cpu_to_be32(l);
669} 673}
674EXPORT_SYMBOL_GPL(__cast5_decrypt);
675
676static void cast5_decrypt(struct crypto_tfm *tfm, u8 *outbuf, const u8 *inbuf)
677{
678 __cast5_decrypt(crypto_tfm_ctx(tfm), outbuf, inbuf);
679}
670 680
671static void key_schedule(u32 *x, u32 *z, u32 *k) 681static void key_schedule(u32 *x, u32 *z, u32 *k)
672{ 682{
@@ -743,7 +753,7 @@ static void key_schedule(u32 *x, u32 *z, u32 *k)
743} 753}
744 754
745 755
746static int cast5_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned key_len) 756int cast5_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int key_len)
747{ 757{
748 struct cast5_ctx *c = crypto_tfm_ctx(tfm); 758 struct cast5_ctx *c = crypto_tfm_ctx(tfm);
749 int i; 759 int i;
@@ -771,20 +781,22 @@ static int cast5_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned key_len)
771 c->Kr[i] = k[i] & 0x1f; 781 c->Kr[i] = k[i] & 0x1f;
772 return 0; 782 return 0;
773} 783}
784EXPORT_SYMBOL_GPL(cast5_setkey);
774 785
775static struct crypto_alg alg = { 786static struct crypto_alg alg = {
776 .cra_name = "cast5", 787 .cra_name = "cast5",
777 .cra_flags = CRYPTO_ALG_TYPE_CIPHER, 788 .cra_driver_name = "cast5-generic",
778 .cra_blocksize = CAST5_BLOCK_SIZE, 789 .cra_priority = 100,
779 .cra_ctxsize = sizeof(struct cast5_ctx), 790 .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
780 .cra_alignmask = 3, 791 .cra_blocksize = CAST5_BLOCK_SIZE,
781 .cra_module = THIS_MODULE, 792 .cra_ctxsize = sizeof(struct cast5_ctx),
782 .cra_list = LIST_HEAD_INIT(alg.cra_list), 793 .cra_alignmask = 3,
783 .cra_u = { 794 .cra_module = THIS_MODULE,
795 .cra_u = {
784 .cipher = { 796 .cipher = {
785 .cia_min_keysize = CAST5_MIN_KEY_SIZE, 797 .cia_min_keysize = CAST5_MIN_KEY_SIZE,
786 .cia_max_keysize = CAST5_MAX_KEY_SIZE, 798 .cia_max_keysize = CAST5_MAX_KEY_SIZE,
787 .cia_setkey = cast5_setkey, 799 .cia_setkey = cast5_setkey,
788 .cia_encrypt = cast5_encrypt, 800 .cia_encrypt = cast5_encrypt,
789 .cia_decrypt = cast5_decrypt 801 .cia_decrypt = cast5_decrypt
790 } 802 }
@@ -806,4 +818,4 @@ module_exit(cast5_mod_fini);
806 818
807MODULE_LICENSE("GPL"); 819MODULE_LICENSE("GPL");
808MODULE_DESCRIPTION("Cast5 Cipher Algorithm"); 820MODULE_DESCRIPTION("Cast5 Cipher Algorithm");
809 821MODULE_ALIAS("cast5");
diff --git a/crypto/cast6.c b/crypto/cast6_generic.c
index e0c15a6c7c34..1acd2f1c48fc 100644
--- a/crypto/cast6.c
+++ b/crypto/cast6_generic.c
@@ -25,24 +25,21 @@
25#include <linux/errno.h> 25#include <linux/errno.h>
26#include <linux/string.h> 26#include <linux/string.h>
27#include <linux/types.h> 27#include <linux/types.h>
28#include <crypto/cast6.h>
28 29
29#define CAST6_BLOCK_SIZE 16 30#define s1 cast6_s1
30#define CAST6_MIN_KEY_SIZE 16 31#define s2 cast6_s2
31#define CAST6_MAX_KEY_SIZE 32 32#define s3 cast6_s3
32 33#define s4 cast6_s4
33struct cast6_ctx {
34 u32 Km[12][4];
35 u8 Kr[12][4];
36};
37 34
38#define F1(D, r, m) ((I = ((m) + (D))), (I = rol32(I, (r))), \ 35#define F1(D, r, m) ((I = ((m) + (D))), (I = rol32(I, (r))), \
39 (((s1[I >> 24] ^ s2[(I>>16)&0xff]) - s3[(I>>8)&0xff]) + s4[I&0xff])) 36 (((s1[I >> 24] ^ s2[(I>>16)&0xff]) - s3[(I>>8)&0xff]) + s4[I&0xff]))
40#define F2(D, r, m) ((I = ((m) ^ (D))), (I = rol32(I, (r))), \ 37#define F2(D, r, m) ((I = ((m) ^ (D))), (I = rol32(I, (r))), \
41 (((s1[I >> 24] - s2[(I>>16)&0xff]) + s3[(I>>8)&0xff]) ^ s4[I&0xff])) 38 (((s1[I >> 24] - s2[(I>>16)&0xff]) + s3[(I>>8)&0xff]) ^ s4[I&0xff]))
42#define F3(D, r, m) ((I = ((m) - (D))), (I = rol32(I, (r))), \ 39#define F3(D, r, m) ((I = ((m) - (D))), (I = rol32(I, (r))), \
43 (((s1[I >> 24] + s2[(I>>16)&0xff]) ^ s3[(I>>8)&0xff]) - s4[I&0xff])) 40 (((s1[I >> 24] + s2[(I>>16)&0xff]) ^ s3[(I>>8)&0xff]) - s4[I&0xff]))
44 41
45static const u32 s1[256] = { 42const u32 cast6_s1[256] = {
46 0x30fb40d4, 0x9fa0ff0b, 0x6beccd2f, 0x3f258c7a, 0x1e213f2f, 43 0x30fb40d4, 0x9fa0ff0b, 0x6beccd2f, 0x3f258c7a, 0x1e213f2f,
47 0x9c004dd3, 0x6003e540, 0xcf9fc949, 44 0x9c004dd3, 0x6003e540, 0xcf9fc949,
48 0xbfd4af27, 0x88bbbdb5, 0xe2034090, 0x98d09675, 0x6e63a0e0, 45 0xbfd4af27, 0x88bbbdb5, 0xe2034090, 0x98d09675, 0x6e63a0e0,
@@ -108,8 +105,9 @@ static const u32 s1[256] = {
108 0x1a69e783, 0x02cc4843, 0xa2f7c579, 0x429ef47d, 0x427b169c, 105 0x1a69e783, 0x02cc4843, 0xa2f7c579, 0x429ef47d, 0x427b169c,
109 0x5ac9f049, 0xdd8f0f00, 0x5c8165bf 106 0x5ac9f049, 0xdd8f0f00, 0x5c8165bf
110}; 107};
108EXPORT_SYMBOL_GPL(cast6_s1);
111 109
112static const u32 s2[256] = { 110const u32 cast6_s2[256] = {
113 0x1f201094, 0xef0ba75b, 0x69e3cf7e, 0x393f4380, 0xfe61cf7a, 111 0x1f201094, 0xef0ba75b, 0x69e3cf7e, 0x393f4380, 0xfe61cf7a,
114 0xeec5207a, 0x55889c94, 0x72fc0651, 112 0xeec5207a, 0x55889c94, 0x72fc0651,
115 0xada7ef79, 0x4e1d7235, 0xd55a63ce, 0xde0436ba, 0x99c430ef, 113 0xada7ef79, 0x4e1d7235, 0xd55a63ce, 0xde0436ba, 0x99c430ef,
@@ -175,8 +173,9 @@ static const u32 s2[256] = {
175 0x43d79572, 0x7e6dd07c, 0x06dfdf1e, 0x6c6cc4ef, 0x7160a539, 173 0x43d79572, 0x7e6dd07c, 0x06dfdf1e, 0x6c6cc4ef, 0x7160a539,
176 0x73bfbe70, 0x83877605, 0x4523ecf1 174 0x73bfbe70, 0x83877605, 0x4523ecf1
177}; 175};
176EXPORT_SYMBOL_GPL(cast6_s2);
178 177
179static const u32 s3[256] = { 178const u32 cast6_s3[256] = {
180 0x8defc240, 0x25fa5d9f, 0xeb903dbf, 0xe810c907, 0x47607fff, 179 0x8defc240, 0x25fa5d9f, 0xeb903dbf, 0xe810c907, 0x47607fff,
181 0x369fe44b, 0x8c1fc644, 0xaececa90, 180 0x369fe44b, 0x8c1fc644, 0xaececa90,
182 0xbeb1f9bf, 0xeefbcaea, 0xe8cf1950, 0x51df07ae, 0x920e8806, 181 0xbeb1f9bf, 0xeefbcaea, 0xe8cf1950, 0x51df07ae, 0x920e8806,
@@ -242,8 +241,9 @@ static const u32 s3[256] = {
242 0xf7baefd5, 0x4142ed9c, 0xa4315c11, 0x83323ec5, 0xdfef4636, 241 0xf7baefd5, 0x4142ed9c, 0xa4315c11, 0x83323ec5, 0xdfef4636,
243 0xa133c501, 0xe9d3531c, 0xee353783 242 0xa133c501, 0xe9d3531c, 0xee353783
244}; 243};
244EXPORT_SYMBOL_GPL(cast6_s3);
245 245
246static const u32 s4[256] = { 246const u32 cast6_s4[256] = {
247 0x9db30420, 0x1fb6e9de, 0xa7be7bef, 0xd273a298, 0x4a4f7bdb, 247 0x9db30420, 0x1fb6e9de, 0xa7be7bef, 0xd273a298, 0x4a4f7bdb,
248 0x64ad8c57, 0x85510443, 0xfa020ed1, 248 0x64ad8c57, 0x85510443, 0xfa020ed1,
249 0x7e287aff, 0xe60fb663, 0x095f35a1, 0x79ebf120, 0xfd059d43, 249 0x7e287aff, 0xe60fb663, 0x095f35a1, 0x79ebf120, 0xfd059d43,
@@ -309,6 +309,7 @@ static const u32 s4[256] = {
309 0x7ae5290c, 0x3cb9536b, 0x851e20fe, 0x9833557e, 0x13ecf0b0, 309 0x7ae5290c, 0x3cb9536b, 0x851e20fe, 0x9833557e, 0x13ecf0b0,
310 0xd3ffb372, 0x3f85c5c1, 0x0aef7ed2 310 0xd3ffb372, 0x3f85c5c1, 0x0aef7ed2
311}; 311};
312EXPORT_SYMBOL_GPL(cast6_s4);
312 313
313static const u32 Tm[24][8] = { 314static const u32 Tm[24][8] = {
314 { 0x5a827999, 0xc95c653a, 0x383650db, 0xa7103c7c, 0x15ea281d, 315 { 0x5a827999, 0xc95c653a, 0x383650db, 0xa7103c7c, 0x15ea281d,
@@ -369,7 +370,7 @@ static const u8 Tr[4][8] = {
369}; 370};
370 371
371/* forward octave */ 372/* forward octave */
372static void W(u32 *key, unsigned int i) 373static inline void W(u32 *key, unsigned int i)
373{ 374{
374 u32 I; 375 u32 I;
375 key[6] ^= F1(key[7], Tr[i % 4][0], Tm[i][0]); 376 key[6] ^= F1(key[7], Tr[i % 4][0], Tm[i][0]);
@@ -382,14 +383,12 @@ static void W(u32 *key, unsigned int i)
382 key[7] ^= F2(key[0], Tr[i % 4][7], Tm[i][7]); 383 key[7] ^= F2(key[0], Tr[i % 4][7], Tm[i][7]);
383} 384}
384 385
385static int cast6_setkey(struct crypto_tfm *tfm, const u8 *in_key, 386int __cast6_setkey(struct cast6_ctx *c, const u8 *in_key,
386 unsigned key_len) 387 unsigned key_len, u32 *flags)
387{ 388{
388 int i; 389 int i;
389 u32 key[8]; 390 u32 key[8];
390 __be32 p_key[8]; /* padded key */ 391 __be32 p_key[8]; /* padded key */
391 struct cast6_ctx *c = crypto_tfm_ctx(tfm);
392 u32 *flags = &tfm->crt_flags;
393 392
394 if (key_len % 4 != 0) { 393 if (key_len % 4 != 0) {
395 *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; 394 *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
@@ -425,9 +424,17 @@ static int cast6_setkey(struct crypto_tfm *tfm, const u8 *in_key,
425 424
426 return 0; 425 return 0;
427} 426}
427EXPORT_SYMBOL_GPL(__cast6_setkey);
428
429int cast6_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
430{
431 return __cast6_setkey(crypto_tfm_ctx(tfm), key, keylen,
432 &tfm->crt_flags);
433}
434EXPORT_SYMBOL_GPL(cast6_setkey);
428 435
429/*forward quad round*/ 436/*forward quad round*/
430static void Q(u32 *block, u8 *Kr, u32 *Km) 437static inline void Q(u32 *block, u8 *Kr, u32 *Km)
431{ 438{
432 u32 I; 439 u32 I;
433 block[2] ^= F1(block[3], Kr[0], Km[0]); 440 block[2] ^= F1(block[3], Kr[0], Km[0]);
@@ -437,7 +444,7 @@ static void Q(u32 *block, u8 *Kr, u32 *Km)
437} 444}
438 445
439/*reverse quad round*/ 446/*reverse quad round*/
440static void QBAR(u32 *block, u8 *Kr, u32 *Km) 447static inline void QBAR(u32 *block, u8 *Kr, u32 *Km)
441{ 448{
442 u32 I; 449 u32 I;
443 block[3] ^= F1(block[0], Kr[3], Km[3]); 450 block[3] ^= F1(block[0], Kr[3], Km[3]);
@@ -446,9 +453,8 @@ static void QBAR(u32 *block, u8 *Kr, u32 *Km)
446 block[2] ^= F1(block[3], Kr[0], Km[0]); 453 block[2] ^= F1(block[3], Kr[0], Km[0]);
447} 454}
448 455
449static void cast6_encrypt(struct crypto_tfm *tfm, u8 *outbuf, const u8 *inbuf) 456void __cast6_encrypt(struct cast6_ctx *c, u8 *outbuf, const u8 *inbuf)
450{ 457{
451 struct cast6_ctx *c = crypto_tfm_ctx(tfm);
452 const __be32 *src = (const __be32 *)inbuf; 458 const __be32 *src = (const __be32 *)inbuf;
453 __be32 *dst = (__be32 *)outbuf; 459 __be32 *dst = (__be32 *)outbuf;
454 u32 block[4]; 460 u32 block[4];
@@ -478,10 +484,15 @@ static void cast6_encrypt(struct crypto_tfm *tfm, u8 *outbuf, const u8 *inbuf)
478 dst[2] = cpu_to_be32(block[2]); 484 dst[2] = cpu_to_be32(block[2]);
479 dst[3] = cpu_to_be32(block[3]); 485 dst[3] = cpu_to_be32(block[3]);
480} 486}
487EXPORT_SYMBOL_GPL(__cast6_encrypt);
481 488
482static void cast6_decrypt(struct crypto_tfm *tfm, u8 *outbuf, const u8 *inbuf) 489static void cast6_encrypt(struct crypto_tfm *tfm, u8 *outbuf, const u8 *inbuf)
490{
491 __cast6_encrypt(crypto_tfm_ctx(tfm), outbuf, inbuf);
492}
493
494void __cast6_decrypt(struct cast6_ctx *c, u8 *outbuf, const u8 *inbuf)
483{ 495{
484 struct cast6_ctx *c = crypto_tfm_ctx(tfm);
485 const __be32 *src = (const __be32 *)inbuf; 496 const __be32 *src = (const __be32 *)inbuf;
486 __be32 *dst = (__be32 *)outbuf; 497 __be32 *dst = (__be32 *)outbuf;
487 u32 block[4]; 498 u32 block[4];
@@ -511,15 +522,22 @@ static void cast6_decrypt(struct crypto_tfm *tfm, u8 *outbuf, const u8 *inbuf)
511 dst[2] = cpu_to_be32(block[2]); 522 dst[2] = cpu_to_be32(block[2]);
512 dst[3] = cpu_to_be32(block[3]); 523 dst[3] = cpu_to_be32(block[3]);
513} 524}
525EXPORT_SYMBOL_GPL(__cast6_decrypt);
526
527static void cast6_decrypt(struct crypto_tfm *tfm, u8 *outbuf, const u8 *inbuf)
528{
529 __cast6_decrypt(crypto_tfm_ctx(tfm), outbuf, inbuf);
530}
514 531
515static struct crypto_alg alg = { 532static struct crypto_alg alg = {
516 .cra_name = "cast6", 533 .cra_name = "cast6",
534 .cra_driver_name = "cast6-generic",
535 .cra_priority = 100,
517 .cra_flags = CRYPTO_ALG_TYPE_CIPHER, 536 .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
518 .cra_blocksize = CAST6_BLOCK_SIZE, 537 .cra_blocksize = CAST6_BLOCK_SIZE,
519 .cra_ctxsize = sizeof(struct cast6_ctx), 538 .cra_ctxsize = sizeof(struct cast6_ctx),
520 .cra_alignmask = 3, 539 .cra_alignmask = 3,
521 .cra_module = THIS_MODULE, 540 .cra_module = THIS_MODULE,
522 .cra_list = LIST_HEAD_INIT(alg.cra_list),
523 .cra_u = { 541 .cra_u = {
524 .cipher = { 542 .cipher = {
525 .cia_min_keysize = CAST6_MIN_KEY_SIZE, 543 .cia_min_keysize = CAST6_MIN_KEY_SIZE,
@@ -545,3 +563,4 @@ module_exit(cast6_mod_fini);
545 563
546MODULE_LICENSE("GPL"); 564MODULE_LICENSE("GPL");
547MODULE_DESCRIPTION("Cast6 Cipher Algorithm"); 565MODULE_DESCRIPTION("Cast6 Cipher Algorithm");
566MODULE_ALIAS("cast6");
diff --git a/crypto/crypto_null.c b/crypto/crypto_null.c
index 07a8a96d46fc..fee7265cd35d 100644
--- a/crypto/crypto_null.c
+++ b/crypto/crypto_null.c
@@ -94,18 +94,6 @@ static int skcipher_null_crypt(struct blkcipher_desc *desc,
94 return err; 94 return err;
95} 95}
96 96
97static struct crypto_alg compress_null = {
98 .cra_name = "compress_null",
99 .cra_flags = CRYPTO_ALG_TYPE_COMPRESS,
100 .cra_blocksize = NULL_BLOCK_SIZE,
101 .cra_ctxsize = 0,
102 .cra_module = THIS_MODULE,
103 .cra_list = LIST_HEAD_INIT(compress_null.cra_list),
104 .cra_u = { .compress = {
105 .coa_compress = null_compress,
106 .coa_decompress = null_compress } }
107};
108
109static struct shash_alg digest_null = { 97static struct shash_alg digest_null = {
110 .digestsize = NULL_DIGEST_SIZE, 98 .digestsize = NULL_DIGEST_SIZE,
111 .setkey = null_hash_setkey, 99 .setkey = null_hash_setkey,
@@ -122,22 +110,19 @@ static struct shash_alg digest_null = {
122 } 110 }
123}; 111};
124 112
125static struct crypto_alg cipher_null = { 113static struct crypto_alg null_algs[3] = { {
126 .cra_name = "cipher_null", 114 .cra_name = "cipher_null",
127 .cra_flags = CRYPTO_ALG_TYPE_CIPHER, 115 .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
128 .cra_blocksize = NULL_BLOCK_SIZE, 116 .cra_blocksize = NULL_BLOCK_SIZE,
129 .cra_ctxsize = 0, 117 .cra_ctxsize = 0,
130 .cra_module = THIS_MODULE, 118 .cra_module = THIS_MODULE,
131 .cra_list = LIST_HEAD_INIT(cipher_null.cra_list),
132 .cra_u = { .cipher = { 119 .cra_u = { .cipher = {
133 .cia_min_keysize = NULL_KEY_SIZE, 120 .cia_min_keysize = NULL_KEY_SIZE,
134 .cia_max_keysize = NULL_KEY_SIZE, 121 .cia_max_keysize = NULL_KEY_SIZE,
135 .cia_setkey = null_setkey, 122 .cia_setkey = null_setkey,
136 .cia_encrypt = null_crypt, 123 .cia_encrypt = null_crypt,
137 .cia_decrypt = null_crypt } } 124 .cia_decrypt = null_crypt } }
138}; 125}, {
139
140static struct crypto_alg skcipher_null = {
141 .cra_name = "ecb(cipher_null)", 126 .cra_name = "ecb(cipher_null)",
142 .cra_driver_name = "ecb-cipher_null", 127 .cra_driver_name = "ecb-cipher_null",
143 .cra_priority = 100, 128 .cra_priority = 100,
@@ -146,7 +131,6 @@ static struct crypto_alg skcipher_null = {
146 .cra_type = &crypto_blkcipher_type, 131 .cra_type = &crypto_blkcipher_type,
147 .cra_ctxsize = 0, 132 .cra_ctxsize = 0,
148 .cra_module = THIS_MODULE, 133 .cra_module = THIS_MODULE,
149 .cra_list = LIST_HEAD_INIT(skcipher_null.cra_list),
150 .cra_u = { .blkcipher = { 134 .cra_u = { .blkcipher = {
151 .min_keysize = NULL_KEY_SIZE, 135 .min_keysize = NULL_KEY_SIZE,
152 .max_keysize = NULL_KEY_SIZE, 136 .max_keysize = NULL_KEY_SIZE,
@@ -154,7 +138,16 @@ static struct crypto_alg skcipher_null = {
154 .setkey = null_setkey, 138 .setkey = null_setkey,
155 .encrypt = skcipher_null_crypt, 139 .encrypt = skcipher_null_crypt,
156 .decrypt = skcipher_null_crypt } } 140 .decrypt = skcipher_null_crypt } }
157}; 141}, {
142 .cra_name = "compress_null",
143 .cra_flags = CRYPTO_ALG_TYPE_COMPRESS,
144 .cra_blocksize = NULL_BLOCK_SIZE,
145 .cra_ctxsize = 0,
146 .cra_module = THIS_MODULE,
147 .cra_u = { .compress = {
148 .coa_compress = null_compress,
149 .coa_decompress = null_compress } }
150} };
158 151
159MODULE_ALIAS("compress_null"); 152MODULE_ALIAS("compress_null");
160MODULE_ALIAS("digest_null"); 153MODULE_ALIAS("digest_null");
@@ -164,40 +157,26 @@ static int __init crypto_null_mod_init(void)
164{ 157{
165 int ret = 0; 158 int ret = 0;
166 159
167 ret = crypto_register_alg(&cipher_null); 160 ret = crypto_register_algs(null_algs, ARRAY_SIZE(null_algs));
168 if (ret < 0) 161 if (ret < 0)
169 goto out; 162 goto out;
170 163
171 ret = crypto_register_alg(&skcipher_null);
172 if (ret < 0)
173 goto out_unregister_cipher;
174
175 ret = crypto_register_shash(&digest_null); 164 ret = crypto_register_shash(&digest_null);
176 if (ret < 0) 165 if (ret < 0)
177 goto out_unregister_skcipher; 166 goto out_unregister_algs;
178 167
179 ret = crypto_register_alg(&compress_null); 168 return 0;
180 if (ret < 0)
181 goto out_unregister_digest;
182 169
170out_unregister_algs:
171 crypto_unregister_algs(null_algs, ARRAY_SIZE(null_algs));
183out: 172out:
184 return ret; 173 return ret;
185
186out_unregister_digest:
187 crypto_unregister_shash(&digest_null);
188out_unregister_skcipher:
189 crypto_unregister_alg(&skcipher_null);
190out_unregister_cipher:
191 crypto_unregister_alg(&cipher_null);
192 goto out;
193} 174}
194 175
195static void __exit crypto_null_mod_fini(void) 176static void __exit crypto_null_mod_fini(void)
196{ 177{
197 crypto_unregister_alg(&compress_null);
198 crypto_unregister_shash(&digest_null); 178 crypto_unregister_shash(&digest_null);
199 crypto_unregister_alg(&skcipher_null); 179 crypto_unregister_algs(null_algs, ARRAY_SIZE(null_algs));
200 crypto_unregister_alg(&cipher_null);
201} 180}
202 181
203module_init(crypto_null_mod_init); 182module_init(crypto_null_mod_init);
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c
index ba2c611154af..35d700a97d79 100644
--- a/crypto/crypto_user.c
+++ b/crypto/crypto_user.c
@@ -30,7 +30,7 @@
30 30
31#include "internal.h" 31#include "internal.h"
32 32
33DEFINE_MUTEX(crypto_cfg_mutex); 33static DEFINE_MUTEX(crypto_cfg_mutex);
34 34
35/* The crypto netlink socket */ 35/* The crypto netlink socket */
36static struct sock *crypto_nlsk; 36static struct sock *crypto_nlsk;
@@ -166,7 +166,7 @@ static int crypto_report_alg(struct crypto_alg *alg,
166 struct crypto_user_alg *ualg; 166 struct crypto_user_alg *ualg;
167 int err = 0; 167 int err = 0;
168 168
169 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).pid, info->nlmsg_seq, 169 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, info->nlmsg_seq,
170 CRYPTO_MSG_GETALG, sizeof(*ualg), info->nlmsg_flags); 170 CRYPTO_MSG_GETALG, sizeof(*ualg), info->nlmsg_flags);
171 if (!nlh) { 171 if (!nlh) {
172 err = -EMSGSIZE; 172 err = -EMSGSIZE;
@@ -216,7 +216,7 @@ static int crypto_report(struct sk_buff *in_skb, struct nlmsghdr *in_nlh,
216 if (err) 216 if (err)
217 return err; 217 return err;
218 218
219 return nlmsg_unicast(crypto_nlsk, skb, NETLINK_CB(in_skb).pid); 219 return nlmsg_unicast(crypto_nlsk, skb, NETLINK_CB(in_skb).portid);
220} 220}
221 221
222static int crypto_dump_report(struct sk_buff *skb, struct netlink_callback *cb) 222static int crypto_dump_report(struct sk_buff *skb, struct netlink_callback *cb)
@@ -500,8 +500,7 @@ static int __init crypto_user_init(void)
500 .input = crypto_netlink_rcv, 500 .input = crypto_netlink_rcv,
501 }; 501 };
502 502
503 crypto_nlsk = netlink_kernel_create(&init_net, NETLINK_CRYPTO, 503 crypto_nlsk = netlink_kernel_create(&init_net, NETLINK_CRYPTO, &cfg);
504 THIS_MODULE, &cfg);
505 if (!crypto_nlsk) 504 if (!crypto_nlsk)
506 return -ENOMEM; 505 return -ENOMEM;
507 506
diff --git a/crypto/deflate.c b/crypto/deflate.c
index b0165ecad0c5..b57d70eb156b 100644
--- a/crypto/deflate.c
+++ b/crypto/deflate.c
@@ -199,7 +199,6 @@ static struct crypto_alg alg = {
199 .cra_flags = CRYPTO_ALG_TYPE_COMPRESS, 199 .cra_flags = CRYPTO_ALG_TYPE_COMPRESS,
200 .cra_ctxsize = sizeof(struct deflate_ctx), 200 .cra_ctxsize = sizeof(struct deflate_ctx),
201 .cra_module = THIS_MODULE, 201 .cra_module = THIS_MODULE,
202 .cra_list = LIST_HEAD_INIT(alg.cra_list),
203 .cra_init = deflate_init, 202 .cra_init = deflate_init,
204 .cra_exit = deflate_exit, 203 .cra_exit = deflate_exit,
205 .cra_u = { .compress = { 204 .cra_u = { .compress = {
diff --git a/crypto/des_generic.c b/crypto/des_generic.c
index 873818d48e86..f6cf63f88468 100644
--- a/crypto/des_generic.c
+++ b/crypto/des_generic.c
@@ -943,59 +943,44 @@ static void des3_ede_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
943 d[1] = cpu_to_le32(L); 943 d[1] = cpu_to_le32(L);
944} 944}
945 945
946static struct crypto_alg des_alg = { 946static struct crypto_alg des_algs[2] = { {
947 .cra_name = "des", 947 .cra_name = "des",
948 .cra_flags = CRYPTO_ALG_TYPE_CIPHER, 948 .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
949 .cra_blocksize = DES_BLOCK_SIZE, 949 .cra_blocksize = DES_BLOCK_SIZE,
950 .cra_ctxsize = sizeof(struct des_ctx), 950 .cra_ctxsize = sizeof(struct des_ctx),
951 .cra_module = THIS_MODULE, 951 .cra_module = THIS_MODULE,
952 .cra_alignmask = 3, 952 .cra_alignmask = 3,
953 .cra_list = LIST_HEAD_INIT(des_alg.cra_list),
954 .cra_u = { .cipher = { 953 .cra_u = { .cipher = {
955 .cia_min_keysize = DES_KEY_SIZE, 954 .cia_min_keysize = DES_KEY_SIZE,
956 .cia_max_keysize = DES_KEY_SIZE, 955 .cia_max_keysize = DES_KEY_SIZE,
957 .cia_setkey = des_setkey, 956 .cia_setkey = des_setkey,
958 .cia_encrypt = des_encrypt, 957 .cia_encrypt = des_encrypt,
959 .cia_decrypt = des_decrypt } } 958 .cia_decrypt = des_decrypt } }
960}; 959}, {
961
962static struct crypto_alg des3_ede_alg = {
963 .cra_name = "des3_ede", 960 .cra_name = "des3_ede",
964 .cra_flags = CRYPTO_ALG_TYPE_CIPHER, 961 .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
965 .cra_blocksize = DES3_EDE_BLOCK_SIZE, 962 .cra_blocksize = DES3_EDE_BLOCK_SIZE,
966 .cra_ctxsize = sizeof(struct des3_ede_ctx), 963 .cra_ctxsize = sizeof(struct des3_ede_ctx),
967 .cra_module = THIS_MODULE, 964 .cra_module = THIS_MODULE,
968 .cra_alignmask = 3, 965 .cra_alignmask = 3,
969 .cra_list = LIST_HEAD_INIT(des3_ede_alg.cra_list),
970 .cra_u = { .cipher = { 966 .cra_u = { .cipher = {
971 .cia_min_keysize = DES3_EDE_KEY_SIZE, 967 .cia_min_keysize = DES3_EDE_KEY_SIZE,
972 .cia_max_keysize = DES3_EDE_KEY_SIZE, 968 .cia_max_keysize = DES3_EDE_KEY_SIZE,
973 .cia_setkey = des3_ede_setkey, 969 .cia_setkey = des3_ede_setkey,
974 .cia_encrypt = des3_ede_encrypt, 970 .cia_encrypt = des3_ede_encrypt,
975 .cia_decrypt = des3_ede_decrypt } } 971 .cia_decrypt = des3_ede_decrypt } }
976}; 972} };
977 973
978MODULE_ALIAS("des3_ede"); 974MODULE_ALIAS("des3_ede");
979 975
980static int __init des_generic_mod_init(void) 976static int __init des_generic_mod_init(void)
981{ 977{
982 int ret = 0; 978 return crypto_register_algs(des_algs, ARRAY_SIZE(des_algs));
983
984 ret = crypto_register_alg(&des_alg);
985 if (ret < 0)
986 goto out;
987
988 ret = crypto_register_alg(&des3_ede_alg);
989 if (ret < 0)
990 crypto_unregister_alg(&des_alg);
991out:
992 return ret;
993} 979}
994 980
995static void __exit des_generic_mod_fini(void) 981static void __exit des_generic_mod_fini(void)
996{ 982{
997 crypto_unregister_alg(&des3_ede_alg); 983 crypto_unregister_algs(des_algs, ARRAY_SIZE(des_algs));
998 crypto_unregister_alg(&des_alg);
999} 984}
1000 985
1001module_init(des_generic_mod_init); 986module_init(des_generic_mod_init);
diff --git a/crypto/fcrypt.c b/crypto/fcrypt.c
index c33107e340b6..3b2cf569c684 100644
--- a/crypto/fcrypt.c
+++ b/crypto/fcrypt.c
@@ -396,7 +396,6 @@ static struct crypto_alg fcrypt_alg = {
396 .cra_ctxsize = sizeof(struct fcrypt_ctx), 396 .cra_ctxsize = sizeof(struct fcrypt_ctx),
397 .cra_module = THIS_MODULE, 397 .cra_module = THIS_MODULE,
398 .cra_alignmask = 3, 398 .cra_alignmask = 3,
399 .cra_list = LIST_HEAD_INIT(fcrypt_alg.cra_list),
400 .cra_u = { .cipher = { 399 .cra_u = { .cipher = {
401 .cia_min_keysize = 8, 400 .cia_min_keysize = 8,
402 .cia_max_keysize = 8, 401 .cia_max_keysize = 8,
diff --git a/crypto/ghash-generic.c b/crypto/ghash-generic.c
index 7835b8fc94db..9d3f0c69a86f 100644
--- a/crypto/ghash-generic.c
+++ b/crypto/ghash-generic.c
@@ -153,7 +153,6 @@ static struct shash_alg ghash_alg = {
153 .cra_blocksize = GHASH_BLOCK_SIZE, 153 .cra_blocksize = GHASH_BLOCK_SIZE,
154 .cra_ctxsize = sizeof(struct ghash_ctx), 154 .cra_ctxsize = sizeof(struct ghash_ctx),
155 .cra_module = THIS_MODULE, 155 .cra_module = THIS_MODULE,
156 .cra_list = LIST_HEAD_INIT(ghash_alg.base.cra_list),
157 .cra_exit = ghash_exit_tfm, 156 .cra_exit = ghash_exit_tfm,
158 }, 157 },
159}; 158};
diff --git a/crypto/khazad.c b/crypto/khazad.c
index 527e4e395fc3..60e7cd66facc 100644
--- a/crypto/khazad.c
+++ b/crypto/khazad.c
@@ -853,7 +853,6 @@ static struct crypto_alg khazad_alg = {
853 .cra_ctxsize = sizeof (struct khazad_ctx), 853 .cra_ctxsize = sizeof (struct khazad_ctx),
854 .cra_alignmask = 7, 854 .cra_alignmask = 7,
855 .cra_module = THIS_MODULE, 855 .cra_module = THIS_MODULE,
856 .cra_list = LIST_HEAD_INIT(khazad_alg.cra_list),
857 .cra_u = { .cipher = { 856 .cra_u = { .cipher = {
858 .cia_min_keysize = KHAZAD_KEY_SIZE, 857 .cia_min_keysize = KHAZAD_KEY_SIZE,
859 .cia_max_keysize = KHAZAD_KEY_SIZE, 858 .cia_max_keysize = KHAZAD_KEY_SIZE,
diff --git a/crypto/krng.c b/crypto/krng.c
index 4328bb3430ed..a2d2b72fc135 100644
--- a/crypto/krng.c
+++ b/crypto/krng.c
@@ -35,7 +35,6 @@ static struct crypto_alg krng_alg = {
35 .cra_ctxsize = 0, 35 .cra_ctxsize = 0,
36 .cra_type = &crypto_rng_type, 36 .cra_type = &crypto_rng_type,
37 .cra_module = THIS_MODULE, 37 .cra_module = THIS_MODULE,
38 .cra_list = LIST_HEAD_INIT(krng_alg.cra_list),
39 .cra_u = { 38 .cra_u = {
40 .rng = { 39 .rng = {
41 .rng_make_random = krng_get_random, 40 .rng_make_random = krng_get_random,
diff --git a/crypto/lzo.c b/crypto/lzo.c
index b5e77077d751..1c2aa69c54b8 100644
--- a/crypto/lzo.c
+++ b/crypto/lzo.c
@@ -81,7 +81,6 @@ static struct crypto_alg alg = {
81 .cra_flags = CRYPTO_ALG_TYPE_COMPRESS, 81 .cra_flags = CRYPTO_ALG_TYPE_COMPRESS,
82 .cra_ctxsize = sizeof(struct lzo_ctx), 82 .cra_ctxsize = sizeof(struct lzo_ctx),
83 .cra_module = THIS_MODULE, 83 .cra_module = THIS_MODULE,
84 .cra_list = LIST_HEAD_INIT(alg.cra_list),
85 .cra_init = lzo_init, 84 .cra_init = lzo_init,
86 .cra_exit = lzo_exit, 85 .cra_exit = lzo_exit,
87 .cra_u = { .compress = { 86 .cra_u = { .compress = {
diff --git a/crypto/salsa20_generic.c b/crypto/salsa20_generic.c
index eac10c11685c..9a4770c02284 100644
--- a/crypto/salsa20_generic.c
+++ b/crypto/salsa20_generic.c
@@ -221,7 +221,6 @@ static struct crypto_alg alg = {
221 .cra_ctxsize = sizeof(struct salsa20_ctx), 221 .cra_ctxsize = sizeof(struct salsa20_ctx),
222 .cra_alignmask = 3, 222 .cra_alignmask = 3,
223 .cra_module = THIS_MODULE, 223 .cra_module = THIS_MODULE,
224 .cra_list = LIST_HEAD_INIT(alg.cra_list),
225 .cra_u = { 224 .cra_u = {
226 .blkcipher = { 225 .blkcipher = {
227 .setkey = setkey, 226 .setkey = setkey,
diff --git a/crypto/seed.c b/crypto/seed.c
index d3e422f60556..9c904d6d2151 100644
--- a/crypto/seed.c
+++ b/crypto/seed.c
@@ -449,7 +449,6 @@ static struct crypto_alg seed_alg = {
449 .cra_ctxsize = sizeof(struct seed_ctx), 449 .cra_ctxsize = sizeof(struct seed_ctx),
450 .cra_alignmask = 3, 450 .cra_alignmask = 3,
451 .cra_module = THIS_MODULE, 451 .cra_module = THIS_MODULE,
452 .cra_list = LIST_HEAD_INIT(seed_alg.cra_list),
453 .cra_u = { 452 .cra_u = {
454 .cipher = { 453 .cipher = {
455 .cia_min_keysize = SEED_KEY_SIZE, 454 .cia_min_keysize = SEED_KEY_SIZE,
diff --git a/crypto/serpent_generic.c b/crypto/serpent_generic.c
index 8f32cf35e5ce..7ddbd7e88859 100644
--- a/crypto/serpent_generic.c
+++ b/crypto/serpent_generic.c
@@ -567,24 +567,6 @@ static void serpent_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
567 __serpent_decrypt(ctx, dst, src); 567 __serpent_decrypt(ctx, dst, src);
568} 568}
569 569
570static struct crypto_alg serpent_alg = {
571 .cra_name = "serpent",
572 .cra_driver_name = "serpent-generic",
573 .cra_priority = 100,
574 .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
575 .cra_blocksize = SERPENT_BLOCK_SIZE,
576 .cra_ctxsize = sizeof(struct serpent_ctx),
577 .cra_alignmask = 3,
578 .cra_module = THIS_MODULE,
579 .cra_list = LIST_HEAD_INIT(serpent_alg.cra_list),
580 .cra_u = { .cipher = {
581 .cia_min_keysize = SERPENT_MIN_KEY_SIZE,
582 .cia_max_keysize = SERPENT_MAX_KEY_SIZE,
583 .cia_setkey = serpent_setkey,
584 .cia_encrypt = serpent_encrypt,
585 .cia_decrypt = serpent_decrypt } }
586};
587
588static int tnepres_setkey(struct crypto_tfm *tfm, const u8 *key, 570static int tnepres_setkey(struct crypto_tfm *tfm, const u8 *key,
589 unsigned int keylen) 571 unsigned int keylen)
590{ 572{
@@ -637,41 +619,44 @@ static void tnepres_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
637 d[3] = swab32(rd[0]); 619 d[3] = swab32(rd[0]);
638} 620}
639 621
640static struct crypto_alg tnepres_alg = { 622static struct crypto_alg srp_algs[2] = { {
623 .cra_name = "serpent",
624 .cra_driver_name = "serpent-generic",
625 .cra_priority = 100,
626 .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
627 .cra_blocksize = SERPENT_BLOCK_SIZE,
628 .cra_ctxsize = sizeof(struct serpent_ctx),
629 .cra_alignmask = 3,
630 .cra_module = THIS_MODULE,
631 .cra_u = { .cipher = {
632 .cia_min_keysize = SERPENT_MIN_KEY_SIZE,
633 .cia_max_keysize = SERPENT_MAX_KEY_SIZE,
634 .cia_setkey = serpent_setkey,
635 .cia_encrypt = serpent_encrypt,
636 .cia_decrypt = serpent_decrypt } }
637}, {
641 .cra_name = "tnepres", 638 .cra_name = "tnepres",
642 .cra_flags = CRYPTO_ALG_TYPE_CIPHER, 639 .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
643 .cra_blocksize = SERPENT_BLOCK_SIZE, 640 .cra_blocksize = SERPENT_BLOCK_SIZE,
644 .cra_ctxsize = sizeof(struct serpent_ctx), 641 .cra_ctxsize = sizeof(struct serpent_ctx),
645 .cra_alignmask = 3, 642 .cra_alignmask = 3,
646 .cra_module = THIS_MODULE, 643 .cra_module = THIS_MODULE,
647 .cra_list = LIST_HEAD_INIT(serpent_alg.cra_list),
648 .cra_u = { .cipher = { 644 .cra_u = { .cipher = {
649 .cia_min_keysize = SERPENT_MIN_KEY_SIZE, 645 .cia_min_keysize = SERPENT_MIN_KEY_SIZE,
650 .cia_max_keysize = SERPENT_MAX_KEY_SIZE, 646 .cia_max_keysize = SERPENT_MAX_KEY_SIZE,
651 .cia_setkey = tnepres_setkey, 647 .cia_setkey = tnepres_setkey,
652 .cia_encrypt = tnepres_encrypt, 648 .cia_encrypt = tnepres_encrypt,
653 .cia_decrypt = tnepres_decrypt } } 649 .cia_decrypt = tnepres_decrypt } }
654}; 650} };
655 651
656static int __init serpent_mod_init(void) 652static int __init serpent_mod_init(void)
657{ 653{
658 int ret = crypto_register_alg(&serpent_alg); 654 return crypto_register_algs(srp_algs, ARRAY_SIZE(srp_algs));
659
660 if (ret)
661 return ret;
662
663 ret = crypto_register_alg(&tnepres_alg);
664
665 if (ret)
666 crypto_unregister_alg(&serpent_alg);
667
668 return ret;
669} 655}
670 656
671static void __exit serpent_mod_fini(void) 657static void __exit serpent_mod_fini(void)
672{ 658{
673 crypto_unregister_alg(&tnepres_alg); 659 crypto_unregister_algs(srp_algs, ARRAY_SIZE(srp_algs));
674 crypto_unregister_alg(&serpent_alg);
675} 660}
676 661
677module_init(serpent_mod_init); 662module_init(serpent_mod_init);
diff --git a/crypto/sha256_generic.c b/crypto/sha256_generic.c
index c48459ebf05b..c3ed4ec924e1 100644
--- a/crypto/sha256_generic.c
+++ b/crypto/sha256_generic.c
@@ -336,7 +336,7 @@ static int sha256_import(struct shash_desc *desc, const void *in)
336 return 0; 336 return 0;
337} 337}
338 338
339static struct shash_alg sha256 = { 339static struct shash_alg sha256_algs[2] = { {
340 .digestsize = SHA256_DIGEST_SIZE, 340 .digestsize = SHA256_DIGEST_SIZE,
341 .init = sha256_init, 341 .init = sha256_init,
342 .update = sha256_update, 342 .update = sha256_update,
@@ -352,9 +352,7 @@ static struct shash_alg sha256 = {
352 .cra_blocksize = SHA256_BLOCK_SIZE, 352 .cra_blocksize = SHA256_BLOCK_SIZE,
353 .cra_module = THIS_MODULE, 353 .cra_module = THIS_MODULE,
354 } 354 }
355}; 355}, {
356
357static struct shash_alg sha224 = {
358 .digestsize = SHA224_DIGEST_SIZE, 356 .digestsize = SHA224_DIGEST_SIZE,
359 .init = sha224_init, 357 .init = sha224_init,
360 .update = sha256_update, 358 .update = sha256_update,
@@ -367,29 +365,16 @@ static struct shash_alg sha224 = {
367 .cra_blocksize = SHA224_BLOCK_SIZE, 365 .cra_blocksize = SHA224_BLOCK_SIZE,
368 .cra_module = THIS_MODULE, 366 .cra_module = THIS_MODULE,
369 } 367 }
370}; 368} };
371 369
372static int __init sha256_generic_mod_init(void) 370static int __init sha256_generic_mod_init(void)
373{ 371{
374 int ret = 0; 372 return crypto_register_shashes(sha256_algs, ARRAY_SIZE(sha256_algs));
375
376 ret = crypto_register_shash(&sha224);
377
378 if (ret < 0)
379 return ret;
380
381 ret = crypto_register_shash(&sha256);
382
383 if (ret < 0)
384 crypto_unregister_shash(&sha224);
385
386 return ret;
387} 373}
388 374
389static void __exit sha256_generic_mod_fini(void) 375static void __exit sha256_generic_mod_fini(void)
390{ 376{
391 crypto_unregister_shash(&sha224); 377 crypto_unregister_shashes(sha256_algs, ARRAY_SIZE(sha256_algs));
392 crypto_unregister_shash(&sha256);
393} 378}
394 379
395module_init(sha256_generic_mod_init); 380module_init(sha256_generic_mod_init);
diff --git a/crypto/sha512_generic.c b/crypto/sha512_generic.c
index dd30f40af9f5..71fcf361102d 100644
--- a/crypto/sha512_generic.c
+++ b/crypto/sha512_generic.c
@@ -242,7 +242,7 @@ static int sha384_final(struct shash_desc *desc, u8 *hash)
242 return 0; 242 return 0;
243} 243}
244 244
245static struct shash_alg sha512 = { 245static struct shash_alg sha512_algs[2] = { {
246 .digestsize = SHA512_DIGEST_SIZE, 246 .digestsize = SHA512_DIGEST_SIZE,
247 .init = sha512_init, 247 .init = sha512_init,
248 .update = sha512_update, 248 .update = sha512_update,
@@ -254,9 +254,7 @@ static struct shash_alg sha512 = {
254 .cra_blocksize = SHA512_BLOCK_SIZE, 254 .cra_blocksize = SHA512_BLOCK_SIZE,
255 .cra_module = THIS_MODULE, 255 .cra_module = THIS_MODULE,
256 } 256 }
257}; 257}, {
258
259static struct shash_alg sha384 = {
260 .digestsize = SHA384_DIGEST_SIZE, 258 .digestsize = SHA384_DIGEST_SIZE,
261 .init = sha384_init, 259 .init = sha384_init,
262 .update = sha512_update, 260 .update = sha512_update,
@@ -268,24 +266,16 @@ static struct shash_alg sha384 = {
268 .cra_blocksize = SHA384_BLOCK_SIZE, 266 .cra_blocksize = SHA384_BLOCK_SIZE,
269 .cra_module = THIS_MODULE, 267 .cra_module = THIS_MODULE,
270 } 268 }
271}; 269} };
272 270
273static int __init sha512_generic_mod_init(void) 271static int __init sha512_generic_mod_init(void)
274{ 272{
275 int ret = 0; 273 return crypto_register_shashes(sha512_algs, ARRAY_SIZE(sha512_algs));
276
277 if ((ret = crypto_register_shash(&sha384)) < 0)
278 goto out;
279 if ((ret = crypto_register_shash(&sha512)) < 0)
280 crypto_unregister_shash(&sha384);
281out:
282 return ret;
283} 274}
284 275
285static void __exit sha512_generic_mod_fini(void) 276static void __exit sha512_generic_mod_fini(void)
286{ 277{
287 crypto_unregister_shash(&sha384); 278 crypto_unregister_shashes(sha512_algs, ARRAY_SIZE(sha512_algs));
288 crypto_unregister_shash(&sha512);
289} 279}
290 280
291module_init(sha512_generic_mod_init); 281module_init(sha512_generic_mod_init);
diff --git a/crypto/shash.c b/crypto/shash.c
index 32067f47e6c7..f426330f1017 100644
--- a/crypto/shash.c
+++ b/crypto/shash.c
@@ -629,6 +629,42 @@ int crypto_unregister_shash(struct shash_alg *alg)
629} 629}
630EXPORT_SYMBOL_GPL(crypto_unregister_shash); 630EXPORT_SYMBOL_GPL(crypto_unregister_shash);
631 631
632int crypto_register_shashes(struct shash_alg *algs, int count)
633{
634 int i, ret;
635
636 for (i = 0; i < count; i++) {
637 ret = crypto_register_shash(&algs[i]);
638 if (ret)
639 goto err;
640 }
641
642 return 0;
643
644err:
645 for (--i; i >= 0; --i)
646 crypto_unregister_shash(&algs[i]);
647
648 return ret;
649}
650EXPORT_SYMBOL_GPL(crypto_register_shashes);
651
652int crypto_unregister_shashes(struct shash_alg *algs, int count)
653{
654 int i, ret;
655
656 for (i = count - 1; i >= 0; --i) {
657 ret = crypto_unregister_shash(&algs[i]);
658 if (ret)
659 pr_err("Failed to unregister %s %s: %d\n",
660 algs[i].base.cra_driver_name,
661 algs[i].base.cra_name, ret);
662 }
663
664 return 0;
665}
666EXPORT_SYMBOL_GPL(crypto_unregister_shashes);
667
632int shash_register_instance(struct crypto_template *tmpl, 668int shash_register_instance(struct crypto_template *tmpl,
633 struct shash_instance *inst) 669 struct shash_instance *inst)
634{ 670{
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 5cf2ccb1540c..e87fa60f5831 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -97,7 +97,6 @@ static int test_cipher_cycles(struct blkcipher_desc *desc, int enc,
97 int ret = 0; 97 int ret = 0;
98 int i; 98 int i;
99 99
100 local_bh_disable();
101 local_irq_disable(); 100 local_irq_disable();
102 101
103 /* Warm-up run. */ 102 /* Warm-up run. */
@@ -130,7 +129,6 @@ static int test_cipher_cycles(struct blkcipher_desc *desc, int enc,
130 129
131out: 130out:
132 local_irq_enable(); 131 local_irq_enable();
133 local_bh_enable();
134 132
135 if (ret == 0) 133 if (ret == 0)
136 printk("1 operation in %lu cycles (%d bytes)\n", 134 printk("1 operation in %lu cycles (%d bytes)\n",
@@ -300,7 +298,6 @@ static int test_hash_cycles_digest(struct hash_desc *desc,
300 int i; 298 int i;
301 int ret; 299 int ret;
302 300
303 local_bh_disable();
304 local_irq_disable(); 301 local_irq_disable();
305 302
306 /* Warm-up run. */ 303 /* Warm-up run. */
@@ -327,7 +324,6 @@ static int test_hash_cycles_digest(struct hash_desc *desc,
327 324
328out: 325out:
329 local_irq_enable(); 326 local_irq_enable();
330 local_bh_enable();
331 327
332 if (ret) 328 if (ret)
333 return ret; 329 return ret;
@@ -348,7 +344,6 @@ static int test_hash_cycles(struct hash_desc *desc, struct scatterlist *sg,
348 if (plen == blen) 344 if (plen == blen)
349 return test_hash_cycles_digest(desc, sg, blen, out); 345 return test_hash_cycles_digest(desc, sg, blen, out);
350 346
351 local_bh_disable();
352 local_irq_disable(); 347 local_irq_disable();
353 348
354 /* Warm-up run. */ 349 /* Warm-up run. */
@@ -391,7 +386,6 @@ static int test_hash_cycles(struct hash_desc *desc, struct scatterlist *sg,
391 386
392out: 387out:
393 local_irq_enable(); 388 local_irq_enable();
394 local_bh_enable();
395 389
396 if (ret) 390 if (ret)
397 return ret; 391 return ret;
@@ -1037,10 +1031,16 @@ static int do_test(int m)
1037 1031
1038 case 14: 1032 case 14:
1039 ret += tcrypt_test("ecb(cast5)"); 1033 ret += tcrypt_test("ecb(cast5)");
1034 ret += tcrypt_test("cbc(cast5)");
1035 ret += tcrypt_test("ctr(cast5)");
1040 break; 1036 break;
1041 1037
1042 case 15: 1038 case 15:
1043 ret += tcrypt_test("ecb(cast6)"); 1039 ret += tcrypt_test("ecb(cast6)");
1040 ret += tcrypt_test("cbc(cast6)");
1041 ret += tcrypt_test("ctr(cast6)");
1042 ret += tcrypt_test("lrw(cast6)");
1043 ret += tcrypt_test("xts(cast6)");
1044 break; 1044 break;
1045 1045
1046 case 16: 1046 case 16:
@@ -1112,6 +1112,9 @@ static int do_test(int m)
1112 case 32: 1112 case 32:
1113 ret += tcrypt_test("ecb(camellia)"); 1113 ret += tcrypt_test("ecb(camellia)");
1114 ret += tcrypt_test("cbc(camellia)"); 1114 ret += tcrypt_test("cbc(camellia)");
1115 ret += tcrypt_test("ctr(camellia)");
1116 ret += tcrypt_test("lrw(camellia)");
1117 ret += tcrypt_test("xts(camellia)");
1115 break; 1118 break;
1116 case 33: 1119 case 33:
1117 ret += tcrypt_test("sha224"); 1120 ret += tcrypt_test("sha224");
@@ -1165,6 +1168,10 @@ static int do_test(int m)
1165 ret += tcrypt_test("rfc4309(ccm(aes))"); 1168 ret += tcrypt_test("rfc4309(ccm(aes))");
1166 break; 1169 break;
1167 1170
1171 case 46:
1172 ret += tcrypt_test("ghash");
1173 break;
1174
1168 case 100: 1175 case 100:
1169 ret += tcrypt_test("hmac(md5)"); 1176 ret += tcrypt_test("hmac(md5)");
1170 break; 1177 break;
@@ -1359,6 +1366,44 @@ static int do_test(int m)
1359 speed_template_8); 1366 speed_template_8);
1360 break; 1367 break;
1361 1368
1369 case 209:
1370 test_cipher_speed("ecb(cast5)", ENCRYPT, sec, NULL, 0,
1371 speed_template_8_16);
1372 test_cipher_speed("ecb(cast5)", DECRYPT, sec, NULL, 0,
1373 speed_template_8_16);
1374 test_cipher_speed("cbc(cast5)", ENCRYPT, sec, NULL, 0,
1375 speed_template_8_16);
1376 test_cipher_speed("cbc(cast5)", DECRYPT, sec, NULL, 0,
1377 speed_template_8_16);
1378 test_cipher_speed("ctr(cast5)", ENCRYPT, sec, NULL, 0,
1379 speed_template_8_16);
1380 test_cipher_speed("ctr(cast5)", DECRYPT, sec, NULL, 0,
1381 speed_template_8_16);
1382 break;
1383
1384 case 210:
1385 test_cipher_speed("ecb(cast6)", ENCRYPT, sec, NULL, 0,
1386 speed_template_16_32);
1387 test_cipher_speed("ecb(cast6)", DECRYPT, sec, NULL, 0,
1388 speed_template_16_32);
1389 test_cipher_speed("cbc(cast6)", ENCRYPT, sec, NULL, 0,
1390 speed_template_16_32);
1391 test_cipher_speed("cbc(cast6)", DECRYPT, sec, NULL, 0,
1392 speed_template_16_32);
1393 test_cipher_speed("ctr(cast6)", ENCRYPT, sec, NULL, 0,
1394 speed_template_16_32);
1395 test_cipher_speed("ctr(cast6)", DECRYPT, sec, NULL, 0,
1396 speed_template_16_32);
1397 test_cipher_speed("lrw(cast6)", ENCRYPT, sec, NULL, 0,
1398 speed_template_32_48);
1399 test_cipher_speed("lrw(cast6)", DECRYPT, sec, NULL, 0,
1400 speed_template_32_48);
1401 test_cipher_speed("xts(cast6)", ENCRYPT, sec, NULL, 0,
1402 speed_template_32_64);
1403 test_cipher_speed("xts(cast6)", DECRYPT, sec, NULL, 0,
1404 speed_template_32_64);
1405 break;
1406
1362 case 300: 1407 case 300:
1363 /* fall through */ 1408 /* fall through */
1364 1409
@@ -1639,6 +1684,44 @@ static int do_test(int m)
1639 speed_template_8); 1684 speed_template_8);
1640 break; 1685 break;
1641 1686
1687 case 506:
1688 test_acipher_speed("ecb(cast5)", ENCRYPT, sec, NULL, 0,
1689 speed_template_8_16);
1690 test_acipher_speed("ecb(cast5)", DECRYPT, sec, NULL, 0,
1691 speed_template_8_16);
1692 test_acipher_speed("cbc(cast5)", ENCRYPT, sec, NULL, 0,
1693 speed_template_8_16);
1694 test_acipher_speed("cbc(cast5)", DECRYPT, sec, NULL, 0,
1695 speed_template_8_16);
1696 test_acipher_speed("ctr(cast5)", ENCRYPT, sec, NULL, 0,
1697 speed_template_8_16);
1698 test_acipher_speed("ctr(cast5)", DECRYPT, sec, NULL, 0,
1699 speed_template_8_16);
1700 break;
1701
1702 case 507:
1703 test_acipher_speed("ecb(cast6)", ENCRYPT, sec, NULL, 0,
1704 speed_template_16_32);
1705 test_acipher_speed("ecb(cast6)", DECRYPT, sec, NULL, 0,
1706 speed_template_16_32);
1707 test_acipher_speed("cbc(cast6)", ENCRYPT, sec, NULL, 0,
1708 speed_template_16_32);
1709 test_acipher_speed("cbc(cast6)", DECRYPT, sec, NULL, 0,
1710 speed_template_16_32);
1711 test_acipher_speed("ctr(cast6)", ENCRYPT, sec, NULL, 0,
1712 speed_template_16_32);
1713 test_acipher_speed("ctr(cast6)", DECRYPT, sec, NULL, 0,
1714 speed_template_16_32);
1715 test_acipher_speed("lrw(cast6)", ENCRYPT, sec, NULL, 0,
1716 speed_template_32_48);
1717 test_acipher_speed("lrw(cast6)", DECRYPT, sec, NULL, 0,
1718 speed_template_32_48);
1719 test_acipher_speed("xts(cast6)", ENCRYPT, sec, NULL, 0,
1720 speed_template_32_64);
1721 test_acipher_speed("xts(cast6)", DECRYPT, sec, NULL, 0,
1722 speed_template_32_64);
1723 break;
1724
1642 case 1000: 1725 case 1000:
1643 test_available(); 1726 test_available();
1644 break; 1727 break;
diff --git a/crypto/tcrypt.h b/crypto/tcrypt.h
index 5be1fc8c1ab3..cd2068524f3f 100644
--- a/crypto/tcrypt.h
+++ b/crypto/tcrypt.h
@@ -47,6 +47,7 @@ static struct cipher_speed_template des3_speed_template[] = {
47 */ 47 */
48static u8 speed_template_8[] = {8, 0}; 48static u8 speed_template_8[] = {8, 0};
49static u8 speed_template_24[] = {24, 0}; 49static u8 speed_template_24[] = {24, 0};
50static u8 speed_template_8_16[] = {8, 16, 0};
50static u8 speed_template_8_32[] = {8, 32, 0}; 51static u8 speed_template_8_32[] = {8, 32, 0};
51static u8 speed_template_16_32[] = {16, 32, 0}; 52static u8 speed_template_16_32[] = {16, 32, 0};
52static u8 speed_template_16_24_32[] = {16, 24, 32, 0}; 53static u8 speed_template_16_24_32[] = {16, 24, 32, 0};
diff --git a/crypto/tea.c b/crypto/tea.c
index 412bc74f8179..0a572323ee4a 100644
--- a/crypto/tea.c
+++ b/crypto/tea.c
@@ -219,84 +219,55 @@ static void xeta_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
219 out[1] = cpu_to_le32(z); 219 out[1] = cpu_to_le32(z);
220} 220}
221 221
222static struct crypto_alg tea_alg = { 222static struct crypto_alg tea_algs[3] = { {
223 .cra_name = "tea", 223 .cra_name = "tea",
224 .cra_flags = CRYPTO_ALG_TYPE_CIPHER, 224 .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
225 .cra_blocksize = TEA_BLOCK_SIZE, 225 .cra_blocksize = TEA_BLOCK_SIZE,
226 .cra_ctxsize = sizeof (struct tea_ctx), 226 .cra_ctxsize = sizeof (struct tea_ctx),
227 .cra_alignmask = 3, 227 .cra_alignmask = 3,
228 .cra_module = THIS_MODULE, 228 .cra_module = THIS_MODULE,
229 .cra_list = LIST_HEAD_INIT(tea_alg.cra_list),
230 .cra_u = { .cipher = { 229 .cra_u = { .cipher = {
231 .cia_min_keysize = TEA_KEY_SIZE, 230 .cia_min_keysize = TEA_KEY_SIZE,
232 .cia_max_keysize = TEA_KEY_SIZE, 231 .cia_max_keysize = TEA_KEY_SIZE,
233 .cia_setkey = tea_setkey, 232 .cia_setkey = tea_setkey,
234 .cia_encrypt = tea_encrypt, 233 .cia_encrypt = tea_encrypt,
235 .cia_decrypt = tea_decrypt } } 234 .cia_decrypt = tea_decrypt } }
236}; 235}, {
237
238static struct crypto_alg xtea_alg = {
239 .cra_name = "xtea", 236 .cra_name = "xtea",
240 .cra_flags = CRYPTO_ALG_TYPE_CIPHER, 237 .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
241 .cra_blocksize = XTEA_BLOCK_SIZE, 238 .cra_blocksize = XTEA_BLOCK_SIZE,
242 .cra_ctxsize = sizeof (struct xtea_ctx), 239 .cra_ctxsize = sizeof (struct xtea_ctx),
243 .cra_alignmask = 3, 240 .cra_alignmask = 3,
244 .cra_module = THIS_MODULE, 241 .cra_module = THIS_MODULE,
245 .cra_list = LIST_HEAD_INIT(xtea_alg.cra_list),
246 .cra_u = { .cipher = { 242 .cra_u = { .cipher = {
247 .cia_min_keysize = XTEA_KEY_SIZE, 243 .cia_min_keysize = XTEA_KEY_SIZE,
248 .cia_max_keysize = XTEA_KEY_SIZE, 244 .cia_max_keysize = XTEA_KEY_SIZE,
249 .cia_setkey = xtea_setkey, 245 .cia_setkey = xtea_setkey,
250 .cia_encrypt = xtea_encrypt, 246 .cia_encrypt = xtea_encrypt,
251 .cia_decrypt = xtea_decrypt } } 247 .cia_decrypt = xtea_decrypt } }
252}; 248}, {
253
254static struct crypto_alg xeta_alg = {
255 .cra_name = "xeta", 249 .cra_name = "xeta",
256 .cra_flags = CRYPTO_ALG_TYPE_CIPHER, 250 .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
257 .cra_blocksize = XTEA_BLOCK_SIZE, 251 .cra_blocksize = XTEA_BLOCK_SIZE,
258 .cra_ctxsize = sizeof (struct xtea_ctx), 252 .cra_ctxsize = sizeof (struct xtea_ctx),
259 .cra_alignmask = 3, 253 .cra_alignmask = 3,
260 .cra_module = THIS_MODULE, 254 .cra_module = THIS_MODULE,
261 .cra_list = LIST_HEAD_INIT(xtea_alg.cra_list),
262 .cra_u = { .cipher = { 255 .cra_u = { .cipher = {
263 .cia_min_keysize = XTEA_KEY_SIZE, 256 .cia_min_keysize = XTEA_KEY_SIZE,
264 .cia_max_keysize = XTEA_KEY_SIZE, 257 .cia_max_keysize = XTEA_KEY_SIZE,
265 .cia_setkey = xtea_setkey, 258 .cia_setkey = xtea_setkey,
266 .cia_encrypt = xeta_encrypt, 259 .cia_encrypt = xeta_encrypt,
267 .cia_decrypt = xeta_decrypt } } 260 .cia_decrypt = xeta_decrypt } }
268}; 261} };
269 262
270static int __init tea_mod_init(void) 263static int __init tea_mod_init(void)
271{ 264{
272 int ret = 0; 265 return crypto_register_algs(tea_algs, ARRAY_SIZE(tea_algs));
273
274 ret = crypto_register_alg(&tea_alg);
275 if (ret < 0)
276 goto out;
277
278 ret = crypto_register_alg(&xtea_alg);
279 if (ret < 0) {
280 crypto_unregister_alg(&tea_alg);
281 goto out;
282 }
283
284 ret = crypto_register_alg(&xeta_alg);
285 if (ret < 0) {
286 crypto_unregister_alg(&tea_alg);
287 crypto_unregister_alg(&xtea_alg);
288 goto out;
289 }
290
291out:
292 return ret;
293} 266}
294 267
295static void __exit tea_mod_fini(void) 268static void __exit tea_mod_fini(void)
296{ 269{
297 crypto_unregister_alg(&tea_alg); 270 crypto_unregister_algs(tea_algs, ARRAY_SIZE(tea_algs));
298 crypto_unregister_alg(&xtea_alg);
299 crypto_unregister_alg(&xeta_alg);
300} 271}
301 272
302MODULE_ALIAS("xtea"); 273MODULE_ALIAS("xtea");
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index a2ca7431760a..941d75cd1f7c 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -358,8 +358,9 @@ out_nobuf:
358 return ret; 358 return ret;
359} 359}
360 360
361static int test_aead(struct crypto_aead *tfm, int enc, 361static int __test_aead(struct crypto_aead *tfm, int enc,
362 struct aead_testvec *template, unsigned int tcount) 362 struct aead_testvec *template, unsigned int tcount,
363 const bool diff_dst)
363{ 364{
364 const char *algo = crypto_tfm_alg_driver_name(crypto_aead_tfm(tfm)); 365 const char *algo = crypto_tfm_alg_driver_name(crypto_aead_tfm(tfm));
365 unsigned int i, j, k, n, temp; 366 unsigned int i, j, k, n, temp;
@@ -367,15 +368,18 @@ static int test_aead(struct crypto_aead *tfm, int enc,
367 char *q; 368 char *q;
368 char *key; 369 char *key;
369 struct aead_request *req; 370 struct aead_request *req;
370 struct scatterlist sg[8]; 371 struct scatterlist *sg;
371 struct scatterlist asg[8]; 372 struct scatterlist *asg;
372 const char *e; 373 struct scatterlist *sgout;
374 const char *e, *d;
373 struct tcrypt_result result; 375 struct tcrypt_result result;
374 unsigned int authsize; 376 unsigned int authsize;
375 void *input; 377 void *input;
378 void *output;
376 void *assoc; 379 void *assoc;
377 char iv[MAX_IVLEN]; 380 char iv[MAX_IVLEN];
378 char *xbuf[XBUFSIZE]; 381 char *xbuf[XBUFSIZE];
382 char *xoutbuf[XBUFSIZE];
379 char *axbuf[XBUFSIZE]; 383 char *axbuf[XBUFSIZE];
380 384
381 if (testmgr_alloc_buf(xbuf)) 385 if (testmgr_alloc_buf(xbuf))
@@ -383,6 +387,21 @@ static int test_aead(struct crypto_aead *tfm, int enc,
383 if (testmgr_alloc_buf(axbuf)) 387 if (testmgr_alloc_buf(axbuf))
384 goto out_noaxbuf; 388 goto out_noaxbuf;
385 389
390 if (diff_dst && testmgr_alloc_buf(xoutbuf))
391 goto out_nooutbuf;
392
393 /* avoid "the frame size is larger than 1024 bytes" compiler warning */
394 sg = kmalloc(sizeof(*sg) * 8 * (diff_dst ? 3 : 2), GFP_KERNEL);
395 if (!sg)
396 goto out_nosg;
397 asg = &sg[8];
398 sgout = &asg[8];
399
400 if (diff_dst)
401 d = "-ddst";
402 else
403 d = "";
404
386 if (enc == ENCRYPT) 405 if (enc == ENCRYPT)
387 e = "encryption"; 406 e = "encryption";
388 else 407 else
@@ -392,8 +411,8 @@ static int test_aead(struct crypto_aead *tfm, int enc,
392 411
393 req = aead_request_alloc(tfm, GFP_KERNEL); 412 req = aead_request_alloc(tfm, GFP_KERNEL);
394 if (!req) { 413 if (!req) {
395 printk(KERN_ERR "alg: aead: Failed to allocate request for " 414 pr_err("alg: aead%s: Failed to allocate request for %s\n",
396 "%s\n", algo); 415 d, algo);
397 goto out; 416 goto out;
398 } 417 }
399 418
@@ -432,9 +451,8 @@ static int test_aead(struct crypto_aead *tfm, int enc,
432 ret = crypto_aead_setkey(tfm, key, 451 ret = crypto_aead_setkey(tfm, key,
433 template[i].klen); 452 template[i].klen);
434 if (!ret == template[i].fail) { 453 if (!ret == template[i].fail) {
435 printk(KERN_ERR "alg: aead: setkey failed on " 454 pr_err("alg: aead%s: setkey failed on test %d for %s: flags=%x\n",
436 "test %d for %s: flags=%x\n", j, algo, 455 d, j, algo, crypto_aead_get_flags(tfm));
437 crypto_aead_get_flags(tfm));
438 goto out; 456 goto out;
439 } else if (ret) 457 } else if (ret)
440 continue; 458 continue;
@@ -442,18 +460,26 @@ static int test_aead(struct crypto_aead *tfm, int enc,
442 authsize = abs(template[i].rlen - template[i].ilen); 460 authsize = abs(template[i].rlen - template[i].ilen);
443 ret = crypto_aead_setauthsize(tfm, authsize); 461 ret = crypto_aead_setauthsize(tfm, authsize);
444 if (ret) { 462 if (ret) {
445 printk(KERN_ERR "alg: aead: Failed to set " 463 pr_err("alg: aead%s: Failed to set authsize to %u on test %d for %s\n",
446 "authsize to %u on test %d for %s\n", 464 d, authsize, j, algo);
447 authsize, j, algo);
448 goto out; 465 goto out;
449 } 466 }
450 467
451 sg_init_one(&sg[0], input, 468 sg_init_one(&sg[0], input,
452 template[i].ilen + (enc ? authsize : 0)); 469 template[i].ilen + (enc ? authsize : 0));
453 470
471 if (diff_dst) {
472 output = xoutbuf[0];
473 sg_init_one(&sgout[0], output,
474 template[i].ilen +
475 (enc ? authsize : 0));
476 } else {
477 output = input;
478 }
479
454 sg_init_one(&asg[0], assoc, template[i].alen); 480 sg_init_one(&asg[0], assoc, template[i].alen);
455 481
456 aead_request_set_crypt(req, sg, sg, 482 aead_request_set_crypt(req, sg, (diff_dst) ? sgout : sg,
457 template[i].ilen, iv); 483 template[i].ilen, iv);
458 484
459 aead_request_set_assoc(req, asg, template[i].alen); 485 aead_request_set_assoc(req, asg, template[i].alen);
@@ -466,10 +492,8 @@ static int test_aead(struct crypto_aead *tfm, int enc,
466 case 0: 492 case 0:
467 if (template[i].novrfy) { 493 if (template[i].novrfy) {
468 /* verification was supposed to fail */ 494 /* verification was supposed to fail */
469 printk(KERN_ERR "alg: aead: %s failed " 495 pr_err("alg: aead%s: %s failed on test %d for %s: ret was 0, expected -EBADMSG\n",
470 "on test %d for %s: ret was 0, " 496 d, e, j, algo);
471 "expected -EBADMSG\n",
472 e, j, algo);
473 /* so really, we got a bad message */ 497 /* so really, we got a bad message */
474 ret = -EBADMSG; 498 ret = -EBADMSG;
475 goto out; 499 goto out;
@@ -489,15 +513,15 @@ static int test_aead(struct crypto_aead *tfm, int enc,
489 continue; 513 continue;
490 /* fall through */ 514 /* fall through */
491 default: 515 default:
492 printk(KERN_ERR "alg: aead: %s failed on test " 516 pr_err("alg: aead%s: %s failed on test %d for %s: ret=%d\n",
493 "%d for %s: ret=%d\n", e, j, algo, -ret); 517 d, e, j, algo, -ret);
494 goto out; 518 goto out;
495 } 519 }
496 520
497 q = input; 521 q = output;
498 if (memcmp(q, template[i].result, template[i].rlen)) { 522 if (memcmp(q, template[i].result, template[i].rlen)) {
499 printk(KERN_ERR "alg: aead: Test %d failed on " 523 pr_err("alg: aead%s: Test %d failed on %s for %s\n",
500 "%s for %s\n", j, e, algo); 524 d, j, e, algo);
501 hexdump(q, template[i].rlen); 525 hexdump(q, template[i].rlen);
502 ret = -EINVAL; 526 ret = -EINVAL;
503 goto out; 527 goto out;
@@ -522,9 +546,8 @@ static int test_aead(struct crypto_aead *tfm, int enc,
522 546
523 ret = crypto_aead_setkey(tfm, key, template[i].klen); 547 ret = crypto_aead_setkey(tfm, key, template[i].klen);
524 if (!ret == template[i].fail) { 548 if (!ret == template[i].fail) {
525 printk(KERN_ERR "alg: aead: setkey failed on " 549 pr_err("alg: aead%s: setkey failed on chunk test %d for %s: flags=%x\n",
526 "chunk test %d for %s: flags=%x\n", j, 550 d, j, algo, crypto_aead_get_flags(tfm));
527 algo, crypto_aead_get_flags(tfm));
528 goto out; 551 goto out;
529 } else if (ret) 552 } else if (ret)
530 continue; 553 continue;
@@ -533,6 +556,8 @@ static int test_aead(struct crypto_aead *tfm, int enc,
533 556
534 ret = -EINVAL; 557 ret = -EINVAL;
535 sg_init_table(sg, template[i].np); 558 sg_init_table(sg, template[i].np);
559 if (diff_dst)
560 sg_init_table(sgout, template[i].np);
536 for (k = 0, temp = 0; k < template[i].np; k++) { 561 for (k = 0, temp = 0; k < template[i].np; k++) {
537 if (WARN_ON(offset_in_page(IDX[k]) + 562 if (WARN_ON(offset_in_page(IDX[k]) +
538 template[i].tap[k] > PAGE_SIZE)) 563 template[i].tap[k] > PAGE_SIZE))
@@ -551,14 +576,26 @@ static int test_aead(struct crypto_aead *tfm, int enc,
551 q[n] = 0; 576 q[n] = 0;
552 577
553 sg_set_buf(&sg[k], q, template[i].tap[k]); 578 sg_set_buf(&sg[k], q, template[i].tap[k]);
579
580 if (diff_dst) {
581 q = xoutbuf[IDX[k] >> PAGE_SHIFT] +
582 offset_in_page(IDX[k]);
583
584 memset(q, 0, template[i].tap[k]);
585 if (offset_in_page(q) + n < PAGE_SIZE)
586 q[n] = 0;
587
588 sg_set_buf(&sgout[k], q,
589 template[i].tap[k]);
590 }
591
554 temp += template[i].tap[k]; 592 temp += template[i].tap[k];
555 } 593 }
556 594
557 ret = crypto_aead_setauthsize(tfm, authsize); 595 ret = crypto_aead_setauthsize(tfm, authsize);
558 if (ret) { 596 if (ret) {
559 printk(KERN_ERR "alg: aead: Failed to set " 597 pr_err("alg: aead%s: Failed to set authsize to %u on chunk test %d for %s\n",
560 "authsize to %u on chunk test %d for " 598 d, authsize, j, algo);
561 "%s\n", authsize, j, algo);
562 goto out; 599 goto out;
563 } 600 }
564 601
@@ -571,6 +608,9 @@ static int test_aead(struct crypto_aead *tfm, int enc,
571 } 608 }
572 609
573 sg[k - 1].length += authsize; 610 sg[k - 1].length += authsize;
611
612 if (diff_dst)
613 sgout[k - 1].length += authsize;
574 } 614 }
575 615
576 sg_init_table(asg, template[i].anp); 616 sg_init_table(asg, template[i].anp);
@@ -588,7 +628,7 @@ static int test_aead(struct crypto_aead *tfm, int enc,
588 temp += template[i].atap[k]; 628 temp += template[i].atap[k];
589 } 629 }
590 630
591 aead_request_set_crypt(req, sg, sg, 631 aead_request_set_crypt(req, sg, (diff_dst) ? sgout : sg,
592 template[i].ilen, 632 template[i].ilen,
593 iv); 633 iv);
594 634
@@ -602,10 +642,8 @@ static int test_aead(struct crypto_aead *tfm, int enc,
602 case 0: 642 case 0:
603 if (template[i].novrfy) { 643 if (template[i].novrfy) {
604 /* verification was supposed to fail */ 644 /* verification was supposed to fail */
605 printk(KERN_ERR "alg: aead: %s failed " 645 pr_err("alg: aead%s: %s failed on chunk test %d for %s: ret was 0, expected -EBADMSG\n",
606 "on chunk test %d for %s: ret " 646 d, e, j, algo);
607 "was 0, expected -EBADMSG\n",
608 e, j, algo);
609 /* so really, we got a bad message */ 647 /* so really, we got a bad message */
610 ret = -EBADMSG; 648 ret = -EBADMSG;
611 goto out; 649 goto out;
@@ -625,32 +663,35 @@ static int test_aead(struct crypto_aead *tfm, int enc,
625 continue; 663 continue;
626 /* fall through */ 664 /* fall through */
627 default: 665 default:
628 printk(KERN_ERR "alg: aead: %s failed on " 666 pr_err("alg: aead%s: %s failed on chunk test %d for %s: ret=%d\n",
629 "chunk test %d for %s: ret=%d\n", e, j, 667 d, e, j, algo, -ret);
630 algo, -ret);
631 goto out; 668 goto out;
632 } 669 }
633 670
634 ret = -EINVAL; 671 ret = -EINVAL;
635 for (k = 0, temp = 0; k < template[i].np; k++) { 672 for (k = 0, temp = 0; k < template[i].np; k++) {
636 q = xbuf[IDX[k] >> PAGE_SHIFT] + 673 if (diff_dst)
637 offset_in_page(IDX[k]); 674 q = xoutbuf[IDX[k] >> PAGE_SHIFT] +
675 offset_in_page(IDX[k]);
676 else
677 q = xbuf[IDX[k] >> PAGE_SHIFT] +
678 offset_in_page(IDX[k]);
638 679
639 n = template[i].tap[k]; 680 n = template[i].tap[k];
640 if (k == template[i].np - 1) 681 if (k == template[i].np - 1)
641 n += enc ? authsize : -authsize; 682 n += enc ? authsize : -authsize;
642 683
643 if (memcmp(q, template[i].result + temp, n)) { 684 if (memcmp(q, template[i].result + temp, n)) {
644 printk(KERN_ERR "alg: aead: Chunk " 685 pr_err("alg: aead%s: Chunk test %d failed on %s at page %u for %s\n",
645 "test %d failed on %s at page " 686 d, j, e, k, algo);
646 "%u for %s\n", j, e, k, algo);
647 hexdump(q, n); 687 hexdump(q, n);
648 goto out; 688 goto out;
649 } 689 }
650 690
651 q += n; 691 q += n;
652 if (k == template[i].np - 1 && !enc) { 692 if (k == template[i].np - 1 && !enc) {
653 if (memcmp(q, template[i].input + 693 if (!diff_dst &&
694 memcmp(q, template[i].input +
654 temp + n, authsize)) 695 temp + n, authsize))
655 n = authsize; 696 n = authsize;
656 else 697 else
@@ -661,11 +702,8 @@ static int test_aead(struct crypto_aead *tfm, int enc,
661 ; 702 ;
662 } 703 }
663 if (n) { 704 if (n) {
664 printk(KERN_ERR "alg: aead: Result " 705 pr_err("alg: aead%s: Result buffer corruption in chunk test %d on %s at page %u for %s: %u bytes:\n",
665 "buffer corruption in chunk " 706 d, j, e, k, algo, n);
666 "test %d on %s at page %u for "
667 "%s: %u bytes:\n", j, e, k,
668 algo, n);
669 hexdump(q, n); 707 hexdump(q, n);
670 goto out; 708 goto out;
671 } 709 }
@@ -679,6 +717,11 @@ static int test_aead(struct crypto_aead *tfm, int enc,
679 717
680out: 718out:
681 aead_request_free(req); 719 aead_request_free(req);
720 kfree(sg);
721out_nosg:
722 if (diff_dst)
723 testmgr_free_buf(xoutbuf);
724out_nooutbuf:
682 testmgr_free_buf(axbuf); 725 testmgr_free_buf(axbuf);
683out_noaxbuf: 726out_noaxbuf:
684 testmgr_free_buf(xbuf); 727 testmgr_free_buf(xbuf);
@@ -686,6 +729,20 @@ out_noxbuf:
686 return ret; 729 return ret;
687} 730}
688 731
732static int test_aead(struct crypto_aead *tfm, int enc,
733 struct aead_testvec *template, unsigned int tcount)
734{
735 int ret;
736
737 /* test 'dst == src' case */
738 ret = __test_aead(tfm, enc, template, tcount, false);
739 if (ret)
740 return ret;
741
742 /* test 'dst != src' case */
743 return __test_aead(tfm, enc, template, tcount, true);
744}
745
689static int test_cipher(struct crypto_cipher *tfm, int enc, 746static int test_cipher(struct crypto_cipher *tfm, int enc,
690 struct cipher_testvec *template, unsigned int tcount) 747 struct cipher_testvec *template, unsigned int tcount)
691{ 748{
@@ -761,8 +818,9 @@ out_nobuf:
761 return ret; 818 return ret;
762} 819}
763 820
764static int test_skcipher(struct crypto_ablkcipher *tfm, int enc, 821static int __test_skcipher(struct crypto_ablkcipher *tfm, int enc,
765 struct cipher_testvec *template, unsigned int tcount) 822 struct cipher_testvec *template, unsigned int tcount,
823 const bool diff_dst)
766{ 824{
767 const char *algo = 825 const char *algo =
768 crypto_tfm_alg_driver_name(crypto_ablkcipher_tfm(tfm)); 826 crypto_tfm_alg_driver_name(crypto_ablkcipher_tfm(tfm));
@@ -770,16 +828,26 @@ static int test_skcipher(struct crypto_ablkcipher *tfm, int enc,
770 char *q; 828 char *q;
771 struct ablkcipher_request *req; 829 struct ablkcipher_request *req;
772 struct scatterlist sg[8]; 830 struct scatterlist sg[8];
773 const char *e; 831 struct scatterlist sgout[8];
832 const char *e, *d;
774 struct tcrypt_result result; 833 struct tcrypt_result result;
775 void *data; 834 void *data;
776 char iv[MAX_IVLEN]; 835 char iv[MAX_IVLEN];
777 char *xbuf[XBUFSIZE]; 836 char *xbuf[XBUFSIZE];
837 char *xoutbuf[XBUFSIZE];
778 int ret = -ENOMEM; 838 int ret = -ENOMEM;
779 839
780 if (testmgr_alloc_buf(xbuf)) 840 if (testmgr_alloc_buf(xbuf))
781 goto out_nobuf; 841 goto out_nobuf;
782 842
843 if (diff_dst && testmgr_alloc_buf(xoutbuf))
844 goto out_nooutbuf;
845
846 if (diff_dst)
847 d = "-ddst";
848 else
849 d = "";
850
783 if (enc == ENCRYPT) 851 if (enc == ENCRYPT)
784 e = "encryption"; 852 e = "encryption";
785 else 853 else
@@ -789,8 +857,8 @@ static int test_skcipher(struct crypto_ablkcipher *tfm, int enc,
789 857
790 req = ablkcipher_request_alloc(tfm, GFP_KERNEL); 858 req = ablkcipher_request_alloc(tfm, GFP_KERNEL);
791 if (!req) { 859 if (!req) {
792 printk(KERN_ERR "alg: skcipher: Failed to allocate request " 860 pr_err("alg: skcipher%s: Failed to allocate request for %s\n",
793 "for %s\n", algo); 861 d, algo);
794 goto out; 862 goto out;
795 } 863 }
796 864
@@ -804,7 +872,7 @@ static int test_skcipher(struct crypto_ablkcipher *tfm, int enc,
804 else 872 else
805 memset(iv, 0, MAX_IVLEN); 873 memset(iv, 0, MAX_IVLEN);
806 874
807 if (!(template[i].np)) { 875 if (!(template[i].np) || (template[i].also_non_np)) {
808 j++; 876 j++;
809 877
810 ret = -EINVAL; 878 ret = -EINVAL;
@@ -822,16 +890,21 @@ static int test_skcipher(struct crypto_ablkcipher *tfm, int enc,
822 ret = crypto_ablkcipher_setkey(tfm, template[i].key, 890 ret = crypto_ablkcipher_setkey(tfm, template[i].key,
823 template[i].klen); 891 template[i].klen);
824 if (!ret == template[i].fail) { 892 if (!ret == template[i].fail) {
825 printk(KERN_ERR "alg: skcipher: setkey failed " 893 pr_err("alg: skcipher%s: setkey failed on test %d for %s: flags=%x\n",
826 "on test %d for %s: flags=%x\n", j, 894 d, j, algo,
827 algo, crypto_ablkcipher_get_flags(tfm)); 895 crypto_ablkcipher_get_flags(tfm));
828 goto out; 896 goto out;
829 } else if (ret) 897 } else if (ret)
830 continue; 898 continue;
831 899
832 sg_init_one(&sg[0], data, template[i].ilen); 900 sg_init_one(&sg[0], data, template[i].ilen);
901 if (diff_dst) {
902 data = xoutbuf[0];
903 sg_init_one(&sgout[0], data, template[i].ilen);
904 }
833 905
834 ablkcipher_request_set_crypt(req, sg, sg, 906 ablkcipher_request_set_crypt(req, sg,
907 (diff_dst) ? sgout : sg,
835 template[i].ilen, iv); 908 template[i].ilen, iv);
836 ret = enc ? 909 ret = enc ?
837 crypto_ablkcipher_encrypt(req) : 910 crypto_ablkcipher_encrypt(req) :
@@ -850,16 +923,15 @@ static int test_skcipher(struct crypto_ablkcipher *tfm, int enc,
850 } 923 }
851 /* fall through */ 924 /* fall through */
852 default: 925 default:
853 printk(KERN_ERR "alg: skcipher: %s failed on " 926 pr_err("alg: skcipher%s: %s failed on test %d for %s: ret=%d\n",
854 "test %d for %s: ret=%d\n", e, j, algo, 927 d, e, j, algo, -ret);
855 -ret);
856 goto out; 928 goto out;
857 } 929 }
858 930
859 q = data; 931 q = data;
860 if (memcmp(q, template[i].result, template[i].rlen)) { 932 if (memcmp(q, template[i].result, template[i].rlen)) {
861 printk(KERN_ERR "alg: skcipher: Test %d " 933 pr_err("alg: skcipher%s: Test %d failed on %s for %s\n",
862 "failed on %s for %s\n", j, e, algo); 934 d, j, e, algo);
863 hexdump(q, template[i].rlen); 935 hexdump(q, template[i].rlen);
864 ret = -EINVAL; 936 ret = -EINVAL;
865 goto out; 937 goto out;
@@ -886,9 +958,8 @@ static int test_skcipher(struct crypto_ablkcipher *tfm, int enc,
886 ret = crypto_ablkcipher_setkey(tfm, template[i].key, 958 ret = crypto_ablkcipher_setkey(tfm, template[i].key,
887 template[i].klen); 959 template[i].klen);
888 if (!ret == template[i].fail) { 960 if (!ret == template[i].fail) {
889 printk(KERN_ERR "alg: skcipher: setkey failed " 961 pr_err("alg: skcipher%s: setkey failed on chunk test %d for %s: flags=%x\n",
890 "on chunk test %d for %s: flags=%x\n", 962 d, j, algo,
891 j, algo,
892 crypto_ablkcipher_get_flags(tfm)); 963 crypto_ablkcipher_get_flags(tfm));
893 goto out; 964 goto out;
894 } else if (ret) 965 } else if (ret)
@@ -897,6 +968,8 @@ static int test_skcipher(struct crypto_ablkcipher *tfm, int enc,
897 temp = 0; 968 temp = 0;
898 ret = -EINVAL; 969 ret = -EINVAL;
899 sg_init_table(sg, template[i].np); 970 sg_init_table(sg, template[i].np);
971 if (diff_dst)
972 sg_init_table(sgout, template[i].np);
900 for (k = 0; k < template[i].np; k++) { 973 for (k = 0; k < template[i].np; k++) {
901 if (WARN_ON(offset_in_page(IDX[k]) + 974 if (WARN_ON(offset_in_page(IDX[k]) +
902 template[i].tap[k] > PAGE_SIZE)) 975 template[i].tap[k] > PAGE_SIZE))
@@ -913,11 +986,24 @@ static int test_skcipher(struct crypto_ablkcipher *tfm, int enc,
913 q[template[i].tap[k]] = 0; 986 q[template[i].tap[k]] = 0;
914 987
915 sg_set_buf(&sg[k], q, template[i].tap[k]); 988 sg_set_buf(&sg[k], q, template[i].tap[k]);
989 if (diff_dst) {
990 q = xoutbuf[IDX[k] >> PAGE_SHIFT] +
991 offset_in_page(IDX[k]);
992
993 sg_set_buf(&sgout[k], q,
994 template[i].tap[k]);
995
996 memset(q, 0, template[i].tap[k]);
997 if (offset_in_page(q) +
998 template[i].tap[k] < PAGE_SIZE)
999 q[template[i].tap[k]] = 0;
1000 }
916 1001
917 temp += template[i].tap[k]; 1002 temp += template[i].tap[k];
918 } 1003 }
919 1004
920 ablkcipher_request_set_crypt(req, sg, sg, 1005 ablkcipher_request_set_crypt(req, sg,
1006 (diff_dst) ? sgout : sg,
921 template[i].ilen, iv); 1007 template[i].ilen, iv);
922 1008
923 ret = enc ? 1009 ret = enc ?
@@ -937,23 +1023,25 @@ static int test_skcipher(struct crypto_ablkcipher *tfm, int enc,
937 } 1023 }
938 /* fall through */ 1024 /* fall through */
939 default: 1025 default:
940 printk(KERN_ERR "alg: skcipher: %s failed on " 1026 pr_err("alg: skcipher%s: %s failed on chunk test %d for %s: ret=%d\n",
941 "chunk test %d for %s: ret=%d\n", e, j, 1027 d, e, j, algo, -ret);
942 algo, -ret);
943 goto out; 1028 goto out;
944 } 1029 }
945 1030
946 temp = 0; 1031 temp = 0;
947 ret = -EINVAL; 1032 ret = -EINVAL;
948 for (k = 0; k < template[i].np; k++) { 1033 for (k = 0; k < template[i].np; k++) {
949 q = xbuf[IDX[k] >> PAGE_SHIFT] + 1034 if (diff_dst)
950 offset_in_page(IDX[k]); 1035 q = xoutbuf[IDX[k] >> PAGE_SHIFT] +
1036 offset_in_page(IDX[k]);
1037 else
1038 q = xbuf[IDX[k] >> PAGE_SHIFT] +
1039 offset_in_page(IDX[k]);
951 1040
952 if (memcmp(q, template[i].result + temp, 1041 if (memcmp(q, template[i].result + temp,
953 template[i].tap[k])) { 1042 template[i].tap[k])) {
954 printk(KERN_ERR "alg: skcipher: Chunk " 1043 pr_err("alg: skcipher%s: Chunk test %d failed on %s at page %u for %s\n",
955 "test %d failed on %s at page " 1044 d, j, e, k, algo);
956 "%u for %s\n", j, e, k, algo);
957 hexdump(q, template[i].tap[k]); 1045 hexdump(q, template[i].tap[k]);
958 goto out; 1046 goto out;
959 } 1047 }
@@ -962,11 +1050,8 @@ static int test_skcipher(struct crypto_ablkcipher *tfm, int enc,
962 for (n = 0; offset_in_page(q + n) && q[n]; n++) 1050 for (n = 0; offset_in_page(q + n) && q[n]; n++)
963 ; 1051 ;
964 if (n) { 1052 if (n) {
965 printk(KERN_ERR "alg: skcipher: " 1053 pr_err("alg: skcipher%s: Result buffer corruption in chunk test %d on %s at page %u for %s: %u bytes:\n",
966 "Result buffer corruption in " 1054 d, j, e, k, algo, n);
967 "chunk test %d on %s at page "
968 "%u for %s: %u bytes:\n", j, e,
969 k, algo, n);
970 hexdump(q, n); 1055 hexdump(q, n);
971 goto out; 1056 goto out;
972 } 1057 }
@@ -979,11 +1064,28 @@ static int test_skcipher(struct crypto_ablkcipher *tfm, int enc,
979 1064
980out: 1065out:
981 ablkcipher_request_free(req); 1066 ablkcipher_request_free(req);
1067 if (diff_dst)
1068 testmgr_free_buf(xoutbuf);
1069out_nooutbuf:
982 testmgr_free_buf(xbuf); 1070 testmgr_free_buf(xbuf);
983out_nobuf: 1071out_nobuf:
984 return ret; 1072 return ret;
985} 1073}
986 1074
1075static int test_skcipher(struct crypto_ablkcipher *tfm, int enc,
1076 struct cipher_testvec *template, unsigned int tcount)
1077{
1078 int ret;
1079
1080 /* test 'dst == src' case */
1081 ret = __test_skcipher(tfm, enc, template, tcount, false);
1082 if (ret)
1083 return ret;
1084
1085 /* test 'dst != src' case */
1086 return __test_skcipher(tfm, enc, template, tcount, true);
1087}
1088
987static int test_comp(struct crypto_comp *tfm, struct comp_testvec *ctemplate, 1089static int test_comp(struct crypto_comp *tfm, struct comp_testvec *ctemplate,
988 struct comp_testvec *dtemplate, int ctcount, int dtcount) 1090 struct comp_testvec *dtemplate, int ctcount, int dtcount)
989{ 1091{
@@ -1534,6 +1636,36 @@ static int alg_test_null(const struct alg_test_desc *desc,
1534/* Please keep this list sorted by algorithm name. */ 1636/* Please keep this list sorted by algorithm name. */
1535static const struct alg_test_desc alg_test_descs[] = { 1637static const struct alg_test_desc alg_test_descs[] = {
1536 { 1638 {
1639 .alg = "__cbc-cast5-avx",
1640 .test = alg_test_null,
1641 .suite = {
1642 .cipher = {
1643 .enc = {
1644 .vecs = NULL,
1645 .count = 0
1646 },
1647 .dec = {
1648 .vecs = NULL,
1649 .count = 0
1650 }
1651 }
1652 }
1653 }, {
1654 .alg = "__cbc-cast6-avx",
1655 .test = alg_test_null,
1656 .suite = {
1657 .cipher = {
1658 .enc = {
1659 .vecs = NULL,
1660 .count = 0
1661 },
1662 .dec = {
1663 .vecs = NULL,
1664 .count = 0
1665 }
1666 }
1667 }
1668 }, {
1537 .alg = "__cbc-serpent-avx", 1669 .alg = "__cbc-serpent-avx",
1538 .test = alg_test_null, 1670 .test = alg_test_null,
1539 .suite = { 1671 .suite = {
@@ -1595,6 +1727,36 @@ static const struct alg_test_desc alg_test_descs[] = {
1595 } 1727 }
1596 } 1728 }
1597 }, { 1729 }, {
1730 .alg = "__driver-cbc-cast5-avx",
1731 .test = alg_test_null,
1732 .suite = {
1733 .cipher = {
1734 .enc = {
1735 .vecs = NULL,
1736 .count = 0
1737 },
1738 .dec = {
1739 .vecs = NULL,
1740 .count = 0
1741 }
1742 }
1743 }
1744 }, {
1745 .alg = "__driver-cbc-cast6-avx",
1746 .test = alg_test_null,
1747 .suite = {
1748 .cipher = {
1749 .enc = {
1750 .vecs = NULL,
1751 .count = 0
1752 },
1753 .dec = {
1754 .vecs = NULL,
1755 .count = 0
1756 }
1757 }
1758 }
1759 }, {
1598 .alg = "__driver-cbc-serpent-avx", 1760 .alg = "__driver-cbc-serpent-avx",
1599 .test = alg_test_null, 1761 .test = alg_test_null,
1600 .suite = { 1762 .suite = {
@@ -1656,6 +1818,36 @@ static const struct alg_test_desc alg_test_descs[] = {
1656 } 1818 }
1657 } 1819 }
1658 }, { 1820 }, {
1821 .alg = "__driver-ecb-cast5-avx",
1822 .test = alg_test_null,
1823 .suite = {
1824 .cipher = {
1825 .enc = {
1826 .vecs = NULL,
1827 .count = 0
1828 },
1829 .dec = {
1830 .vecs = NULL,
1831 .count = 0
1832 }
1833 }
1834 }
1835 }, {
1836 .alg = "__driver-ecb-cast6-avx",
1837 .test = alg_test_null,
1838 .suite = {
1839 .cipher = {
1840 .enc = {
1841 .vecs = NULL,
1842 .count = 0
1843 },
1844 .dec = {
1845 .vecs = NULL,
1846 .count = 0
1847 }
1848 }
1849 }
1850 }, {
1659 .alg = "__driver-ecb-serpent-avx", 1851 .alg = "__driver-ecb-serpent-avx",
1660 .test = alg_test_null, 1852 .test = alg_test_null,
1661 .suite = { 1853 .suite = {
@@ -1818,6 +2010,36 @@ static const struct alg_test_desc alg_test_descs[] = {
1818 } 2010 }
1819 } 2011 }
1820 }, { 2012 }, {
2013 .alg = "cbc(cast5)",
2014 .test = alg_test_skcipher,
2015 .suite = {
2016 .cipher = {
2017 .enc = {
2018 .vecs = cast5_cbc_enc_tv_template,
2019 .count = CAST5_CBC_ENC_TEST_VECTORS
2020 },
2021 .dec = {
2022 .vecs = cast5_cbc_dec_tv_template,
2023 .count = CAST5_CBC_DEC_TEST_VECTORS
2024 }
2025 }
2026 }
2027 }, {
2028 .alg = "cbc(cast6)",
2029 .test = alg_test_skcipher,
2030 .suite = {
2031 .cipher = {
2032 .enc = {
2033 .vecs = cast6_cbc_enc_tv_template,
2034 .count = CAST6_CBC_ENC_TEST_VECTORS
2035 },
2036 .dec = {
2037 .vecs = cast6_cbc_dec_tv_template,
2038 .count = CAST6_CBC_DEC_TEST_VECTORS
2039 }
2040 }
2041 }
2042 }, {
1821 .alg = "cbc(des)", 2043 .alg = "cbc(des)",
1822 .test = alg_test_skcipher, 2044 .test = alg_test_skcipher,
1823 .suite = { 2045 .suite = {
@@ -1937,6 +2159,36 @@ static const struct alg_test_desc alg_test_descs[] = {
1937 } 2159 }
1938 } 2160 }
1939 }, { 2161 }, {
2162 .alg = "cryptd(__driver-ecb-cast5-avx)",
2163 .test = alg_test_null,
2164 .suite = {
2165 .cipher = {
2166 .enc = {
2167 .vecs = NULL,
2168 .count = 0
2169 },
2170 .dec = {
2171 .vecs = NULL,
2172 .count = 0
2173 }
2174 }
2175 }
2176 }, {
2177 .alg = "cryptd(__driver-ecb-cast6-avx)",
2178 .test = alg_test_null,
2179 .suite = {
2180 .cipher = {
2181 .enc = {
2182 .vecs = NULL,
2183 .count = 0
2184 },
2185 .dec = {
2186 .vecs = NULL,
2187 .count = 0
2188 }
2189 }
2190 }
2191 }, {
1940 .alg = "cryptd(__driver-ecb-serpent-avx)", 2192 .alg = "cryptd(__driver-ecb-serpent-avx)",
1941 .test = alg_test_null, 2193 .test = alg_test_null,
1942 .suite = { 2194 .suite = {
@@ -2054,6 +2306,36 @@ static const struct alg_test_desc alg_test_descs[] = {
2054 } 2306 }
2055 } 2307 }
2056 }, { 2308 }, {
2309 .alg = "ctr(cast5)",
2310 .test = alg_test_skcipher,
2311 .suite = {
2312 .cipher = {
2313 .enc = {
2314 .vecs = cast5_ctr_enc_tv_template,
2315 .count = CAST5_CTR_ENC_TEST_VECTORS
2316 },
2317 .dec = {
2318 .vecs = cast5_ctr_dec_tv_template,
2319 .count = CAST5_CTR_DEC_TEST_VECTORS
2320 }
2321 }
2322 }
2323 }, {
2324 .alg = "ctr(cast6)",
2325 .test = alg_test_skcipher,
2326 .suite = {
2327 .cipher = {
2328 .enc = {
2329 .vecs = cast6_ctr_enc_tv_template,
2330 .count = CAST6_CTR_ENC_TEST_VECTORS
2331 },
2332 .dec = {
2333 .vecs = cast6_ctr_dec_tv_template,
2334 .count = CAST6_CTR_DEC_TEST_VECTORS
2335 }
2336 }
2337 }
2338 }, {
2057 .alg = "ctr(serpent)", 2339 .alg = "ctr(serpent)",
2058 .test = alg_test_skcipher, 2340 .test = alg_test_skcipher,
2059 .suite = { 2341 .suite = {
@@ -2530,6 +2812,21 @@ static const struct alg_test_desc alg_test_descs[] = {
2530 } 2812 }
2531 } 2813 }
2532 }, { 2814 }, {
2815 .alg = "lrw(cast6)",
2816 .test = alg_test_skcipher,
2817 .suite = {
2818 .cipher = {
2819 .enc = {
2820 .vecs = cast6_lrw_enc_tv_template,
2821 .count = CAST6_LRW_ENC_TEST_VECTORS
2822 },
2823 .dec = {
2824 .vecs = cast6_lrw_dec_tv_template,
2825 .count = CAST6_LRW_DEC_TEST_VECTORS
2826 }
2827 }
2828 }
2829 }, {
2533 .alg = "lrw(serpent)", 2830 .alg = "lrw(serpent)",
2534 .test = alg_test_skcipher, 2831 .test = alg_test_skcipher,
2535 .suite = { 2832 .suite = {
@@ -2882,6 +3179,21 @@ static const struct alg_test_desc alg_test_descs[] = {
2882 } 3179 }
2883 } 3180 }
2884 }, { 3181 }, {
3182 .alg = "xts(cast6)",
3183 .test = alg_test_skcipher,
3184 .suite = {
3185 .cipher = {
3186 .enc = {
3187 .vecs = cast6_xts_enc_tv_template,
3188 .count = CAST6_XTS_ENC_TEST_VECTORS
3189 },
3190 .dec = {
3191 .vecs = cast6_xts_dec_tv_template,
3192 .count = CAST6_XTS_DEC_TEST_VECTORS
3193 }
3194 }
3195 }
3196 }, {
2885 .alg = "xts(serpent)", 3197 .alg = "xts(serpent)",
2886 .test = alg_test_skcipher, 3198 .test = alg_test_skcipher,
2887 .suite = { 3199 .suite = {
diff --git a/crypto/testmgr.h b/crypto/testmgr.h
index f8179e0344ed..76d7f6cc82f5 100644
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
@@ -53,6 +53,7 @@ struct cipher_testvec {
53 char *result; 53 char *result;
54 unsigned short tap[MAX_TAP]; 54 unsigned short tap[MAX_TAP];
55 int np; 55 int np;
56 unsigned char also_non_np;
56 unsigned char fail; 57 unsigned char fail;
57 unsigned char wk; /* weak key flag */ 58 unsigned char wk; /* weak key flag */
58 unsigned char klen; 59 unsigned char klen;
@@ -2468,6 +2469,9 @@ static struct cipher_testvec bf_enc_tv_template[] = {
2468 "\xC2\xF4\x6D\xFF\xF6\xCD\x6B\x40" 2469 "\xC2\xF4\x6D\xFF\xF6\xCD\x6B\x40"
2469 "\xE1\xB3\xBF\xD4\x38\x2B\xC8\x3B", 2470 "\xE1\xB3\xBF\xD4\x38\x2B\xC8\x3B",
2470 .rlen = 40, 2471 .rlen = 40,
2472 .also_non_np = 1,
2473 .np = 2,
2474 .tap = { 40 - 8, 8 },
2471 }, 2475 },
2472}; 2476};
2473 2477
@@ -2541,6 +2545,9 @@ static struct cipher_testvec bf_dec_tv_template[] = {
2541 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87" 2545 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2542 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9", 2546 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9",
2543 .rlen = 40, 2547 .rlen = 40,
2548 .also_non_np = 1,
2549 .np = 2,
2550 .tap = { 40 - 8, 8 },
2544 }, 2551 },
2545}; 2552};
2546 2553
@@ -2579,6 +2586,9 @@ static struct cipher_testvec bf_cbc_enc_tv_template[] = {
2579 "\x1B\xD9\x02\xB6\x48\xB0\x87\x25" 2586 "\x1B\xD9\x02\xB6\x48\xB0\x87\x25"
2580 "\x01\x9C\x93\x63\x51\x60\x82\xD2", 2587 "\x01\x9C\x93\x63\x51\x60\x82\xD2",
2581 .rlen = 40, 2588 .rlen = 40,
2589 .also_non_np = 1,
2590 .np = 2,
2591 .tap = { 40 - 8, 8 },
2582 }, 2592 },
2583}; 2593};
2584 2594
@@ -2617,6 +2627,9 @@ static struct cipher_testvec bf_cbc_dec_tv_template[] = {
2617 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87" 2627 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2618 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9", 2628 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9",
2619 .rlen = 40, 2629 .rlen = 40,
2630 .also_non_np = 1,
2631 .np = 2,
2632 .tap = { 40 - 8, 8 },
2620 }, 2633 },
2621}; 2634};
2622 2635
@@ -2661,6 +2674,144 @@ static struct cipher_testvec bf_ctr_enc_tv_template[] = {
2661 "\xE4\x1F\x5E\xA5\x89\xAC\x32\xBC" 2674 "\xE4\x1F\x5E\xA5\x89\xAC\x32\xBC"
2662 "\x3D\xA7\xE9", 2675 "\x3D\xA7\xE9",
2663 .rlen = 43, 2676 .rlen = 43,
2677 .also_non_np = 1,
2678 .np = 2,
2679 .tap = { 43 - 8, 8 },
2680 }, { /* Generated with Crypto++ */
2681 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2682 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2683 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2684 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2685 .klen = 32,
2686 .iv = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFD",
2687 .input = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2688 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2689 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2690 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2691 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
2692 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
2693 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
2694 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
2695 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
2696 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
2697 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
2698 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
2699 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
2700 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
2701 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
2702 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
2703 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
2704 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
2705 "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
2706 "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
2707 "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
2708 "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
2709 "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
2710 "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
2711 "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
2712 "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
2713 "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
2714 "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
2715 "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
2716 "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
2717 "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
2718 "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
2719 "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
2720 "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
2721 "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
2722 "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
2723 "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
2724 "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
2725 "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
2726 "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
2727 "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
2728 "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
2729 "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
2730 "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
2731 "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
2732 "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
2733 "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
2734 "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
2735 "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
2736 "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
2737 "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
2738 "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
2739 "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
2740 "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
2741 "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
2742 "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
2743 "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
2744 "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
2745 "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
2746 "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
2747 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
2748 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
2749 "\x2B\xC2\x59\xF0\x64\xFB\x92\x06",
2750 .ilen = 504,
2751 .result = "\x5F\x58\x6E\x60\x51\x6E\xDC\x3D"
2752 "\xD1\xBB\xF7\xB7\xFD\x04\x44\x82"
2753 "\xDC\x9F\x4B\x02\xF1\xD2\x5A\x6F"
2754 "\x25\xF9\x27\x21\xF2\xD2\x9A\x01"
2755 "\xBD\xAD\x3D\x93\x87\xCA\x0D\xFE"
2756 "\xB7\x2C\x17\x1F\x42\x8C\x13\xB2"
2757 "\x62\x44\x72\xB9\x5D\xC0\xF8\x37"
2758 "\xDF\xEA\x78\x81\x8F\xA6\x34\xB2"
2759 "\x07\x09\x7C\xB9\x3A\xA0\x2B\x18"
2760 "\x34\x6A\x9D\x3D\xA5\xEB\xF4\x60"
2761 "\xF8\x98\xA2\x39\x81\x23\x6C\xA9"
2762 "\x70\xCA\xCC\x45\xD8\x1F\xDF\x44"
2763 "\x2A\x67\x7A\x88\x28\xDC\x36\x83"
2764 "\x18\xD7\x48\x43\x17\x2B\x1B\xE6"
2765 "\x0B\x82\x59\x14\x26\x67\x08\x09"
2766 "\x5B\x5D\x38\xD0\x81\xCE\x54\x2A"
2767 "\xCD\x22\x94\x42\xF5\xBA\x74\x7E"
2768 "\xD9\x00\x40\xA9\x0D\x0B\xBD\x8E"
2769 "\xC4\x8E\x5E\x17\x8F\x48\xE2\xB8"
2770 "\xF4\xCC\x19\x76\xAB\x48\x29\xAA"
2771 "\x81\xD5\xCE\xD5\x8A\x3B\xC9\x21"
2772 "\xEF\x50\x4F\x04\x02\xBF\xE1\x1F"
2773 "\x59\x28\x1A\xE4\x18\x16\xA0\x29"
2774 "\xBF\x34\xA9\x2D\x28\x83\xC0\x5E"
2775 "\xEA\x44\xC4\x6E\xAB\x24\x79\x9D"
2776 "\x2D\xA1\xE8\x55\xCA\x74\xFC\xBD"
2777 "\xFE\xDD\xDA\xA5\xFB\x34\x90\x31"
2778 "\x0E\x62\x28\x9B\xDC\xD7\xA1\xBB"
2779 "\xF0\x1A\xB3\xE2\xD0\xFA\xBD\xE8"
2780 "\x5C\x5A\x10\x67\xF6\x6A\x17\x3F"
2781 "\xC5\xE9\x09\x08\xDD\x22\x77\x42"
2782 "\x26\x6A\x6A\x7A\x3F\x87\x80\x0C"
2783 "\xF0\xFF\x15\x8E\x84\x86\xC0\x10"
2784 "\x0F\x8D\x33\x06\xB8\x72\xA4\x47"
2785 "\x6B\xED\x2E\x05\x94\x6C\x5C\x5B"
2786 "\x13\xF6\x77\xEE\x3B\x16\xDF\xC2"
2787 "\x63\x66\x07\x6D\x3F\x6C\x51\x7C"
2788 "\x1C\xAC\x80\xB6\x58\x48\xB7\x9D"
2789 "\xB4\x19\xD8\x19\x45\x66\x27\x02"
2790 "\xA1\xA9\x99\xF3\x1F\xE5\xA7\x1D"
2791 "\x31\xE7\x1B\x0D\xFF\xBB\xB5\xA1"
2792 "\xF5\x9C\x45\x1E\x18\x19\xA1\xE7"
2793 "\xC2\xF1\xBF\x68\xC3\xEC\xCF\x53"
2794 "\x67\xA6\x2B\x7D\x3C\x6D\x24\xC3"
2795 "\xE8\xE6\x07\x5A\x09\xE0\x32\xA8"
2796 "\x52\xF6\xE9\xED\x0E\xC6\x0A\x6A"
2797 "\xFC\x60\x2A\xE0\x93\xCE\xB8\x2E"
2798 "\xA2\xA8\x0E\x79\x9E\x34\x5D\x37"
2799 "\x6F\x12\xFE\x48\x7B\xE7\xB9\x22"
2800 "\x29\xE8\xD7\xBE\x5D\xD1\x8B\xD9"
2801 "\x91\x51\x4E\x71\xF2\x98\x85\x16"
2802 "\x25\x7A\x76\x8A\x51\x0E\x65\x14"
2803 "\x81\xB5\x3A\x37\xFD\xEC\xB5\x8A"
2804 "\xE1\xCF\x41\x72\x14\x29\x4C\xF0"
2805 "\x20\xD9\x9A\xC5\x66\xA4\x03\x76"
2806 "\x5B\xA4\x15\x4F\x0E\x64\x39\x40"
2807 "\x25\xF9\x20\x22\xF5\x88\xF5\xBA"
2808 "\xE4\xDF\x45\x61\xBF\x8D\x7A\x24"
2809 "\x4B\x92\x71\xD9\x2F\x77\xA7\x95"
2810 "\xA8\x7F\x61\xD5\xA4\x57\xB0\xFB"
2811 "\xB5\x77\xBA\x1C\xEE\x71\xFA\xB0"
2812 "\x16\x4C\x18\x6B\xF2\x69\xA0\x07"
2813 "\xEF\xBE\xEC\x69\xAC\xA8\x63\x9E",
2814 .rlen = 504,
2664 }, 2815 },
2665}; 2816};
2666 2817
@@ -2705,6 +2856,144 @@ static struct cipher_testvec bf_ctr_dec_tv_template[] = {
2705 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9" 2856 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
2706 "\x6D\x04\x9B", 2857 "\x6D\x04\x9B",
2707 .rlen = 43, 2858 .rlen = 43,
2859 .also_non_np = 1,
2860 .np = 2,
2861 .tap = { 43 - 8, 8 },
2862 }, { /* Generated with Crypto++ */
2863 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
2864 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
2865 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
2866 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
2867 .klen = 32,
2868 .iv = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFD",
2869 .input = "\x5F\x58\x6E\x60\x51\x6E\xDC\x3D"
2870 "\xD1\xBB\xF7\xB7\xFD\x04\x44\x82"
2871 "\xDC\x9F\x4B\x02\xF1\xD2\x5A\x6F"
2872 "\x25\xF9\x27\x21\xF2\xD2\x9A\x01"
2873 "\xBD\xAD\x3D\x93\x87\xCA\x0D\xFE"
2874 "\xB7\x2C\x17\x1F\x42\x8C\x13\xB2"
2875 "\x62\x44\x72\xB9\x5D\xC0\xF8\x37"
2876 "\xDF\xEA\x78\x81\x8F\xA6\x34\xB2"
2877 "\x07\x09\x7C\xB9\x3A\xA0\x2B\x18"
2878 "\x34\x6A\x9D\x3D\xA5\xEB\xF4\x60"
2879 "\xF8\x98\xA2\x39\x81\x23\x6C\xA9"
2880 "\x70\xCA\xCC\x45\xD8\x1F\xDF\x44"
2881 "\x2A\x67\x7A\x88\x28\xDC\x36\x83"
2882 "\x18\xD7\x48\x43\x17\x2B\x1B\xE6"
2883 "\x0B\x82\x59\x14\x26\x67\x08\x09"
2884 "\x5B\x5D\x38\xD0\x81\xCE\x54\x2A"
2885 "\xCD\x22\x94\x42\xF5\xBA\x74\x7E"
2886 "\xD9\x00\x40\xA9\x0D\x0B\xBD\x8E"
2887 "\xC4\x8E\x5E\x17\x8F\x48\xE2\xB8"
2888 "\xF4\xCC\x19\x76\xAB\x48\x29\xAA"
2889 "\x81\xD5\xCE\xD5\x8A\x3B\xC9\x21"
2890 "\xEF\x50\x4F\x04\x02\xBF\xE1\x1F"
2891 "\x59\x28\x1A\xE4\x18\x16\xA0\x29"
2892 "\xBF\x34\xA9\x2D\x28\x83\xC0\x5E"
2893 "\xEA\x44\xC4\x6E\xAB\x24\x79\x9D"
2894 "\x2D\xA1\xE8\x55\xCA\x74\xFC\xBD"
2895 "\xFE\xDD\xDA\xA5\xFB\x34\x90\x31"
2896 "\x0E\x62\x28\x9B\xDC\xD7\xA1\xBB"
2897 "\xF0\x1A\xB3\xE2\xD0\xFA\xBD\xE8"
2898 "\x5C\x5A\x10\x67\xF6\x6A\x17\x3F"
2899 "\xC5\xE9\x09\x08\xDD\x22\x77\x42"
2900 "\x26\x6A\x6A\x7A\x3F\x87\x80\x0C"
2901 "\xF0\xFF\x15\x8E\x84\x86\xC0\x10"
2902 "\x0F\x8D\x33\x06\xB8\x72\xA4\x47"
2903 "\x6B\xED\x2E\x05\x94\x6C\x5C\x5B"
2904 "\x13\xF6\x77\xEE\x3B\x16\xDF\xC2"
2905 "\x63\x66\x07\x6D\x3F\x6C\x51\x7C"
2906 "\x1C\xAC\x80\xB6\x58\x48\xB7\x9D"
2907 "\xB4\x19\xD8\x19\x45\x66\x27\x02"
2908 "\xA1\xA9\x99\xF3\x1F\xE5\xA7\x1D"
2909 "\x31\xE7\x1B\x0D\xFF\xBB\xB5\xA1"
2910 "\xF5\x9C\x45\x1E\x18\x19\xA1\xE7"
2911 "\xC2\xF1\xBF\x68\xC3\xEC\xCF\x53"
2912 "\x67\xA6\x2B\x7D\x3C\x6D\x24\xC3"
2913 "\xE8\xE6\x07\x5A\x09\xE0\x32\xA8"
2914 "\x52\xF6\xE9\xED\x0E\xC6\x0A\x6A"
2915 "\xFC\x60\x2A\xE0\x93\xCE\xB8\x2E"
2916 "\xA2\xA8\x0E\x79\x9E\x34\x5D\x37"
2917 "\x6F\x12\xFE\x48\x7B\xE7\xB9\x22"
2918 "\x29\xE8\xD7\xBE\x5D\xD1\x8B\xD9"
2919 "\x91\x51\x4E\x71\xF2\x98\x85\x16"
2920 "\x25\x7A\x76\x8A\x51\x0E\x65\x14"
2921 "\x81\xB5\x3A\x37\xFD\xEC\xB5\x8A"
2922 "\xE1\xCF\x41\x72\x14\x29\x4C\xF0"
2923 "\x20\xD9\x9A\xC5\x66\xA4\x03\x76"
2924 "\x5B\xA4\x15\x4F\x0E\x64\x39\x40"
2925 "\x25\xF9\x20\x22\xF5\x88\xF5\xBA"
2926 "\xE4\xDF\x45\x61\xBF\x8D\x7A\x24"
2927 "\x4B\x92\x71\xD9\x2F\x77\xA7\x95"
2928 "\xA8\x7F\x61\xD5\xA4\x57\xB0\xFB"
2929 "\xB5\x77\xBA\x1C\xEE\x71\xFA\xB0"
2930 "\x16\x4C\x18\x6B\xF2\x69\xA0\x07"
2931 "\xEF\xBE\xEC\x69\xAC\xA8\x63\x9E",
2932 .ilen = 504,
2933 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
2934 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
2935 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
2936 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
2937 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
2938 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
2939 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
2940 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
2941 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
2942 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
2943 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
2944 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
2945 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
2946 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
2947 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
2948 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
2949 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
2950 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
2951 "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
2952 "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
2953 "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
2954 "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
2955 "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
2956 "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
2957 "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
2958 "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
2959 "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
2960 "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
2961 "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
2962 "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
2963 "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
2964 "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
2965 "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
2966 "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
2967 "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
2968 "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
2969 "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
2970 "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
2971 "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
2972 "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
2973 "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
2974 "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
2975 "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
2976 "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
2977 "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
2978 "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
2979 "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
2980 "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
2981 "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
2982 "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
2983 "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
2984 "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
2985 "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
2986 "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
2987 "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
2988 "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
2989 "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
2990 "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
2991 "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
2992 "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
2993 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
2994 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
2995 "\x2B\xC2\x59\xF0\x64\xFB\x92\x06",
2996 .rlen = 504,
2708 }, 2997 },
2709}; 2998};
2710 2999
@@ -2884,6 +3173,9 @@ static struct cipher_testvec tf_enc_tv_template[] = {
2884 "\x58\x33\x9B\x78\xC7\x58\x48\x6B" 3173 "\x58\x33\x9B\x78\xC7\x58\x48\x6B"
2885 "\x2C\x75\x64\xC4\xCA\xC1\x7E\xD5", 3174 "\x2C\x75\x64\xC4\xCA\xC1\x7E\xD5",
2886 .rlen = 496, 3175 .rlen = 496,
3176 .also_non_np = 1,
3177 .np = 2,
3178 .tap = { 496 - 16, 16 },
2887 }, 3179 },
2888}; 3180};
2889 3181
@@ -3049,6 +3341,9 @@ static struct cipher_testvec tf_dec_tv_template[] = {
3049 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45" 3341 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
3050 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7", 3342 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
3051 .rlen = 496, 3343 .rlen = 496,
3344 .also_non_np = 1,
3345 .np = 2,
3346 .tap = { 496 - 16, 16 },
3052 }, 3347 },
3053}; 3348};
3054 3349
@@ -3229,6 +3524,9 @@ static struct cipher_testvec tf_cbc_enc_tv_template[] = {
3229 "\x30\x70\x56\xA4\x37\xDD\x7C\xC0" 3524 "\x30\x70\x56\xA4\x37\xDD\x7C\xC0"
3230 "\x0A\xA3\x30\x10\x26\x25\x41\x2C", 3525 "\x0A\xA3\x30\x10\x26\x25\x41\x2C",
3231 .rlen = 496, 3526 .rlen = 496,
3527 .also_non_np = 1,
3528 .np = 2,
3529 .tap = { 496 - 16, 16 },
3232 }, 3530 },
3233}; 3531};
3234 3532
@@ -3409,6 +3707,9 @@ static struct cipher_testvec tf_cbc_dec_tv_template[] = {
3409 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45" 3707 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
3410 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7", 3708 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
3411 .rlen = 496, 3709 .rlen = 496,
3710 .also_non_np = 1,
3711 .np = 2,
3712 .tap = { 496 - 16, 16 },
3412 }, 3713 },
3413}; 3714};
3414 3715
@@ -3553,6 +3854,140 @@ static struct cipher_testvec tf_ctr_enc_tv_template[] = {
3553 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B" 3854 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3554 "\x78\xBE\x9B\x78\x55\x32\x0F\x55", 3855 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3555 .klen = 32, 3856 .klen = 32,
3857 .iv = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"
3858 "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFD",
3859 .input = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
3860 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
3861 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
3862 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
3863 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
3864 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
3865 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
3866 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
3867 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
3868 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
3869 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
3870 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
3871 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
3872 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
3873 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
3874 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
3875 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
3876 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
3877 "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
3878 "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
3879 "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
3880 "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
3881 "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
3882 "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
3883 "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
3884 "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
3885 "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
3886 "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
3887 "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
3888 "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
3889 "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
3890 "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
3891 "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
3892 "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
3893 "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
3894 "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
3895 "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
3896 "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
3897 "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
3898 "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
3899 "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
3900 "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
3901 "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
3902 "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
3903 "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
3904 "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
3905 "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
3906 "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
3907 "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
3908 "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
3909 "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
3910 "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
3911 "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
3912 "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
3913 "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
3914 "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
3915 "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
3916 "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
3917 "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
3918 "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
3919 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
3920 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
3921 .ilen = 496,
3922 .result = "\xEB\x44\xAF\x49\x27\xB8\xFB\x44"
3923 "\x4C\xA6\xC3\x0C\x8B\xD0\x01\x0C"
3924 "\x53\xC8\x16\x38\xDE\x40\x4F\x91"
3925 "\x25\x6D\x4C\xA0\x9A\x87\x1E\xDA"
3926 "\x88\x7E\x89\xE9\x67\x2B\x83\xA2"
3927 "\x5F\x2E\x23\x3E\x45\xB9\x77\x7B"
3928 "\xA6\x7E\x47\x36\x81\x9F\x9B\xF3"
3929 "\xE0\xF0\xD7\x47\xA9\xC8\xEF\x33"
3930 "\x0C\x43\xFE\x67\x50\x0A\x2C\x3E"
3931 "\xA0\xE1\x25\x8E\x80\x07\x4A\xC0"
3932 "\x64\x89\x9F\x6A\x27\x96\x07\xA6"
3933 "\x9B\xC8\x1B\x21\x60\xAE\x5D\x01"
3934 "\xE2\xCD\xC8\xAA\x6C\x9D\x1C\x34"
3935 "\x39\x18\x09\xA4\x82\x59\x78\xE7"
3936 "\xFC\x59\x65\xF2\x94\xFF\xFB\xE2"
3937 "\x3C\xDA\xB1\x90\x95\xBF\x91\xE3"
3938 "\xE6\x87\x31\x9E\x16\x85\xAD\xB1"
3939 "\x4C\xAE\x43\x4D\x19\x58\xB5\x5E"
3940 "\x2E\xF5\x09\xAA\x39\xF4\xC0\xB3"
3941 "\xD4\x4D\xDB\x73\x7A\xD4\xF1\xBF"
3942 "\x89\x16\x4D\x2D\xA2\x26\x33\x72"
3943 "\x18\x33\x7E\xD6\xD2\x16\xA4\x54"
3944 "\xF4\x8C\xB3\x52\xDF\x21\x9C\xEB"
3945 "\xBF\x49\xD3\xF9\x05\x06\xCB\xD2"
3946 "\xA9\xD2\x3B\x6E\x19\x8C\xBC\x19"
3947 "\xAB\x89\xD6\xD8\xCD\x56\x89\x5E"
3948 "\xAC\x00\xE3\x50\x63\x4A\x80\x9A"
3949 "\x05\xBC\x50\x39\xD3\x32\xD9\x0D"
3950 "\xE3\x20\x0D\x75\x54\xEC\xE6\x31"
3951 "\x14\xB9\x3A\x59\x00\x43\x37\x8E"
3952 "\x8C\x5A\x79\x62\x14\x76\x8A\xAE"
3953 "\x8F\xCC\xA1\x6C\x38\x78\xDD\x2D"
3954 "\x8B\x6D\xEA\xBD\x7B\x25\xFF\x60"
3955 "\xC9\x87\xB1\x79\x1E\xA5\x86\x68"
3956 "\x81\xB4\xE2\xC1\x05\x7D\x3A\x73"
3957 "\xD0\xDA\x75\x77\x9E\x05\x27\xF1"
3958 "\x08\xA9\x66\x64\x6C\xBC\x82\x17"
3959 "\x2C\x23\x5F\x62\x4D\x02\x1A\x58"
3960 "\xE7\xB7\x23\x6D\xE2\x20\xDA\xEF"
3961 "\xB4\xB3\x3F\xB2\x2B\x69\x98\x83"
3962 "\x95\x87\x13\x57\x60\xD7\xB5\xB1"
3963 "\xEE\x0A\x2F\x95\x36\x4C\x76\x5D"
3964 "\x5F\xD9\x19\xED\xB9\xA5\x48\xBF"
3965 "\xC8\xAB\x0F\x71\xCC\x61\x8E\x0A"
3966 "\xD0\x29\x44\xA8\xB9\xC1\xE8\xC8"
3967 "\xC9\xA8\x28\x81\xFB\x50\xF2\xF0"
3968 "\x26\xAE\x39\xB8\x91\xCD\xA8\xAC"
3969 "\xDE\x55\x1B\x50\x14\x53\x44\x17"
3970 "\x54\x46\xFC\xB1\xE4\x07\x6B\x9A"
3971 "\x01\x14\xF0\x2E\x2E\xDB\x46\x1B"
3972 "\x1A\x09\x97\xA9\xB6\x97\x79\x06"
3973 "\xFB\xCB\x85\xCF\xDD\xA1\x41\xB1"
3974 "\x00\xAA\xF7\xE0\x89\x73\xFB\xE5"
3975 "\xBF\x84\xDB\xC9\xCD\xC4\xA2\x0D"
3976 "\x3B\xAC\xF9\xDF\x96\xBF\x88\x23"
3977 "\x41\x67\xA1\x24\x99\x7E\xCC\x9B"
3978 "\x02\x8F\x6A\x49\xF6\x25\xBA\x7A"
3979 "\xF4\x78\xFD\x79\x62\x63\x4F\x14"
3980 "\xD6\x11\x11\x04\x05\x5F\x7E\xEA"
3981 "\x4C\xB6\xF8\xF4\x5F\x48\x52\x54"
3982 "\x94\x63\xA8\x4E\xCF\xD2\x1B\x1B"
3983 "\x22\x18\x6A\xAF\x6E\x3E\xE1\x0D",
3984 .rlen = 496,
3985 }, { /* Generated with Crypto++ */
3986 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
3987 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
3988 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3989 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3990 .klen = 32,
3556 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F" 3991 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
3557 "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64", 3992 "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
3558 .input = "\x56\xED\x84\x1B\x8F\x26\xBD\x31" 3993 .input = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
@@ -3683,6 +4118,9 @@ static struct cipher_testvec tf_ctr_enc_tv_template[] = {
3683 "\xC5\xC9\x7F\x9E\xCF\x33\x7A\xDF" 4118 "\xC5\xC9\x7F\x9E\xCF\x33\x7A\xDF"
3684 "\x6C\x82\x9D", 4119 "\x6C\x82\x9D",
3685 .rlen = 499, 4120 .rlen = 499,
4121 .also_non_np = 1,
4122 .np = 2,
4123 .tap = { 499 - 16, 16 },
3686 }, 4124 },
3687}; 4125};
3688 4126
@@ -3827,6 +4265,140 @@ static struct cipher_testvec tf_ctr_dec_tv_template[] = {
3827 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B" 4265 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
3828 "\x78\xBE\x9B\x78\x55\x32\x0F\x55", 4266 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
3829 .klen = 32, 4267 .klen = 32,
4268 .iv = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"
4269 "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFD",
4270 .input = "\xEB\x44\xAF\x49\x27\xB8\xFB\x44"
4271 "\x4C\xA6\xC3\x0C\x8B\xD0\x01\x0C"
4272 "\x53\xC8\x16\x38\xDE\x40\x4F\x91"
4273 "\x25\x6D\x4C\xA0\x9A\x87\x1E\xDA"
4274 "\x88\x7E\x89\xE9\x67\x2B\x83\xA2"
4275 "\x5F\x2E\x23\x3E\x45\xB9\x77\x7B"
4276 "\xA6\x7E\x47\x36\x81\x9F\x9B\xF3"
4277 "\xE0\xF0\xD7\x47\xA9\xC8\xEF\x33"
4278 "\x0C\x43\xFE\x67\x50\x0A\x2C\x3E"
4279 "\xA0\xE1\x25\x8E\x80\x07\x4A\xC0"
4280 "\x64\x89\x9F\x6A\x27\x96\x07\xA6"
4281 "\x9B\xC8\x1B\x21\x60\xAE\x5D\x01"
4282 "\xE2\xCD\xC8\xAA\x6C\x9D\x1C\x34"
4283 "\x39\x18\x09\xA4\x82\x59\x78\xE7"
4284 "\xFC\x59\x65\xF2\x94\xFF\xFB\xE2"
4285 "\x3C\xDA\xB1\x90\x95\xBF\x91\xE3"
4286 "\xE6\x87\x31\x9E\x16\x85\xAD\xB1"
4287 "\x4C\xAE\x43\x4D\x19\x58\xB5\x5E"
4288 "\x2E\xF5\x09\xAA\x39\xF4\xC0\xB3"
4289 "\xD4\x4D\xDB\x73\x7A\xD4\xF1\xBF"
4290 "\x89\x16\x4D\x2D\xA2\x26\x33\x72"
4291 "\x18\x33\x7E\xD6\xD2\x16\xA4\x54"
4292 "\xF4\x8C\xB3\x52\xDF\x21\x9C\xEB"
4293 "\xBF\x49\xD3\xF9\x05\x06\xCB\xD2"
4294 "\xA9\xD2\x3B\x6E\x19\x8C\xBC\x19"
4295 "\xAB\x89\xD6\xD8\xCD\x56\x89\x5E"
4296 "\xAC\x00\xE3\x50\x63\x4A\x80\x9A"
4297 "\x05\xBC\x50\x39\xD3\x32\xD9\x0D"
4298 "\xE3\x20\x0D\x75\x54\xEC\xE6\x31"
4299 "\x14\xB9\x3A\x59\x00\x43\x37\x8E"
4300 "\x8C\x5A\x79\x62\x14\x76\x8A\xAE"
4301 "\x8F\xCC\xA1\x6C\x38\x78\xDD\x2D"
4302 "\x8B\x6D\xEA\xBD\x7B\x25\xFF\x60"
4303 "\xC9\x87\xB1\x79\x1E\xA5\x86\x68"
4304 "\x81\xB4\xE2\xC1\x05\x7D\x3A\x73"
4305 "\xD0\xDA\x75\x77\x9E\x05\x27\xF1"
4306 "\x08\xA9\x66\x64\x6C\xBC\x82\x17"
4307 "\x2C\x23\x5F\x62\x4D\x02\x1A\x58"
4308 "\xE7\xB7\x23\x6D\xE2\x20\xDA\xEF"
4309 "\xB4\xB3\x3F\xB2\x2B\x69\x98\x83"
4310 "\x95\x87\x13\x57\x60\xD7\xB5\xB1"
4311 "\xEE\x0A\x2F\x95\x36\x4C\x76\x5D"
4312 "\x5F\xD9\x19\xED\xB9\xA5\x48\xBF"
4313 "\xC8\xAB\x0F\x71\xCC\x61\x8E\x0A"
4314 "\xD0\x29\x44\xA8\xB9\xC1\xE8\xC8"
4315 "\xC9\xA8\x28\x81\xFB\x50\xF2\xF0"
4316 "\x26\xAE\x39\xB8\x91\xCD\xA8\xAC"
4317 "\xDE\x55\x1B\x50\x14\x53\x44\x17"
4318 "\x54\x46\xFC\xB1\xE4\x07\x6B\x9A"
4319 "\x01\x14\xF0\x2E\x2E\xDB\x46\x1B"
4320 "\x1A\x09\x97\xA9\xB6\x97\x79\x06"
4321 "\xFB\xCB\x85\xCF\xDD\xA1\x41\xB1"
4322 "\x00\xAA\xF7\xE0\x89\x73\xFB\xE5"
4323 "\xBF\x84\xDB\xC9\xCD\xC4\xA2\x0D"
4324 "\x3B\xAC\xF9\xDF\x96\xBF\x88\x23"
4325 "\x41\x67\xA1\x24\x99\x7E\xCC\x9B"
4326 "\x02\x8F\x6A\x49\xF6\x25\xBA\x7A"
4327 "\xF4\x78\xFD\x79\x62\x63\x4F\x14"
4328 "\xD6\x11\x11\x04\x05\x5F\x7E\xEA"
4329 "\x4C\xB6\xF8\xF4\x5F\x48\x52\x54"
4330 "\x94\x63\xA8\x4E\xCF\xD2\x1B\x1B"
4331 "\x22\x18\x6A\xAF\x6E\x3E\xE1\x0D",
4332 .ilen = 496,
4333 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
4334 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
4335 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
4336 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
4337 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
4338 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
4339 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
4340 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
4341 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
4342 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
4343 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
4344 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
4345 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
4346 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
4347 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
4348 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
4349 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
4350 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
4351 "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
4352 "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
4353 "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
4354 "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
4355 "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
4356 "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
4357 "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
4358 "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
4359 "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
4360 "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
4361 "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
4362 "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
4363 "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
4364 "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
4365 "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
4366 "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
4367 "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
4368 "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
4369 "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
4370 "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
4371 "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
4372 "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
4373 "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
4374 "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
4375 "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
4376 "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
4377 "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
4378 "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
4379 "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
4380 "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
4381 "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
4382 "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
4383 "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
4384 "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
4385 "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
4386 "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
4387 "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
4388 "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
4389 "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
4390 "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
4391 "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
4392 "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
4393 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
4394 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
4395 .rlen = 496,
4396 }, { /* Generated with Crypto++ */
4397 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
4398 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
4399 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
4400 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
4401 .klen = 32,
3830 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F" 4402 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
3831 "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64", 4403 "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
3832 .input = "\xDF\xDD\x69\xFA\xB0\x2E\xFD\xFE" 4404 .input = "\xDF\xDD\x69\xFA\xB0\x2E\xFD\xFE"
@@ -3957,6 +4529,9 @@ static struct cipher_testvec tf_ctr_dec_tv_template[] = {
3957 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7" 4529 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
3958 "\x2B\xC2\x59", 4530 "\x2B\xC2\x59",
3959 .rlen = 499, 4531 .rlen = 499,
4532 .also_non_np = 1,
4533 .np = 2,
4534 .tap = { 499 - 16, 16 },
3960 }, 4535 },
3961}; 4536};
3962 4537
@@ -4206,6 +4781,9 @@ static struct cipher_testvec tf_lrw_enc_tv_template[] = {
4206 "\x80\x18\xc4\x6c\x03\xd3\xb7\xba" 4781 "\x80\x18\xc4\x6c\x03\xd3\xb7\xba"
4207 "\x11\xd7\xb8\x6e\xea\xe1\x80\x30", 4782 "\x11\xd7\xb8\x6e\xea\xe1\x80\x30",
4208 .rlen = 512, 4783 .rlen = 512,
4784 .also_non_np = 1,
4785 .np = 2,
4786 .tap = { 512 - 16, 16 },
4209 }, 4787 },
4210}; 4788};
4211 4789
@@ -4456,6 +5034,9 @@ static struct cipher_testvec tf_lrw_dec_tv_template[] = {
4456 "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4" 5034 "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
4457 "\x21\xc4\xc2\x75\x67\x89\x37\x0a", 5035 "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
4458 .rlen = 512, 5036 .rlen = 512,
5037 .also_non_np = 1,
5038 .np = 2,
5039 .tap = { 512 - 16, 16 },
4459 }, 5040 },
4460}; 5041};
4461 5042
@@ -4795,6 +5376,9 @@ static struct cipher_testvec tf_xts_enc_tv_template[] = {
4795 "\xa4\x05\x0b\xb2\xb3\xa8\x30\x97" 5376 "\xa4\x05\x0b\xb2\xb3\xa8\x30\x97"
4796 "\x37\x30\xe1\x91\x8d\xb3\x2a\xff", 5377 "\x37\x30\xe1\x91\x8d\xb3\x2a\xff",
4797 .rlen = 512, 5378 .rlen = 512,
5379 .also_non_np = 1,
5380 .np = 2,
5381 .tap = { 512 - 16, 16 },
4798 }, 5382 },
4799}; 5383};
4800 5384
@@ -5135,6 +5719,9 @@ static struct cipher_testvec tf_xts_dec_tv_template[] = {
5135 "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7" 5719 "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
5136 "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff", 5720 "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
5137 .rlen = 512, 5721 .rlen = 512,
5722 .also_non_np = 1,
5723 .np = 2,
5724 .tap = { 512 - 16, 16 },
5138 }, 5725 },
5139}; 5726};
5140 5727
@@ -5242,6 +5829,9 @@ static struct cipher_testvec serpent_enc_tv_template[] = {
5242 "\x30\xD4\x2C\xF2\x8E\x06\x4B\x39" 5829 "\x30\xD4\x2C\xF2\x8E\x06\x4B\x39"
5243 "\xB3\x12\x1D\xB3\x17\x46\xE6\xD6", 5830 "\xB3\x12\x1D\xB3\x17\x46\xE6\xD6",
5244 .rlen = 144, 5831 .rlen = 144,
5832 .also_non_np = 1,
5833 .np = 2,
5834 .tap = { 144 - 16, 16 },
5245 }, 5835 },
5246}; 5836};
5247 5837
@@ -5377,6 +5967,9 @@ static struct cipher_testvec serpent_dec_tv_template[] = {
5377 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8" 5967 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
5378 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A", 5968 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
5379 .rlen = 144, 5969 .rlen = 144,
5970 .also_non_np = 1,
5971 .np = 2,
5972 .tap = { 144 - 16, 16 },
5380 }, 5973 },
5381}; 5974};
5382 5975
@@ -5468,6 +6061,9 @@ static struct cipher_testvec serpent_cbc_enc_tv_template[] = {
5468 "\x27\xDF\x89\x1D\x86\x3E\xF7\x5A" 6061 "\x27\xDF\x89\x1D\x86\x3E\xF7\x5A"
5469 "\xF6\xE3\x0F\xC7\x6B\x4C\x96\x7C", 6062 "\xF6\xE3\x0F\xC7\x6B\x4C\x96\x7C",
5470 .rlen = 144, 6063 .rlen = 144,
6064 .also_non_np = 1,
6065 .np = 2,
6066 .tap = { 144 - 16, 16 },
5471 }, 6067 },
5472}; 6068};
5473 6069
@@ -5518,6 +6114,9 @@ static struct cipher_testvec serpent_cbc_dec_tv_template[] = {
5518 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8" 6114 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
5519 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A", 6115 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A",
5520 .rlen = 144, 6116 .rlen = 144,
6117 .also_non_np = 1,
6118 .np = 2,
6119 .tap = { 144 - 16, 16 },
5521 }, 6120 },
5522}; 6121};
5523 6122
@@ -5616,6 +6215,143 @@ static struct cipher_testvec serpent_ctr_enc_tv_template[] = {
5616 "\x5D\xE1\x4F\xA1\xEA\xB3\xCA\xB9" 6215 "\x5D\xE1\x4F\xA1\xEA\xB3\xCA\xB9"
5617 "\xE6\xD0\x97", 6216 "\xE6\xD0\x97",
5618 .rlen = 147, 6217 .rlen = 147,
6218 .also_non_np = 1,
6219 .np = 2,
6220 .tap = { 147 - 16, 16 },
6221 }, { /* Generated with Crypto++ */
6222 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
6223 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
6224 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
6225 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
6226 .klen = 32,
6227 .iv = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"
6228 "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFD",
6229 .input = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
6230 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
6231 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
6232 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
6233 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
6234 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
6235 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
6236 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
6237 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
6238 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
6239 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
6240 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
6241 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
6242 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
6243 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
6244 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
6245 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
6246 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
6247 "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
6248 "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
6249 "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
6250 "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
6251 "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
6252 "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
6253 "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
6254 "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
6255 "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
6256 "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
6257 "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
6258 "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
6259 "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
6260 "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
6261 "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
6262 "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
6263 "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
6264 "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
6265 "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
6266 "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
6267 "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
6268 "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
6269 "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
6270 "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
6271 "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
6272 "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
6273 "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
6274 "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
6275 "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
6276 "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
6277 "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
6278 "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
6279 "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
6280 "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
6281 "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
6282 "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
6283 "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
6284 "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
6285 "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
6286 "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
6287 "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
6288 "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
6289 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
6290 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
6291 .ilen = 496,
6292 .result = "\x06\x9A\xF8\xB4\x53\x88\x62\xFC"
6293 "\x68\xB8\x2E\xDF\xC1\x05\x0F\x3D"
6294 "\xAF\x4D\x95\xAE\xC4\xE9\x1C\xDC"
6295 "\xF6\x2B\x8F\x90\x89\xF6\x7E\x1A"
6296 "\xA6\xB9\xE4\xF4\xFA\xCA\xE5\x7E"
6297 "\x71\x28\x06\x4F\xE8\x08\x39\xDA"
6298 "\xA5\x0E\xC8\xC0\xB8\x16\xE5\x69"
6299 "\xE5\xCA\xEC\x4F\x63\x2C\xC0\x9B"
6300 "\x9F\x3E\x39\x79\xF0\xCD\x64\x35"
6301 "\x4A\xD3\xC8\xA9\x31\xCD\x48\x5B"
6302 "\x92\x3D\x8F\x3F\x96\xBD\xB3\x18"
6303 "\x74\x2A\x5D\x29\x3F\x57\x8F\xE2"
6304 "\x67\x9A\xE0\xE5\xD4\x4A\xE2\x47"
6305 "\xBC\xF6\xEB\x14\xF3\x8C\x20\xC2"
6306 "\x7D\xE2\x43\x81\x86\x72\x2E\xB1"
6307 "\x39\xF6\x95\xE1\x1F\xCB\x76\x33"
6308 "\x5B\x7D\x23\x0F\x3A\x67\x2A\x2F"
6309 "\xB9\x37\x9D\xDD\x1F\x16\xA1\x3C"
6310 "\x70\xFE\x52\xAA\x93\x3C\xC4\x46"
6311 "\xB1\xE5\xFF\xDA\xAF\xE2\x84\xFE"
6312 "\x25\x92\xB2\x63\xBD\x49\x77\xB4"
6313 "\x22\xA4\x6A\xD5\x04\xE0\x45\x58"
6314 "\x1C\x34\x96\x7C\x03\x0C\x13\xA2"
6315 "\x05\x22\xE2\xCB\x5A\x35\x03\x09"
6316 "\x40\xD2\x82\x05\xCA\x58\x73\xF2"
6317 "\x29\x5E\x01\x47\x13\x32\x78\xBE"
6318 "\x06\xB0\x51\xDB\x6C\x31\xA0\x1C"
6319 "\x74\xBC\x8D\x25\xDF\xF8\x65\xD1"
6320 "\x38\x35\x11\x26\x4A\xB4\x06\x32"
6321 "\xFA\xD2\x07\x77\xB3\x74\x98\x80"
6322 "\x61\x59\xA8\x9F\xF3\x6F\x2A\xBF"
6323 "\xE6\xA5\x9A\xC4\x6B\xA6\x49\x6F"
6324 "\xBC\x47\xD9\xFB\xC6\xEF\x25\x65"
6325 "\x96\xAC\x9F\xE4\x81\x4B\xD8\xBA"
6326 "\xD6\x9B\xC9\x6D\x58\x40\x81\x02"
6327 "\x73\x44\x4E\x43\x6E\x37\xBB\x11"
6328 "\xE3\xF9\xB8\x2F\xEC\x76\x34\xEA"
6329 "\x90\xCD\xB7\x2E\x0E\x32\x71\xE8"
6330 "\xBB\x4E\x0B\x98\xA4\x17\x17\x5B"
6331 "\x07\xB5\x82\x3A\xC4\xE8\x42\x51"
6332 "\x5A\x4C\x4E\x7D\xBF\xC4\xC0\x4F"
6333 "\x68\xB8\xC6\x4A\x32\x6F\x0B\xD7"
6334 "\x85\xED\x6B\xFB\x72\xD2\xA5\x8F"
6335 "\xBF\xF9\xAC\x59\x50\xA8\x08\x70"
6336 "\xEC\xBD\x0A\xBF\xE5\x87\xA1\xC2"
6337 "\x92\x14\x78\xAF\xE8\xEA\x2E\xDD"
6338 "\xC1\x03\x9A\xAA\x89\x8B\x32\x46"
6339 "\x5B\x18\x27\xBA\x46\xAA\x64\xDE"
6340 "\xE3\xD5\xA3\xFC\x7B\x5B\x61\xDB"
6341 "\x7E\xDA\xEC\x30\x17\x19\xF8\x80"
6342 "\xB5\x5E\x27\xB5\x37\x3A\x1F\x28"
6343 "\x07\x73\xC3\x63\xCE\xFF\x8C\xFE"
6344 "\x81\x4E\xF8\x24\xF3\xB8\xC7\xE8"
6345 "\x16\x9A\xCC\x58\x2F\x88\x1C\x4B"
6346 "\xBB\x33\xA2\x73\xF0\x1C\x89\x0E"
6347 "\xDC\x34\x27\x89\x98\xCE\x1C\xA2"
6348 "\xD8\xB8\x90\xBE\xEC\x72\x28\x13"
6349 "\xAC\x7B\xF1\xD0\x7F\x7A\x28\x50"
6350 "\xB7\x99\x65\x8A\xC9\xC6\x21\x34"
6351 "\x7F\x67\x9D\xB7\x2C\xCC\xF5\x17"
6352 "\x2B\x89\xAC\xB0\xD7\x1E\x47\xB0"
6353 "\x61\xAF\xD4\x63\x6D\xB8\x2D\x20",
6354 .rlen = 496,
5619 }, 6355 },
5620}; 6356};
5621 6357
@@ -5714,6 +6450,143 @@ static struct cipher_testvec serpent_ctr_dec_tv_template[] = {
5714 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A" 6450 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
5715 "\xF1\x65\xFC", 6451 "\xF1\x65\xFC",
5716 .rlen = 147, 6452 .rlen = 147,
6453 .also_non_np = 1,
6454 .np = 2,
6455 .tap = { 147 - 16, 16 },
6456 }, { /* Generated with Crypto++ */
6457 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
6458 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
6459 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
6460 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
6461 .klen = 32,
6462 .iv = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"
6463 "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFD",
6464 .input = "\x06\x9A\xF8\xB4\x53\x88\x62\xFC"
6465 "\x68\xB8\x2E\xDF\xC1\x05\x0F\x3D"
6466 "\xAF\x4D\x95\xAE\xC4\xE9\x1C\xDC"
6467 "\xF6\x2B\x8F\x90\x89\xF6\x7E\x1A"
6468 "\xA6\xB9\xE4\xF4\xFA\xCA\xE5\x7E"
6469 "\x71\x28\x06\x4F\xE8\x08\x39\xDA"
6470 "\xA5\x0E\xC8\xC0\xB8\x16\xE5\x69"
6471 "\xE5\xCA\xEC\x4F\x63\x2C\xC0\x9B"
6472 "\x9F\x3E\x39\x79\xF0\xCD\x64\x35"
6473 "\x4A\xD3\xC8\xA9\x31\xCD\x48\x5B"
6474 "\x92\x3D\x8F\x3F\x96\xBD\xB3\x18"
6475 "\x74\x2A\x5D\x29\x3F\x57\x8F\xE2"
6476 "\x67\x9A\xE0\xE5\xD4\x4A\xE2\x47"
6477 "\xBC\xF6\xEB\x14\xF3\x8C\x20\xC2"
6478 "\x7D\xE2\x43\x81\x86\x72\x2E\xB1"
6479 "\x39\xF6\x95\xE1\x1F\xCB\x76\x33"
6480 "\x5B\x7D\x23\x0F\x3A\x67\x2A\x2F"
6481 "\xB9\x37\x9D\xDD\x1F\x16\xA1\x3C"
6482 "\x70\xFE\x52\xAA\x93\x3C\xC4\x46"
6483 "\xB1\xE5\xFF\xDA\xAF\xE2\x84\xFE"
6484 "\x25\x92\xB2\x63\xBD\x49\x77\xB4"
6485 "\x22\xA4\x6A\xD5\x04\xE0\x45\x58"
6486 "\x1C\x34\x96\x7C\x03\x0C\x13\xA2"
6487 "\x05\x22\xE2\xCB\x5A\x35\x03\x09"
6488 "\x40\xD2\x82\x05\xCA\x58\x73\xF2"
6489 "\x29\x5E\x01\x47\x13\x32\x78\xBE"
6490 "\x06\xB0\x51\xDB\x6C\x31\xA0\x1C"
6491 "\x74\xBC\x8D\x25\xDF\xF8\x65\xD1"
6492 "\x38\x35\x11\x26\x4A\xB4\x06\x32"
6493 "\xFA\xD2\x07\x77\xB3\x74\x98\x80"
6494 "\x61\x59\xA8\x9F\xF3\x6F\x2A\xBF"
6495 "\xE6\xA5\x9A\xC4\x6B\xA6\x49\x6F"
6496 "\xBC\x47\xD9\xFB\xC6\xEF\x25\x65"
6497 "\x96\xAC\x9F\xE4\x81\x4B\xD8\xBA"
6498 "\xD6\x9B\xC9\x6D\x58\x40\x81\x02"
6499 "\x73\x44\x4E\x43\x6E\x37\xBB\x11"
6500 "\xE3\xF9\xB8\x2F\xEC\x76\x34\xEA"
6501 "\x90\xCD\xB7\x2E\x0E\x32\x71\xE8"
6502 "\xBB\x4E\x0B\x98\xA4\x17\x17\x5B"
6503 "\x07\xB5\x82\x3A\xC4\xE8\x42\x51"
6504 "\x5A\x4C\x4E\x7D\xBF\xC4\xC0\x4F"
6505 "\x68\xB8\xC6\x4A\x32\x6F\x0B\xD7"
6506 "\x85\xED\x6B\xFB\x72\xD2\xA5\x8F"
6507 "\xBF\xF9\xAC\x59\x50\xA8\x08\x70"
6508 "\xEC\xBD\x0A\xBF\xE5\x87\xA1\xC2"
6509 "\x92\x14\x78\xAF\xE8\xEA\x2E\xDD"
6510 "\xC1\x03\x9A\xAA\x89\x8B\x32\x46"
6511 "\x5B\x18\x27\xBA\x46\xAA\x64\xDE"
6512 "\xE3\xD5\xA3\xFC\x7B\x5B\x61\xDB"
6513 "\x7E\xDA\xEC\x30\x17\x19\xF8\x80"
6514 "\xB5\x5E\x27\xB5\x37\x3A\x1F\x28"
6515 "\x07\x73\xC3\x63\xCE\xFF\x8C\xFE"
6516 "\x81\x4E\xF8\x24\xF3\xB8\xC7\xE8"
6517 "\x16\x9A\xCC\x58\x2F\x88\x1C\x4B"
6518 "\xBB\x33\xA2\x73\xF0\x1C\x89\x0E"
6519 "\xDC\x34\x27\x89\x98\xCE\x1C\xA2"
6520 "\xD8\xB8\x90\xBE\xEC\x72\x28\x13"
6521 "\xAC\x7B\xF1\xD0\x7F\x7A\x28\x50"
6522 "\xB7\x99\x65\x8A\xC9\xC6\x21\x34"
6523 "\x7F\x67\x9D\xB7\x2C\xCC\xF5\x17"
6524 "\x2B\x89\xAC\xB0\xD7\x1E\x47\xB0"
6525 "\x61\xAF\xD4\x63\x6D\xB8\x2D\x20",
6526 .ilen = 496,
6527 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
6528 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
6529 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
6530 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
6531 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
6532 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
6533 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
6534 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
6535 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
6536 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
6537 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
6538 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
6539 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
6540 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
6541 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
6542 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
6543 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
6544 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
6545 "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
6546 "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
6547 "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
6548 "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
6549 "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
6550 "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
6551 "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
6552 "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
6553 "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
6554 "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
6555 "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
6556 "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
6557 "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
6558 "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
6559 "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
6560 "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
6561 "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
6562 "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
6563 "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
6564 "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
6565 "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
6566 "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
6567 "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
6568 "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
6569 "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
6570 "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
6571 "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
6572 "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
6573 "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
6574 "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
6575 "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
6576 "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
6577 "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
6578 "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
6579 "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
6580 "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
6581 "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
6582 "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
6583 "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
6584 "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
6585 "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
6586 "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
6587 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
6588 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
6589 .rlen = 496,
5717 }, 6590 },
5718}; 6591};
5719 6592
@@ -5963,6 +6836,9 @@ static struct cipher_testvec serpent_lrw_enc_tv_template[] = {
5963 "\x5c\xc6\x84\xfe\x7c\xcb\x26\xfd" 6836 "\x5c\xc6\x84\xfe\x7c\xcb\x26\xfd"
5964 "\xd9\x51\x0f\xd7\x94\x2f\xc5\xa7", 6837 "\xd9\x51\x0f\xd7\x94\x2f\xc5\xa7",
5965 .rlen = 512, 6838 .rlen = 512,
6839 .also_non_np = 1,
6840 .np = 2,
6841 .tap = { 512 - 16, 16 },
5966 }, 6842 },
5967}; 6843};
5968 6844
@@ -6213,6 +7089,9 @@ static struct cipher_testvec serpent_lrw_dec_tv_template[] = {
6213 "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4" 7089 "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
6214 "\x21\xc4\xc2\x75\x67\x89\x37\x0a", 7090 "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
6215 .rlen = 512, 7091 .rlen = 512,
7092 .also_non_np = 1,
7093 .np = 2,
7094 .tap = { 512 - 16, 16 },
6216 }, 7095 },
6217}; 7096};
6218 7097
@@ -6552,6 +7431,9 @@ static struct cipher_testvec serpent_xts_enc_tv_template[] = {
6552 "\xaf\x43\x0b\xc5\x20\x41\x92\x20" 7431 "\xaf\x43\x0b\xc5\x20\x41\x92\x20"
6553 "\xd4\xa0\x91\x98\x11\x5f\x4d\xb1", 7432 "\xd4\xa0\x91\x98\x11\x5f\x4d\xb1",
6554 .rlen = 512, 7433 .rlen = 512,
7434 .also_non_np = 1,
7435 .np = 2,
7436 .tap = { 512 - 16, 16 },
6555 }, 7437 },
6556}; 7438};
6557 7439
@@ -6892,12 +7774,23 @@ static struct cipher_testvec serpent_xts_dec_tv_template[] = {
6892 "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7" 7774 "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
6893 "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff", 7775 "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
6894 .rlen = 512, 7776 .rlen = 512,
7777 .also_non_np = 1,
7778 .np = 2,
7779 .tap = { 512 - 16, 16 },
6895 }, 7780 },
6896}; 7781};
6897 7782
6898/* Cast6 test vectors from RFC 2612 */ 7783/* Cast6 test vectors from RFC 2612 */
6899#define CAST6_ENC_TEST_VECTORS 3 7784#define CAST6_ENC_TEST_VECTORS 4
6900#define CAST6_DEC_TEST_VECTORS 3 7785#define CAST6_DEC_TEST_VECTORS 4
7786#define CAST6_CBC_ENC_TEST_VECTORS 1
7787#define CAST6_CBC_DEC_TEST_VECTORS 1
7788#define CAST6_CTR_ENC_TEST_VECTORS 2
7789#define CAST6_CTR_DEC_TEST_VECTORS 2
7790#define CAST6_LRW_ENC_TEST_VECTORS 1
7791#define CAST6_LRW_DEC_TEST_VECTORS 1
7792#define CAST6_XTS_ENC_TEST_VECTORS 1
7793#define CAST6_XTS_DEC_TEST_VECTORS 1
6901 7794
6902static struct cipher_testvec cast6_enc_tv_template[] = { 7795static struct cipher_testvec cast6_enc_tv_template[] = {
6903 { 7796 {
@@ -6930,6 +7823,143 @@ static struct cipher_testvec cast6_enc_tv_template[] = {
6930 .result = "\x4f\x6a\x20\x38\x28\x68\x97\xb9" 7823 .result = "\x4f\x6a\x20\x38\x28\x68\x97\xb9"
6931 "\xc9\x87\x01\x36\x55\x33\x17\xfa", 7824 "\xc9\x87\x01\x36\x55\x33\x17\xfa",
6932 .rlen = 16, 7825 .rlen = 16,
7826 }, { /* Generated from TF test vectors */
7827 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
7828 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
7829 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
7830 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
7831 .klen = 32,
7832 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
7833 "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
7834 .input = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
7835 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
7836 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
7837 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
7838 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
7839 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
7840 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
7841 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
7842 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
7843 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
7844 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
7845 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
7846 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
7847 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
7848 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
7849 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
7850 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
7851 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
7852 "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
7853 "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
7854 "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
7855 "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
7856 "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
7857 "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
7858 "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
7859 "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
7860 "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
7861 "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
7862 "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
7863 "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
7864 "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
7865 "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
7866 "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
7867 "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
7868 "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
7869 "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
7870 "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
7871 "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
7872 "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
7873 "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
7874 "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
7875 "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
7876 "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
7877 "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
7878 "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
7879 "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
7880 "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
7881 "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
7882 "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
7883 "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
7884 "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
7885 "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
7886 "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
7887 "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
7888 "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
7889 "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
7890 "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
7891 "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
7892 "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
7893 "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
7894 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
7895 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
7896 .ilen = 496,
7897 .result = "\xC3\x70\x22\x32\xF5\x80\xCB\x54"
7898 "\xFC\x30\xE0\xF6\xEB\x39\x57\xA6"
7899 "\xB6\xB9\xC5\xA4\x91\x55\x14\x97"
7900 "\xC1\x20\xFF\x6C\x5C\xF0\x67\xEA"
7901 "\x2F\xED\xD8\xC9\xFB\x38\x3F\xFE"
7902 "\x93\xBE\xDC\x00\xD3\x7F\xAD\x4C"
7903 "\x5A\x08\x92\xD1\x47\x0C\xFA\x6C"
7904 "\xD0\x6A\x99\x10\x72\xF8\x47\x62"
7905 "\x81\x42\xF8\xD8\xF5\xBB\x94\x08"
7906 "\xAA\x97\xA2\x8B\x69\xB3\xD2\x7E"
7907 "\xBC\xB5\x00\x0C\xE5\x44\x4B\x58"
7908 "\xE8\x63\xDC\xB3\xC4\xE5\x23\x12"
7909 "\x5A\x72\x85\x47\x8B\xEC\x9F\x26"
7910 "\x84\xB6\xED\x10\x33\x63\x9B\x5F"
7911 "\x4D\x53\xEE\x94\x45\x8B\x60\x58"
7912 "\x86\x20\xF9\x1E\x82\x08\x3E\x58"
7913 "\x60\x1B\x34\x19\x02\xBE\x4E\x09"
7914 "\xBB\x7C\x15\xCC\x60\x27\x55\x7A"
7915 "\x12\xB8\xD8\x08\x89\x3C\xA6\xF3"
7916 "\xF1\xDD\xA7\x07\xA3\x12\x85\x28"
7917 "\xE9\x57\xAC\x80\x0C\x5C\x0F\x3A"
7918 "\x5D\xC2\x91\xC7\x90\xE4\x8C\x43"
7919 "\x92\xE4\x7C\x26\x69\x4D\x83\x68"
7920 "\x14\x96\x42\x47\xBD\xA9\xE4\x8A"
7921 "\x33\x19\xEB\x54\x8E\x0D\x4B\x6E"
7922 "\x91\x51\xB5\x36\x08\xDE\x1C\x06"
7923 "\x03\xBD\xDE\x81\x26\xF7\x99\xC2"
7924 "\xBA\xF7\x6D\x87\x0D\xE4\xA6\xCF"
7925 "\xC1\xF5\x27\x05\xB8\x02\x57\x72"
7926 "\xE6\x42\x13\x0B\xC6\x47\x05\x74"
7927 "\x24\x15\xF7\x0D\xC2\x23\x9D\xB9"
7928 "\x3C\x77\x18\x93\xBA\xB4\xFC\x8C"
7929 "\x98\x82\x67\x67\xB4\xD7\xD3\x43"
7930 "\x23\x08\x02\xB7\x9B\x99\x05\xFB"
7931 "\xD3\xB5\x00\x0A\xA9\x9D\x66\xD6"
7932 "\x2E\x49\x58\xD0\xA8\x57\x29\x7F"
7933 "\x0A\x0E\x7D\xFC\x92\x83\xCC\x67"
7934 "\xA2\xB1\x70\x3A\x8F\x87\x4A\x8D"
7935 "\x17\xE2\x58\x2B\x88\x0D\x68\x62"
7936 "\xBF\x35\xD1\x6F\xC0\xF0\x18\x62"
7937 "\xB2\xC7\x2D\x58\xC7\x16\xDE\x08"
7938 "\xEB\x84\x1D\x25\xA7\x38\x94\x06"
7939 "\x93\x9D\xF8\xFE\x88\x71\xE7\x84"
7940 "\x2C\xA0\x38\xA3\x1D\x48\xCF\x29"
7941 "\x0B\xBC\xD8\x50\x99\x1A\x26\xFB"
7942 "\x8E\x75\x3D\x73\xEB\x6A\xED\x29"
7943 "\xE0\x8E\xED\xFC\xFE\x6F\xF6\xBA"
7944 "\x41\xE2\x10\x4C\x01\x8B\x69\x2B"
7945 "\x25\x3F\x4D\x70\x7B\x92\xD6\x3B"
7946 "\xAC\xF9\x77\x18\xD9\x6A\x30\xA6"
7947 "\x2E\xFA\x30\xFF\xC8\xD5\x1D\x06"
7948 "\x59\x28\x1D\x86\x43\x04\x5D\x3B"
7949 "\x99\x4C\x04\x5A\x21\x17\x8B\x76"
7950 "\x8F\x72\xCB\xA1\x9C\x29\x4C\xC3"
7951 "\x65\xA2\x58\x2A\xC5\x66\x24\xBF"
7952 "\xBA\xE6\x0C\xDD\x34\x24\x74\xC8"
7953 "\x84\x0A\x66\x2C\xBE\x8F\x32\xA9"
7954 "\xE7\xE4\xA1\xD7\xDA\xAB\x23\x1E"
7955 "\xEB\xEE\x6C\x94\x6F\x9C\x2E\xD1"
7956 "\x49\x2C\xF3\xD4\x90\xCC\x93\x4C"
7957 "\x84\x52\x6D\x68\xDE\xC6\x64\xB2"
7958 "\x11\x74\x93\x57\xB4\x7E\xC6\x00",
7959 .rlen = 496,
7960 .also_non_np = 1,
7961 .np = 2,
7962 .tap = { 496 - 16, 16 },
6933 }, 7963 },
6934}; 7964};
6935 7965
@@ -6964,6 +7994,1331 @@ static struct cipher_testvec cast6_dec_tv_template[] = {
6964 .ilen = 16, 7994 .ilen = 16,
6965 .result = zeroed_string, 7995 .result = zeroed_string,
6966 .rlen = 16, 7996 .rlen = 16,
7997 }, { /* Generated from TF test vectors */
7998 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
7999 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
8000 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
8001 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
8002 .klen = 32,
8003 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
8004 "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
8005 .input = "\xC3\x70\x22\x32\xF5\x80\xCB\x54"
8006 "\xFC\x30\xE0\xF6\xEB\x39\x57\xA6"
8007 "\xB6\xB9\xC5\xA4\x91\x55\x14\x97"
8008 "\xC1\x20\xFF\x6C\x5C\xF0\x67\xEA"
8009 "\x2F\xED\xD8\xC9\xFB\x38\x3F\xFE"
8010 "\x93\xBE\xDC\x00\xD3\x7F\xAD\x4C"
8011 "\x5A\x08\x92\xD1\x47\x0C\xFA\x6C"
8012 "\xD0\x6A\x99\x10\x72\xF8\x47\x62"
8013 "\x81\x42\xF8\xD8\xF5\xBB\x94\x08"
8014 "\xAA\x97\xA2\x8B\x69\xB3\xD2\x7E"
8015 "\xBC\xB5\x00\x0C\xE5\x44\x4B\x58"
8016 "\xE8\x63\xDC\xB3\xC4\xE5\x23\x12"
8017 "\x5A\x72\x85\x47\x8B\xEC\x9F\x26"
8018 "\x84\xB6\xED\x10\x33\x63\x9B\x5F"
8019 "\x4D\x53\xEE\x94\x45\x8B\x60\x58"
8020 "\x86\x20\xF9\x1E\x82\x08\x3E\x58"
8021 "\x60\x1B\x34\x19\x02\xBE\x4E\x09"
8022 "\xBB\x7C\x15\xCC\x60\x27\x55\x7A"
8023 "\x12\xB8\xD8\x08\x89\x3C\xA6\xF3"
8024 "\xF1\xDD\xA7\x07\xA3\x12\x85\x28"
8025 "\xE9\x57\xAC\x80\x0C\x5C\x0F\x3A"
8026 "\x5D\xC2\x91\xC7\x90\xE4\x8C\x43"
8027 "\x92\xE4\x7C\x26\x69\x4D\x83\x68"
8028 "\x14\x96\x42\x47\xBD\xA9\xE4\x8A"
8029 "\x33\x19\xEB\x54\x8E\x0D\x4B\x6E"
8030 "\x91\x51\xB5\x36\x08\xDE\x1C\x06"
8031 "\x03\xBD\xDE\x81\x26\xF7\x99\xC2"
8032 "\xBA\xF7\x6D\x87\x0D\xE4\xA6\xCF"
8033 "\xC1\xF5\x27\x05\xB8\x02\x57\x72"
8034 "\xE6\x42\x13\x0B\xC6\x47\x05\x74"
8035 "\x24\x15\xF7\x0D\xC2\x23\x9D\xB9"
8036 "\x3C\x77\x18\x93\xBA\xB4\xFC\x8C"
8037 "\x98\x82\x67\x67\xB4\xD7\xD3\x43"
8038 "\x23\x08\x02\xB7\x9B\x99\x05\xFB"
8039 "\xD3\xB5\x00\x0A\xA9\x9D\x66\xD6"
8040 "\x2E\x49\x58\xD0\xA8\x57\x29\x7F"
8041 "\x0A\x0E\x7D\xFC\x92\x83\xCC\x67"
8042 "\xA2\xB1\x70\x3A\x8F\x87\x4A\x8D"
8043 "\x17\xE2\x58\x2B\x88\x0D\x68\x62"
8044 "\xBF\x35\xD1\x6F\xC0\xF0\x18\x62"
8045 "\xB2\xC7\x2D\x58\xC7\x16\xDE\x08"
8046 "\xEB\x84\x1D\x25\xA7\x38\x94\x06"
8047 "\x93\x9D\xF8\xFE\x88\x71\xE7\x84"
8048 "\x2C\xA0\x38\xA3\x1D\x48\xCF\x29"
8049 "\x0B\xBC\xD8\x50\x99\x1A\x26\xFB"
8050 "\x8E\x75\x3D\x73\xEB\x6A\xED\x29"
8051 "\xE0\x8E\xED\xFC\xFE\x6F\xF6\xBA"
8052 "\x41\xE2\x10\x4C\x01\x8B\x69\x2B"
8053 "\x25\x3F\x4D\x70\x7B\x92\xD6\x3B"
8054 "\xAC\xF9\x77\x18\xD9\x6A\x30\xA6"
8055 "\x2E\xFA\x30\xFF\xC8\xD5\x1D\x06"
8056 "\x59\x28\x1D\x86\x43\x04\x5D\x3B"
8057 "\x99\x4C\x04\x5A\x21\x17\x8B\x76"
8058 "\x8F\x72\xCB\xA1\x9C\x29\x4C\xC3"
8059 "\x65\xA2\x58\x2A\xC5\x66\x24\xBF"
8060 "\xBA\xE6\x0C\xDD\x34\x24\x74\xC8"
8061 "\x84\x0A\x66\x2C\xBE\x8F\x32\xA9"
8062 "\xE7\xE4\xA1\xD7\xDA\xAB\x23\x1E"
8063 "\xEB\xEE\x6C\x94\x6F\x9C\x2E\xD1"
8064 "\x49\x2C\xF3\xD4\x90\xCC\x93\x4C"
8065 "\x84\x52\x6D\x68\xDE\xC6\x64\xB2"
8066 "\x11\x74\x93\x57\xB4\x7E\xC6\x00",
8067 .ilen = 496,
8068 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
8069 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
8070 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
8071 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
8072 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
8073 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
8074 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
8075 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
8076 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
8077 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
8078 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
8079 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
8080 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
8081 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
8082 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
8083 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
8084 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
8085 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
8086 "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
8087 "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
8088 "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
8089 "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
8090 "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
8091 "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
8092 "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
8093 "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
8094 "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
8095 "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
8096 "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
8097 "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
8098 "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
8099 "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
8100 "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
8101 "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
8102 "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
8103 "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
8104 "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
8105 "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
8106 "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
8107 "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
8108 "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
8109 "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
8110 "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
8111 "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
8112 "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
8113 "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
8114 "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
8115 "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
8116 "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
8117 "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
8118 "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
8119 "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
8120 "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
8121 "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
8122 "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
8123 "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
8124 "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
8125 "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
8126 "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
8127 "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
8128 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
8129 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
8130 .rlen = 496,
8131 .also_non_np = 1,
8132 .np = 2,
8133 .tap = { 496 - 16, 16 },
8134 },
8135};
8136
8137static struct cipher_testvec cast6_cbc_enc_tv_template[] = {
8138 { /* Generated from TF test vectors */
8139 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
8140 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
8141 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
8142 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
8143 .klen = 32,
8144 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
8145 "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
8146 .input = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
8147 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
8148 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
8149 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
8150 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
8151 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
8152 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
8153 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
8154 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
8155 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
8156 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
8157 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
8158 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
8159 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
8160 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
8161 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
8162 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
8163 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
8164 "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
8165 "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
8166 "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
8167 "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
8168 "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
8169 "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
8170 "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
8171 "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
8172 "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
8173 "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
8174 "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
8175 "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
8176 "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
8177 "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
8178 "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
8179 "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
8180 "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
8181 "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
8182 "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
8183 "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
8184 "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
8185 "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
8186 "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
8187 "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
8188 "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
8189 "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
8190 "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
8191 "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
8192 "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
8193 "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
8194 "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
8195 "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
8196 "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
8197 "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
8198 "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
8199 "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
8200 "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
8201 "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
8202 "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
8203 "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
8204 "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
8205 "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
8206 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
8207 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
8208 .ilen = 496,
8209 .result = "\xDF\x77\x68\x96\xC7\xBA\xF8\xE2"
8210 "\x0E\x24\x99\x1A\xAA\xF3\xC6\x9F"
8211 "\xA0\x73\xB3\x70\xC3\x68\x64\x70"
8212 "\xAD\x33\x02\xFB\x88\x74\xAA\x78"
8213 "\xC7\x47\x1A\x18\x61\x2D\xAC\x9F"
8214 "\x7E\x6F\xDF\x05\x13\x76\xA6\x72"
8215 "\xB7\x13\x09\x0F\x7D\x38\xDF\x25"
8216 "\x4E\xFD\x50\x45\xFA\x35\x6A\xC0"
8217 "\x57\x95\xE1\x21\x26\x10\x9A\x21"
8218 "\xA1\x8A\x51\x05\xD1\xB1\x78\x35"
8219 "\x98\xF5\xAE\xC0\xC1\x8B\x94\xFF"
8220 "\xD0\x69\x3F\x42\xC2\x01\xA7\x9B"
8221 "\x23\x16\x47\x72\x81\x13\x3A\x72"
8222 "\xEC\xD9\x40\x88\x00\x9C\xB0\xA8"
8223 "\x9C\xAC\xCE\x11\x73\x7B\x63\x3E"
8224 "\xA3\x63\x98\x7D\x35\xE4\xD9\x83"
8225 "\xE2\xD0\x52\x87\x0C\x1F\xB0\xB3"
8226 "\x41\x1A\x93\x8D\x76\x31\x9F\xF2"
8227 "\xFE\x09\xA3\x8F\x22\x6A\x3B\xB9"
8228 "\x6C\x9E\xE4\xA1\xA0\xC4\xE7\xA1"
8229 "\x21\x9C\x1A\xCA\x65\xDE\x44\x03"
8230 "\x99\xF2\xD2\x39\xE3\x3F\x0F\x37"
8231 "\x53\x50\x23\xA4\x81\x6E\xDA\xFB"
8232 "\xF8\x7B\x01\xD7\xB2\x32\x9C\xB8"
8233 "\xB1\x0E\x99\x17\xB5\x38\xF9\xD7"
8234 "\x86\x2D\x6E\x94\x5C\x99\x9D\xB3"
8235 "\xD3\x63\x4B\x2A\x7D\x44\x6A\xB2"
8236 "\xC1\x03\xE6\x5A\x37\xD8\x64\x18"
8237 "\xAA\x32\xCE\x29\xED\xC0\xA2\xCB"
8238 "\x8D\xAF\xCD\xBE\x8F\xB6\xEC\xB4"
8239 "\x89\x05\x81\x6E\x71\x4F\xC3\x28"
8240 "\x10\xC1\x62\xC4\x41\xE9\xD2\x39"
8241 "\xF3\x22\x39\x12\x2C\xC2\x95\x2D"
8242 "\xBF\x93\x58\x4B\x04\xD1\x8D\x57"
8243 "\xAE\xEB\x60\x03\x56\x35\xAD\x5A"
8244 "\xE9\xC3\xFF\x4E\x31\xE1\x37\xF8"
8245 "\x7D\xEE\x65\x8A\xB6\x88\x1A\x3E"
8246 "\x07\x09\x82\xBA\xF0\x80\x8A\xD0"
8247 "\xA0\x3F\x6A\xE9\x24\x87\x19\x65"
8248 "\x73\x3F\x12\x91\x47\x54\xBA\x39"
8249 "\x30\x5B\x1E\xE5\xC2\xF9\x3F\xEF"
8250 "\xD6\x75\xF9\xB8\x7C\x8B\x05\x76"
8251 "\xEE\xB7\x08\x25\x4B\xB6\x7B\x47"
8252 "\x72\xC0\x4C\xD4\xDA\xE0\x75\xF1"
8253 "\x7C\xE8\x94\x9E\x16\x6E\xB8\x12"
8254 "\xA1\xC1\x6E\x3B\x1C\x59\x41\x2D"
8255 "\x23\xFA\x7D\x77\xB8\x46\x75\xFE"
8256 "\x4F\x10\xD3\x09\x60\xA1\x36\x96"
8257 "\x5B\xC2\xDC\x6E\x84\x7D\x9B\x14"
8258 "\x80\x21\x83\x58\x3C\x76\xFD\x28"
8259 "\x1D\xF9\x93\x13\xD7\x0E\x62\x14"
8260 "\x5A\xC5\x4E\x08\xA5\x56\xA4\x3C"
8261 "\x68\x93\x44\x70\xDF\xCF\x4A\x51"
8262 "\x0B\x81\x29\x41\xE5\x62\x4D\x36"
8263 "\xB3\xEA\x94\xA6\xB9\xDD\x3F\x09"
8264 "\x62\x34\xA0\x6A\x7E\x7D\xF5\xF6"
8265 "\x01\x91\xB4\x27\xDA\x59\xD6\x17"
8266 "\x56\x4D\x82\x62\x37\xA3\x48\x01"
8267 "\x99\x91\x77\xB2\x08\x6B\x2C\x37"
8268 "\xC5\x5C\xAD\xB6\x07\xB6\x84\xF3"
8269 "\x4D\x59\x7D\xC5\x28\x69\xFA\x92"
8270 "\x22\x46\x89\x2D\x0F\x2B\x08\x24",
8271 .rlen = 496,
8272 .also_non_np = 1,
8273 .np = 2,
8274 .tap = { 496 - 16, 16 },
8275 },
8276};
8277
8278static struct cipher_testvec cast6_cbc_dec_tv_template[] = {
8279 { /* Generated from TF test vectors */
8280 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
8281 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
8282 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
8283 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
8284 .klen = 32,
8285 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
8286 "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
8287 .input = "\xDF\x77\x68\x96\xC7\xBA\xF8\xE2"
8288 "\x0E\x24\x99\x1A\xAA\xF3\xC6\x9F"
8289 "\xA0\x73\xB3\x70\xC3\x68\x64\x70"
8290 "\xAD\x33\x02\xFB\x88\x74\xAA\x78"
8291 "\xC7\x47\x1A\x18\x61\x2D\xAC\x9F"
8292 "\x7E\x6F\xDF\x05\x13\x76\xA6\x72"
8293 "\xB7\x13\x09\x0F\x7D\x38\xDF\x25"
8294 "\x4E\xFD\x50\x45\xFA\x35\x6A\xC0"
8295 "\x57\x95\xE1\x21\x26\x10\x9A\x21"
8296 "\xA1\x8A\x51\x05\xD1\xB1\x78\x35"
8297 "\x98\xF5\xAE\xC0\xC1\x8B\x94\xFF"
8298 "\xD0\x69\x3F\x42\xC2\x01\xA7\x9B"
8299 "\x23\x16\x47\x72\x81\x13\x3A\x72"
8300 "\xEC\xD9\x40\x88\x00\x9C\xB0\xA8"
8301 "\x9C\xAC\xCE\x11\x73\x7B\x63\x3E"
8302 "\xA3\x63\x98\x7D\x35\xE4\xD9\x83"
8303 "\xE2\xD0\x52\x87\x0C\x1F\xB0\xB3"
8304 "\x41\x1A\x93\x8D\x76\x31\x9F\xF2"
8305 "\xFE\x09\xA3\x8F\x22\x6A\x3B\xB9"
8306 "\x6C\x9E\xE4\xA1\xA0\xC4\xE7\xA1"
8307 "\x21\x9C\x1A\xCA\x65\xDE\x44\x03"
8308 "\x99\xF2\xD2\x39\xE3\x3F\x0F\x37"
8309 "\x53\x50\x23\xA4\x81\x6E\xDA\xFB"
8310 "\xF8\x7B\x01\xD7\xB2\x32\x9C\xB8"
8311 "\xB1\x0E\x99\x17\xB5\x38\xF9\xD7"
8312 "\x86\x2D\x6E\x94\x5C\x99\x9D\xB3"
8313 "\xD3\x63\x4B\x2A\x7D\x44\x6A\xB2"
8314 "\xC1\x03\xE6\x5A\x37\xD8\x64\x18"
8315 "\xAA\x32\xCE\x29\xED\xC0\xA2\xCB"
8316 "\x8D\xAF\xCD\xBE\x8F\xB6\xEC\xB4"
8317 "\x89\x05\x81\x6E\x71\x4F\xC3\x28"
8318 "\x10\xC1\x62\xC4\x41\xE9\xD2\x39"
8319 "\xF3\x22\x39\x12\x2C\xC2\x95\x2D"
8320 "\xBF\x93\x58\x4B\x04\xD1\x8D\x57"
8321 "\xAE\xEB\x60\x03\x56\x35\xAD\x5A"
8322 "\xE9\xC3\xFF\x4E\x31\xE1\x37\xF8"
8323 "\x7D\xEE\x65\x8A\xB6\x88\x1A\x3E"
8324 "\x07\x09\x82\xBA\xF0\x80\x8A\xD0"
8325 "\xA0\x3F\x6A\xE9\x24\x87\x19\x65"
8326 "\x73\x3F\x12\x91\x47\x54\xBA\x39"
8327 "\x30\x5B\x1E\xE5\xC2\xF9\x3F\xEF"
8328 "\xD6\x75\xF9\xB8\x7C\x8B\x05\x76"
8329 "\xEE\xB7\x08\x25\x4B\xB6\x7B\x47"
8330 "\x72\xC0\x4C\xD4\xDA\xE0\x75\xF1"
8331 "\x7C\xE8\x94\x9E\x16\x6E\xB8\x12"
8332 "\xA1\xC1\x6E\x3B\x1C\x59\x41\x2D"
8333 "\x23\xFA\x7D\x77\xB8\x46\x75\xFE"
8334 "\x4F\x10\xD3\x09\x60\xA1\x36\x96"
8335 "\x5B\xC2\xDC\x6E\x84\x7D\x9B\x14"
8336 "\x80\x21\x83\x58\x3C\x76\xFD\x28"
8337 "\x1D\xF9\x93\x13\xD7\x0E\x62\x14"
8338 "\x5A\xC5\x4E\x08\xA5\x56\xA4\x3C"
8339 "\x68\x93\x44\x70\xDF\xCF\x4A\x51"
8340 "\x0B\x81\x29\x41\xE5\x62\x4D\x36"
8341 "\xB3\xEA\x94\xA6\xB9\xDD\x3F\x09"
8342 "\x62\x34\xA0\x6A\x7E\x7D\xF5\xF6"
8343 "\x01\x91\xB4\x27\xDA\x59\xD6\x17"
8344 "\x56\x4D\x82\x62\x37\xA3\x48\x01"
8345 "\x99\x91\x77\xB2\x08\x6B\x2C\x37"
8346 "\xC5\x5C\xAD\xB6\x07\xB6\x84\xF3"
8347 "\x4D\x59\x7D\xC5\x28\x69\xFA\x92"
8348 "\x22\x46\x89\x2D\x0F\x2B\x08\x24",
8349 .ilen = 496,
8350 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
8351 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
8352 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
8353 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
8354 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
8355 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
8356 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
8357 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
8358 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
8359 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
8360 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
8361 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
8362 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
8363 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
8364 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
8365 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
8366 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
8367 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
8368 "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
8369 "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
8370 "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
8371 "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
8372 "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
8373 "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
8374 "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
8375 "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
8376 "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
8377 "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
8378 "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
8379 "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
8380 "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
8381 "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
8382 "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
8383 "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
8384 "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
8385 "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
8386 "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
8387 "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
8388 "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
8389 "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
8390 "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
8391 "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
8392 "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
8393 "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
8394 "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
8395 "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
8396 "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
8397 "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
8398 "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
8399 "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
8400 "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
8401 "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
8402 "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
8403 "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
8404 "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
8405 "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
8406 "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
8407 "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
8408 "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
8409 "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
8410 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
8411 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
8412 .rlen = 496,
8413 .also_non_np = 1,
8414 .np = 2,
8415 .tap = { 496 - 16, 16 },
8416 },
8417};
8418
8419static struct cipher_testvec cast6_ctr_enc_tv_template[] = {
8420 { /* Generated from TF test vectors */
8421 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
8422 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
8423 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
8424 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
8425 .klen = 32,
8426 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
8427 "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
8428 .input = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
8429 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
8430 "\x3A",
8431 .ilen = 17,
8432 .result = "\x26\x0A\xF1\xE2\x3F\x8A\xEF\xA3"
8433 "\x53\x9A\x5E\x1B\x2A\x1A\xC6\x0A"
8434 "\x57",
8435 .rlen = 17,
8436 }, { /* Generated from TF test vectors */
8437 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
8438 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
8439 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
8440 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
8441 .klen = 32,
8442 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
8443 "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
8444 .input = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
8445 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
8446 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
8447 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
8448 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
8449 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
8450 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
8451 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
8452 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
8453 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
8454 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
8455 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
8456 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
8457 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
8458 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
8459 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
8460 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
8461 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
8462 "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
8463 "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
8464 "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
8465 "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
8466 "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
8467 "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
8468 "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
8469 "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
8470 "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
8471 "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
8472 "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
8473 "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
8474 "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
8475 "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
8476 "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
8477 "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
8478 "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
8479 "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
8480 "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
8481 "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
8482 "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
8483 "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
8484 "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
8485 "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
8486 "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
8487 "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
8488 "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
8489 "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
8490 "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
8491 "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
8492 "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
8493 "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
8494 "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
8495 "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
8496 "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
8497 "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
8498 "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
8499 "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
8500 "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
8501 "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
8502 "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
8503 "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
8504 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
8505 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
8506 .ilen = 496,
8507 .result = "\x26\x0A\xF1\xE2\x3F\x8A\xEF\xA3"
8508 "\x53\x9A\x5E\x1B\x2A\x1A\xC6\x0A"
8509 "\x57\xA3\xEF\x47\x2A\xE8\x88\xA7"
8510 "\x3C\xD0\xEC\xB9\x94\x50\x7D\x56"
8511 "\xBC\xE1\xC1\xF5\xE1\xEE\x12\xF8"
8512 "\x4F\x03\x82\x3A\x93\x6B\x4C\xD3"
8513 "\xE3\xF3\xFA\xC2\x23\x55\x98\x20"
8514 "\x49\x76\x9B\x6B\xC1\x23\xBF\xE5"
8515 "\xD4\xC4\x2F\x61\xE1\x67\x2A\x30"
8516 "\x6F\x29\xCA\x54\xF8\x1B\xA6\x7D"
8517 "\x66\x45\xEE\xC8\x19\xBE\x50\xF0"
8518 "\x5F\x65\xF8\x1E\x4D\x07\x87\xD9"
8519 "\xD3\xD9\x1B\x09\x89\xFD\x42\xC5"
8520 "\xDB\xEB\x86\xF1\x67\x04\x0F\x5C"
8521 "\x81\xDF\x82\x12\xC7\x4C\x1B\x07"
8522 "\xDE\xE6\xFA\x29\x86\xD1\xB0\xBA"
8523 "\x3D\x6A\x69\x76\xEC\x0F\xB4\xE6"
8524 "\xCD\xA7\xF8\xA8\xB8\xE0\x33\xF5"
8525 "\x49\x61\x22\x52\x64\x8C\x46\x41"
8526 "\x1F\x48\x5F\x4F\xA2\x89\x36\x17"
8527 "\x20\xF8\x2F\x8F\x4B\xFA\xF2\xC0"
8528 "\x1E\x18\xA2\xF8\xB7\x6D\x98\xE3"
8529 "\x00\x14\x15\x59\xC1\x30\x64\xAF"
8530 "\xA8\x01\x38\xAB\xD4\x8B\xEC\x7C"
8531 "\x44\x9A\xC6\x2C\x2E\x2B\x2B\xF4"
8532 "\x02\x37\xC4\x69\xEF\x36\xC1\xF3"
8533 "\xA0\xFB\xFE\x29\xAD\x39\xCF\xD0"
8534 "\x51\x73\xA3\x22\x42\x41\xAB\xD2"
8535 "\x0F\x50\x14\xB9\x54\xD3\xD4\xFA"
8536 "\xBF\xC9\xBB\xCE\xC4\x1D\x2D\xAF"
8537 "\xC9\x3F\x07\x87\x42\x4B\x3A\x54"
8538 "\x34\x8E\x37\xA3\x03\x6F\x65\x66"
8539 "\xDB\x44\xC3\xE8\xD7\xDD\x7D\xDD"
8540 "\x61\xB4\x2B\x80\xA3\x98\x13\xF5"
8541 "\x5A\xD3\x34\x58\xC3\x6E\xF6\xB8"
8542 "\x0A\xC6\x50\x01\x8E\xD5\x6C\x7D"
8543 "\xFE\x16\xB6\xCF\xFC\x51\x40\xAE"
8544 "\xB3\x15\xAC\x90\x6F\x0B\x28\x3A"
8545 "\x60\x40\x38\x90\x20\x46\xC7\xB3"
8546 "\x0B\x12\x6D\x3B\x15\x14\xF9\xF4"
8547 "\x11\x41\x76\x6B\xB3\x60\x82\x3C"
8548 "\x84\xFB\x08\x2E\x92\x25\xCB\x79"
8549 "\x6F\x58\xC5\x94\x00\x00\x47\xB6"
8550 "\x9E\xDC\x0F\x29\x70\x46\x20\x76"
8551 "\x65\x75\x66\x5C\x00\x96\xB3\xE1"
8552 "\x0B\xA7\x11\x8B\x2E\x61\x4E\x45"
8553 "\x73\xFC\x91\xAB\x79\x41\x23\x14"
8554 "\x13\xB6\x72\x6C\x46\xB3\x03\x11"
8555 "\xE4\xF1\xEE\xC9\x7A\xCF\x96\x32"
8556 "\xB6\xF0\x8B\x97\xB4\xCF\x82\xB7"
8557 "\x15\x48\x44\x99\x09\xF6\xE0\xD7"
8558 "\xBC\xF1\x5B\x91\x4F\x30\x22\xA2"
8559 "\x45\xC4\x68\x55\xC2\xBE\xA7\xD2"
8560 "\x12\x53\x35\x9C\xF9\xE7\x35\x5D"
8561 "\x81\xE4\x86\x42\xC3\x58\xFB\xF0"
8562 "\x38\x9B\x8E\x5A\xEF\x83\x33\x0F"
8563 "\x00\x4E\x3F\x9F\xF5\x84\x62\xC4"
8564 "\x19\x35\x88\x22\x45\x59\x0E\x8F"
8565 "\xEC\x27\xDD\x4A\xA4\x1F\xBC\x41"
8566 "\x9B\x66\x8D\x32\xBA\x81\x34\x87"
8567 "\x0E\x74\x33\x30\x62\xB9\x89\xDF"
8568 "\xF9\xC5\xDD\x27\xB3\x39\xCB\xCB",
8569 .rlen = 496,
8570 .also_non_np = 1,
8571 .np = 2,
8572 .tap = { 496 - 16, 16 },
8573 },
8574};
8575
8576static struct cipher_testvec cast6_ctr_dec_tv_template[] = {
8577 { /* Generated from TF test vectors */
8578 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
8579 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
8580 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
8581 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
8582 .klen = 32,
8583 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
8584 "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
8585 .input = "\x26\x0A\xF1\xE2\x3F\x8A\xEF\xA3"
8586 "\x53\x9A\x5E\x1B\x2A\x1A\xC6\x0A"
8587 "\x57",
8588 .ilen = 17,
8589 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
8590 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
8591 "\x3A",
8592 .rlen = 17,
8593 }, { /* Generated from TF test vectors */
8594 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
8595 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
8596 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
8597 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
8598 .klen = 32,
8599 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F"
8600 "\xC4\x29\x8E\xF3\x35\x9A\xFF\x64",
8601 .input = "\x26\x0A\xF1\xE2\x3F\x8A\xEF\xA3"
8602 "\x53\x9A\x5E\x1B\x2A\x1A\xC6\x0A"
8603 "\x57\xA3\xEF\x47\x2A\xE8\x88\xA7"
8604 "\x3C\xD0\xEC\xB9\x94\x50\x7D\x56"
8605 "\xBC\xE1\xC1\xF5\xE1\xEE\x12\xF8"
8606 "\x4F\x03\x82\x3A\x93\x6B\x4C\xD3"
8607 "\xE3\xF3\xFA\xC2\x23\x55\x98\x20"
8608 "\x49\x76\x9B\x6B\xC1\x23\xBF\xE5"
8609 "\xD4\xC4\x2F\x61\xE1\x67\x2A\x30"
8610 "\x6F\x29\xCA\x54\xF8\x1B\xA6\x7D"
8611 "\x66\x45\xEE\xC8\x19\xBE\x50\xF0"
8612 "\x5F\x65\xF8\x1E\x4D\x07\x87\xD9"
8613 "\xD3\xD9\x1B\x09\x89\xFD\x42\xC5"
8614 "\xDB\xEB\x86\xF1\x67\x04\x0F\x5C"
8615 "\x81\xDF\x82\x12\xC7\x4C\x1B\x07"
8616 "\xDE\xE6\xFA\x29\x86\xD1\xB0\xBA"
8617 "\x3D\x6A\x69\x76\xEC\x0F\xB4\xE6"
8618 "\xCD\xA7\xF8\xA8\xB8\xE0\x33\xF5"
8619 "\x49\x61\x22\x52\x64\x8C\x46\x41"
8620 "\x1F\x48\x5F\x4F\xA2\x89\x36\x17"
8621 "\x20\xF8\x2F\x8F\x4B\xFA\xF2\xC0"
8622 "\x1E\x18\xA2\xF8\xB7\x6D\x98\xE3"
8623 "\x00\x14\x15\x59\xC1\x30\x64\xAF"
8624 "\xA8\x01\x38\xAB\xD4\x8B\xEC\x7C"
8625 "\x44\x9A\xC6\x2C\x2E\x2B\x2B\xF4"
8626 "\x02\x37\xC4\x69\xEF\x36\xC1\xF3"
8627 "\xA0\xFB\xFE\x29\xAD\x39\xCF\xD0"
8628 "\x51\x73\xA3\x22\x42\x41\xAB\xD2"
8629 "\x0F\x50\x14\xB9\x54\xD3\xD4\xFA"
8630 "\xBF\xC9\xBB\xCE\xC4\x1D\x2D\xAF"
8631 "\xC9\x3F\x07\x87\x42\x4B\x3A\x54"
8632 "\x34\x8E\x37\xA3\x03\x6F\x65\x66"
8633 "\xDB\x44\xC3\xE8\xD7\xDD\x7D\xDD"
8634 "\x61\xB4\x2B\x80\xA3\x98\x13\xF5"
8635 "\x5A\xD3\x34\x58\xC3\x6E\xF6\xB8"
8636 "\x0A\xC6\x50\x01\x8E\xD5\x6C\x7D"
8637 "\xFE\x16\xB6\xCF\xFC\x51\x40\xAE"
8638 "\xB3\x15\xAC\x90\x6F\x0B\x28\x3A"
8639 "\x60\x40\x38\x90\x20\x46\xC7\xB3"
8640 "\x0B\x12\x6D\x3B\x15\x14\xF9\xF4"
8641 "\x11\x41\x76\x6B\xB3\x60\x82\x3C"
8642 "\x84\xFB\x08\x2E\x92\x25\xCB\x79"
8643 "\x6F\x58\xC5\x94\x00\x00\x47\xB6"
8644 "\x9E\xDC\x0F\x29\x70\x46\x20\x76"
8645 "\x65\x75\x66\x5C\x00\x96\xB3\xE1"
8646 "\x0B\xA7\x11\x8B\x2E\x61\x4E\x45"
8647 "\x73\xFC\x91\xAB\x79\x41\x23\x14"
8648 "\x13\xB6\x72\x6C\x46\xB3\x03\x11"
8649 "\xE4\xF1\xEE\xC9\x7A\xCF\x96\x32"
8650 "\xB6\xF0\x8B\x97\xB4\xCF\x82\xB7"
8651 "\x15\x48\x44\x99\x09\xF6\xE0\xD7"
8652 "\xBC\xF1\x5B\x91\x4F\x30\x22\xA2"
8653 "\x45\xC4\x68\x55\xC2\xBE\xA7\xD2"
8654 "\x12\x53\x35\x9C\xF9\xE7\x35\x5D"
8655 "\x81\xE4\x86\x42\xC3\x58\xFB\xF0"
8656 "\x38\x9B\x8E\x5A\xEF\x83\x33\x0F"
8657 "\x00\x4E\x3F\x9F\xF5\x84\x62\xC4"
8658 "\x19\x35\x88\x22\x45\x59\x0E\x8F"
8659 "\xEC\x27\xDD\x4A\xA4\x1F\xBC\x41"
8660 "\x9B\x66\x8D\x32\xBA\x81\x34\x87"
8661 "\x0E\x74\x33\x30\x62\xB9\x89\xDF"
8662 "\xF9\xC5\xDD\x27\xB3\x39\xCB\xCB",
8663 .ilen = 496,
8664 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
8665 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
8666 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
8667 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
8668 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
8669 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
8670 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
8671 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
8672 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
8673 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
8674 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
8675 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
8676 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
8677 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
8678 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
8679 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
8680 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
8681 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
8682 "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
8683 "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
8684 "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
8685 "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
8686 "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
8687 "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
8688 "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
8689 "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
8690 "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
8691 "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
8692 "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
8693 "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
8694 "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
8695 "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
8696 "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
8697 "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
8698 "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
8699 "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
8700 "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
8701 "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
8702 "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
8703 "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
8704 "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
8705 "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
8706 "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
8707 "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
8708 "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
8709 "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
8710 "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
8711 "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
8712 "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
8713 "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
8714 "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
8715 "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
8716 "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
8717 "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
8718 "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
8719 "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
8720 "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
8721 "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
8722 "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
8723 "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
8724 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
8725 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
8726 .rlen = 496,
8727 .also_non_np = 1,
8728 .np = 2,
8729 .tap = { 496 - 16, 16 },
8730 },
8731};
8732
8733static struct cipher_testvec cast6_lrw_enc_tv_template[] = {
8734 { /* Generated from TF test vectors */
8735 .key = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
8736 "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
8737 "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
8738 "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
8739 "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
8740 "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
8741 .klen = 48,
8742 .iv = "\x00\x00\x00\x00\x00\x00\x00\x00"
8743 "\x00\x00\x00\x00\x00\x00\x00\x01",
8744 .input = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
8745 "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
8746 "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
8747 "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
8748 "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
8749 "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
8750 "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
8751 "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
8752 "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
8753 "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
8754 "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
8755 "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
8756 "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
8757 "\x4c\x96\x12\xed\x7c\x92\x03\x01"
8758 "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
8759 "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
8760 "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
8761 "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
8762 "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
8763 "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
8764 "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
8765 "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
8766 "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
8767 "\x76\x12\x73\x44\x1a\x56\xd7\x72"
8768 "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
8769 "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
8770 "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
8771 "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
8772 "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
8773 "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
8774 "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
8775 "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
8776 "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
8777 "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
8778 "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
8779 "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
8780 "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
8781 "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
8782 "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
8783 "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
8784 "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
8785 "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
8786 "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
8787 "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
8788 "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
8789 "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
8790 "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
8791 "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
8792 "\x62\x73\x65\xfd\x46\x63\x25\x3d"
8793 "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
8794 "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
8795 "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
8796 "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
8797 "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
8798 "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
8799 "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
8800 "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
8801 "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
8802 "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
8803 "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
8804 "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
8805 "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
8806 "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
8807 "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
8808 .ilen = 512,
8809 .result = "\x55\x25\x09\x8B\xB5\xD5\xF8\xBF"
8810 "\x37\x4A\xFE\x3C\x47\xD8\xE6\xEB"
8811 "\xCA\xA4\x9B\xB0\xAB\x6D\x64\xCA"
8812 "\x58\xB6\x73\xF0\xD7\x52\x34\xEF"
8813 "\xFB\x3E\x96\x81\xB7\x71\x34\xA4"
8814 "\x55\x20\xBE\x39\x5A\x2B\xF9\xD1"
8815 "\x65\x0B\xDA\xD3\x7E\xB3\xA6\xF7"
8816 "\x2E\x0B\x5A\x52\xDB\x39\x8C\x9B"
8817 "\x61\x17\x5F\xAF\xB6\x5A\xC8\x08"
8818 "\xA7\xB7\x2A\x11\x7C\x97\x38\x9D"
8819 "\x59\x0E\x66\x59\x5E\xD8\x8B\xCE"
8820 "\x70\xE0\xC3\x42\xB0\x8C\x0F\xBA"
8821 "\xB2\x0D\x81\xB6\xBE\x61\x1C\x2D"
8822 "\x7E\xEA\x91\x25\xAC\xEC\xF8\x28"
8823 "\x80\x1D\xF0\x30\xBA\x62\x77\x7D"
8824 "\xDB\x15\x69\xDF\xFA\x2A\x81\x64"
8825 "\x95\x5B\xA4\x7F\x3E\x4F\xE3\x30"
8826 "\xB0\x5C\xC2\x05\xF8\xF0\x29\xE7"
8827 "\x0A\xA0\x66\xB2\x5D\x0F\x39\x2B"
8828 "\xB4\xB3\x00\xA9\xD0\xAB\x63\x61"
8829 "\x5E\xDB\xFC\x11\x74\x25\x96\x65"
8830 "\xE8\xE2\x34\x57\x77\x15\x5E\x70"
8831 "\xFF\x10\x90\xC3\x64\xF0\x11\x0A"
8832 "\x63\x3A\xD3\x55\x92\x15\x4B\x0C"
8833 "\xC7\x08\x89\x17\x3B\x99\xAD\x63"
8834 "\xE7\x06\xDF\x52\xBC\x15\x64\x45"
8835 "\x9D\x7A\xFB\x69\xBC\x2D\x6E\xA9"
8836 "\x35\xD9\xD8\xF5\x0C\xC4\xA2\x23"
8837 "\x9C\x18\x8B\xA8\x8C\xFE\xF8\x0E"
8838 "\xBD\xAB\x60\x1A\x51\x17\x54\x27"
8839 "\xB6\xE8\xBE\x0F\xA9\xA5\x82\x19"
8840 "\x2F\x6F\x20\xA7\x47\xED\x74\x6C"
8841 "\x4E\xC1\xF8\x8C\x14\xF3\xBB\x1F"
8842 "\xED\x4D\x8F\x7C\x37\xEF\x19\xA1"
8843 "\x07\x16\xDE\x76\xCC\x5E\x94\x02"
8844 "\xFB\xBF\xE4\x81\x50\xCE\xFC\x0F"
8845 "\x9E\xCF\x3D\xF6\x67\x00\xBF\xA7"
8846 "\x6E\x21\x58\x36\x06\xDE\xB3\xD4"
8847 "\xA2\xFA\xD8\x4E\xE0\xB9\x7F\x23"
8848 "\x51\x21\x2B\x32\x68\xAA\xF8\xA8"
8849 "\x93\x08\xB5\x6D\xE6\x43\x2C\xB7"
8850 "\x31\xB2\x0F\xD0\xA2\x51\xC0\x25"
8851 "\x30\xC7\x10\x3F\x97\x27\x01\x8E"
8852 "\xFA\xD8\x4F\x78\xD8\x2E\x1D\xEB"
8853 "\xA1\x37\x52\x0F\x7B\x5E\x87\xA8"
8854 "\x22\xE2\xE6\x92\xA7\x5F\x11\x32"
8855 "\xCC\x93\x34\xFC\xD1\x7E\xAE\x54"
8856 "\xBC\x6A\x1B\x91\xD1\x2E\x21\xEC"
8857 "\x5D\xF1\xC4\xF1\x55\x20\xBF\xE5"
8858 "\x96\x3D\x69\x91\x20\x4E\xF2\x61"
8859 "\xDA\x77\xFE\xEE\xC3\x74\x57\x2A"
8860 "\x78\x39\xB0\xE0\xCF\x12\x56\xD6"
8861 "\x05\xDC\xF9\x19\x66\x44\x1D\xF9"
8862 "\x82\x37\xD4\xC2\x60\xB6\x31\xDF"
8863 "\x0C\xAF\xBC\x8B\x55\x9A\xC8\x2D"
8864 "\xAB\xA7\x88\x7B\x41\xE8\x29\xC9"
8865 "\x9B\x8D\xA7\x00\x86\x25\xB6\x14"
8866 "\xF5\x13\x73\xD7\x4B\x6B\x83\xF3"
8867 "\xAF\x96\x00\xE4\xB7\x3C\x65\xA6"
8868 "\x15\xB7\x94\x7D\x4E\x70\x4C\x75"
8869 "\xF3\xB4\x02\xA9\x17\x1C\x7A\x0A"
8870 "\xC0\xD5\x33\x11\x56\xDE\xDC\xF5"
8871 "\x8D\xD9\xCD\x3B\x22\x67\x18\xC7"
8872 "\xC4\xF5\x99\x61\xBC\xBB\x5B\x46",
8873 .rlen = 512,
8874 .also_non_np = 1,
8875 .np = 2,
8876 .tap = { 512 - 16, 16 },
8877 },
8878};
8879
8880static struct cipher_testvec cast6_lrw_dec_tv_template[] = {
8881 { /* Generated from TF test vectors */
8882 .key = "\xf8\xd4\x76\xff\xd6\x46\xee\x6c"
8883 "\x23\x84\xcb\x1c\x77\xd6\x19\x5d"
8884 "\xfe\xf1\xa9\xf3\x7b\xbc\x8d\x21"
8885 "\xa7\x9c\x21\xf8\xcb\x90\x02\x89"
8886 "\xa8\x45\x34\x8e\xc8\xc5\xb5\xf1"
8887 "\x26\xf5\x0e\x76\xfe\xfd\x1b\x1e",
8888 .klen = 48,
8889 .iv = "\x00\x00\x00\x00\x00\x00\x00\x00"
8890 "\x00\x00\x00\x00\x00\x00\x00\x01",
8891 .input = "\x55\x25\x09\x8B\xB5\xD5\xF8\xBF"
8892 "\x37\x4A\xFE\x3C\x47\xD8\xE6\xEB"
8893 "\xCA\xA4\x9B\xB0\xAB\x6D\x64\xCA"
8894 "\x58\xB6\x73\xF0\xD7\x52\x34\xEF"
8895 "\xFB\x3E\x96\x81\xB7\x71\x34\xA4"
8896 "\x55\x20\xBE\x39\x5A\x2B\xF9\xD1"
8897 "\x65\x0B\xDA\xD3\x7E\xB3\xA6\xF7"
8898 "\x2E\x0B\x5A\x52\xDB\x39\x8C\x9B"
8899 "\x61\x17\x5F\xAF\xB6\x5A\xC8\x08"
8900 "\xA7\xB7\x2A\x11\x7C\x97\x38\x9D"
8901 "\x59\x0E\x66\x59\x5E\xD8\x8B\xCE"
8902 "\x70\xE0\xC3\x42\xB0\x8C\x0F\xBA"
8903 "\xB2\x0D\x81\xB6\xBE\x61\x1C\x2D"
8904 "\x7E\xEA\x91\x25\xAC\xEC\xF8\x28"
8905 "\x80\x1D\xF0\x30\xBA\x62\x77\x7D"
8906 "\xDB\x15\x69\xDF\xFA\x2A\x81\x64"
8907 "\x95\x5B\xA4\x7F\x3E\x4F\xE3\x30"
8908 "\xB0\x5C\xC2\x05\xF8\xF0\x29\xE7"
8909 "\x0A\xA0\x66\xB2\x5D\x0F\x39\x2B"
8910 "\xB4\xB3\x00\xA9\xD0\xAB\x63\x61"
8911 "\x5E\xDB\xFC\x11\x74\x25\x96\x65"
8912 "\xE8\xE2\x34\x57\x77\x15\x5E\x70"
8913 "\xFF\x10\x90\xC3\x64\xF0\x11\x0A"
8914 "\x63\x3A\xD3\x55\x92\x15\x4B\x0C"
8915 "\xC7\x08\x89\x17\x3B\x99\xAD\x63"
8916 "\xE7\x06\xDF\x52\xBC\x15\x64\x45"
8917 "\x9D\x7A\xFB\x69\xBC\x2D\x6E\xA9"
8918 "\x35\xD9\xD8\xF5\x0C\xC4\xA2\x23"
8919 "\x9C\x18\x8B\xA8\x8C\xFE\xF8\x0E"
8920 "\xBD\xAB\x60\x1A\x51\x17\x54\x27"
8921 "\xB6\xE8\xBE\x0F\xA9\xA5\x82\x19"
8922 "\x2F\x6F\x20\xA7\x47\xED\x74\x6C"
8923 "\x4E\xC1\xF8\x8C\x14\xF3\xBB\x1F"
8924 "\xED\x4D\x8F\x7C\x37\xEF\x19\xA1"
8925 "\x07\x16\xDE\x76\xCC\x5E\x94\x02"
8926 "\xFB\xBF\xE4\x81\x50\xCE\xFC\x0F"
8927 "\x9E\xCF\x3D\xF6\x67\x00\xBF\xA7"
8928 "\x6E\x21\x58\x36\x06\xDE\xB3\xD4"
8929 "\xA2\xFA\xD8\x4E\xE0\xB9\x7F\x23"
8930 "\x51\x21\x2B\x32\x68\xAA\xF8\xA8"
8931 "\x93\x08\xB5\x6D\xE6\x43\x2C\xB7"
8932 "\x31\xB2\x0F\xD0\xA2\x51\xC0\x25"
8933 "\x30\xC7\x10\x3F\x97\x27\x01\x8E"
8934 "\xFA\xD8\x4F\x78\xD8\x2E\x1D\xEB"
8935 "\xA1\x37\x52\x0F\x7B\x5E\x87\xA8"
8936 "\x22\xE2\xE6\x92\xA7\x5F\x11\x32"
8937 "\xCC\x93\x34\xFC\xD1\x7E\xAE\x54"
8938 "\xBC\x6A\x1B\x91\xD1\x2E\x21\xEC"
8939 "\x5D\xF1\xC4\xF1\x55\x20\xBF\xE5"
8940 "\x96\x3D\x69\x91\x20\x4E\xF2\x61"
8941 "\xDA\x77\xFE\xEE\xC3\x74\x57\x2A"
8942 "\x78\x39\xB0\xE0\xCF\x12\x56\xD6"
8943 "\x05\xDC\xF9\x19\x66\x44\x1D\xF9"
8944 "\x82\x37\xD4\xC2\x60\xB6\x31\xDF"
8945 "\x0C\xAF\xBC\x8B\x55\x9A\xC8\x2D"
8946 "\xAB\xA7\x88\x7B\x41\xE8\x29\xC9"
8947 "\x9B\x8D\xA7\x00\x86\x25\xB6\x14"
8948 "\xF5\x13\x73\xD7\x4B\x6B\x83\xF3"
8949 "\xAF\x96\x00\xE4\xB7\x3C\x65\xA6"
8950 "\x15\xB7\x94\x7D\x4E\x70\x4C\x75"
8951 "\xF3\xB4\x02\xA9\x17\x1C\x7A\x0A"
8952 "\xC0\xD5\x33\x11\x56\xDE\xDC\xF5"
8953 "\x8D\xD9\xCD\x3B\x22\x67\x18\xC7"
8954 "\xC4\xF5\x99\x61\xBC\xBB\x5B\x46",
8955 .ilen = 512,
8956 .result = "\x05\x11\xb7\x18\xab\xc6\x2d\xac"
8957 "\x70\x5d\xf6\x22\x94\xcd\xe5\x6c"
8958 "\x17\x6b\xf6\x1c\xf0\xf3\x6e\xf8"
8959 "\x50\x38\x1f\x71\x49\xb6\x57\xd6"
8960 "\x8f\xcb\x8d\x6b\xe3\xa6\x29\x90"
8961 "\xfe\x2a\x62\x82\xae\x6d\x8b\xf6"
8962 "\xad\x1e\x9e\x20\x5f\x38\xbe\x04"
8963 "\xda\x10\x8e\xed\xa2\xa4\x87\xab"
8964 "\xda\x6b\xb4\x0c\x75\xba\xd3\x7c"
8965 "\xc9\xac\x42\x31\x95\x7c\xc9\x04"
8966 "\xeb\xd5\x6e\x32\x69\x8a\xdb\xa6"
8967 "\x15\xd7\x3f\x4f\x2f\x66\x69\x03"
8968 "\x9c\x1f\x54\x0f\xde\x1f\xf3\x65"
8969 "\x4c\x96\x12\xed\x7c\x92\x03\x01"
8970 "\x6f\xbc\x35\x93\xac\xf1\x27\xf1"
8971 "\xb4\x96\x82\x5a\x5f\xb0\xa0\x50"
8972 "\x89\xa4\x8e\x66\x44\x85\xcc\xfd"
8973 "\x33\x14\x70\xe3\x96\xb2\xc3\xd3"
8974 "\xbb\x54\x5a\x1a\xf9\x74\xa2\xc5"
8975 "\x2d\x64\x75\xdd\xb4\x54\xe6\x74"
8976 "\x8c\xd3\x9d\x9e\x86\xab\x51\x53"
8977 "\xb7\x93\x3e\x6f\xd0\x4e\x2c\x40"
8978 "\xf6\xa8\x2e\x3e\x9d\xf4\x66\xa5"
8979 "\x76\x12\x73\x44\x1a\x56\xd7\x72"
8980 "\x88\xcd\x21\x8c\x4c\x0f\xfe\xda"
8981 "\x95\xe0\x3a\xa6\xa5\x84\x46\xcd"
8982 "\xd5\x3e\x9d\x3a\xe2\x67\xe6\x60"
8983 "\x1a\xe2\x70\x85\x58\xc2\x1b\x09"
8984 "\xe1\xd7\x2c\xca\xad\xa8\x8f\xf9"
8985 "\xac\xb3\x0e\xdb\xca\x2e\xe2\xb8"
8986 "\x51\x71\xd9\x3c\x6c\xf1\x56\xf8"
8987 "\xea\x9c\xf1\xfb\x0c\xe6\xb7\x10"
8988 "\x1c\xf8\xa9\x7c\xe8\x53\x35\xc1"
8989 "\x90\x3e\x76\x4a\x74\xa4\x21\x2c"
8990 "\xf6\x2c\x4e\x0f\x94\x3a\x88\x2e"
8991 "\x41\x09\x6a\x33\x7d\xf6\xdd\x3f"
8992 "\x8d\x23\x31\x74\x84\xeb\x88\x6e"
8993 "\xcc\xb9\xbc\x22\x83\x19\x07\x22"
8994 "\xa5\x2d\xdf\xa5\xf3\x80\x85\x78"
8995 "\x84\x39\x6a\x6d\x6a\x99\x4f\xa5"
8996 "\x15\xfe\x46\xb0\xe4\x6c\xa5\x41"
8997 "\x3c\xce\x8f\x42\x60\x71\xa7\x75"
8998 "\x08\x40\x65\x8a\x82\xbf\xf5\x43"
8999 "\x71\x96\xa9\x4d\x44\x8a\x20\xbe"
9000 "\xfa\x4d\xbb\xc0\x7d\x31\x96\x65"
9001 "\xe7\x75\xe5\x3e\xfd\x92\x3b\xc9"
9002 "\x55\xbb\x16\x7e\xf7\xc2\x8c\xa4"
9003 "\x40\x1d\xe5\xef\x0e\xdf\xe4\x9a"
9004 "\x62\x73\x65\xfd\x46\x63\x25\x3d"
9005 "\x2b\xaf\xe5\x64\xfe\xa5\x5c\xcf"
9006 "\x24\xf3\xb4\xac\x64\xba\xdf\x4b"
9007 "\xc6\x96\x7d\x81\x2d\x8d\x97\xf7"
9008 "\xc5\x68\x77\x84\x32\x2b\xcc\x85"
9009 "\x74\x96\xf0\x12\x77\x61\xb9\xeb"
9010 "\x71\xaa\x82\xcb\x1c\xdb\x89\xc8"
9011 "\xc6\xb5\xe3\x5c\x7d\x39\x07\x24"
9012 "\xda\x39\x87\x45\xc0\x2b\xbb\x01"
9013 "\xac\xbc\x2a\x5c\x7f\xfc\xe8\xce"
9014 "\x6d\x9c\x6f\xed\xd3\xc1\xa1\xd6"
9015 "\xc5\x55\xa9\x66\x2f\xe1\xc8\x32"
9016 "\xa6\x5d\xa4\x3a\x98\x73\xe8\x45"
9017 "\xa4\xc7\xa8\xb4\xf6\x13\x03\xf6"
9018 "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
9019 "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
9020 .rlen = 512,
9021 .also_non_np = 1,
9022 .np = 2,
9023 .tap = { 512 - 16, 16 },
9024 },
9025};
9026
9027static struct cipher_testvec cast6_xts_enc_tv_template[] = {
9028 { /* Generated from TF test vectors */
9029 .key = "\x27\x18\x28\x18\x28\x45\x90\x45"
9030 "\x23\x53\x60\x28\x74\x71\x35\x26"
9031 "\x62\x49\x77\x57\x24\x70\x93\x69"
9032 "\x99\x59\x57\x49\x66\x96\x76\x27"
9033 "\x31\x41\x59\x26\x53\x58\x97\x93"
9034 "\x23\x84\x62\x64\x33\x83\x27\x95"
9035 "\x02\x88\x41\x97\x16\x93\x99\x37"
9036 "\x51\x05\x82\x09\x74\x94\x45\x92",
9037 .klen = 64,
9038 .iv = "\xff\x00\x00\x00\x00\x00\x00\x00"
9039 "\x00\x00\x00\x00\x00\x00\x00\x00",
9040 .input = "\x00\x01\x02\x03\x04\x05\x06\x07"
9041 "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
9042 "\x10\x11\x12\x13\x14\x15\x16\x17"
9043 "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
9044 "\x20\x21\x22\x23\x24\x25\x26\x27"
9045 "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
9046 "\x30\x31\x32\x33\x34\x35\x36\x37"
9047 "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
9048 "\x40\x41\x42\x43\x44\x45\x46\x47"
9049 "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
9050 "\x50\x51\x52\x53\x54\x55\x56\x57"
9051 "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
9052 "\x60\x61\x62\x63\x64\x65\x66\x67"
9053 "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
9054 "\x70\x71\x72\x73\x74\x75\x76\x77"
9055 "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
9056 "\x80\x81\x82\x83\x84\x85\x86\x87"
9057 "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
9058 "\x90\x91\x92\x93\x94\x95\x96\x97"
9059 "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
9060 "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
9061 "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
9062 "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
9063 "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
9064 "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
9065 "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
9066 "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
9067 "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
9068 "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
9069 "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
9070 "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
9071 "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
9072 "\x00\x01\x02\x03\x04\x05\x06\x07"
9073 "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
9074 "\x10\x11\x12\x13\x14\x15\x16\x17"
9075 "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
9076 "\x20\x21\x22\x23\x24\x25\x26\x27"
9077 "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
9078 "\x30\x31\x32\x33\x34\x35\x36\x37"
9079 "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
9080 "\x40\x41\x42\x43\x44\x45\x46\x47"
9081 "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
9082 "\x50\x51\x52\x53\x54\x55\x56\x57"
9083 "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
9084 "\x60\x61\x62\x63\x64\x65\x66\x67"
9085 "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
9086 "\x70\x71\x72\x73\x74\x75\x76\x77"
9087 "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
9088 "\x80\x81\x82\x83\x84\x85\x86\x87"
9089 "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
9090 "\x90\x91\x92\x93\x94\x95\x96\x97"
9091 "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
9092 "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
9093 "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
9094 "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
9095 "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
9096 "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
9097 "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
9098 "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
9099 "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
9100 "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
9101 "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
9102 "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
9103 "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
9104 .ilen = 512,
9105 .result = "\xDE\x6F\x22\xA5\xE8\x39\xE8\x78"
9106 "\x88\x5A\x4F\x8D\x82\x76\x52\x6D"
9107 "\xB2\x41\x16\xF4\x2B\xA6\xEB\xF6"
9108 "\xE2\xC5\x62\x8D\x61\xA1\x01\xED"
9109 "\xD9\x38\x01\xC1\x43\x63\x4E\x88"
9110 "\xC9\x4B\x5A\x88\x80\xB7\x5C\x71"
9111 "\x47\xEE\x11\xD8\xB7\x2D\x5D\x13"
9112 "\x1A\xB1\x68\x5B\x61\xA7\xA9\x81"
9113 "\x8B\x83\xA1\x6A\xAA\x36\xD6\xB6"
9114 "\x60\x54\x09\x32\xFE\x6A\x76\x2E"
9115 "\x28\xFF\xD5\xD6\xDD\x1D\x45\x7D"
9116 "\xF0\x8B\xF3\x32\x4E\x6C\x12\xCB"
9117 "\xB8\x25\x70\xF8\x40\xBC\x90\x1B"
9118 "\x11\xC3\x59\xAF\xF0\x2F\x92\xDD"
9119 "\xD3\x3B\xCF\x60\xA1\x78\x94\x57"
9120 "\xAF\x76\xC1\x67\xA6\x3C\xCD\x98"
9121 "\xB1\xF7\x27\xB9\xA3\xBD\x10\xEA"
9122 "\xCD\x8B\xC2\xF2\x14\xF2\xB2\x67"
9123 "\x05\xDD\x1D\x58\x6E\x2F\x95\x08"
9124 "\x3A\xF8\x78\x76\x82\x56\xA7\xEC"
9125 "\x51\x4B\x85\x77\xC2\x4C\x4A\x34"
9126 "\x71\x38\x17\x91\x44\xE8\xFC\x65"
9127 "\x99\x0D\x52\x91\xEE\xF8\xEF\x27"
9128 "\x2A\x9E\x6E\x78\xC4\x26\x87\xF4"
9129 "\x8A\xF0\x2D\x04\xE8\x14\x92\x5D"
9130 "\x59\x22\x9B\x29\x5C\x18\xF0\xC3"
9131 "\x47\xF3\x76\xD8\xE4\xF3\x1B\xD1"
9132 "\x70\xA3\x0D\xB5\x70\x02\x1D\xA3"
9133 "\x91\x3B\x49\x73\x18\xAB\xD4\xC9"
9134 "\xC3\x1E\xEF\x1F\xFE\xD5\x59\x8A"
9135 "\xD7\xF6\xC9\x71\x67\x79\xD7\x0E"
9136 "\xBE\x1F\x8E\xEC\x55\x7E\x4F\x24"
9137 "\xE6\x87\xEA\xFE\x96\x25\x67\x8E"
9138 "\x93\x03\xFA\xFF\xCE\xAF\xB2\x3C"
9139 "\x6F\xEB\x57\xFB\xD3\x28\x87\xA9"
9140 "\xCE\xC2\xF5\x9C\xC6\x67\xB5\x97"
9141 "\x49\xF7\x04\xCB\xEF\x84\x98\x33"
9142 "\xAF\x38\xD3\x04\x1C\x24\x71\x38"
9143 "\xC7\x71\xDD\x43\x0D\x12\x4A\x18"
9144 "\xBA\xC4\xAF\xBA\xB2\x5B\xEB\x95"
9145 "\x02\x43\x5D\xCE\x19\xCC\xCD\x66"
9146 "\x91\x0B\x8C\x7F\x51\xC4\xBF\x3C"
9147 "\x8B\xF1\xCC\xAA\x29\xD7\x87\xCB"
9148 "\x3E\xC5\xF3\xC9\x75\xE8\xA3\x5B"
9149 "\x30\x45\xA9\xB7\xAF\x80\x64\x6F"
9150 "\x75\x4A\xA7\xC0\x6D\x19\x6B\xDE"
9151 "\x17\xDE\x6D\xEA\x87\x9F\x95\xAE"
9152 "\xF5\x3C\xEE\x54\xB8\x27\x84\xF8"
9153 "\x97\xA3\xE1\x6F\x38\x24\x34\x88"
9154 "\xCE\xBD\x32\x52\xE0\x00\x6C\x94"
9155 "\xC9\xD7\x5D\x37\x81\x33\x2E\x7F"
9156 "\x4F\x7E\x2E\x0D\x94\xBD\xEA\x59"
9157 "\x34\x39\xA8\x35\x12\xB7\xBC\xAC"
9158 "\xEA\x52\x9C\x78\x02\x6D\x92\x36"
9159 "\xFB\x59\x2B\xA4\xEA\x7B\x1B\x83"
9160 "\xE1\x4D\x5E\x2A\x7E\x92\xB1\x64"
9161 "\xDE\xE0\x27\x4B\x0A\x6F\x4C\xE3"
9162 "\xB0\xEB\x31\xE4\x69\x95\xAB\x35"
9163 "\x8B\x2C\xF5\x6B\x7F\xF1\xA2\x82"
9164 "\xF8\xD9\x47\x82\xA9\x82\x03\x91"
9165 "\x69\x1F\xBE\x4C\xE7\xC7\x34\x2F"
9166 "\x45\x72\x80\x17\x81\xBD\x9D\x62"
9167 "\xA1\xAC\xE8\xCF\xC6\x74\xCF\xDC"
9168 "\x22\x60\x4E\xE8\xA4\x5D\x85\xB9",
9169 .rlen = 512,
9170 .also_non_np = 1,
9171 .np = 2,
9172 .tap = { 512 - 16, 16 },
9173 },
9174};
9175
9176static struct cipher_testvec cast6_xts_dec_tv_template[] = {
9177 { /* Generated from TF test vectors */
9178 .key = "\x27\x18\x28\x18\x28\x45\x90\x45"
9179 "\x23\x53\x60\x28\x74\x71\x35\x26"
9180 "\x62\x49\x77\x57\x24\x70\x93\x69"
9181 "\x99\x59\x57\x49\x66\x96\x76\x27"
9182 "\x31\x41\x59\x26\x53\x58\x97\x93"
9183 "\x23\x84\x62\x64\x33\x83\x27\x95"
9184 "\x02\x88\x41\x97\x16\x93\x99\x37"
9185 "\x51\x05\x82\x09\x74\x94\x45\x92",
9186 .klen = 64,
9187 .iv = "\xff\x00\x00\x00\x00\x00\x00\x00"
9188 "\x00\x00\x00\x00\x00\x00\x00\x00",
9189 .input = "\xDE\x6F\x22\xA5\xE8\x39\xE8\x78"
9190 "\x88\x5A\x4F\x8D\x82\x76\x52\x6D"
9191 "\xB2\x41\x16\xF4\x2B\xA6\xEB\xF6"
9192 "\xE2\xC5\x62\x8D\x61\xA1\x01\xED"
9193 "\xD9\x38\x01\xC1\x43\x63\x4E\x88"
9194 "\xC9\x4B\x5A\x88\x80\xB7\x5C\x71"
9195 "\x47\xEE\x11\xD8\xB7\x2D\x5D\x13"
9196 "\x1A\xB1\x68\x5B\x61\xA7\xA9\x81"
9197 "\x8B\x83\xA1\x6A\xAA\x36\xD6\xB6"
9198 "\x60\x54\x09\x32\xFE\x6A\x76\x2E"
9199 "\x28\xFF\xD5\xD6\xDD\x1D\x45\x7D"
9200 "\xF0\x8B\xF3\x32\x4E\x6C\x12\xCB"
9201 "\xB8\x25\x70\xF8\x40\xBC\x90\x1B"
9202 "\x11\xC3\x59\xAF\xF0\x2F\x92\xDD"
9203 "\xD3\x3B\xCF\x60\xA1\x78\x94\x57"
9204 "\xAF\x76\xC1\x67\xA6\x3C\xCD\x98"
9205 "\xB1\xF7\x27\xB9\xA3\xBD\x10\xEA"
9206 "\xCD\x8B\xC2\xF2\x14\xF2\xB2\x67"
9207 "\x05\xDD\x1D\x58\x6E\x2F\x95\x08"
9208 "\x3A\xF8\x78\x76\x82\x56\xA7\xEC"
9209 "\x51\x4B\x85\x77\xC2\x4C\x4A\x34"
9210 "\x71\x38\x17\x91\x44\xE8\xFC\x65"
9211 "\x99\x0D\x52\x91\xEE\xF8\xEF\x27"
9212 "\x2A\x9E\x6E\x78\xC4\x26\x87\xF4"
9213 "\x8A\xF0\x2D\x04\xE8\x14\x92\x5D"
9214 "\x59\x22\x9B\x29\x5C\x18\xF0\xC3"
9215 "\x47\xF3\x76\xD8\xE4\xF3\x1B\xD1"
9216 "\x70\xA3\x0D\xB5\x70\x02\x1D\xA3"
9217 "\x91\x3B\x49\x73\x18\xAB\xD4\xC9"
9218 "\xC3\x1E\xEF\x1F\xFE\xD5\x59\x8A"
9219 "\xD7\xF6\xC9\x71\x67\x79\xD7\x0E"
9220 "\xBE\x1F\x8E\xEC\x55\x7E\x4F\x24"
9221 "\xE6\x87\xEA\xFE\x96\x25\x67\x8E"
9222 "\x93\x03\xFA\xFF\xCE\xAF\xB2\x3C"
9223 "\x6F\xEB\x57\xFB\xD3\x28\x87\xA9"
9224 "\xCE\xC2\xF5\x9C\xC6\x67\xB5\x97"
9225 "\x49\xF7\x04\xCB\xEF\x84\x98\x33"
9226 "\xAF\x38\xD3\x04\x1C\x24\x71\x38"
9227 "\xC7\x71\xDD\x43\x0D\x12\x4A\x18"
9228 "\xBA\xC4\xAF\xBA\xB2\x5B\xEB\x95"
9229 "\x02\x43\x5D\xCE\x19\xCC\xCD\x66"
9230 "\x91\x0B\x8C\x7F\x51\xC4\xBF\x3C"
9231 "\x8B\xF1\xCC\xAA\x29\xD7\x87\xCB"
9232 "\x3E\xC5\xF3\xC9\x75\xE8\xA3\x5B"
9233 "\x30\x45\xA9\xB7\xAF\x80\x64\x6F"
9234 "\x75\x4A\xA7\xC0\x6D\x19\x6B\xDE"
9235 "\x17\xDE\x6D\xEA\x87\x9F\x95\xAE"
9236 "\xF5\x3C\xEE\x54\xB8\x27\x84\xF8"
9237 "\x97\xA3\xE1\x6F\x38\x24\x34\x88"
9238 "\xCE\xBD\x32\x52\xE0\x00\x6C\x94"
9239 "\xC9\xD7\x5D\x37\x81\x33\x2E\x7F"
9240 "\x4F\x7E\x2E\x0D\x94\xBD\xEA\x59"
9241 "\x34\x39\xA8\x35\x12\xB7\xBC\xAC"
9242 "\xEA\x52\x9C\x78\x02\x6D\x92\x36"
9243 "\xFB\x59\x2B\xA4\xEA\x7B\x1B\x83"
9244 "\xE1\x4D\x5E\x2A\x7E\x92\xB1\x64"
9245 "\xDE\xE0\x27\x4B\x0A\x6F\x4C\xE3"
9246 "\xB0\xEB\x31\xE4\x69\x95\xAB\x35"
9247 "\x8B\x2C\xF5\x6B\x7F\xF1\xA2\x82"
9248 "\xF8\xD9\x47\x82\xA9\x82\x03\x91"
9249 "\x69\x1F\xBE\x4C\xE7\xC7\x34\x2F"
9250 "\x45\x72\x80\x17\x81\xBD\x9D\x62"
9251 "\xA1\xAC\xE8\xCF\xC6\x74\xCF\xDC"
9252 "\x22\x60\x4E\xE8\xA4\x5D\x85\xB9",
9253 .ilen = 512,
9254 .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
9255 "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
9256 "\x10\x11\x12\x13\x14\x15\x16\x17"
9257 "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
9258 "\x20\x21\x22\x23\x24\x25\x26\x27"
9259 "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
9260 "\x30\x31\x32\x33\x34\x35\x36\x37"
9261 "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
9262 "\x40\x41\x42\x43\x44\x45\x46\x47"
9263 "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
9264 "\x50\x51\x52\x53\x54\x55\x56\x57"
9265 "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
9266 "\x60\x61\x62\x63\x64\x65\x66\x67"
9267 "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
9268 "\x70\x71\x72\x73\x74\x75\x76\x77"
9269 "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
9270 "\x80\x81\x82\x83\x84\x85\x86\x87"
9271 "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
9272 "\x90\x91\x92\x93\x94\x95\x96\x97"
9273 "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
9274 "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
9275 "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
9276 "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
9277 "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
9278 "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
9279 "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
9280 "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
9281 "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
9282 "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
9283 "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
9284 "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
9285 "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
9286 "\x00\x01\x02\x03\x04\x05\x06\x07"
9287 "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
9288 "\x10\x11\x12\x13\x14\x15\x16\x17"
9289 "\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
9290 "\x20\x21\x22\x23\x24\x25\x26\x27"
9291 "\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
9292 "\x30\x31\x32\x33\x34\x35\x36\x37"
9293 "\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
9294 "\x40\x41\x42\x43\x44\x45\x46\x47"
9295 "\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
9296 "\x50\x51\x52\x53\x54\x55\x56\x57"
9297 "\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
9298 "\x60\x61\x62\x63\x64\x65\x66\x67"
9299 "\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
9300 "\x70\x71\x72\x73\x74\x75\x76\x77"
9301 "\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
9302 "\x80\x81\x82\x83\x84\x85\x86\x87"
9303 "\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
9304 "\x90\x91\x92\x93\x94\x95\x96\x97"
9305 "\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
9306 "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7"
9307 "\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
9308 "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7"
9309 "\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
9310 "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
9311 "\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
9312 "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7"
9313 "\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
9314 "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7"
9315 "\xe8\xe9\xea\xeb\xec\xed\xee\xef"
9316 "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
9317 "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
9318 .rlen = 512,
9319 .also_non_np = 1,
9320 .np = 2,
9321 .tap = { 512 - 16, 16 },
6967 }, 9322 },
6968}; 9323};
6969 9324
@@ -8313,6 +10668,9 @@ static struct cipher_testvec aes_lrw_enc_tv_template[] = {
8313 "\xcd\x7e\x2b\x5d\x43\xea\x42\xe7" 10668 "\xcd\x7e\x2b\x5d\x43\xea\x42\xe7"
8314 "\x74\x3f\x7d\x58\x88\x75\xde\x3e", 10669 "\x74\x3f\x7d\x58\x88\x75\xde\x3e",
8315 .rlen = 512, 10670 .rlen = 512,
10671 .also_non_np = 1,
10672 .np = 2,
10673 .tap = { 512 - 16, 16 },
8316 } 10674 }
8317}; 10675};
8318 10676
@@ -8564,6 +10922,9 @@ static struct cipher_testvec aes_lrw_dec_tv_template[] = {
8564 "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4" 10922 "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
8565 "\x21\xc4\xc2\x75\x67\x89\x37\x0a", 10923 "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
8566 .rlen = 512, 10924 .rlen = 512,
10925 .also_non_np = 1,
10926 .np = 2,
10927 .tap = { 512 - 16, 16 },
8567 } 10928 }
8568}; 10929};
8569 10930
@@ -8905,6 +11266,9 @@ static struct cipher_testvec aes_xts_enc_tv_template[] = {
8905 "\xc4\xf3\x6f\xfd\xa9\xfc\xea\x70" 11266 "\xc4\xf3\x6f\xfd\xa9\xfc\xea\x70"
8906 "\xb9\xc6\xe6\x93\xe1\x48\xc1\x51", 11267 "\xb9\xc6\xe6\x93\xe1\x48\xc1\x51",
8907 .rlen = 512, 11268 .rlen = 512,
11269 .also_non_np = 1,
11270 .np = 2,
11271 .tap = { 512 - 16, 16 },
8908 } 11272 }
8909}; 11273};
8910 11274
@@ -9246,7 +11610,9 @@ static struct cipher_testvec aes_xts_dec_tv_template[] = {
9246 "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7" 11610 "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
9247 "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff", 11611 "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
9248 .rlen = 512, 11612 .rlen = 512,
9249 11613 .also_non_np = 1,
11614 .np = 2,
11615 .tap = { 512 - 16, 16 },
9250 } 11616 }
9251}; 11617};
9252 11618
@@ -12125,8 +14491,12 @@ static struct cprng_testvec ansi_cprng_aes_tv_template[] = {
12125}; 14491};
12126 14492
12127/* Cast5 test vectors from RFC 2144 */ 14493/* Cast5 test vectors from RFC 2144 */
12128#define CAST5_ENC_TEST_VECTORS 3 14494#define CAST5_ENC_TEST_VECTORS 4
12129#define CAST5_DEC_TEST_VECTORS 3 14495#define CAST5_DEC_TEST_VECTORS 4
14496#define CAST5_CBC_ENC_TEST_VECTORS 1
14497#define CAST5_CBC_DEC_TEST_VECTORS 1
14498#define CAST5_CTR_ENC_TEST_VECTORS 2
14499#define CAST5_CTR_DEC_TEST_VECTORS 2
12130 14500
12131static struct cipher_testvec cast5_enc_tv_template[] = { 14501static struct cipher_testvec cast5_enc_tv_template[] = {
12132 { 14502 {
@@ -12152,6 +14522,140 @@ static struct cipher_testvec cast5_enc_tv_template[] = {
12152 .ilen = 8, 14522 .ilen = 8,
12153 .result = "\x7a\xc8\x16\xd1\x6e\x9b\x30\x2e", 14523 .result = "\x7a\xc8\x16\xd1\x6e\x9b\x30\x2e",
12154 .rlen = 8, 14524 .rlen = 8,
14525 }, { /* Generated from TF test vectors */
14526 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
14527 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A",
14528 .klen = 16,
14529 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
14530 .input = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
14531 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
14532 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
14533 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
14534 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
14535 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
14536 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
14537 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
14538 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
14539 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
14540 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
14541 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
14542 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
14543 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
14544 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
14545 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
14546 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
14547 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
14548 "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
14549 "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
14550 "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
14551 "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
14552 "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
14553 "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
14554 "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
14555 "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
14556 "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
14557 "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
14558 "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
14559 "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
14560 "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
14561 "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
14562 "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
14563 "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
14564 "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
14565 "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
14566 "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
14567 "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
14568 "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
14569 "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
14570 "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
14571 "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
14572 "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
14573 "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
14574 "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
14575 "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
14576 "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
14577 "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
14578 "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
14579 "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
14580 "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
14581 "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
14582 "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
14583 "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
14584 "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
14585 "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
14586 "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
14587 "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
14588 "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
14589 "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
14590 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
14591 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
14592 .ilen = 496,
14593 .result = "\x8D\xFC\x81\x9C\xCB\xAA\x5A\x1C"
14594 "\x7E\x95\xCF\x40\xAB\x4D\x6F\xEA"
14595 "\xD3\xD9\xB0\x9A\xB7\xC7\xE0\x2E"
14596 "\xD1\x39\x34\x92\x8F\xFA\x14\xF1"
14597 "\xD5\xD2\x7B\x59\x1F\x35\x28\xC2"
14598 "\x20\xD9\x42\x06\xC9\x0B\x10\x04"
14599 "\xF8\x79\xCD\x32\x86\x75\x4C\xB6"
14600 "\x7B\x1C\x52\xB1\x91\x64\x22\x4B"
14601 "\x13\xC7\xAE\x98\x0E\xB5\xCF\x6F"
14602 "\x3F\xF4\x43\x96\x73\x0D\xA2\x05"
14603 "\xDB\xFD\x28\x90\x2C\x56\xB9\x37"
14604 "\x5B\x69\x0C\xAD\x84\x67\xFF\x15"
14605 "\x4A\xD4\xA7\xD3\xDD\x99\x47\x3A"
14606 "\xED\x34\x35\x78\x6B\x91\xC9\x32"
14607 "\xE1\xBF\xBC\xB4\x04\x85\x6A\x39"
14608 "\xC0\xBA\x51\xD0\x0F\x4E\xD1\xE2"
14609 "\x1C\xFD\x0E\x05\x07\xF4\x10\xED"
14610 "\xA2\x17\xFF\xF5\x64\xC6\x1A\x22"
14611 "\xAD\x78\xE7\xD7\x11\xE9\x99\xB9"
14612 "\xAA\xEC\x6F\xF8\x3B\xBF\xCE\x77"
14613 "\x93\xE8\xAD\x1D\x50\x6C\xAE\xBC"
14614 "\xBA\x5C\x80\xD1\x91\x65\x51\x1B"
14615 "\xE8\x0A\xCD\x99\x96\x71\x3D\xB6"
14616 "\x78\x75\x37\x55\xC1\xF5\x90\x40"
14617 "\x34\xF4\x7E\xC8\xCC\x3A\x5F\x6E"
14618 "\x36\xA1\xA1\xC2\x3A\x72\x42\x8E"
14619 "\x0E\x37\x88\xE8\xCE\x83\xCB\xAD"
14620 "\xE0\x69\x77\x50\xC7\x0C\x99\xCA"
14621 "\x19\x5B\x30\x25\x9A\xEF\x9B\x0C"
14622 "\xEF\x8F\x74\x4C\xCF\x49\x4E\xB9"
14623 "\xC5\xAE\x9E\x2E\x78\x9A\xB9\x48"
14624 "\xD5\x81\xE4\x37\x1D\xBF\x27\xD9"
14625 "\xC5\xD6\x65\x43\x45\x8C\xBB\xB6"
14626 "\x55\xF4\x06\xBB\x49\x53\x8B\x1B"
14627 "\x07\xA9\x96\x69\x5B\xCB\x0F\xBC"
14628 "\x93\x85\x90\x0F\x0A\x68\x40\x2A"
14629 "\x95\xED\x2D\x88\xBF\x71\xD0\xBB"
14630 "\xEC\xB0\x77\x6C\x79\xFC\x3C\x05"
14631 "\x49\x3F\xB8\x24\xEF\x8E\x09\xA2"
14632 "\x1D\xEF\x92\x02\x96\xD4\x7F\xC8"
14633 "\x03\xB2\xCA\xDB\x17\x5C\x52\xCF"
14634 "\xDD\x70\x37\x63\xAA\xA5\x83\x20"
14635 "\x52\x02\xF6\xB9\xE7\x6E\x0A\xB6"
14636 "\x79\x03\xA0\xDA\xA3\x79\x21\xBD"
14637 "\xE3\x37\x3A\xC0\xF7\x2C\x32\xBE"
14638 "\x8B\xE8\xA6\x00\xC7\x32\xD5\x06"
14639 "\xBB\xE3\xAB\x06\x21\x82\xB8\x32"
14640 "\x31\x34\x2A\xA7\x1F\x64\x99\xBF"
14641 "\xFA\xDA\x3D\x75\xF7\x48\xD5\x48"
14642 "\x4B\x52\x7E\xF6\x7C\xAB\x67\x59"
14643 "\xC5\xDC\xA8\xC6\x63\x85\x4A\xDF"
14644 "\xF0\x40\x5F\xCF\xE3\x58\x52\x67"
14645 "\x7A\x24\x32\xC5\xEC\x9E\xA9\x6F"
14646 "\x58\x56\xDD\x94\x1F\x71\x8D\xF4"
14647 "\x6E\xFF\x2C\xA7\xA5\xD8\xBA\xAF"
14648 "\x1D\x8B\xA2\x46\xB5\xC4\x9F\x57"
14649 "\x8D\xD8\xB3\x3C\x02\x0D\xBB\x84"
14650 "\xC7\xBD\xB4\x9A\x6E\xBB\xB1\x37"
14651 "\x95\x79\xC4\xA7\xEA\x1D\xDC\x33"
14652 "\x5D\x0B\x3F\x03\x8F\x30\xF9\xAE"
14653 "\x4F\xFE\x24\x9C\x9A\x02\xE5\x57"
14654 "\xF5\xBC\x25\xD6\x02\x56\x57\x1C",
14655 .rlen = 496,
14656 .also_non_np = 1,
14657 .np = 2,
14658 .tap = { 496 - 16, 16 },
12155 }, 14659 },
12156}; 14660};
12157 14661
@@ -12179,6 +14683,718 @@ static struct cipher_testvec cast5_dec_tv_template[] = {
12179 .ilen = 8, 14683 .ilen = 8,
12180 .result = "\x01\x23\x45\x67\x89\xab\xcd\xef", 14684 .result = "\x01\x23\x45\x67\x89\xab\xcd\xef",
12181 .rlen = 8, 14685 .rlen = 8,
14686 }, { /* Generated from TF test vectors */
14687 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
14688 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A",
14689 .klen = 16,
14690 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
14691 .input = "\x8D\xFC\x81\x9C\xCB\xAA\x5A\x1C"
14692 "\x7E\x95\xCF\x40\xAB\x4D\x6F\xEA"
14693 "\xD3\xD9\xB0\x9A\xB7\xC7\xE0\x2E"
14694 "\xD1\x39\x34\x92\x8F\xFA\x14\xF1"
14695 "\xD5\xD2\x7B\x59\x1F\x35\x28\xC2"
14696 "\x20\xD9\x42\x06\xC9\x0B\x10\x04"
14697 "\xF8\x79\xCD\x32\x86\x75\x4C\xB6"
14698 "\x7B\x1C\x52\xB1\x91\x64\x22\x4B"
14699 "\x13\xC7\xAE\x98\x0E\xB5\xCF\x6F"
14700 "\x3F\xF4\x43\x96\x73\x0D\xA2\x05"
14701 "\xDB\xFD\x28\x90\x2C\x56\xB9\x37"
14702 "\x5B\x69\x0C\xAD\x84\x67\xFF\x15"
14703 "\x4A\xD4\xA7\xD3\xDD\x99\x47\x3A"
14704 "\xED\x34\x35\x78\x6B\x91\xC9\x32"
14705 "\xE1\xBF\xBC\xB4\x04\x85\x6A\x39"
14706 "\xC0\xBA\x51\xD0\x0F\x4E\xD1\xE2"
14707 "\x1C\xFD\x0E\x05\x07\xF4\x10\xED"
14708 "\xA2\x17\xFF\xF5\x64\xC6\x1A\x22"
14709 "\xAD\x78\xE7\xD7\x11\xE9\x99\xB9"
14710 "\xAA\xEC\x6F\xF8\x3B\xBF\xCE\x77"
14711 "\x93\xE8\xAD\x1D\x50\x6C\xAE\xBC"
14712 "\xBA\x5C\x80\xD1\x91\x65\x51\x1B"
14713 "\xE8\x0A\xCD\x99\x96\x71\x3D\xB6"
14714 "\x78\x75\x37\x55\xC1\xF5\x90\x40"
14715 "\x34\xF4\x7E\xC8\xCC\x3A\x5F\x6E"
14716 "\x36\xA1\xA1\xC2\x3A\x72\x42\x8E"
14717 "\x0E\x37\x88\xE8\xCE\x83\xCB\xAD"
14718 "\xE0\x69\x77\x50\xC7\x0C\x99\xCA"
14719 "\x19\x5B\x30\x25\x9A\xEF\x9B\x0C"
14720 "\xEF\x8F\x74\x4C\xCF\x49\x4E\xB9"
14721 "\xC5\xAE\x9E\x2E\x78\x9A\xB9\x48"
14722 "\xD5\x81\xE4\x37\x1D\xBF\x27\xD9"
14723 "\xC5\xD6\x65\x43\x45\x8C\xBB\xB6"
14724 "\x55\xF4\x06\xBB\x49\x53\x8B\x1B"
14725 "\x07\xA9\x96\x69\x5B\xCB\x0F\xBC"
14726 "\x93\x85\x90\x0F\x0A\x68\x40\x2A"
14727 "\x95\xED\x2D\x88\xBF\x71\xD0\xBB"
14728 "\xEC\xB0\x77\x6C\x79\xFC\x3C\x05"
14729 "\x49\x3F\xB8\x24\xEF\x8E\x09\xA2"
14730 "\x1D\xEF\x92\x02\x96\xD4\x7F\xC8"
14731 "\x03\xB2\xCA\xDB\x17\x5C\x52\xCF"
14732 "\xDD\x70\x37\x63\xAA\xA5\x83\x20"
14733 "\x52\x02\xF6\xB9\xE7\x6E\x0A\xB6"
14734 "\x79\x03\xA0\xDA\xA3\x79\x21\xBD"
14735 "\xE3\x37\x3A\xC0\xF7\x2C\x32\xBE"
14736 "\x8B\xE8\xA6\x00\xC7\x32\xD5\x06"
14737 "\xBB\xE3\xAB\x06\x21\x82\xB8\x32"
14738 "\x31\x34\x2A\xA7\x1F\x64\x99\xBF"
14739 "\xFA\xDA\x3D\x75\xF7\x48\xD5\x48"
14740 "\x4B\x52\x7E\xF6\x7C\xAB\x67\x59"
14741 "\xC5\xDC\xA8\xC6\x63\x85\x4A\xDF"
14742 "\xF0\x40\x5F\xCF\xE3\x58\x52\x67"
14743 "\x7A\x24\x32\xC5\xEC\x9E\xA9\x6F"
14744 "\x58\x56\xDD\x94\x1F\x71\x8D\xF4"
14745 "\x6E\xFF\x2C\xA7\xA5\xD8\xBA\xAF"
14746 "\x1D\x8B\xA2\x46\xB5\xC4\x9F\x57"
14747 "\x8D\xD8\xB3\x3C\x02\x0D\xBB\x84"
14748 "\xC7\xBD\xB4\x9A\x6E\xBB\xB1\x37"
14749 "\x95\x79\xC4\xA7\xEA\x1D\xDC\x33"
14750 "\x5D\x0B\x3F\x03\x8F\x30\xF9\xAE"
14751 "\x4F\xFE\x24\x9C\x9A\x02\xE5\x57"
14752 "\xF5\xBC\x25\xD6\x02\x56\x57\x1C",
14753 .ilen = 496,
14754 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
14755 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
14756 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
14757 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
14758 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
14759 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
14760 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
14761 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
14762 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
14763 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
14764 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
14765 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
14766 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
14767 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
14768 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
14769 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
14770 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
14771 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
14772 "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
14773 "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
14774 "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
14775 "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
14776 "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
14777 "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
14778 "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
14779 "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
14780 "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
14781 "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
14782 "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
14783 "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
14784 "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
14785 "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
14786 "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
14787 "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
14788 "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
14789 "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
14790 "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
14791 "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
14792 "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
14793 "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
14794 "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
14795 "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
14796 "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
14797 "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
14798 "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
14799 "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
14800 "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
14801 "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
14802 "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
14803 "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
14804 "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
14805 "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
14806 "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
14807 "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
14808 "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
14809 "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
14810 "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
14811 "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
14812 "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
14813 "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
14814 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
14815 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
14816 .rlen = 496,
14817 .also_non_np = 1,
14818 .np = 2,
14819 .tap = { 496 - 16, 16 },
14820 },
14821};
14822
14823static struct cipher_testvec cast5_cbc_enc_tv_template[] = {
14824 { /* Generated from TF test vectors */
14825 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
14826 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A",
14827 .klen = 16,
14828 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
14829 .input = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
14830 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
14831 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
14832 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
14833 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
14834 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
14835 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
14836 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
14837 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
14838 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
14839 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
14840 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
14841 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
14842 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
14843 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
14844 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
14845 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
14846 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
14847 "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
14848 "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
14849 "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
14850 "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
14851 "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
14852 "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
14853 "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
14854 "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
14855 "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
14856 "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
14857 "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
14858 "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
14859 "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
14860 "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
14861 "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
14862 "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
14863 "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
14864 "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
14865 "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
14866 "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
14867 "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
14868 "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
14869 "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
14870 "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
14871 "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
14872 "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
14873 "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
14874 "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
14875 "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
14876 "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
14877 "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
14878 "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
14879 "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
14880 "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
14881 "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
14882 "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
14883 "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
14884 "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
14885 "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
14886 "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
14887 "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
14888 "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
14889 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
14890 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
14891 .ilen = 496,
14892 .result = "\x05\x28\xCE\x61\x90\x80\xE1\x78"
14893 "\xB9\x2A\x97\x7C\xB0\x83\xD8\x1A"
14894 "\xDE\x58\x7F\xD7\xFD\x72\xB8\xFB"
14895 "\xDA\xF0\x6E\x77\x14\x47\x82\xBA"
14896 "\x29\x0E\x25\x6E\xB4\x39\xD9\x7F"
14897 "\x05\xA7\xA7\x3A\xC1\x5D\x9E\x39"
14898 "\xA7\xFB\x0D\x05\x00\xF3\x58\x67"
14899 "\x60\xEC\x73\x77\x46\x85\x9B\x6A"
14900 "\x08\x3E\xBE\x59\xFB\xE4\x96\x34"
14901 "\xB4\x05\x49\x1A\x97\x43\xAD\xA0"
14902 "\xA9\x1E\x6E\x74\xF1\x94\xEC\xA8"
14903 "\xB5\x8A\x20\xEA\x89\x6B\x19\xAA"
14904 "\xA7\xF1\x33\x67\x90\x23\x0D\xEE"
14905 "\x81\xD5\x78\x4F\xD3\x63\xEA\x46"
14906 "\xB5\xB2\x6E\xBB\xCA\x76\x06\x10"
14907 "\x96\x2A\x0A\xBA\xF9\x41\x5A\x1D"
14908 "\x36\x7C\x56\x14\x54\x83\xFA\xA1"
14909 "\x27\xDD\xBA\x8A\x90\x29\xD6\xA6"
14910 "\xFA\x48\x3E\x1E\x23\x6E\x98\xA8"
14911 "\xA7\xD9\x67\x92\x5C\x13\xB4\x71"
14912 "\xA8\xAA\x89\x4A\xA4\xB3\x49\x7C"
14913 "\x7D\x7F\xCE\x6F\x29\x2E\x7E\x37"
14914 "\xC8\x52\x60\xD9\xE7\xCA\x60\x98"
14915 "\xED\xCD\xE8\x60\x83\xAD\x34\x4D"
14916 "\x96\x4A\x99\x2B\xB7\x14\x75\x66"
14917 "\x6C\x2C\x1A\xBA\x4B\xBB\x49\x56"
14918 "\xE1\x86\xA2\x0E\xD0\xF0\x07\xD3"
14919 "\x18\x38\x09\x9C\x0E\x8B\x86\x07"
14920 "\x90\x12\x37\x49\x27\x98\x69\x18"
14921 "\xB0\xCC\xFB\xD3\xBD\x04\xA0\x85"
14922 "\x4B\x22\x97\x07\xB6\x97\xE9\x95"
14923 "\x0F\x88\x36\xA9\x44\x00\xC6\xE9"
14924 "\x27\x53\x5C\x5B\x1F\xD3\xE2\xEE"
14925 "\xD0\xCD\x63\x30\xA9\xC0\xDD\x49"
14926 "\xFE\x16\xA4\x07\x0D\xE2\x5D\x97"
14927 "\xDE\x89\xBA\x2E\xF3\xA9\x5E\xBE"
14928 "\x03\x55\x0E\x02\x41\x4A\x45\x06"
14929 "\xBE\xEA\x32\xF2\xDC\x91\x5C\x20"
14930 "\x94\x02\x30\xD2\xFC\x29\xFA\x8E"
14931 "\x34\xA0\x31\xB8\x34\xBA\xAE\x54"
14932 "\xB5\x88\x1F\xDC\x43\xDC\x22\x9F"
14933 "\xDC\xCE\xD3\xFA\xA4\xA8\xBC\x8A"
14934 "\xC7\x5A\x43\x21\xA5\xB1\xDB\xC3"
14935 "\x84\x3B\xB4\x9B\xB5\xA7\xF1\x0A"
14936 "\xB6\x37\x21\x19\x55\xC2\xBD\x99"
14937 "\x49\x24\xBB\x7C\xB3\x8E\xEF\xD2"
14938 "\x3A\xCF\xA0\x31\x28\x0E\x25\xA2"
14939 "\x11\xB4\x18\x17\x1A\x65\x92\x56"
14940 "\xE8\xE0\x52\x9C\x61\x18\x2A\xB1"
14941 "\x1A\x01\x22\x45\x17\x62\x52\x6C"
14942 "\x91\x44\xCF\x98\xC7\xC0\x79\x26"
14943 "\x32\x66\x6F\x23\x7F\x94\x36\x88"
14944 "\x3C\xC9\xD0\xB7\x45\x30\x31\x86"
14945 "\x3D\xC6\xA3\x98\x62\x84\x1A\x8B"
14946 "\x16\x88\xC7\xA3\xE9\x4F\xE0\x86"
14947 "\xA4\x93\xA8\x34\x5A\xCA\xDF\xCA"
14948 "\x46\x38\xD2\xF4\xE0\x2D\x1E\xC9"
14949 "\x7C\xEF\x53\xB7\x60\x72\x41\xBF"
14950 "\x29\x00\x87\x02\xAF\x44\x4C\xB7"
14951 "\x8C\xF5\x3F\x19\xF4\x80\x45\xA7"
14952 "\x15\x5F\xDB\xE9\xB1\x83\xD2\xE6"
14953 "\x1D\x18\x66\x44\x5B\x8F\x14\xEB",
14954 .rlen = 496,
14955 .also_non_np = 1,
14956 .np = 2,
14957 .tap = { 496 - 16, 16 },
14958 },
14959};
14960
14961static struct cipher_testvec cast5_cbc_dec_tv_template[] = {
14962 { /* Generated from TF test vectors */
14963 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
14964 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A",
14965 .klen = 16,
14966 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
14967 .input = "\x05\x28\xCE\x61\x90\x80\xE1\x78"
14968 "\xB9\x2A\x97\x7C\xB0\x83\xD8\x1A"
14969 "\xDE\x58\x7F\xD7\xFD\x72\xB8\xFB"
14970 "\xDA\xF0\x6E\x77\x14\x47\x82\xBA"
14971 "\x29\x0E\x25\x6E\xB4\x39\xD9\x7F"
14972 "\x05\xA7\xA7\x3A\xC1\x5D\x9E\x39"
14973 "\xA7\xFB\x0D\x05\x00\xF3\x58\x67"
14974 "\x60\xEC\x73\x77\x46\x85\x9B\x6A"
14975 "\x08\x3E\xBE\x59\xFB\xE4\x96\x34"
14976 "\xB4\x05\x49\x1A\x97\x43\xAD\xA0"
14977 "\xA9\x1E\x6E\x74\xF1\x94\xEC\xA8"
14978 "\xB5\x8A\x20\xEA\x89\x6B\x19\xAA"
14979 "\xA7\xF1\x33\x67\x90\x23\x0D\xEE"
14980 "\x81\xD5\x78\x4F\xD3\x63\xEA\x46"
14981 "\xB5\xB2\x6E\xBB\xCA\x76\x06\x10"
14982 "\x96\x2A\x0A\xBA\xF9\x41\x5A\x1D"
14983 "\x36\x7C\x56\x14\x54\x83\xFA\xA1"
14984 "\x27\xDD\xBA\x8A\x90\x29\xD6\xA6"
14985 "\xFA\x48\x3E\x1E\x23\x6E\x98\xA8"
14986 "\xA7\xD9\x67\x92\x5C\x13\xB4\x71"
14987 "\xA8\xAA\x89\x4A\xA4\xB3\x49\x7C"
14988 "\x7D\x7F\xCE\x6F\x29\x2E\x7E\x37"
14989 "\xC8\x52\x60\xD9\xE7\xCA\x60\x98"
14990 "\xED\xCD\xE8\x60\x83\xAD\x34\x4D"
14991 "\x96\x4A\x99\x2B\xB7\x14\x75\x66"
14992 "\x6C\x2C\x1A\xBA\x4B\xBB\x49\x56"
14993 "\xE1\x86\xA2\x0E\xD0\xF0\x07\xD3"
14994 "\x18\x38\x09\x9C\x0E\x8B\x86\x07"
14995 "\x90\x12\x37\x49\x27\x98\x69\x18"
14996 "\xB0\xCC\xFB\xD3\xBD\x04\xA0\x85"
14997 "\x4B\x22\x97\x07\xB6\x97\xE9\x95"
14998 "\x0F\x88\x36\xA9\x44\x00\xC6\xE9"
14999 "\x27\x53\x5C\x5B\x1F\xD3\xE2\xEE"
15000 "\xD0\xCD\x63\x30\xA9\xC0\xDD\x49"
15001 "\xFE\x16\xA4\x07\x0D\xE2\x5D\x97"
15002 "\xDE\x89\xBA\x2E\xF3\xA9\x5E\xBE"
15003 "\x03\x55\x0E\x02\x41\x4A\x45\x06"
15004 "\xBE\xEA\x32\xF2\xDC\x91\x5C\x20"
15005 "\x94\x02\x30\xD2\xFC\x29\xFA\x8E"
15006 "\x34\xA0\x31\xB8\x34\xBA\xAE\x54"
15007 "\xB5\x88\x1F\xDC\x43\xDC\x22\x9F"
15008 "\xDC\xCE\xD3\xFA\xA4\xA8\xBC\x8A"
15009 "\xC7\x5A\x43\x21\xA5\xB1\xDB\xC3"
15010 "\x84\x3B\xB4\x9B\xB5\xA7\xF1\x0A"
15011 "\xB6\x37\x21\x19\x55\xC2\xBD\x99"
15012 "\x49\x24\xBB\x7C\xB3\x8E\xEF\xD2"
15013 "\x3A\xCF\xA0\x31\x28\x0E\x25\xA2"
15014 "\x11\xB4\x18\x17\x1A\x65\x92\x56"
15015 "\xE8\xE0\x52\x9C\x61\x18\x2A\xB1"
15016 "\x1A\x01\x22\x45\x17\x62\x52\x6C"
15017 "\x91\x44\xCF\x98\xC7\xC0\x79\x26"
15018 "\x32\x66\x6F\x23\x7F\x94\x36\x88"
15019 "\x3C\xC9\xD0\xB7\x45\x30\x31\x86"
15020 "\x3D\xC6\xA3\x98\x62\x84\x1A\x8B"
15021 "\x16\x88\xC7\xA3\xE9\x4F\xE0\x86"
15022 "\xA4\x93\xA8\x34\x5A\xCA\xDF\xCA"
15023 "\x46\x38\xD2\xF4\xE0\x2D\x1E\xC9"
15024 "\x7C\xEF\x53\xB7\x60\x72\x41\xBF"
15025 "\x29\x00\x87\x02\xAF\x44\x4C\xB7"
15026 "\x8C\xF5\x3F\x19\xF4\x80\x45\xA7"
15027 "\x15\x5F\xDB\xE9\xB1\x83\xD2\xE6"
15028 "\x1D\x18\x66\x44\x5B\x8F\x14\xEB",
15029 .ilen = 496,
15030 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
15031 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
15032 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
15033 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
15034 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
15035 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
15036 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
15037 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
15038 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
15039 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
15040 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
15041 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
15042 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
15043 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
15044 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
15045 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
15046 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
15047 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
15048 "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
15049 "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
15050 "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
15051 "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
15052 "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
15053 "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
15054 "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
15055 "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
15056 "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
15057 "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
15058 "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
15059 "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
15060 "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
15061 "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
15062 "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
15063 "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
15064 "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
15065 "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
15066 "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
15067 "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
15068 "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
15069 "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
15070 "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
15071 "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
15072 "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
15073 "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
15074 "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
15075 "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
15076 "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
15077 "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
15078 "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
15079 "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
15080 "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
15081 "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
15082 "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
15083 "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
15084 "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
15085 "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
15086 "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
15087 "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
15088 "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
15089 "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
15090 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
15091 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
15092 .rlen = 496,
15093 .also_non_np = 1,
15094 .np = 2,
15095 .tap = { 496 - 16, 16 },
15096 },
15097};
15098
15099static struct cipher_testvec cast5_ctr_enc_tv_template[] = {
15100 { /* Generated from TF test vectors */
15101 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
15102 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A",
15103 .klen = 16,
15104 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
15105 .input = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
15106 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
15107 "\x3A",
15108 .ilen = 17,
15109 .result = "\xFF\xC4\x2E\x82\x3D\xF8\xA8\x39"
15110 "\x7C\x52\xC4\xD3\xBB\x62\xC6\xA8"
15111 "\x0C",
15112 .rlen = 17,
15113 }, { /* Generated from TF test vectors */
15114 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
15115 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A",
15116 .klen = 16,
15117 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
15118 .input = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
15119 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
15120 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
15121 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
15122 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
15123 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
15124 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
15125 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
15126 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
15127 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
15128 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
15129 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
15130 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
15131 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
15132 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
15133 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
15134 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
15135 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
15136 "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
15137 "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
15138 "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
15139 "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
15140 "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
15141 "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
15142 "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
15143 "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
15144 "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
15145 "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
15146 "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
15147 "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
15148 "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
15149 "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
15150 "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
15151 "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
15152 "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
15153 "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
15154 "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
15155 "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
15156 "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
15157 "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
15158 "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
15159 "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
15160 "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
15161 "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
15162 "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
15163 "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
15164 "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
15165 "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
15166 "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
15167 "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
15168 "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
15169 "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
15170 "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
15171 "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
15172 "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
15173 "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
15174 "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
15175 "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
15176 "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
15177 "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
15178 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
15179 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
15180 .ilen = 496,
15181 .result = "\xFF\xC4\x2E\x82\x3D\xF8\xA8\x39"
15182 "\x7C\x52\xC4\xD3\xBB\x62\xC6\xA8"
15183 "\x0C\x63\xA5\x55\xE3\xF8\x1C\x7F"
15184 "\xDC\x59\xF9\xA0\x52\xAD\x83\xDF"
15185 "\xD5\x3B\x53\x4A\xAA\x1F\x49\x44"
15186 "\xE8\x20\xCC\xF8\x97\xE6\xE0\x3C"
15187 "\x5A\xD2\x83\xEC\xEE\x25\x3F\xCF"
15188 "\x0D\xC2\x79\x80\x99\x6E\xFF\x7B"
15189 "\x64\xB0\x7B\x86\x29\x1D\x9F\x17"
15190 "\x10\xA5\xA5\xEB\x16\x55\x9E\xE3"
15191 "\x88\x18\x52\x56\x48\x58\xD1\x6B"
15192 "\xE8\x74\x6E\x48\xB0\x2E\x69\x63"
15193 "\x32\xAA\xAC\x26\x55\x45\x94\xDE"
15194 "\x30\x26\x26\xE6\x08\x82\x2F\x5F"
15195 "\xA7\x15\x94\x07\x75\x2D\xC6\x3A"
15196 "\x1B\xA0\x39\xFB\xBA\xB9\x06\x56"
15197 "\xF6\x9F\xF1\x2F\x9B\xF3\x89\x8B"
15198 "\x08\xC8\x9D\x5E\x6B\x95\x09\xC7"
15199 "\x98\xB7\x62\xA4\x1D\x25\xFA\xC5"
15200 "\x62\xC8\x5D\x6B\xB4\x85\x88\x7F"
15201 "\x3B\x29\xF9\xB4\x32\x62\x69\xBF"
15202 "\x32\xB8\xEB\xFD\x0E\x26\xAA\xA3"
15203 "\x44\x67\x90\x20\xAC\x41\xDF\x43"
15204 "\xC6\xC7\x19\x9F\x2C\x28\x74\xEB"
15205 "\x3E\x7F\x7A\x80\x5B\xE4\x08\x60"
15206 "\xC7\xC9\x71\x34\x44\xCE\x05\xFD"
15207 "\xA8\x91\xA8\x44\x5E\xD3\x89\x2C"
15208 "\xAE\x59\x0F\x07\x88\x79\x53\x26"
15209 "\xAF\xAC\xCB\x1D\x6F\x08\x25\x62"
15210 "\xD0\x82\x65\x66\xE4\x2A\x29\x1C"
15211 "\x9C\x64\x5F\x49\x9D\xF8\x62\xF9"
15212 "\xED\xC4\x13\x52\x75\xDC\xE4\xF9"
15213 "\x68\x0F\x8A\xCD\xA6\x8D\x75\xAA"
15214 "\x49\xA1\x86\x86\x37\x5C\x6B\x3D"
15215 "\x56\xE5\x6F\xBE\x27\xC0\x10\xF8"
15216 "\x3C\x4D\x17\x35\x14\xDC\x1C\xA0"
15217 "\x6E\xAE\xD1\x10\xDD\x83\x06\xC2"
15218 "\x23\xD3\xC7\x27\x15\x04\x2C\x27"
15219 "\xDD\x1F\x2E\x97\x09\x9C\x33\x7D"
15220 "\xAC\x50\x1B\x2E\xC9\x52\x0C\x14"
15221 "\x4B\x78\xC4\xDE\x07\x6A\x12\x02"
15222 "\x6E\xD7\x4B\x91\xB9\x88\x4D\x02"
15223 "\xC3\xB5\x04\xBC\xE0\x67\xCA\x18"
15224 "\x22\xA1\xAE\x9A\x21\xEF\xB2\x06"
15225 "\x35\xCD\xEC\x37\x70\x2D\xFC\x1E"
15226 "\xA8\x31\xE7\xFC\xE5\x8E\x88\x66"
15227 "\x16\xB5\xC8\x45\x21\x37\xBD\x24"
15228 "\xA9\xD5\x36\x12\x9F\x6E\x67\x80"
15229 "\x87\x54\xD5\xAF\x97\xE1\x15\xA7"
15230 "\x11\xF0\x63\x7B\xE1\x44\x14\x1C"
15231 "\x06\x32\x05\x8C\x6C\xDB\x9B\x36"
15232 "\x6A\x6B\xAD\x3A\x27\x55\x20\x4C"
15233 "\x76\x36\x43\xE8\x16\x60\xB5\xF3"
15234 "\xDF\x5A\xC6\xA5\x69\x78\x59\x51"
15235 "\x54\x68\x65\x06\x84\xDE\x3D\xAE"
15236 "\x38\x91\xBD\xCC\xA2\x8A\xEC\xE6"
15237 "\x9E\x83\xAE\x1E\x8E\x34\x5D\xDE"
15238 "\x91\xCE\x8F\xED\x40\xF7\xC8\x8B"
15239 "\x9A\x13\x4C\xAD\x89\x97\x9E\xD1"
15240 "\x91\x01\xD7\x21\x23\x28\x1E\xCC"
15241 "\x8C\x98\xDB\xDE\xFC\x72\x94\xAA"
15242 "\xC0\x0D\x96\xAA\x23\xF8\xFE\x13",
15243 .rlen = 496,
15244 .also_non_np = 1,
15245 .np = 2,
15246 .tap = { 496 - 16, 16 },
15247 },
15248};
15249
15250static struct cipher_testvec cast5_ctr_dec_tv_template[] = {
15251 { /* Generated from TF test vectors */
15252 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
15253 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A",
15254 .klen = 16,
15255 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
15256 .input = "\xFF\xC4\x2E\x82\x3D\xF8\xA8\x39"
15257 "\x7C\x52\xC4\xD3\xBB\x62\xC6\xA8"
15258 "\x0C",
15259 .ilen = 17,
15260 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
15261 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
15262 "\x3A",
15263 .rlen = 17,
15264 }, { /* Generated from TF test vectors */
15265 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
15266 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A",
15267 .klen = 16,
15268 .iv = "\xE2\x24\x89\xEE\x53\xB8\x1D\x5F",
15269 .input = "\xFF\xC4\x2E\x82\x3D\xF8\xA8\x39"
15270 "\x7C\x52\xC4\xD3\xBB\x62\xC6\xA8"
15271 "\x0C\x63\xA5\x55\xE3\xF8\x1C\x7F"
15272 "\xDC\x59\xF9\xA0\x52\xAD\x83\xDF"
15273 "\xD5\x3B\x53\x4A\xAA\x1F\x49\x44"
15274 "\xE8\x20\xCC\xF8\x97\xE6\xE0\x3C"
15275 "\x5A\xD2\x83\xEC\xEE\x25\x3F\xCF"
15276 "\x0D\xC2\x79\x80\x99\x6E\xFF\x7B"
15277 "\x64\xB0\x7B\x86\x29\x1D\x9F\x17"
15278 "\x10\xA5\xA5\xEB\x16\x55\x9E\xE3"
15279 "\x88\x18\x52\x56\x48\x58\xD1\x6B"
15280 "\xE8\x74\x6E\x48\xB0\x2E\x69\x63"
15281 "\x32\xAA\xAC\x26\x55\x45\x94\xDE"
15282 "\x30\x26\x26\xE6\x08\x82\x2F\x5F"
15283 "\xA7\x15\x94\x07\x75\x2D\xC6\x3A"
15284 "\x1B\xA0\x39\xFB\xBA\xB9\x06\x56"
15285 "\xF6\x9F\xF1\x2F\x9B\xF3\x89\x8B"
15286 "\x08\xC8\x9D\x5E\x6B\x95\x09\xC7"
15287 "\x98\xB7\x62\xA4\x1D\x25\xFA\xC5"
15288 "\x62\xC8\x5D\x6B\xB4\x85\x88\x7F"
15289 "\x3B\x29\xF9\xB4\x32\x62\x69\xBF"
15290 "\x32\xB8\xEB\xFD\x0E\x26\xAA\xA3"
15291 "\x44\x67\x90\x20\xAC\x41\xDF\x43"
15292 "\xC6\xC7\x19\x9F\x2C\x28\x74\xEB"
15293 "\x3E\x7F\x7A\x80\x5B\xE4\x08\x60"
15294 "\xC7\xC9\x71\x34\x44\xCE\x05\xFD"
15295 "\xA8\x91\xA8\x44\x5E\xD3\x89\x2C"
15296 "\xAE\x59\x0F\x07\x88\x79\x53\x26"
15297 "\xAF\xAC\xCB\x1D\x6F\x08\x25\x62"
15298 "\xD0\x82\x65\x66\xE4\x2A\x29\x1C"
15299 "\x9C\x64\x5F\x49\x9D\xF8\x62\xF9"
15300 "\xED\xC4\x13\x52\x75\xDC\xE4\xF9"
15301 "\x68\x0F\x8A\xCD\xA6\x8D\x75\xAA"
15302 "\x49\xA1\x86\x86\x37\x5C\x6B\x3D"
15303 "\x56\xE5\x6F\xBE\x27\xC0\x10\xF8"
15304 "\x3C\x4D\x17\x35\x14\xDC\x1C\xA0"
15305 "\x6E\xAE\xD1\x10\xDD\x83\x06\xC2"
15306 "\x23\xD3\xC7\x27\x15\x04\x2C\x27"
15307 "\xDD\x1F\x2E\x97\x09\x9C\x33\x7D"
15308 "\xAC\x50\x1B\x2E\xC9\x52\x0C\x14"
15309 "\x4B\x78\xC4\xDE\x07\x6A\x12\x02"
15310 "\x6E\xD7\x4B\x91\xB9\x88\x4D\x02"
15311 "\xC3\xB5\x04\xBC\xE0\x67\xCA\x18"
15312 "\x22\xA1\xAE\x9A\x21\xEF\xB2\x06"
15313 "\x35\xCD\xEC\x37\x70\x2D\xFC\x1E"
15314 "\xA8\x31\xE7\xFC\xE5\x8E\x88\x66"
15315 "\x16\xB5\xC8\x45\x21\x37\xBD\x24"
15316 "\xA9\xD5\x36\x12\x9F\x6E\x67\x80"
15317 "\x87\x54\xD5\xAF\x97\xE1\x15\xA7"
15318 "\x11\xF0\x63\x7B\xE1\x44\x14\x1C"
15319 "\x06\x32\x05\x8C\x6C\xDB\x9B\x36"
15320 "\x6A\x6B\xAD\x3A\x27\x55\x20\x4C"
15321 "\x76\x36\x43\xE8\x16\x60\xB5\xF3"
15322 "\xDF\x5A\xC6\xA5\x69\x78\x59\x51"
15323 "\x54\x68\x65\x06\x84\xDE\x3D\xAE"
15324 "\x38\x91\xBD\xCC\xA2\x8A\xEC\xE6"
15325 "\x9E\x83\xAE\x1E\x8E\x34\x5D\xDE"
15326 "\x91\xCE\x8F\xED\x40\xF7\xC8\x8B"
15327 "\x9A\x13\x4C\xAD\x89\x97\x9E\xD1"
15328 "\x91\x01\xD7\x21\x23\x28\x1E\xCC"
15329 "\x8C\x98\xDB\xDE\xFC\x72\x94\xAA"
15330 "\xC0\x0D\x96\xAA\x23\xF8\xFE\x13",
15331 .ilen = 496,
15332 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
15333 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
15334 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
15335 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
15336 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
15337 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
15338 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
15339 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
15340 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
15341 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
15342 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
15343 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
15344 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
15345 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
15346 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
15347 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
15348 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
15349 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
15350 "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
15351 "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
15352 "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
15353 "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
15354 "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
15355 "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
15356 "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
15357 "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
15358 "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
15359 "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
15360 "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
15361 "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
15362 "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
15363 "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
15364 "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
15365 "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
15366 "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
15367 "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
15368 "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
15369 "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
15370 "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
15371 "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
15372 "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
15373 "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
15374 "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
15375 "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
15376 "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
15377 "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
15378 "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
15379 "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
15380 "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
15381 "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
15382 "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
15383 "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
15384 "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
15385 "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
15386 "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
15387 "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
15388 "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
15389 "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
15390 "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
15391 "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
15392 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
15393 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
15394 .rlen = 496,
15395 .also_non_np = 1,
15396 .np = 2,
15397 .tap = { 496 - 16, 16 },
12182 }, 15398 },
12183}; 15399};
12184 15400
@@ -13096,6 +16312,9 @@ static struct cipher_testvec camellia_enc_tv_template[] = {
13096 "\x0D\xD0\xFD\xC4\x65\xA5\x69\xB9" 16312 "\x0D\xD0\xFD\xC4\x65\xA5\x69\xB9"
13097 "\xF1\xF6\xB1\xA5\xB2\x75\x4F\x8A", 16313 "\xF1\xF6\xB1\xA5\xB2\x75\x4F\x8A",
13098 .rlen = 48, 16314 .rlen = 48,
16315 .also_non_np = 1,
16316 .np = 2,
16317 .tap = { 48 - 16, 16 },
13099 }, 16318 },
13100}; 16319};
13101 16320
@@ -13154,6 +16373,9 @@ static struct cipher_testvec camellia_dec_tv_template[] = {
13154 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9" 16373 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
13155 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48", 16374 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48",
13156 .rlen = 48, 16375 .rlen = 48,
16376 .also_non_np = 1,
16377 .np = 2,
16378 .tap = { 48 - 16, 16 },
13157 }, 16379 },
13158}; 16380};
13159 16381
@@ -13208,6 +16430,9 @@ static struct cipher_testvec camellia_cbc_enc_tv_template[] = {
13208 "\xB9\xF9\xC2\x27\x6A\xB6\x31\x27" 16430 "\xB9\xF9\xC2\x27\x6A\xB6\x31\x27"
13209 "\xA6\xAD\xEF\xE5\x5D\xE4\x02\x01", 16431 "\xA6\xAD\xEF\xE5\x5D\xE4\x02\x01",
13210 .rlen = 48, 16432 .rlen = 48,
16433 .also_non_np = 1,
16434 .np = 2,
16435 .tap = { 48 - 16, 16 },
13211 }, 16436 },
13212}; 16437};
13213 16438
@@ -13262,6 +16487,9 @@ static struct cipher_testvec camellia_cbc_dec_tv_template[] = {
13262 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9" 16487 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
13263 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48", 16488 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48",
13264 .rlen = 48, 16489 .rlen = 48,
16490 .also_non_np = 1,
16491 .np = 2,
16492 .tap = { 48 - 16, 16 },
13265 }, 16493 },
13266}; 16494};
13267 16495
@@ -13313,6 +16541,143 @@ static struct cipher_testvec camellia_ctr_enc_tv_template[] = {
13313 "\x60\xFC\xE8\x94\xE8\xB5\x09\x2C" 16541 "\x60\xFC\xE8\x94\xE8\xB5\x09\x2C"
13314 "\x1E\x43\xEF", 16542 "\x1E\x43\xEF",
13315 .rlen = 51, 16543 .rlen = 51,
16544 .also_non_np = 1,
16545 .np = 2,
16546 .tap = { 51 - 16, 16 },
16547 }, { /* Generated with Crypto++ */
16548 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
16549 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
16550 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
16551 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
16552 .klen = 32,
16553 .iv = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"
16554 "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFD",
16555 .input = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
16556 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
16557 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
16558 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
16559 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
16560 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
16561 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
16562 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
16563 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
16564 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
16565 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
16566 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
16567 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
16568 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
16569 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
16570 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
16571 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
16572 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
16573 "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
16574 "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
16575 "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
16576 "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
16577 "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
16578 "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
16579 "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
16580 "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
16581 "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
16582 "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
16583 "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
16584 "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
16585 "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
16586 "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
16587 "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
16588 "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
16589 "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
16590 "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
16591 "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
16592 "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
16593 "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
16594 "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
16595 "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
16596 "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
16597 "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
16598 "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
16599 "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
16600 "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
16601 "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
16602 "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
16603 "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
16604 "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
16605 "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
16606 "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
16607 "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
16608 "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
16609 "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
16610 "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
16611 "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
16612 "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
16613 "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
16614 "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
16615 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
16616 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
16617 .ilen = 496,
16618 .result = "\x85\x79\x6C\x8B\x2B\x6D\x14\xF9"
16619 "\xA6\x83\xB6\x80\x5B\x3A\xF3\x7E"
16620 "\x30\x29\xEB\x1F\xDC\x19\x5F\xEB"
16621 "\xF7\xC4\x27\x04\x51\x87\xD7\x6F"
16622 "\xB8\x4E\x07\xFB\xAC\x3B\x08\xB4"
16623 "\x4D\xCB\xE8\xE1\x71\x7D\x4F\x48"
16624 "\xCD\x81\x64\xA5\xC4\x07\x1A\x9A"
16625 "\x4B\x62\x90\x0E\xC8\xB3\x2B\x6B"
16626 "\x8F\x9C\x6E\x72\x4B\xBA\xEF\x07"
16627 "\x2C\x56\x07\x5E\x37\x30\x60\xA9"
16628 "\xE3\xEF\xD6\x69\xE1\xA1\x77\x64"
16629 "\x93\x75\x7A\xB7\x7A\x3B\xE9\x43"
16630 "\x23\x35\x95\x91\x80\x8A\xC7\xCF"
16631 "\xC3\xD5\xBF\xE7\xFE\x4C\x06\x6B"
16632 "\x05\x19\x48\xE2\x62\xBA\x4F\xF2"
16633 "\xFB\xEE\xE4\xCB\x79\x9D\xA3\x10"
16634 "\x1D\x29\x8C\x1D\x7A\x88\x5A\xDD"
16635 "\x4E\xB6\x18\xAA\xCD\xE6\x33\x96"
16636 "\xD9\x0F\x90\x5A\x78\x76\x4D\x77"
16637 "\x3C\x20\x89\x3B\xA3\xF9\x07\xFD"
16638 "\xE4\xE8\x20\x2D\x15\x0A\x63\x49"
16639 "\xF5\x4F\x89\xD8\xDE\xA1\x28\x78"
16640 "\x28\x07\x09\x1B\x03\x94\x1D\x4B"
16641 "\x82\x28\x1E\x1D\x95\xBA\xAC\x85"
16642 "\x71\x6E\x3C\x18\x4B\x77\x74\x79"
16643 "\xBF\x67\x0A\x53\x3C\x94\xD9\x60"
16644 "\xE9\x6D\x40\x34\xA0\x2A\x53\x5D"
16645 "\x27\xD5\x47\xF9\xC3\x4B\x27\x29"
16646 "\xE4\x76\x9C\x3F\xA7\x1C\x87\xFC"
16647 "\x6E\x0F\xCF\x9B\x60\xF0\xF0\x8B"
16648 "\x70\x1C\x84\x81\x72\x4D\xB4\x98"
16649 "\x23\x62\xE7\x6A\x2B\xFC\xA5\xB2"
16650 "\xFF\xF5\x71\x07\xCD\x90\x23\x13"
16651 "\x19\xD7\x79\x36\x6C\x9D\x55\x8B"
16652 "\x93\x78\x86\x05\x69\x46\xD0\xC5"
16653 "\x39\x09\xEB\x79\xEF\xFA\x9F\xAE"
16654 "\xF3\xD5\x44\xC3\xFD\x86\xD2\x7C"
16655 "\x83\x4B\xD8\x75\x9C\x18\x04\x7B"
16656 "\x73\xAD\x72\xA4\xF6\xAB\xCF\x4B"
16657 "\xCC\x01\x45\x90\xA6\x43\x05\x0C"
16658 "\x6C\x4F\x62\x77\x57\x97\x9F\xEE"
16659 "\x75\xA7\x3C\x38\xD1\x0F\x3D\x0E"
16660 "\x2C\x43\x98\xFB\x13\x65\x73\xE4"
16661 "\x3C\x1E\xD6\x90\x08\xF7\xE0\x99"
16662 "\x3B\xF1\x9D\x6C\x48\xA9\x0E\x32"
16663 "\x17\xC2\xCC\x20\xA1\x19\x26\xAA"
16664 "\xE0\x75\x2F\xFB\x54\x66\x0A\xDF"
16665 "\xB5\xF2\x1F\xC1\x34\x3C\x30\x56"
16666 "\xE8\xDC\xF7\x92\x6B\xBF\x17\x24"
16667 "\xEC\x94\xB5\x3B\xD6\xCE\xA2\x54"
16668 "\x10\x7F\x50\xDE\x69\x77\xD5\x37"
16669 "\xFE\x9C\x10\x83\xC5\xEB\xC9\x53"
16670 "\xB7\xF3\xC4\x20\xAF\x0A\x7E\x57"
16671 "\x3A\xE6\x75\xFE\x89\x00\x6E\x48"
16672 "\xFB\x99\x17\x2C\xF6\x64\x40\x95"
16673 "\x5E\xDC\x7A\xA6\x70\xC7\xF4\xDD"
16674 "\x52\x05\x24\x34\xF9\x0E\xC8\x64"
16675 "\x6D\xE2\xD8\x80\x53\x31\x4C\xFE"
16676 "\xB4\x3A\x5F\x19\xCF\x42\x1B\x22"
16677 "\x0B\x2D\x7B\xF1\xC5\x43\xF7\x5E"
16678 "\x12\xA8\x01\x64\x16\x0B\x26\x5A"
16679 "\x0C\x95\x0F\x40\xC5\x5A\x06\x7C",
16680 .rlen = 496,
13316 }, 16681 },
13317}; 16682};
13318 16683
@@ -13364,8 +16729,144 @@ static struct cipher_testvec camellia_ctr_dec_tv_template[] = {
13364 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48" 16729 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
13365 "\xDF\x76\x0D", 16730 "\xDF\x76\x0D",
13366 .rlen = 51, 16731 .rlen = 51,
16732 .also_non_np = 1,
16733 .np = 2,
16734 .tap = { 51 - 16, 16 },
16735 }, { /* Generated with Crypto++ */
16736 .key = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
16737 "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
16738 "\x27\x04\xE1\x27\x04\xE1\xBE\x9B"
16739 "\x78\xBE\x9B\x78\x55\x32\x0F\x55",
16740 .klen = 32,
16741 .iv = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"
16742 "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFD",
16743 .input = "\x85\x79\x6C\x8B\x2B\x6D\x14\xF9"
16744 "\xA6\x83\xB6\x80\x5B\x3A\xF3\x7E"
16745 "\x30\x29\xEB\x1F\xDC\x19\x5F\xEB"
16746 "\xF7\xC4\x27\x04\x51\x87\xD7\x6F"
16747 "\xB8\x4E\x07\xFB\xAC\x3B\x08\xB4"
16748 "\x4D\xCB\xE8\xE1\x71\x7D\x4F\x48"
16749 "\xCD\x81\x64\xA5\xC4\x07\x1A\x9A"
16750 "\x4B\x62\x90\x0E\xC8\xB3\x2B\x6B"
16751 "\x8F\x9C\x6E\x72\x4B\xBA\xEF\x07"
16752 "\x2C\x56\x07\x5E\x37\x30\x60\xA9"
16753 "\xE3\xEF\xD6\x69\xE1\xA1\x77\x64"
16754 "\x93\x75\x7A\xB7\x7A\x3B\xE9\x43"
16755 "\x23\x35\x95\x91\x80\x8A\xC7\xCF"
16756 "\xC3\xD5\xBF\xE7\xFE\x4C\x06\x6B"
16757 "\x05\x19\x48\xE2\x62\xBA\x4F\xF2"
16758 "\xFB\xEE\xE4\xCB\x79\x9D\xA3\x10"
16759 "\x1D\x29\x8C\x1D\x7A\x88\x5A\xDD"
16760 "\x4E\xB6\x18\xAA\xCD\xE6\x33\x96"
16761 "\xD9\x0F\x90\x5A\x78\x76\x4D\x77"
16762 "\x3C\x20\x89\x3B\xA3\xF9\x07\xFD"
16763 "\xE4\xE8\x20\x2D\x15\x0A\x63\x49"
16764 "\xF5\x4F\x89\xD8\xDE\xA1\x28\x78"
16765 "\x28\x07\x09\x1B\x03\x94\x1D\x4B"
16766 "\x82\x28\x1E\x1D\x95\xBA\xAC\x85"
16767 "\x71\x6E\x3C\x18\x4B\x77\x74\x79"
16768 "\xBF\x67\x0A\x53\x3C\x94\xD9\x60"
16769 "\xE9\x6D\x40\x34\xA0\x2A\x53\x5D"
16770 "\x27\xD5\x47\xF9\xC3\x4B\x27\x29"
16771 "\xE4\x76\x9C\x3F\xA7\x1C\x87\xFC"
16772 "\x6E\x0F\xCF\x9B\x60\xF0\xF0\x8B"
16773 "\x70\x1C\x84\x81\x72\x4D\xB4\x98"
16774 "\x23\x62\xE7\x6A\x2B\xFC\xA5\xB2"
16775 "\xFF\xF5\x71\x07\xCD\x90\x23\x13"
16776 "\x19\xD7\x79\x36\x6C\x9D\x55\x8B"
16777 "\x93\x78\x86\x05\x69\x46\xD0\xC5"
16778 "\x39\x09\xEB\x79\xEF\xFA\x9F\xAE"
16779 "\xF3\xD5\x44\xC3\xFD\x86\xD2\x7C"
16780 "\x83\x4B\xD8\x75\x9C\x18\x04\x7B"
16781 "\x73\xAD\x72\xA4\xF6\xAB\xCF\x4B"
16782 "\xCC\x01\x45\x90\xA6\x43\x05\x0C"
16783 "\x6C\x4F\x62\x77\x57\x97\x9F\xEE"
16784 "\x75\xA7\x3C\x38\xD1\x0F\x3D\x0E"
16785 "\x2C\x43\x98\xFB\x13\x65\x73\xE4"
16786 "\x3C\x1E\xD6\x90\x08\xF7\xE0\x99"
16787 "\x3B\xF1\x9D\x6C\x48\xA9\x0E\x32"
16788 "\x17\xC2\xCC\x20\xA1\x19\x26\xAA"
16789 "\xE0\x75\x2F\xFB\x54\x66\x0A\xDF"
16790 "\xB5\xF2\x1F\xC1\x34\x3C\x30\x56"
16791 "\xE8\xDC\xF7\x92\x6B\xBF\x17\x24"
16792 "\xEC\x94\xB5\x3B\xD6\xCE\xA2\x54"
16793 "\x10\x7F\x50\xDE\x69\x77\xD5\x37"
16794 "\xFE\x9C\x10\x83\xC5\xEB\xC9\x53"
16795 "\xB7\xF3\xC4\x20\xAF\x0A\x7E\x57"
16796 "\x3A\xE6\x75\xFE\x89\x00\x6E\x48"
16797 "\xFB\x99\x17\x2C\xF6\x64\x40\x95"
16798 "\x5E\xDC\x7A\xA6\x70\xC7\xF4\xDD"
16799 "\x52\x05\x24\x34\xF9\x0E\xC8\x64"
16800 "\x6D\xE2\xD8\x80\x53\x31\x4C\xFE"
16801 "\xB4\x3A\x5F\x19\xCF\x42\x1B\x22"
16802 "\x0B\x2D\x7B\xF1\xC5\x43\xF7\x5E"
16803 "\x12\xA8\x01\x64\x16\x0B\x26\x5A"
16804 "\x0C\x95\x0F\x40\xC5\x5A\x06\x7C",
16805 .ilen = 496,
16806 .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
16807 "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
16808 "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
16809 "\xAC\x20\xB7\x4E\xE5\x59\xF0\x87"
16810 "\x1E\x92\x29\xC0\x34\xCB\x62\xF9"
16811 "\x6D\x04\x9B\x0F\xA6\x3D\xD4\x48"
16812 "\xDF\x76\x0D\x81\x18\xAF\x23\xBA"
16813 "\x51\xE8\x5C\xF3\x8A\x21\x95\x2C"
16814 "\xC3\x37\xCE\x65\xFC\x70\x07\x9E"
16815 "\x12\xA9\x40\xD7\x4B\xE2\x79\x10"
16816 "\x84\x1B\xB2\x26\xBD\x54\xEB\x5F"
16817 "\xF6\x8D\x01\x98\x2F\xC6\x3A\xD1"
16818 "\x68\xFF\x73\x0A\xA1\x15\xAC\x43"
16819 "\xDA\x4E\xE5\x7C\x13\x87\x1E\xB5"
16820 "\x29\xC0\x57\xEE\x62\xF9\x90\x04"
16821 "\x9B\x32\xC9\x3D\xD4\x6B\x02\x76"
16822 "\x0D\xA4\x18\xAF\x46\xDD\x51\xE8"
16823 "\x7F\x16\x8A\x21\xB8\x2C\xC3\x5A"
16824 "\xF1\x65\xFC\x93\x07\x9E\x35\xCC"
16825 "\x40\xD7\x6E\x05\x79\x10\xA7\x1B"
16826 "\xB2\x49\xE0\x54\xEB\x82\x19\x8D"
16827 "\x24\xBB\x2F\xC6\x5D\xF4\x68\xFF"
16828 "\x96\x0A\xA1\x38\xCF\x43\xDA\x71"
16829 "\x08\x7C\x13\xAA\x1E\xB5\x4C\xE3"
16830 "\x57\xEE\x85\x1C\x90\x27\xBE\x32"
16831 "\xC9\x60\xF7\x6B\x02\x99\x0D\xA4"
16832 "\x3B\xD2\x46\xDD\x74\x0B\x7F\x16"
16833 "\xAD\x21\xB8\x4F\xE6\x5A\xF1\x88"
16834 "\x1F\x93\x2A\xC1\x35\xCC\x63\xFA"
16835 "\x6E\x05\x9C\x10\xA7\x3E\xD5\x49"
16836 "\xE0\x77\x0E\x82\x19\xB0\x24\xBB"
16837 "\x52\xE9\x5D\xF4\x8B\x22\x96\x2D"
16838 "\xC4\x38\xCF\x66\xFD\x71\x08\x9F"
16839 "\x13\xAA\x41\xD8\x4C\xE3\x7A\x11"
16840 "\x85\x1C\xB3\x27\xBE\x55\xEC\x60"
16841 "\xF7\x8E\x02\x99\x30\xC7\x3B\xD2"
16842 "\x69\x00\x74\x0B\xA2\x16\xAD\x44"
16843 "\xDB\x4F\xE6\x7D\x14\x88\x1F\xB6"
16844 "\x2A\xC1\x58\xEF\x63\xFA\x91\x05"
16845 "\x9C\x33\xCA\x3E\xD5\x6C\x03\x77"
16846 "\x0E\xA5\x19\xB0\x47\xDE\x52\xE9"
16847 "\x80\x17\x8B\x22\xB9\x2D\xC4\x5B"
16848 "\xF2\x66\xFD\x94\x08\x9F\x36\xCD"
16849 "\x41\xD8\x6F\x06\x7A\x11\xA8\x1C"
16850 "\xB3\x4A\xE1\x55\xEC\x83\x1A\x8E"
16851 "\x25\xBC\x30\xC7\x5E\xF5\x69\x00"
16852 "\x97\x0B\xA2\x39\xD0\x44\xDB\x72"
16853 "\x09\x7D\x14\xAB\x1F\xB6\x4D\xE4"
16854 "\x58\xEF\x86\x1D\x91\x28\xBF\x33"
16855 "\xCA\x61\xF8\x6C\x03\x9A\x0E\xA5"
16856 "\x3C\xD3\x47\xDE\x75\x0C\x80\x17"
16857 "\xAE\x22\xB9\x50\xE7\x5B\xF2\x89"
16858 "\x20\x94\x2B\xC2\x36\xCD\x64\xFB"
16859 "\x6F\x06\x9D\x11\xA8\x3F\xD6\x4A"
16860 "\xE1\x78\x0F\x83\x1A\xB1\x25\xBC"
16861 "\x53\xEA\x5E\xF5\x8C\x00\x97\x2E"
16862 "\xC5\x39\xD0\x67\xFE\x72\x09\xA0"
16863 "\x14\xAB\x42\xD9\x4D\xE4\x7B\x12"
16864 "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
16865 "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
16866 "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
16867 "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
16868 .rlen = 496,
13367 }, 16869 },
13368
13369}; 16870};
13370 16871
13371static struct cipher_testvec camellia_lrw_enc_tv_template[] = { 16872static struct cipher_testvec camellia_lrw_enc_tv_template[] = {
@@ -13614,6 +17115,9 @@ static struct cipher_testvec camellia_lrw_enc_tv_template[] = {
13614 "\xb2\x1a\xd8\x4c\xbd\x1d\x10\xe9" 17115 "\xb2\x1a\xd8\x4c\xbd\x1d\x10\xe9"
13615 "\x5a\xa8\x92\x7f\xba\xe6\x0c\x95", 17116 "\x5a\xa8\x92\x7f\xba\xe6\x0c\x95",
13616 .rlen = 512, 17117 .rlen = 512,
17118 .also_non_np = 1,
17119 .np = 2,
17120 .tap = { 512 - 16, 16 },
13617 }, 17121 },
13618}; 17122};
13619 17123
@@ -13864,6 +17368,9 @@ static struct cipher_testvec camellia_lrw_dec_tv_template[] = {
13864 "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4" 17368 "\xe9\x2e\xc4\x29\x0f\x84\xdb\xc4"
13865 "\x21\xc4\xc2\x75\x67\x89\x37\x0a", 17369 "\x21\xc4\xc2\x75\x67\x89\x37\x0a",
13866 .rlen = 512, 17370 .rlen = 512,
17371 .also_non_np = 1,
17372 .np = 2,
17373 .tap = { 512 - 16, 16 },
13867 }, 17374 },
13868}; 17375};
13869 17376
@@ -14203,6 +17710,9 @@ static struct cipher_testvec camellia_xts_enc_tv_template[] = {
14203 "\xb7\x16\xd8\x12\x5c\xcd\x7d\x4e" 17710 "\xb7\x16\xd8\x12\x5c\xcd\x7d\x4e"
14204 "\xd5\xc6\x99\xcc\x4e\x6c\x94\x95", 17711 "\xd5\xc6\x99\xcc\x4e\x6c\x94\x95",
14205 .rlen = 512, 17712 .rlen = 512,
17713 .also_non_np = 1,
17714 .np = 2,
17715 .tap = { 512 - 16, 16 },
14206 }, 17716 },
14207}; 17717};
14208 17718
@@ -14543,6 +18053,9 @@ static struct cipher_testvec camellia_xts_dec_tv_template[] = {
14543 "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7" 18053 "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7"
14544 "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff", 18054 "\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
14545 .rlen = 512, 18055 .rlen = 512,
18056 .also_non_np = 1,
18057 .np = 2,
18058 .tap = { 512 - 16, 16 },
14546 }, 18059 },
14547}; 18060};
14548 18061
diff --git a/crypto/tgr192.c b/crypto/tgr192.c
index cbca4f208c9f..87403556fd0b 100644
--- a/crypto/tgr192.c
+++ b/crypto/tgr192.c
@@ -628,7 +628,7 @@ static int tgr128_final(struct shash_desc *desc, u8 * out)
628 return 0; 628 return 0;
629} 629}
630 630
631static struct shash_alg tgr192 = { 631static struct shash_alg tgr_algs[3] = { {
632 .digestsize = TGR192_DIGEST_SIZE, 632 .digestsize = TGR192_DIGEST_SIZE,
633 .init = tgr192_init, 633 .init = tgr192_init,
634 .update = tgr192_update, 634 .update = tgr192_update,
@@ -640,9 +640,7 @@ static struct shash_alg tgr192 = {
640 .cra_blocksize = TGR192_BLOCK_SIZE, 640 .cra_blocksize = TGR192_BLOCK_SIZE,
641 .cra_module = THIS_MODULE, 641 .cra_module = THIS_MODULE,
642 } 642 }
643}; 643}, {
644
645static struct shash_alg tgr160 = {
646 .digestsize = TGR160_DIGEST_SIZE, 644 .digestsize = TGR160_DIGEST_SIZE,
647 .init = tgr192_init, 645 .init = tgr192_init,
648 .update = tgr192_update, 646 .update = tgr192_update,
@@ -654,9 +652,7 @@ static struct shash_alg tgr160 = {
654 .cra_blocksize = TGR192_BLOCK_SIZE, 652 .cra_blocksize = TGR192_BLOCK_SIZE,
655 .cra_module = THIS_MODULE, 653 .cra_module = THIS_MODULE,
656 } 654 }
657}; 655}, {
658
659static struct shash_alg tgr128 = {
660 .digestsize = TGR128_DIGEST_SIZE, 656 .digestsize = TGR128_DIGEST_SIZE,
661 .init = tgr192_init, 657 .init = tgr192_init,
662 .update = tgr192_update, 658 .update = tgr192_update,
@@ -668,38 +664,16 @@ static struct shash_alg tgr128 = {
668 .cra_blocksize = TGR192_BLOCK_SIZE, 664 .cra_blocksize = TGR192_BLOCK_SIZE,
669 .cra_module = THIS_MODULE, 665 .cra_module = THIS_MODULE,
670 } 666 }
671}; 667} };
672 668
673static int __init tgr192_mod_init(void) 669static int __init tgr192_mod_init(void)
674{ 670{
675 int ret = 0; 671 return crypto_register_shashes(tgr_algs, ARRAY_SIZE(tgr_algs));
676
677 ret = crypto_register_shash(&tgr192);
678
679 if (ret < 0) {
680 goto out;
681 }
682
683 ret = crypto_register_shash(&tgr160);
684 if (ret < 0) {
685 crypto_unregister_shash(&tgr192);
686 goto out;
687 }
688
689 ret = crypto_register_shash(&tgr128);
690 if (ret < 0) {
691 crypto_unregister_shash(&tgr192);
692 crypto_unregister_shash(&tgr160);
693 }
694 out:
695 return ret;
696} 672}
697 673
698static void __exit tgr192_mod_fini(void) 674static void __exit tgr192_mod_fini(void)
699{ 675{
700 crypto_unregister_shash(&tgr192); 676 crypto_unregister_shashes(tgr_algs, ARRAY_SIZE(tgr_algs));
701 crypto_unregister_shash(&tgr160);
702 crypto_unregister_shash(&tgr128);
703} 677}
704 678
705MODULE_ALIAS("tgr160"); 679MODULE_ALIAS("tgr160");
diff --git a/crypto/twofish_generic.c b/crypto/twofish_generic.c
index 1f07b843e07c..2d5000552d0f 100644
--- a/crypto/twofish_generic.c
+++ b/crypto/twofish_generic.c
@@ -188,7 +188,6 @@ static struct crypto_alg alg = {
188 .cra_ctxsize = sizeof(struct twofish_ctx), 188 .cra_ctxsize = sizeof(struct twofish_ctx),
189 .cra_alignmask = 3, 189 .cra_alignmask = 3,
190 .cra_module = THIS_MODULE, 190 .cra_module = THIS_MODULE,
191 .cra_list = LIST_HEAD_INIT(alg.cra_list),
192 .cra_u = { .cipher = { 191 .cra_u = { .cipher = {
193 .cia_min_keysize = TF_MIN_KEY_SIZE, 192 .cia_min_keysize = TF_MIN_KEY_SIZE,
194 .cia_max_keysize = TF_MAX_KEY_SIZE, 193 .cia_max_keysize = TF_MAX_KEY_SIZE,
diff --git a/crypto/vmac.c b/crypto/vmac.c
index 4243905ba135..f2338ca98368 100644
--- a/crypto/vmac.c
+++ b/crypto/vmac.c
@@ -38,11 +38,11 @@
38 * Constants and masks 38 * Constants and masks
39 */ 39 */
40#define UINT64_C(x) x##ULL 40#define UINT64_C(x) x##ULL
41const u64 p64 = UINT64_C(0xfffffffffffffeff); /* 2^64 - 257 prime */ 41static const u64 p64 = UINT64_C(0xfffffffffffffeff); /* 2^64 - 257 prime */
42const u64 m62 = UINT64_C(0x3fffffffffffffff); /* 62-bit mask */ 42static const u64 m62 = UINT64_C(0x3fffffffffffffff); /* 62-bit mask */
43const u64 m63 = UINT64_C(0x7fffffffffffffff); /* 63-bit mask */ 43static const u64 m63 = UINT64_C(0x7fffffffffffffff); /* 63-bit mask */
44const u64 m64 = UINT64_C(0xffffffffffffffff); /* 64-bit mask */ 44static const u64 m64 = UINT64_C(0xffffffffffffffff); /* 64-bit mask */
45const u64 mpoly = UINT64_C(0x1fffffff1fffffff); /* Poly key mask */ 45static const u64 mpoly = UINT64_C(0x1fffffff1fffffff); /* Poly key mask */
46 46
47#define pe64_to_cpup le64_to_cpup /* Prefer little endian */ 47#define pe64_to_cpup le64_to_cpup /* Prefer little endian */
48 48
diff --git a/crypto/wp512.c b/crypto/wp512.c
index 71719a2be25a..180f1d6e03f4 100644
--- a/crypto/wp512.c
+++ b/crypto/wp512.c
@@ -1119,7 +1119,7 @@ static int wp256_final(struct shash_desc *desc, u8 *out)
1119 return 0; 1119 return 0;
1120} 1120}
1121 1121
1122static struct shash_alg wp512 = { 1122static struct shash_alg wp_algs[3] = { {
1123 .digestsize = WP512_DIGEST_SIZE, 1123 .digestsize = WP512_DIGEST_SIZE,
1124 .init = wp512_init, 1124 .init = wp512_init,
1125 .update = wp512_update, 1125 .update = wp512_update,
@@ -1131,9 +1131,7 @@ static struct shash_alg wp512 = {
1131 .cra_blocksize = WP512_BLOCK_SIZE, 1131 .cra_blocksize = WP512_BLOCK_SIZE,
1132 .cra_module = THIS_MODULE, 1132 .cra_module = THIS_MODULE,
1133 } 1133 }
1134}; 1134}, {
1135
1136static struct shash_alg wp384 = {
1137 .digestsize = WP384_DIGEST_SIZE, 1135 .digestsize = WP384_DIGEST_SIZE,
1138 .init = wp512_init, 1136 .init = wp512_init,
1139 .update = wp512_update, 1137 .update = wp512_update,
@@ -1145,9 +1143,7 @@ static struct shash_alg wp384 = {
1145 .cra_blocksize = WP512_BLOCK_SIZE, 1143 .cra_blocksize = WP512_BLOCK_SIZE,
1146 .cra_module = THIS_MODULE, 1144 .cra_module = THIS_MODULE,
1147 } 1145 }
1148}; 1146}, {
1149
1150static struct shash_alg wp256 = {
1151 .digestsize = WP256_DIGEST_SIZE, 1147 .digestsize = WP256_DIGEST_SIZE,
1152 .init = wp512_init, 1148 .init = wp512_init,
1153 .update = wp512_update, 1149 .update = wp512_update,
@@ -1159,39 +1155,16 @@ static struct shash_alg wp256 = {
1159 .cra_blocksize = WP512_BLOCK_SIZE, 1155 .cra_blocksize = WP512_BLOCK_SIZE,
1160 .cra_module = THIS_MODULE, 1156 .cra_module = THIS_MODULE,
1161 } 1157 }
1162}; 1158} };
1163 1159
1164static int __init wp512_mod_init(void) 1160static int __init wp512_mod_init(void)
1165{ 1161{
1166 int ret = 0; 1162 return crypto_register_shashes(wp_algs, ARRAY_SIZE(wp_algs));
1167
1168 ret = crypto_register_shash(&wp512);
1169
1170 if (ret < 0)
1171 goto out;
1172
1173 ret = crypto_register_shash(&wp384);
1174 if (ret < 0)
1175 {
1176 crypto_unregister_shash(&wp512);
1177 goto out;
1178 }
1179
1180 ret = crypto_register_shash(&wp256);
1181 if (ret < 0)
1182 {
1183 crypto_unregister_shash(&wp512);
1184 crypto_unregister_shash(&wp384);
1185 }
1186out:
1187 return ret;
1188} 1163}
1189 1164
1190static void __exit wp512_mod_fini(void) 1165static void __exit wp512_mod_fini(void)
1191{ 1166{
1192 crypto_unregister_shash(&wp512); 1167 crypto_unregister_shashes(wp_algs, ARRAY_SIZE(wp_algs));
1193 crypto_unregister_shash(&wp384);
1194 crypto_unregister_shash(&wp256);
1195} 1168}
1196 1169
1197MODULE_ALIAS("wp384"); 1170MODULE_ALIAS("wp384");