xref: /freebsd/contrib/netbsd-tests/dev/cgd/t_cgd_blowfish.c (revision 1a36faad54665288ed4eb839d2a4699ae2ead45e)
1 /*	$NetBSD: t_cgd_blowfish.c,v 1.2 2017/01/13 21:30:39 christos Exp $	*/
2 /*-
3  * Copyright (c) 2016 The NetBSD Foundation, Inc.
4  * All rights reserved.
5  *
6  * This code is derived from software contributed to The NetBSD Foundation
7  * by Alexander Nasonov.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in
17  *    the documentation and/or other materials provided with the
18  *    distribution.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
24  * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25  * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
26  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31  * SUCH DAMAGE.
32  */
33 
34 #include <sys/types.h>
35 #include <sys/ioctl.h>
36 #include <sys/sysctl.h>
37 
38 #include <atf-c.h>
39 #include <fcntl.h>
40 #include <stdio.h>
41 #include <stdlib.h>
42 #include <string.h>
43 #include <unistd.h>
44 #include <util.h>
45 
46 #include <dev/cgdvar.h>
47 
48 #include <rump/rump.h>
49 #include <rump/rump_syscalls.h>
50 
51 #include "h_macros.h"
52 
53 #define SECSIZE 512
54 
55 struct testvec {
56 	unsigned int blkno;
57 	const uint8_t *ptxt;	/* PlainText  */
58 	const uint8_t *ctxt;	/* CipherText */
59 };
60 
61 /*
62  * 128 bits Blowfish key, NUL terminated.
63  */
64 static const char bf_cbc_128_key[17] = {
65 	0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 01234567 */
66 	0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, /* 89ABCDEF */
67 	0
68 };
69 
70 /*
71  * 256 bits Blowfish key, NUL terminated.
72  */
73 static const char bf_cbc_256_key[33] = {
74 	0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 01234567 */
75 	0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, /* 89ABCDEF */
76 	0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 01234567 */
77 	0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, /* 89abcdef */
78 	0
79 };
80 
81 /*
82  * 448 bits Blowfish key, NUL terminated.
83  */
84 static const char bf_cbc_448_key[57] = {
85 	0x3a, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* :ABCDEFG */
86 	0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* HIJKLMNO */
87 	0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* PQRSTUVW */
88 	0x58, 0x59, 0x5a, 0x7e, 0x3a, 0x61, 0x62, 0x63, /* XYZ~:abc */
89 	0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, /* defghijk */
90 	0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, /* lmnopqrs */
91 	0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x23, /* tuvwxyz# */
92 	0
93 };
94 
95 static const uint8_t bf_cbc_ptxt[SECSIZE] =
96 	"                abcdefghijklmnop"
97 	"                abcdefghijklmnop"
98 	"                abcdefghijklmnop"
99 	"                abcdefghijklmnop"
100 	"                abcdefghijklmnop"
101 	"                abcdefghijklmnop"
102 	"                abcdefghijklmnop"
103 	"                abcdefghijklmnop"
104 	"                abcdefghijklmnop"
105 	"                abcdefghijklmnop"
106 	"                abcdefghijklmnop"
107 	"                abcdefghijklmnop"
108 	"                abcdefghijklmnop"
109 	"                abcdefghijklmnop"
110 	"                abcdefghijklmnop"
111 	"                abcdefghijklmnop";
112 
113 /*
114  * IV method encblkno1, blkno 0.
115  */
116 static const uint8_t bf_cbc_128_encblkno1_vec0_ctxt[SECSIZE] = {
117 	0x78, 0x53, 0x43, 0x2a, 0x08, 0xe7, 0x84, 0x3f,
118 	0xb7, 0x61, 0x9c, 0x17, 0x81, 0xbe, 0x38, 0xb9,
119 	0x65, 0x51, 0x68, 0xa2, 0x29, 0xd7, 0x45, 0xc9,
120 	0xee, 0x0e, 0x9d, 0xe1, 0x69, 0xc6, 0x81, 0x81,
121 	0xf3, 0x93, 0xa6, 0x62, 0xc9, 0x05, 0x2c, 0x1b,
122 	0x0e, 0x05, 0xca, 0xbe, 0x12, 0x25, 0x37, 0xd8,
123 	0x98, 0x66, 0xa2, 0xd3, 0xd0, 0x8a, 0x89, 0x57,
124 	0x44, 0x91, 0x1e, 0xe9, 0x07, 0x03, 0x5c, 0xa6,
125 	0xb8, 0x30, 0xf1, 0xc7, 0x8c, 0x66, 0x05, 0xb0,
126 	0x2d, 0xc3, 0xc3, 0xd7, 0x60, 0xef, 0x62, 0xd3,
127 	0x34, 0x9c, 0xa9, 0xd2, 0x0c, 0x1a, 0x9c, 0xfe,
128 	0x74, 0x92, 0xcb, 0x90, 0x80, 0xfa, 0x71, 0x5c,
129 	0xaa, 0x29, 0x39, 0xdd, 0x3b, 0x62, 0xa1, 0xfc,
130 	0xa5, 0x35, 0xcd, 0xa3, 0x29, 0x41, 0x1a, 0x03,
131 	0xf7, 0xe1, 0x36, 0xb2, 0xdc, 0x1a, 0xb3, 0x9f,
132 	0x46, 0xa3, 0xf7, 0xc3, 0xd1, 0x29, 0x83, 0xcf,
133 	0x0d, 0x88, 0x0b, 0xd1, 0xb7, 0xc7, 0x87, 0x21,
134 	0xb7, 0x1f, 0xe7, 0xa2, 0x8e, 0x5f, 0xac, 0x6b,
135 	0x49, 0x9c, 0x93, 0x6b, 0x6b, 0x05, 0x8e, 0x4c,
136 	0xbd, 0x31, 0x13, 0x5f, 0x4a, 0xd0, 0x35, 0x0c,
137 	0x67, 0x8f, 0xd0, 0x7a, 0xc9, 0xe3, 0x52, 0x50,
138 	0x4f, 0x85, 0x09, 0xf1, 0x27, 0xb9, 0xb1, 0x1e,
139 	0xe4, 0x6a, 0x40, 0xf6, 0x5a, 0x4f, 0x5f, 0xbe,
140 	0xab, 0xe8, 0xb9, 0xfe, 0xc7, 0x59, 0x6b, 0x0c,
141 	0xcd, 0x46, 0x4e, 0x90, 0x99, 0xde, 0xf7, 0x43,
142 	0xee, 0x6e, 0xb6, 0xae, 0xc2, 0x5e, 0x08, 0xbb,
143 	0xe9, 0x30, 0x2d, 0xb2, 0x91, 0xcc, 0xb9, 0xc7,
144 	0x58, 0xea, 0x35, 0xae, 0xa2, 0xd8, 0x00, 0xf7,
145 	0xc0, 0x01, 0xc4, 0x34, 0x2b, 0x34, 0x43, 0xae,
146 	0xeb, 0x27, 0xbc, 0x5c, 0x91, 0x5f, 0x5f, 0xc1,
147 	0x61, 0x42, 0x45, 0x68, 0x31, 0xbc, 0xce, 0xb4,
148 	0x5c, 0xd3, 0x07, 0xdf, 0x4e, 0x65, 0x65, 0x9d,
149 	0x2e, 0x26, 0x28, 0xfa, 0xcd, 0x53, 0x77, 0x6a,
150 	0x77, 0xad, 0x96, 0x0b, 0x1f, 0xea, 0x03, 0xc1,
151 	0xdd, 0xca, 0xe8, 0xfe, 0xe8, 0x36, 0x01, 0x61,
152 	0x72, 0xbb, 0xed, 0xfd, 0x8d, 0xa3, 0xc2, 0x15,
153 	0x25, 0x4f, 0xa6, 0x1a, 0x73, 0xbd, 0xcd, 0x45,
154 	0xdb, 0x08, 0x74, 0x7b, 0xa8, 0x23, 0xf5, 0x74,
155 	0x3a, 0x18, 0x6d, 0x90, 0xe0, 0xee, 0xae, 0xfe,
156 	0xc8, 0xac, 0x00, 0x57, 0xa0, 0xe1, 0xfe, 0x10,
157 	0xd4, 0xf3, 0xa8, 0x00, 0x21, 0x3e, 0x2d, 0xf9,
158 	0x63, 0xb8, 0xe9, 0xa4, 0x2e, 0xf4, 0x6b, 0xd7,
159 	0x5c, 0xfd, 0x32, 0x6c, 0x98, 0x05, 0x38, 0x0d,
160 	0x29, 0xb5, 0x5a, 0x5b, 0xbb, 0xad, 0xfd, 0x46,
161 	0x9b, 0x6a, 0x97, 0x4c, 0x24, 0xcc, 0x7d, 0x13,
162 	0x25, 0xe8, 0x2c, 0xb9, 0x13, 0x54, 0xb2, 0x8a,
163 	0x28, 0xa0, 0x8a, 0x3a, 0x4d, 0x7e, 0xf4, 0x29,
164 	0xff, 0xfb, 0x4f, 0xd6, 0x3d, 0xf7, 0xca, 0x89,
165 	0x2a, 0x58, 0x9e, 0x42, 0x00, 0x84, 0x61, 0x58,
166 	0x7c, 0x94, 0xf6, 0x50, 0x48, 0x2f, 0x34, 0x88,
167 	0xec, 0x97, 0xef, 0x8b, 0x2f, 0x84, 0xca, 0x23,
168 	0xe1, 0xb7, 0x63, 0x99, 0xdd, 0x4a, 0x76, 0xdd,
169 	0x20, 0xc1, 0xc2, 0x56, 0x45, 0xbe, 0x75, 0x9a,
170 	0x40, 0x72, 0xc8, 0xfb, 0x7e, 0x40, 0x6f, 0x38,
171 	0xfd, 0x76, 0xa4, 0x78, 0xf5, 0xde, 0x5f, 0xb7,
172 	0x4a, 0xa9, 0xaf, 0xad, 0xa1, 0x8b, 0x25, 0x8f,
173 	0xea, 0xb3, 0xeb, 0x54, 0x39, 0x5a, 0x91, 0xfe,
174 	0x86, 0x18, 0xea, 0x8c, 0xd6, 0x66, 0xd5, 0x85,
175 	0x02, 0x2b, 0x00, 0x5d, 0x7e, 0x13, 0xa0, 0x1f,
176 	0x73, 0x46, 0x6d, 0x5e, 0xcd, 0xe0, 0x82, 0x02,
177 	0x28, 0x88, 0xbf, 0x17, 0xfd, 0x9b, 0x83, 0x2c,
178 	0xa2, 0xf7, 0xde, 0x51, 0x98, 0x3f, 0xe2, 0x80,
179 	0x66, 0x14, 0x17, 0xce, 0x8e, 0x30, 0x2d, 0xe2,
180 	0x24, 0x68, 0x4b, 0xe5, 0xd1, 0x09, 0xfb, 0x6e,
181 };
182 
183 /*
184  * IV method encblkno1, blkno 1.
185  */
186 static const uint8_t bf_cbc_128_encblkno1_vec1_ctxt[SECSIZE] = {
187 	0x87, 0xae, 0x01, 0x52, 0xe8, 0xe9, 0xd9, 0xba,
188 	0xa9, 0x18, 0x31, 0x2c, 0x1b, 0xab, 0x57, 0xad,
189 	0x45, 0x0e, 0x25, 0x5e, 0x0e, 0x04, 0xfa, 0xdd,
190 	0xf1, 0x59, 0xe6, 0xea, 0x78, 0x4b, 0x83, 0x07,
191 	0x8b, 0x46, 0x91, 0x09, 0x58, 0x5a, 0x11, 0x2e,
192 	0x54, 0x43, 0xa4, 0xc1, 0x04, 0x35, 0xd3, 0x3e,
193 	0xc9, 0xc8, 0xf5, 0xff, 0x69, 0x1e, 0x57, 0x85,
194 	0x6d, 0x91, 0x03, 0xeb, 0x8c, 0xa7, 0xe8, 0xcc,
195 	0x3f, 0xac, 0xf9, 0x14, 0x1e, 0x88, 0x50, 0xa5,
196 	0x38, 0x66, 0xa9, 0xf4, 0xf5, 0xc6, 0x30, 0x95,
197 	0xd6, 0x84, 0x0b, 0x81, 0xf9, 0x51, 0x05, 0x80,
198 	0x9a, 0x89, 0xbf, 0xd4, 0x7d, 0x6a, 0x26, 0x59,
199 	0x29, 0x44, 0xe7, 0x1d, 0x0e, 0xad, 0x8c, 0xa0,
200 	0x93, 0xe9, 0x4b, 0x4b, 0x51, 0x46, 0xa5, 0x07,
201 	0xe8, 0xcb, 0x59, 0xf4, 0x63, 0xb5, 0x36, 0xdb,
202 	0xbc, 0x54, 0x2d, 0xec, 0xf0, 0x90, 0x3a, 0xa5,
203 	0xed, 0xc8, 0x28, 0x0e, 0xd3, 0x79, 0xb8, 0x57,
204 	0xc6, 0x7f, 0x02, 0x22, 0x5e, 0x80, 0xe8, 0x7f,
205 	0xdf, 0xa0, 0x0f, 0xbc, 0x98, 0x79, 0x6f, 0xd2,
206 	0xb0, 0xb2, 0x4f, 0x9b, 0x1a, 0x21, 0x8f, 0x63,
207 	0xce, 0x54, 0x41, 0x64, 0xbf, 0xb9, 0xa7, 0x93,
208 	0xd6, 0x5b, 0x89, 0x86, 0xda, 0x90, 0x23, 0x2e,
209 	0x25, 0x35, 0x1a, 0x9a, 0xf5, 0x1e, 0x8f, 0xb4,
210 	0xe6, 0x66, 0x8e, 0x0e, 0x2d, 0x91, 0x06, 0x4b,
211 	0x3d, 0x4a, 0x97, 0xab, 0x9b, 0x92, 0x09, 0xaa,
212 	0x07, 0xbf, 0xc1, 0x7d, 0xe2, 0xbc, 0xd2, 0xf1,
213 	0x38, 0x8d, 0x02, 0x45, 0xc8, 0x13, 0x12, 0xda,
214 	0xaa, 0x53, 0xa2, 0x2c, 0x96, 0x69, 0x64, 0xce,
215 	0x86, 0xe4, 0x84, 0x56, 0xd0, 0xe5, 0x81, 0x99,
216 	0x27, 0xad, 0x86, 0x47, 0x5f, 0xaf, 0xa2, 0xa2,
217 	0x90, 0x7f, 0xe7, 0x86, 0xec, 0x7f, 0xf4, 0xa3,
218 	0xcd, 0x4f, 0x60, 0xcc, 0x1e, 0x35, 0x44, 0xe8,
219 	0xe9, 0x06, 0xaf, 0x5e, 0x53, 0x3d, 0x30, 0x91,
220 	0xfe, 0x44, 0x59, 0x66, 0x82, 0xc2, 0xea, 0x9f,
221 	0xc8, 0x3b, 0xe2, 0xe5, 0x58, 0xf7, 0x34, 0xd5,
222 	0x9e, 0xfc, 0x20, 0x84, 0x34, 0xaa, 0x4f, 0xe1,
223 	0xd4, 0x95, 0x76, 0x11, 0x59, 0x90, 0x90, 0xfd,
224 	0x4d, 0xf9, 0xb8, 0x41, 0xe1, 0xdb, 0x36, 0x05,
225 	0xe3, 0x0f, 0xa4, 0x4f, 0x0c, 0x61, 0x70, 0xa5,
226 	0x1b, 0xbf, 0xab, 0x65, 0x67, 0x75, 0x5c, 0x7d,
227 	0x46, 0x3b, 0x29, 0xd0, 0x3d, 0x06, 0x40, 0x25,
228 	0x47, 0x3e, 0x8d, 0x62, 0xf8, 0xd8, 0x08, 0xc1,
229 	0x03, 0x04, 0x4b, 0x5a, 0x40, 0x65, 0x84, 0x52,
230 	0x34, 0xa2, 0x4a, 0xcc, 0x3a, 0x9c, 0x1e, 0xbf,
231 	0x2d, 0xed, 0x08, 0x8b, 0xc3, 0x8f, 0x48, 0xba,
232 	0x06, 0x03, 0xea, 0x5b, 0xba, 0x6a, 0xac, 0x23,
233 	0x5a, 0x5e, 0x31, 0x08, 0x29, 0x69, 0x64, 0x44,
234 	0x1c, 0x31, 0xae, 0xb1, 0x86, 0x7b, 0x26, 0x89,
235 	0xa6, 0xbe, 0xef, 0x69, 0x81, 0xf7, 0x77, 0xd5,
236 	0x8e, 0x78, 0xa5, 0x11, 0x51, 0xca, 0xec, 0xd0,
237 	0x86, 0xa5, 0x33, 0xf3, 0x65, 0x5d, 0x04, 0xc5,
238 	0xd2, 0x17, 0x2a, 0xfe, 0x4a, 0x58, 0x0f, 0x98,
239 	0x61, 0xad, 0xc3, 0xb8, 0x5b, 0x45, 0xcc, 0x28,
240 	0x3d, 0x4d, 0x00, 0xf5, 0x4a, 0xe2, 0xbc, 0x6c,
241 	0x1b, 0x80, 0x7a, 0x2b, 0x40, 0xb8, 0x34, 0x0e,
242 	0x44, 0x53, 0x16, 0xda, 0x7c, 0x46, 0x8b, 0x42,
243 	0x5e, 0xa8, 0xe1, 0xb8, 0xf8, 0xcf, 0xff, 0x48,
244 	0xcf, 0x2c, 0x4c, 0x98, 0xdb, 0xe5, 0x55, 0xfe,
245 	0x45, 0xfa, 0xf8, 0xde, 0x72, 0xf9, 0x84, 0x3c,
246 	0xc0, 0x0c, 0x1f, 0x86, 0x97, 0x86, 0xb8, 0xfe,
247 	0x7d, 0xff, 0xa3, 0xaf, 0x68, 0x00, 0x66, 0x90,
248 	0xac, 0xb5, 0xd8, 0xde, 0x35, 0x01, 0xf7, 0xab,
249 	0xab, 0xe3, 0xe9, 0x85, 0x4c, 0x6f, 0xe6, 0xbc,
250 	0xce, 0x67, 0x4a, 0xbd, 0xad, 0x7b, 0xec, 0xa1,
251 };
252 
253 /*
254  * IV method encblkno1, blkno 2.
255  */
256 static const uint8_t bf_cbc_128_encblkno1_vec2_ctxt[SECSIZE] = {
257 	0x17, 0xdd, 0x0f, 0x4b, 0x28, 0x33, 0x03, 0x89,
258 	0x21, 0x7b, 0x67, 0x15, 0x15, 0x65, 0x08, 0x4f,
259 	0x65, 0x18, 0xa6, 0x4b, 0x62, 0xdb, 0x1e, 0xc2,
260 	0xaa, 0x82, 0xb6, 0x1d, 0xf7, 0x12, 0x9e, 0x73,
261 	0xfe, 0xac, 0x2f, 0x1e, 0x2b, 0xea, 0x3a, 0x4f,
262 	0xc3, 0x0a, 0x59, 0x80, 0x0d, 0x3d, 0xbc, 0x62,
263 	0x8d, 0x70, 0xef, 0x1b, 0xfb, 0xdc, 0x4e, 0xc4,
264 	0x97, 0xf4, 0x77, 0xb7, 0x25, 0x94, 0x13, 0x48,
265 	0xf2, 0x3d, 0x4c, 0xa7, 0xb8, 0x8c, 0xf5, 0x26,
266 	0xa4, 0x35, 0xeb, 0xa0, 0xe7, 0x68, 0xb0, 0x69,
267 	0xf4, 0xf6, 0x13, 0x3a, 0x57, 0xa3, 0xd2, 0x26,
268 	0xe6, 0x70, 0xd8, 0xd4, 0x05, 0xb5, 0x01, 0xda,
269 	0xc7, 0x4a, 0x79, 0x1a, 0x6d, 0xb6, 0xf6, 0xb5,
270 	0x7d, 0x9a, 0x5c, 0xf1, 0x6a, 0xf8, 0xd1, 0x0a,
271 	0xbc, 0xe7, 0xea, 0xb4, 0x99, 0x72, 0x19, 0x97,
272 	0x41, 0x4f, 0x14, 0x5f, 0xa3, 0xb3, 0x9b, 0x36,
273 	0x00, 0x08, 0x88, 0x8c, 0xce, 0x7f, 0x3a, 0x9b,
274 	0xb0, 0x24, 0x17, 0x95, 0xc4, 0x59, 0x30, 0x5d,
275 	0xc6, 0x92, 0x19, 0x12, 0x99, 0xb0, 0x08, 0xa6,
276 	0x04, 0xdb, 0xc6, 0xd5, 0x61, 0xe4, 0xe1, 0x68,
277 	0xa8, 0xd7, 0x07, 0xfe, 0x2f, 0x47, 0xea, 0x14,
278 	0xe5, 0xf7, 0x61, 0x9b, 0xbb, 0x98, 0xcb, 0x3b,
279 	0x8c, 0x41, 0xd1, 0x55, 0x59, 0xb2, 0x41, 0x61,
280 	0x8e, 0x60, 0x17, 0xcd, 0xe8, 0xf7, 0x1d, 0xbd,
281 	0x28, 0x5d, 0x1e, 0x15, 0x28, 0x80, 0x8c, 0x29,
282 	0x34, 0x96, 0x31, 0xda, 0xe1, 0x19, 0x88, 0xd5,
283 	0xe0, 0xc8, 0xb4, 0xaa, 0x04, 0x21, 0xf5, 0xef,
284 	0xfa, 0x0e, 0xc9, 0xa5, 0x88, 0x77, 0x49, 0xf4,
285 	0x02, 0x22, 0x0b, 0x8b, 0x5e, 0xe1, 0xab, 0xd4,
286 	0xb1, 0xb6, 0x48, 0x54, 0x96, 0x08, 0xaf, 0xa1,
287 	0x0b, 0xc0, 0xfe, 0x2a, 0x12, 0x36, 0x56, 0x85,
288 	0x6a, 0xf7, 0x3d, 0x82, 0xe6, 0xda, 0x5d, 0xfe,
289 	0x4f, 0x4f, 0xc9, 0x43, 0xdc, 0x0f, 0x53, 0x05,
290 	0x09, 0xd4, 0x9c, 0x2e, 0x6e, 0xf3, 0x52, 0x6a,
291 	0x10, 0xc6, 0x48, 0xb1, 0x54, 0x70, 0xab, 0x7c,
292 	0x31, 0xf6, 0x47, 0xef, 0x64, 0x5f, 0xff, 0x45,
293 	0x8c, 0x3f, 0x87, 0x3a, 0x2d, 0xa6, 0xaf, 0xb2,
294 	0x44, 0xdf, 0x80, 0x2e, 0x89, 0x4c, 0x94, 0x67,
295 	0xfc, 0x20, 0x98, 0xb4, 0xcf, 0x58, 0x1e, 0x33,
296 	0x55, 0x6a, 0x7c, 0x67, 0x5c, 0x28, 0x2f, 0x19,
297 	0x02, 0x14, 0x06, 0x93, 0x8c, 0x84, 0xae, 0x62,
298 	0x14, 0xf9, 0x87, 0xae, 0x85, 0xa3, 0x60, 0x26,
299 	0xfc, 0x8d, 0x04, 0x92, 0x27, 0xfe, 0x35, 0x7b,
300 	0x45, 0x9d, 0x4a, 0x86, 0x75, 0xa6, 0xb3, 0xa1,
301 	0x59, 0xe4, 0x4b, 0x1c, 0xd2, 0x71, 0x36, 0xfe,
302 	0x73, 0xed, 0x54, 0x0d, 0x9d, 0xde, 0x63, 0xb2,
303 	0xc0, 0x7c, 0xf2, 0xb3, 0x36, 0x62, 0x06, 0x1f,
304 	0xcd, 0x41, 0x92, 0x73, 0xbc, 0x11, 0x68, 0xc9,
305 	0x69, 0x20, 0xf9, 0xbb, 0x9a, 0xe9, 0x6c, 0x05,
306 	0xcf, 0x01, 0x57, 0xc4, 0x1d, 0x95, 0x5e, 0xe3,
307 	0xb7, 0x15, 0xde, 0xa7, 0xb5, 0x1a, 0x4e, 0x78,
308 	0x44, 0x5b, 0x9a, 0xee, 0x29, 0xe2, 0x22, 0x8b,
309 	0xe9, 0xe3, 0xe6, 0x70, 0x3e, 0xcb, 0x9f, 0x7f,
310 	0xc3, 0xd0, 0x2c, 0xdc, 0x55, 0xb4, 0x0d, 0x67,
311 	0xf5, 0xd8, 0xff, 0xbb, 0xb1, 0x02, 0xbf, 0xf6,
312 	0x33, 0x4e, 0x7a, 0x3a, 0x50, 0xb1, 0x01, 0x77,
313 	0x51, 0xef, 0xb5, 0x75, 0xb3, 0x66, 0xe8, 0xe6,
314 	0xd6, 0x53, 0x7d, 0x33, 0x51, 0x62, 0x5d, 0xf2,
315 	0x77, 0x02, 0x34, 0x42, 0xda, 0xee, 0xd9, 0xee,
316 	0x0b, 0x4d, 0x71, 0x5c, 0xc0, 0xec, 0xdd, 0xc0,
317 	0x34, 0x6f, 0xf4, 0x65, 0x32, 0xde, 0xc5, 0xb2,
318 	0x97, 0x60, 0x89, 0x4e, 0x3b, 0x0c, 0xf2, 0xa7,
319 	0x74, 0x61, 0xd7, 0xe4, 0xa6, 0x80, 0x78, 0x76,
320 	0xe5, 0x7d, 0xab, 0x96, 0x04, 0x00, 0x76, 0x22,
321 };
322 
323 /*
324  * IV method encblkno1, blkno 3.
325  */
326 static const uint8_t bf_cbc_128_encblkno1_vec3_ctxt[SECSIZE] = {
327 	0xdd, 0x8e, 0xce, 0x5b, 0xb8, 0x2a, 0xc8, 0x0e,
328 	0xd2, 0xbe, 0xcf, 0xa7, 0x2a, 0x5b, 0x0c, 0x1a,
329 	0xb2, 0x68, 0x5b, 0xe7, 0x53, 0xaf, 0xce, 0x56,
330 	0xfd, 0xbd, 0x73, 0x3c, 0x44, 0x02, 0x96, 0x57,
331 	0xaa, 0x47, 0x8d, 0xf1, 0x28, 0x59, 0xb6, 0xce,
332 	0xba, 0x1e, 0xc9, 0x78, 0x76, 0xdd, 0x43, 0x3a,
333 	0xbc, 0x43, 0x4c, 0x17, 0xd2, 0xba, 0xb1, 0xda,
334 	0xa8, 0xbf, 0x32, 0x25, 0xaa, 0xc0, 0xf7, 0xb6,
335 	0x72, 0x65, 0xe2, 0x67, 0xdb, 0xf0, 0xa8, 0x60,
336 	0xda, 0x9b, 0x70, 0xad, 0x8f, 0x1d, 0x34, 0x24,
337 	0x1a, 0xfd, 0x77, 0x2e, 0x1c, 0xb6, 0xc0, 0x6b,
338 	0xa0, 0x4b, 0x4a, 0xa0, 0xd5, 0x8b, 0xbb, 0xd4,
339 	0xcc, 0x7b, 0x4e, 0x4c, 0x71, 0x9a, 0x50, 0x12,
340 	0x36, 0xd4, 0xfd, 0x1f, 0xf1, 0xfc, 0x19, 0x31,
341 	0xec, 0x54, 0x24, 0xb4, 0x9f, 0xa9, 0xea, 0xd2,
342 	0x87, 0x11, 0x03, 0x29, 0xbb, 0x20, 0x20, 0x37,
343 	0xa0, 0xeb, 0x93, 0xa1, 0x60, 0x5f, 0x83, 0x9f,
344 	0x00, 0x09, 0xe4, 0x9c, 0x79, 0xcb, 0xfc, 0x4f,
345 	0x9e, 0xd2, 0x76, 0x9f, 0x56, 0x3b, 0x88, 0x1d,
346 	0x29, 0x8f, 0x36, 0x07, 0xf7, 0x7e, 0xf1, 0xa1,
347 	0xa4, 0x25, 0xfb, 0xa0, 0xbe, 0xc6, 0xa2, 0x76,
348 	0xd3, 0x59, 0x2a, 0x7f, 0xb7, 0x9b, 0xb8, 0x75,
349 	0xc7, 0xc1, 0xc0, 0xe9, 0x9b, 0x83, 0x16, 0x00,
350 	0xc8, 0x9c, 0x25, 0x2a, 0x8b, 0xd1, 0x8d, 0x16,
351 	0x9f, 0xd6, 0xd3, 0x03, 0x5b, 0xc7, 0x40, 0xac,
352 	0xb6, 0xf3, 0xbb, 0x22, 0xa3, 0x3e, 0x56, 0x55,
353 	0xdf, 0x06, 0x76, 0xe0, 0x7b, 0xd0, 0x52, 0x54,
354 	0x38, 0xb0, 0xaa, 0xab, 0x62, 0x31, 0xd1, 0x79,
355 	0x19, 0xec, 0x82, 0x36, 0x58, 0x31, 0xf9, 0x01,
356 	0xf9, 0x5e, 0xaf, 0x24, 0xb3, 0xc9, 0xb2, 0x30,
357 	0x3d, 0xbc, 0xf1, 0xbe, 0x17, 0xeb, 0xa0, 0x31,
358 	0x43, 0xed, 0xd7, 0x50, 0xcc, 0xc2, 0xe2, 0xaa,
359 	0x68, 0xc8, 0xf0, 0xd3, 0x89, 0xbd, 0xf5, 0x69,
360 	0x56, 0xe3, 0x88, 0x92, 0x32, 0x56, 0x85, 0x6f,
361 	0x25, 0x30, 0x28, 0x37, 0xd5, 0xe2, 0xa6, 0xf7,
362 	0x6e, 0xa9, 0x71, 0xda, 0x4a, 0x25, 0x94, 0x0b,
363 	0x84, 0x7f, 0x1f, 0x6b, 0x89, 0x2a, 0xf8, 0x30,
364 	0xcb, 0x60, 0x75, 0x21, 0xbd, 0xe2, 0x34, 0xf7,
365 	0x8f, 0x30, 0xd5, 0xd5, 0x1f, 0x17, 0x0d, 0x00,
366 	0x6c, 0x50, 0xde, 0x56, 0x15, 0x33, 0x1b, 0x83,
367 	0x68, 0x7b, 0x24, 0xe3, 0xa0, 0xda, 0xd5, 0x7a,
368 	0x3e, 0x93, 0x6d, 0xe0, 0x02, 0x79, 0x62, 0x5d,
369 	0x71, 0xe3, 0x7b, 0xa9, 0x0b, 0x7a, 0xcd, 0xb3,
370 	0xb2, 0x6f, 0x96, 0x19, 0x8f, 0xf8, 0x8b, 0x26,
371 	0x7a, 0x40, 0xc8, 0xae, 0xfe, 0x0d, 0x6f, 0x67,
372 	0xce, 0x5e, 0xa0, 0x04, 0x7e, 0x93, 0x1d, 0x17,
373 	0x1c, 0x32, 0x82, 0xf4, 0x54, 0xb9, 0x80, 0xdd,
374 	0x82, 0xae, 0xf5, 0xc5, 0x1e, 0x15, 0xab, 0xc2,
375 	0x5c, 0x60, 0xd2, 0x08, 0xc2, 0xa1, 0x1f, 0x89,
376 	0x0b, 0x59, 0x36, 0x07, 0xdc, 0x57, 0xd3, 0xa0,
377 	0x32, 0x42, 0xac, 0xa6, 0x90, 0x0b, 0xc0, 0xe4,
378 	0x91, 0x45, 0x85, 0x27, 0xb9, 0x48, 0x2a, 0x88,
379 	0x0a, 0xbf, 0xf6, 0x2d, 0xef, 0x4d, 0x1b, 0x64,
380 	0x49, 0x23, 0x47, 0x30, 0x29, 0x25, 0xb2, 0xc9,
381 	0xaf, 0xcd, 0xae, 0x56, 0x43, 0x28, 0xcf, 0x81,
382 	0x95, 0xa7, 0x3e, 0x51, 0x5b, 0x3b, 0xf7, 0x87,
383 	0x13, 0xc6, 0xee, 0x50, 0x2f, 0x78, 0xdd, 0xcf,
384 	0x63, 0xef, 0x15, 0xb9, 0x4f, 0x21, 0x27, 0x5e,
385 	0x94, 0x78, 0xad, 0xcd, 0x9b, 0x3d, 0xf2, 0xdb,
386 	0xed, 0xf2, 0xa2, 0x39, 0xca, 0xa3, 0xa8, 0x2e,
387 	0x68, 0xd5, 0xc3, 0xcf, 0x71, 0xec, 0x92, 0xdc,
388 	0xce, 0xe7, 0x7d, 0x2b, 0xf7, 0xbc, 0xe9, 0x2b,
389 	0x2e, 0xae, 0xaf, 0x0b, 0x92, 0x72, 0xac, 0x6e,
390 	0x49, 0xe1, 0xb3, 0x1f, 0xe5, 0x43, 0x2f, 0xa7,
391 };
392 
393 const struct testvec bf_cbc_128_1_vectors[] = {
394 	{
395 		.blkno = 0,
396 		.ptxt = bf_cbc_ptxt,
397 		.ctxt = bf_cbc_128_encblkno1_vec0_ctxt,
398 	},
399 	{
400 		.blkno = 1,
401 		.ptxt = bf_cbc_ptxt,
402 		.ctxt = bf_cbc_128_encblkno1_vec1_ctxt,
403 	},
404 	{
405 		.blkno = 2,
406 		.ptxt = bf_cbc_ptxt,
407 		.ctxt = bf_cbc_128_encblkno1_vec2_ctxt,
408 	},
409 	{
410 		.blkno = 3,
411 		.ptxt = bf_cbc_ptxt,
412 		.ctxt = bf_cbc_128_encblkno1_vec3_ctxt,
413 	},
414 };
415 
416 /*
417  * IV method encblkno8, blkno 0.
418  */
419 static const uint8_t bf_cbc_128_encblkno8_vec0_ctxt[SECSIZE] = {
420 	0xb8, 0x65, 0x67, 0x8e, 0xe4, 0xd8, 0xb4, 0x93,
421 	0xa5, 0xbb, 0x13, 0x92, 0x27, 0x4b, 0xdd, 0xeb,
422 	0x0d, 0xad, 0x80, 0x6a, 0x57, 0x37, 0xc0, 0x23,
423 	0x23, 0xbf, 0xed, 0x86, 0x0c, 0x18, 0x48, 0x19,
424 	0xcd, 0x84, 0x66, 0xa7, 0xd6, 0xa0, 0x44, 0xd3,
425 	0x05, 0x4e, 0xf4, 0xfe, 0x6a, 0x57, 0x69, 0x01,
426 	0xaa, 0x91, 0x9c, 0x6e, 0x4f, 0x79, 0xc9, 0x8f,
427 	0x4c, 0xdf, 0x5b, 0x9c, 0xc4, 0xf7, 0x63, 0x16,
428 	0x20, 0x09, 0x07, 0x3f, 0x5e, 0x31, 0xcc, 0x81,
429 	0x71, 0xe3, 0x7b, 0xb5, 0xea, 0x2c, 0xb5, 0x14,
430 	0x1e, 0xf9, 0x0d, 0xe0, 0x45, 0xbc, 0x9f, 0x92,
431 	0x6c, 0xc9, 0x0a, 0x85, 0x62, 0x42, 0xf1, 0x4b,
432 	0xac, 0xe2, 0xfa, 0xad, 0x97, 0x7a, 0x43, 0x3d,
433 	0xb6, 0x5f, 0xcb, 0xe7, 0x17, 0x23, 0x28, 0xde,
434 	0x4e, 0xf8, 0xa1, 0x3c, 0x22, 0x63, 0x49, 0x31,
435 	0xa7, 0xbe, 0xbf, 0xfe, 0xee, 0xd9, 0x1f, 0xa0,
436 	0x2a, 0x0e, 0xf2, 0x4f, 0x3e, 0xf8, 0xbb, 0xae,
437 	0x9e, 0x0d, 0x2c, 0xaa, 0x2a, 0x2c, 0xf0, 0x6c,
438 	0x37, 0x2a, 0x5d, 0x96, 0x70, 0x9c, 0x87, 0xcc,
439 	0x2b, 0xca, 0x95, 0x37, 0xf4, 0x4d, 0x78, 0xae,
440 	0x4f, 0xb5, 0xe6, 0xad, 0xb1, 0xc1, 0x31, 0xd3,
441 	0x2d, 0xa6, 0xaf, 0xc1, 0x8c, 0xe4, 0x72, 0x05,
442 	0xb0, 0xfc, 0xb0, 0xf7, 0xfe, 0xf9, 0x3e, 0xa3,
443 	0xb9, 0xea, 0xc8, 0x69, 0xe3, 0x4e, 0x6d, 0xd1,
444 	0x8b, 0x2b, 0xf9, 0x2f, 0xd9, 0x40, 0x69, 0xff,
445 	0x90, 0x98, 0x7a, 0x82, 0xe3, 0x0d, 0x4e, 0x19,
446 	0x2f, 0x77, 0xf9, 0xab, 0x36, 0xa9, 0x4e, 0xbc,
447 	0x25, 0x32, 0xbd, 0x44, 0xea, 0x5a, 0x18, 0x31,
448 	0x37, 0xcd, 0x6c, 0x98, 0xdd, 0x1d, 0xf9, 0xf7,
449 	0x8f, 0x0b, 0x79, 0xbc, 0xe6, 0xf5, 0xf1, 0xa3,
450 	0x13, 0xe9, 0x39, 0xaf, 0xa4, 0x8a, 0x74, 0xae,
451 	0x60, 0x30, 0x63, 0x6e, 0xee, 0x97, 0x83, 0xee,
452 	0xc0, 0xdd, 0xde, 0xad, 0x92, 0x83, 0xc9, 0x3c,
453 	0xd8, 0x58, 0x6c, 0xcb, 0xe4, 0x29, 0x04, 0x69,
454 	0x4f, 0x45, 0xc2, 0x59, 0x98, 0x20, 0x91, 0x6e,
455 	0x95, 0x82, 0xb3, 0x47, 0x2c, 0xef, 0xdb, 0x96,
456 	0x38, 0xba, 0x01, 0x89, 0x84, 0x96, 0x71, 0xf9,
457 	0x2b, 0x23, 0xe0, 0x89, 0xb8, 0xb9, 0x80, 0xbf,
458 	0x0c, 0xdc, 0xf0, 0x5c, 0xd6, 0x4f, 0x18, 0x19,
459 	0xfe, 0x23, 0x5a, 0x1e, 0x20, 0x9a, 0x05, 0xf2,
460 	0x62, 0xd4, 0x04, 0x92, 0x24, 0xfc, 0xc0, 0x48,
461 	0xf0, 0x00, 0xb4, 0xbe, 0x2e, 0xea, 0x25, 0x17,
462 	0x5d, 0xab, 0x73, 0x26, 0x79, 0x77, 0xc5, 0x96,
463 	0xd3, 0xbf, 0x38, 0xda, 0x0f, 0xe1, 0x26, 0x9a,
464 	0x38, 0xfc, 0x43, 0x82, 0xd1, 0x4d, 0xf2, 0xae,
465 	0x98, 0x1e, 0xb0, 0x0d, 0xec, 0x7b, 0x56, 0x66,
466 	0xcb, 0x30, 0x57, 0x4f, 0xe7, 0x03, 0xe3, 0xa6,
467 	0x4a, 0x4a, 0xf9, 0xa3, 0xbf, 0x44, 0xac, 0x1a,
468 	0xe7, 0x4b, 0xc1, 0x5b, 0x03, 0x25, 0x4e, 0xc6,
469 	0x1f, 0x96, 0x4d, 0xf7, 0xbe, 0xa7, 0x5d, 0x60,
470 	0x20, 0x62, 0x10, 0xd7, 0xab, 0x64, 0xce, 0x22,
471 	0x8b, 0x52, 0x76, 0xa1, 0xa1, 0x8b, 0x1e, 0xb2,
472 	0x18, 0x29, 0x8f, 0xc5, 0x24, 0x39, 0xd4, 0xf8,
473 	0x75, 0x1e, 0x30, 0x57, 0x12, 0x01, 0x04, 0x78,
474 	0x68, 0x97, 0xa8, 0x65, 0x8c, 0xac, 0xb4, 0x3b,
475 	0x37, 0x45, 0x41, 0xbc, 0x7d, 0x4b, 0x09, 0xd7,
476 	0x46, 0x40, 0x99, 0x59, 0xa1, 0xb5, 0x9e, 0x84,
477 	0x24, 0x6d, 0xfb, 0x74, 0x22, 0xac, 0x4e, 0x5f,
478 	0x11, 0xd3, 0xa7, 0x9f, 0xa5, 0xca, 0x38, 0x54,
479 	0xe2, 0x65, 0x52, 0x02, 0x69, 0xe9, 0xa8, 0xf1,
480 	0xd7, 0x9d, 0x9a, 0x17, 0x54, 0xa0, 0xda, 0xbb,
481 	0x37, 0xb4, 0x0c, 0xb6, 0x00, 0xad, 0x6f, 0x88,
482 	0x84, 0xa7, 0x69, 0xd7, 0x0b, 0xbe, 0xb4, 0xbe,
483 	0x96, 0xbc, 0xcd, 0x08, 0xf1, 0x28, 0xe0, 0x6f,
484 };
485 
486 /*
487  * IV method encblkno8, blkno 1.
488  */
489 static const uint8_t bf_cbc_128_encblkno8_vec1_ctxt[SECSIZE] = {
490 	0x7d, 0x95, 0x5a, 0x66, 0x23, 0x98, 0xa8, 0xbe,
491 	0x53, 0x63, 0x0d, 0x46, 0x4e, 0x38, 0x1b, 0x1d,
492 	0x36, 0xdd, 0x2a, 0x57, 0x3c, 0x17, 0x01, 0xba,
493 	0x4e, 0xf8, 0xaa, 0x22, 0x74, 0x05, 0xa2, 0x40,
494 	0xd0, 0x30, 0x61, 0x6c, 0x65, 0x5e, 0xfb, 0x21,
495 	0x63, 0xef, 0x62, 0x01, 0x74, 0x15, 0xf6, 0x87,
496 	0x92, 0xc1, 0x4e, 0x46, 0xdd, 0x76, 0xdb, 0x8b,
497 	0x20, 0x44, 0xc4, 0xfa, 0x7c, 0xd2, 0x07, 0x32,
498 	0x11, 0xeb, 0x5b, 0x38, 0x44, 0x32, 0xa1, 0xe7,
499 	0xcb, 0xa6, 0x1a, 0x12, 0xb9, 0x53, 0x13, 0x6f,
500 	0xc2, 0x0e, 0x6a, 0x77, 0x8b, 0x96, 0x14, 0x0a,
501 	0x23, 0x48, 0x65, 0xa5, 0xcd, 0x39, 0x38, 0x03,
502 	0xc8, 0x3a, 0x98, 0x69, 0x3d, 0x14, 0xae, 0xad,
503 	0x54, 0x57, 0xf6, 0x5a, 0xdd, 0x46, 0x4c, 0x3a,
504 	0x68, 0xa8, 0xb7, 0x57, 0xdd, 0x1e, 0x66, 0x0e,
505 	0xc2, 0x4c, 0x17, 0xba, 0xa4, 0x7e, 0x83, 0x45,
506 	0xc6, 0xf2, 0x34, 0x3b, 0x4e, 0xab, 0x67, 0x0c,
507 	0x73, 0xbf, 0x87, 0x7e, 0x93, 0x2b, 0x14, 0x33,
508 	0xd6, 0x24, 0x8d, 0xc7, 0x90, 0x11, 0xd2, 0x38,
509 	0xe6, 0xe0, 0x39, 0x1f, 0x00, 0x74, 0x40, 0xab,
510 	0xdc, 0xdd, 0x46, 0xe8, 0x85, 0x14, 0xb1, 0x78,
511 	0x34, 0x24, 0x04, 0x97, 0xde, 0xf9, 0x04, 0x69,
512 	0x0b, 0x15, 0x72, 0x37, 0xf4, 0x0d, 0xf4, 0x76,
513 	0x6f, 0xd8, 0x05, 0x75, 0x8f, 0x7e, 0x6b, 0xca,
514 	0x55, 0x20, 0x4a, 0x29, 0x16, 0xc1, 0x6e, 0x91,
515 	0x22, 0x01, 0x0d, 0x39, 0x5d, 0xb9, 0x09, 0xa4,
516 	0xe8, 0xc7, 0xff, 0x60, 0x39, 0xc6, 0xe4, 0x2a,
517 	0x1c, 0xf2, 0x3c, 0xf7, 0xf9, 0xd7, 0xde, 0x0b,
518 	0x0e, 0x30, 0xf1, 0x20, 0x7c, 0x93, 0x2f, 0x74,
519 	0x72, 0x40, 0x47, 0x2d, 0xeb, 0x8a, 0x5f, 0x69,
520 	0x60, 0xdf, 0xe9, 0x4d, 0x06, 0x24, 0x9c, 0x79,
521 	0xe7, 0x61, 0xd3, 0xa7, 0x57, 0x44, 0x49, 0x97,
522 	0x3a, 0xa3, 0x11, 0xc4, 0x70, 0xf4, 0x3d, 0xb5,
523 	0x4b, 0xb7, 0xae, 0x77, 0x36, 0xcf, 0x65, 0x3e,
524 	0xb6, 0x51, 0x83, 0xcb, 0x43, 0x5f, 0xd0, 0xfb,
525 	0x69, 0xc4, 0x1b, 0x77, 0x71, 0xcc, 0x72, 0xf4,
526 	0x5f, 0xc2, 0xda, 0xea, 0xa4, 0x33, 0xec, 0x8e,
527 	0x92, 0x22, 0x6a, 0x55, 0x34, 0x6a, 0x10, 0xb8,
528 	0x62, 0x66, 0xc1, 0x6f, 0x65, 0xdd, 0x9a, 0x40,
529 	0xa0, 0xbf, 0x88, 0xbb, 0x79, 0x1c, 0xa4, 0xaa,
530 	0xdf, 0xe8, 0xe7, 0x40, 0x88, 0xc6, 0x0f, 0xa2,
531 	0x2c, 0xee, 0xe7, 0x41, 0x32, 0x46, 0xa2, 0x46,
532 	0x85, 0xbf, 0x4c, 0xca, 0x4d, 0xd3, 0x9b, 0x49,
533 	0x43, 0x98, 0xae, 0xfc, 0x93, 0xa7, 0x94, 0x98,
534 	0x86, 0xa1, 0x0a, 0x85, 0x77, 0x67, 0xa6, 0x16,
535 	0x94, 0x76, 0xe5, 0x2f, 0x88, 0x5f, 0x24, 0x16,
536 	0xe5, 0x84, 0x4c, 0xd2, 0x58, 0x59, 0x82, 0x59,
537 	0x2c, 0xe2, 0x8d, 0xba, 0x08, 0x01, 0x67, 0x1f,
538 	0x2a, 0x9e, 0x4d, 0x53, 0x57, 0x2d, 0x6e, 0x35,
539 	0x38, 0xd5, 0x50, 0xa7, 0x0c, 0xe6, 0x77, 0x71,
540 	0xbe, 0x45, 0x2e, 0xf4, 0x7a, 0x3a, 0x51, 0x03,
541 	0x04, 0x2b, 0xd7, 0x42, 0x6c, 0x5b, 0x82, 0xba,
542 	0xb4, 0x09, 0xee, 0x9d, 0xea, 0x8f, 0xf0, 0xb3,
543 	0xb2, 0x9d, 0x0e, 0x09, 0x72, 0x8c, 0xd9, 0x1e,
544 	0x6d, 0x78, 0x57, 0x10, 0x1f, 0xeb, 0x4e, 0x53,
545 	0x57, 0x65, 0xe5, 0x43, 0xe8, 0xb4, 0xb6, 0xb8,
546 	0x25, 0x8a, 0xe2, 0xb3, 0x99, 0x95, 0x2c, 0xd0,
547 	0xc7, 0x89, 0xad, 0xdb, 0x72, 0xf0, 0x83, 0xe3,
548 	0x2f, 0x30, 0x33, 0xf4, 0x03, 0x14, 0x86, 0xa0,
549 	0xe0, 0x57, 0x15, 0x53, 0x26, 0xd0, 0x6d, 0x12,
550 	0x51, 0x96, 0x9b, 0x00, 0x8e, 0x41, 0xea, 0x05,
551 	0x75, 0x5d, 0xb3, 0x8d, 0x44, 0x7f, 0x41, 0x7f,
552 	0xd1, 0xed, 0x7c, 0xf7, 0xac, 0x6b, 0x21, 0xc7,
553 	0x0c, 0x49, 0xa1, 0x2e, 0x57, 0xa1, 0x21, 0xe2,
554 };
555 
556 /*
557  * IV method encblkno8, blkno 2.
558  */
559 static const uint8_t bf_cbc_128_encblkno8_vec2_ctxt[SECSIZE] = {
560 	0x28, 0x0c, 0x49, 0x08, 0x84, 0xcb, 0xba, 0x4a,
561 	0xa5, 0xb6, 0x12, 0x4c, 0x14, 0x11, 0x1f, 0x88,
562 	0x57, 0x78, 0x1e, 0x51, 0x7c, 0x9d, 0xba, 0x31,
563 	0x80, 0x14, 0xeb, 0x4a, 0x98, 0x8a, 0xb5, 0x4d,
564 	0xc5, 0xbd, 0xd2, 0x48, 0x1e, 0x19, 0x43, 0x54,
565 	0x48, 0x1d, 0x24, 0x76, 0x7d, 0xd8, 0xcc, 0xe9,
566 	0xd9, 0x7b, 0xa9, 0xdf, 0xe3, 0x65, 0x85, 0x10,
567 	0xb8, 0x11, 0xce, 0xa3, 0x07, 0x4d, 0x87, 0x3f,
568 	0x95, 0xfb, 0xa5, 0x06, 0xa4, 0x37, 0xb0, 0x89,
569 	0x03, 0xa9, 0xef, 0x62, 0x98, 0xd3, 0x85, 0xe8,
570 	0xb3, 0x21, 0xab, 0xe9, 0xdc, 0x03, 0x2a, 0x20,
571 	0xf7, 0xb1, 0xa4, 0x7a, 0xd5, 0xdc, 0x61, 0x2e,
572 	0x15, 0x81, 0x3e, 0xcf, 0x8d, 0x8d, 0x54, 0x19,
573 	0x70, 0xde, 0xa9, 0x57, 0x93, 0x87, 0xc7, 0x16,
574 	0x06, 0x25, 0xf3, 0x93, 0x8f, 0x73, 0x92, 0x29,
575 	0x1e, 0xcd, 0x5a, 0x9d, 0x8f, 0x8d, 0x44, 0x15,
576 	0x8d, 0x92, 0x44, 0x95, 0x7a, 0x5e, 0x1b, 0xfd,
577 	0x31, 0xa5, 0x8c, 0x22, 0x89, 0xbb, 0x91, 0x15,
578 	0xad, 0x0a, 0x73, 0x94, 0x65, 0xae, 0xca, 0xfc,
579 	0x7e, 0xae, 0x85, 0x45, 0xe7, 0xd7, 0x8f, 0x89,
580 	0x8e, 0x44, 0x62, 0x7a, 0xe0, 0xee, 0x78, 0xbd,
581 	0x88, 0x62, 0x8e, 0xb8, 0x35, 0x7a, 0xa9, 0x12,
582 	0x56, 0x2d, 0xe4, 0xbb, 0x2d, 0xc8, 0x98, 0x0e,
583 	0x35, 0x9e, 0xea, 0x14, 0x43, 0x80, 0xde, 0x9e,
584 	0x2e, 0xf8, 0xf9, 0xcd, 0x61, 0xa6, 0x22, 0xc8,
585 	0x77, 0xfc, 0x32, 0x71, 0x4b, 0xcb, 0x00, 0x9b,
586 	0x9f, 0x85, 0x02, 0x92, 0xfa, 0x84, 0xd8, 0xd8,
587 	0x09, 0xa4, 0x08, 0xc1, 0x96, 0xd3, 0x9a, 0x27,
588 	0xa3, 0x82, 0x05, 0xd0, 0x78, 0x18, 0x0a, 0x7d,
589 	0xb6, 0x95, 0xc0, 0x27, 0x3e, 0x76, 0x77, 0xf3,
590 	0xd9, 0x62, 0x8e, 0x77, 0xa0, 0x1f, 0x9e, 0x41,
591 	0xdb, 0x24, 0xaa, 0xdd, 0x8f, 0x94, 0x7b, 0x1f,
592 	0xff, 0xaa, 0xfd, 0xe2, 0x19, 0xc2, 0x71, 0x80,
593 	0x0a, 0xda, 0xc5, 0x98, 0x57, 0xde, 0x4e, 0xfb,
594 	0x38, 0xe6, 0x9b, 0xe5, 0xa6, 0x1f, 0x7d, 0x2c,
595 	0x41, 0x5f, 0x4d, 0x13, 0xb8, 0x0c, 0xac, 0x9a,
596 	0x7d, 0xc0, 0x7c, 0x44, 0x64, 0x1e, 0xbc, 0x7d,
597 	0x16, 0xaa, 0x45, 0xda, 0x62, 0x4e, 0x64, 0x69,
598 	0xd6, 0x71, 0xd9, 0x64, 0x2a, 0x5d, 0x20, 0x34,
599 	0xb0, 0xcb, 0x9d, 0xd3, 0x69, 0xd6, 0x60, 0xad,
600 	0x78, 0x72, 0xb8, 0x36, 0x17, 0xe7, 0xaf, 0x0a,
601 	0x11, 0x84, 0x43, 0x32, 0x38, 0x43, 0xe5, 0xc5,
602 	0x1b, 0xf4, 0x48, 0xb6, 0x0e, 0x72, 0x48, 0x2f,
603 	0x9b, 0xe3, 0xce, 0x27, 0xcd, 0x66, 0x28, 0x5c,
604 	0x2a, 0xd7, 0x28, 0x52, 0x6e, 0x86, 0x03, 0x60,
605 	0x7b, 0xbd, 0xbd, 0x53, 0xfb, 0x7d, 0xa1, 0xba,
606 	0x6a, 0x46, 0x0c, 0xf3, 0x1a, 0xbf, 0xa7, 0xa2,
607 	0x46, 0x87, 0x40, 0xaa, 0x7d, 0x76, 0x36, 0x85,
608 	0xa5, 0xbf, 0x0b, 0xd4, 0x56, 0x4c, 0x37, 0xe3,
609 	0x60, 0x93, 0xdc, 0x3b, 0xca, 0x34, 0x78, 0xcf,
610 	0xdb, 0x0c, 0x9d, 0x5c, 0x52, 0xb2, 0xd5, 0x7b,
611 	0xbb, 0x4e, 0xe1, 0xa9, 0x2a, 0xc6, 0x42, 0xf5,
612 	0x21, 0x9c, 0x15, 0xae, 0xb9, 0x08, 0x3a, 0xc4,
613 	0x50, 0x7e, 0x0e, 0xb6, 0xc3, 0xfe, 0xf4, 0xd9,
614 	0x1a, 0x97, 0x30, 0x9f, 0x51, 0x2c, 0xac, 0xd2,
615 	0x13, 0x93, 0x62, 0x56, 0xcb, 0x34, 0xf3, 0xca,
616 	0x26, 0xc6, 0x32, 0xbe, 0xf6, 0xd5, 0x1e, 0x5b,
617 	0x3a, 0x5c, 0x31, 0x08, 0xa1, 0x47, 0x6b, 0x75,
618 	0x95, 0x8e, 0x3d, 0xbf, 0x2e, 0x81, 0x02, 0x0d,
619 	0x17, 0x66, 0x6f, 0x04, 0xe0, 0x1e, 0x03, 0x27,
620 	0xd3, 0xcf, 0x45, 0xc6, 0x08, 0xdb, 0xdf, 0x83,
621 	0xd5, 0xc2, 0x7f, 0xe8, 0x5f, 0x4a, 0x36, 0x0a,
622 	0x6d, 0x3c, 0x91, 0x8e, 0x52, 0xf3, 0xdd, 0x62,
623 	0xff, 0x78, 0x87, 0xd9, 0x4c, 0xad, 0x5c, 0x9f,
624 };
625 
626 /*
627  * IV method encblkno8, blkno 3.
628  */
629 static const uint8_t bf_cbc_128_encblkno8_vec3_ctxt[SECSIZE] = {
630 	0xa3, 0x9a, 0x21, 0xbd, 0x1c, 0x97, 0x4f, 0xe2,
631 	0x7d, 0x63, 0xfe, 0x52, 0x07, 0xac, 0x81, 0x75,
632 	0x15, 0x04, 0x8c, 0xc7, 0x7c, 0x11, 0x8d, 0x53,
633 	0x17, 0x87, 0xe8, 0x5d, 0xb1, 0xe8, 0xcb, 0x43,
634 	0xe2, 0x4b, 0xce, 0x9b, 0xf7, 0x51, 0x0a, 0xee,
635 	0x0a, 0x49, 0xae, 0x9a, 0xbd, 0x33, 0x3f, 0x0b,
636 	0xd4, 0xe8, 0x57, 0x77, 0xb1, 0xe1, 0xa5, 0x22,
637 	0x83, 0xbf, 0x7c, 0x63, 0x6c, 0x3b, 0x25, 0xde,
638 	0x2c, 0x6a, 0x28, 0x66, 0x0e, 0xc4, 0x8d, 0x66,
639 	0x66, 0xb6, 0xc6, 0xb5, 0x38, 0x40, 0x84, 0x81,
640 	0xec, 0x03, 0xdb, 0xbf, 0xe1, 0x8f, 0xf4, 0xb3,
641 	0xc4, 0x50, 0x24, 0xa2, 0x48, 0x66, 0x73, 0xed,
642 	0x4b, 0x00, 0x12, 0xd5, 0x15, 0x5f, 0xfb, 0xd9,
643 	0x6c, 0x76, 0x3b, 0xa2, 0x68, 0x41, 0xc1, 0x96,
644 	0x50, 0xff, 0x8a, 0x83, 0xac, 0x02, 0x42, 0xcb,
645 	0xed, 0x93, 0xbf, 0xd9, 0x51, 0x46, 0x50, 0xd1,
646 	0xeb, 0x02, 0x61, 0x64, 0xa7, 0x0e, 0x95, 0xc2,
647 	0x95, 0x5a, 0x93, 0xd9, 0x77, 0x17, 0xa4, 0xc7,
648 	0x51, 0x42, 0xa3, 0xd4, 0x32, 0x4e, 0x4f, 0xe1,
649 	0xaa, 0x6d, 0xab, 0x08, 0xd9, 0xe9, 0xfe, 0x72,
650 	0xf3, 0x2c, 0xfb, 0x43, 0xdf, 0x88, 0x44, 0x94,
651 	0x0b, 0x5c, 0x85, 0x54, 0xe3, 0x13, 0xe2, 0x10,
652 	0x64, 0xa7, 0xcf, 0xe3, 0x2a, 0x3e, 0xfe, 0xd1,
653 	0x67, 0xcd, 0xd1, 0x66, 0x06, 0x26, 0x2f, 0x6f,
654 	0x6f, 0x44, 0xe7, 0xf4, 0xac, 0xe4, 0x58, 0x2f,
655 	0x61, 0xad, 0x64, 0xc6, 0x0c, 0xf0, 0x9a, 0x3b,
656 	0x85, 0x1f, 0x3c, 0xea, 0x8e, 0x84, 0xbb, 0x1a,
657 	0x51, 0x19, 0x3c, 0x6f, 0x5b, 0xf5, 0x6c, 0xb1,
658 	0x8c, 0x91, 0x25, 0x89, 0x3a, 0x45, 0xb5, 0x35,
659 	0x13, 0x74, 0xec, 0x68, 0x44, 0xb8, 0xfd, 0xd6,
660 	0x20, 0x78, 0x7b, 0xe3, 0xe0, 0x82, 0xb7, 0x4a,
661 	0x38, 0xb6, 0xe4, 0x1b, 0xbf, 0xd9, 0xd3, 0xe9,
662 	0xbf, 0xd7, 0xdc, 0x8e, 0x90, 0x7d, 0xcb, 0x39,
663 	0xc4, 0x6c, 0xa4, 0x70, 0x15, 0xf7, 0xa2, 0x16,
664 	0x04, 0x9b, 0xc0, 0x85, 0x04, 0x1e, 0x69, 0x73,
665 	0xf3, 0xbd, 0x64, 0x95, 0xfb, 0x21, 0xcb, 0xca,
666 	0x72, 0xd4, 0x33, 0xe5, 0x11, 0xc3, 0x46, 0xa6,
667 	0xd2, 0x4c, 0x8a, 0xbb, 0xba, 0x45, 0xcc, 0x45,
668 	0xdb, 0x8a, 0xec, 0xef, 0x8c, 0x04, 0xcc, 0xeb,
669 	0x42, 0xad, 0xc3, 0x87, 0xe2, 0x59, 0x3b, 0xed,
670 	0x2a, 0x11, 0x74, 0xc1, 0x28, 0x8a, 0xc2, 0x17,
671 	0xca, 0x5a, 0x88, 0xcc, 0x17, 0x2c, 0x03, 0xf6,
672 	0xcd, 0xd6, 0x92, 0xbd, 0x68, 0x26, 0x41, 0x40,
673 	0x15, 0x3e, 0x54, 0xf5, 0xb7, 0x4a, 0x82, 0x68,
674 	0xca, 0x27, 0xed, 0xed, 0x25, 0xd6, 0x0d, 0x0f,
675 	0x86, 0x62, 0xf0, 0x86, 0x5b, 0xed, 0x94, 0x0b,
676 	0xd0, 0xec, 0xc7, 0xfd, 0x9c, 0x8a, 0xdf, 0x4f,
677 	0x65, 0x7e, 0x63, 0x40, 0xeb, 0xe4, 0x79, 0xcb,
678 	0x67, 0xc6, 0x0e, 0x45, 0xf9, 0xb1, 0x48, 0x27,
679 	0x16, 0xfc, 0x99, 0x76, 0xac, 0xd0, 0xbc, 0xe6,
680 	0x9b, 0x29, 0x2d, 0xa5, 0x6c, 0x88, 0x45, 0x7a,
681 	0x01, 0xf3, 0xe3, 0x15, 0xfb, 0x29, 0xd4, 0x3b,
682 	0x9a, 0xa8, 0xc6, 0x98, 0x92, 0x19, 0x16, 0xba,
683 	0xdc, 0x41, 0x70, 0x40, 0x51, 0xfb, 0x7f, 0xb5,
684 	0xe4, 0x3f, 0x3f, 0x73, 0xb0, 0xb3, 0xd7, 0x6d,
685 	0x3e, 0x4d, 0x6b, 0x9e, 0x42, 0x8e, 0xbb, 0xd7,
686 	0xb5, 0x26, 0xa9, 0x19, 0xf5, 0x68, 0xf3, 0x8d,
687 	0x35, 0x91, 0x06, 0x48, 0xfa, 0x0e, 0x7d, 0xe2,
688 	0xd3, 0x71, 0x75, 0x44, 0xbd, 0xe6, 0xe6, 0xd6,
689 	0x36, 0x43, 0x64, 0x3a, 0xd5, 0x97, 0xfa, 0xc0,
690 	0x10, 0xf7, 0x6c, 0x26, 0xf1, 0xb4, 0xbc, 0xf5,
691 	0xf6, 0xa3, 0xec, 0x0a, 0xb5, 0x34, 0x55, 0x1a,
692 	0x67, 0xcb, 0xec, 0x2c, 0x2e, 0x2e, 0x74, 0xed,
693 	0xfc, 0x85, 0x53, 0x01, 0x87, 0xa7, 0xa0, 0x1f,
694 };
695 
696 const struct testvec bf_cbc_128_8_vectors[] = {
697 	{
698 		.blkno = 0,
699 		.ptxt = bf_cbc_ptxt,
700 		.ctxt = bf_cbc_128_encblkno8_vec0_ctxt,
701 	},
702 	{
703 		.blkno = 1,
704 		.ptxt = bf_cbc_ptxt,
705 		.ctxt = bf_cbc_128_encblkno8_vec1_ctxt,
706 	},
707 	{
708 		.blkno = 2,
709 		.ptxt = bf_cbc_ptxt,
710 		.ctxt = bf_cbc_128_encblkno8_vec2_ctxt,
711 	},
712 	{
713 		.blkno = 3,
714 		.ptxt = bf_cbc_ptxt,
715 		.ctxt = bf_cbc_128_encblkno8_vec3_ctxt,
716 	},
717 };
718 
719 /*
720  * IV method encblkno1, blkno 0.
721  */
722 static const uint8_t bf_cbc_256_encblkno1_vec0_ctxt[SECSIZE] = {
723 	0x14, 0xec, 0xa9, 0xa0, 0x51, 0x9f, 0x5e, 0xb5,
724 	0x81, 0x6f, 0xa2, 0xbf, 0x5e, 0xf7, 0x91, 0xad,
725 	0xc5, 0x1a, 0x7e, 0xe6, 0x7a, 0x82, 0x4a, 0xba,
726 	0x54, 0x60, 0xcb, 0xc3, 0x2f, 0x69, 0x5c, 0xd9,
727 	0x1e, 0x58, 0xa1, 0x88, 0xa1, 0xe5, 0xa8, 0x52,
728 	0xdf, 0xf3, 0x8d, 0x5e, 0x2f, 0x81, 0x54, 0xab,
729 	0x67, 0xb5, 0x05, 0x63, 0x20, 0x10, 0x98, 0xf5,
730 	0xa5, 0xc3, 0x9e, 0x6d, 0x80, 0x4d, 0xb6, 0x82,
731 	0x80, 0x5e, 0xb3, 0xc5, 0xd8, 0x77, 0x94, 0xa0,
732 	0xb8, 0x67, 0xb8, 0x2d, 0x9b, 0x11, 0x3c, 0x24,
733 	0xbd, 0xb7, 0x0b, 0x1d, 0xeb, 0x1d, 0x6c, 0xab,
734 	0x3f, 0x8c, 0x91, 0xa0, 0x3a, 0xa6, 0x0c, 0x5a,
735 	0x88, 0xa0, 0xb5, 0xea, 0x49, 0x58, 0xfb, 0x37,
736 	0x7c, 0x94, 0xc4, 0x22, 0x35, 0x84, 0xda, 0xd1,
737 	0x1b, 0x4a, 0x42, 0xa1, 0xd4, 0x90, 0xcd, 0xfb,
738 	0x77, 0x29, 0xd2, 0xe3, 0x89, 0xec, 0x9e, 0x6a,
739 	0x4b, 0xbc, 0xc0, 0xfa, 0xb8, 0xdd, 0x5c, 0x2b,
740 	0xc5, 0x49, 0xb1, 0x6d, 0x6f, 0x2c, 0xb5, 0x50,
741 	0xd1, 0xd4, 0x9b, 0x15, 0x1c, 0xd7, 0x44, 0xf3,
742 	0x2e, 0x1f, 0x46, 0xee, 0x38, 0x40, 0xaa, 0x73,
743 	0xca, 0xf2, 0xc3, 0x83, 0xe2, 0xff, 0xd6, 0xc7,
744 	0x20, 0xea, 0x70, 0x95, 0x48, 0x58, 0x29, 0x6e,
745 	0xac, 0x10, 0x75, 0x69, 0x1d, 0xb2, 0x08, 0x3e,
746 	0x68, 0x43, 0xff, 0x69, 0x1e, 0x88, 0x0a, 0x34,
747 	0x40, 0xae, 0xb9, 0xf4, 0xb9, 0x3f, 0xa5, 0xd2,
748 	0xfb, 0xa0, 0xfd, 0x10, 0xa5, 0xbb, 0xd7, 0x22,
749 	0x8c, 0xd1, 0xf5, 0xc4, 0x11, 0xc6, 0x1e, 0xb5,
750 	0xfc, 0x90, 0x84, 0xa2, 0x49, 0x38, 0x64, 0x92,
751 	0x6e, 0xf2, 0xaa, 0xed, 0xe8, 0x9d, 0xac, 0x86,
752 	0xb7, 0xb3, 0xd9, 0x98, 0x11, 0x8f, 0x51, 0x33,
753 	0x84, 0x06, 0x40, 0x26, 0x3f, 0xe1, 0xb3, 0x4a,
754 	0x76, 0x53, 0x68, 0x8b, 0xfe, 0x6f, 0xcd, 0x66,
755 	0x92, 0x24, 0x42, 0xf4, 0x11, 0x02, 0x01, 0x00,
756 	0xaa, 0x15, 0x35, 0x42, 0xab, 0x6f, 0x2b, 0x3b,
757 	0x9a, 0x23, 0x73, 0x18, 0xa8, 0x9b, 0x43, 0x4b,
758 	0xfb, 0xef, 0x07, 0x75, 0xd7, 0xd6, 0x08, 0x94,
759 	0xe3, 0x2d, 0xd9, 0xd4, 0x8e, 0x6b, 0x7c, 0xe0,
760 	0xae, 0xef, 0xcb, 0x5c, 0x46, 0x39, 0x64, 0x34,
761 	0x48, 0x77, 0x2c, 0x87, 0x68, 0x57, 0xef, 0xba,
762 	0xd3, 0x3b, 0xb8, 0x68, 0xc5, 0x65, 0x73, 0x44,
763 	0x0b, 0xef, 0xc7, 0x5e, 0xe6, 0xa2, 0xba, 0x24,
764 	0x8c, 0x67, 0xa0, 0xf4, 0xef, 0x18, 0x8c, 0x72,
765 	0x5b, 0x81, 0x8c, 0x81, 0x4f, 0x9a, 0xed, 0x46,
766 	0x5d, 0x05, 0x9a, 0xdc, 0x01, 0xbe, 0xe8, 0x3f,
767 	0xb7, 0x5c, 0x8b, 0x2f, 0x92, 0x2c, 0x93, 0x54,
768 	0x68, 0xfa, 0xd4, 0x27, 0x81, 0xab, 0xa9, 0xfd,
769 	0x20, 0x21, 0x1b, 0x3a, 0x6e, 0x6b, 0x02, 0x57,
770 	0x6e, 0xd6, 0x7b, 0x7e, 0x5d, 0x84, 0x47, 0x69,
771 	0x86, 0x7b, 0x8f, 0x8b, 0xff, 0xb5, 0xcd, 0xc1,
772 	0x03, 0x18, 0x23, 0x7f, 0x23, 0x2e, 0x3a, 0x48,
773 	0xe2, 0xf6, 0xb1, 0x78, 0x13, 0x81, 0xbb, 0x80,
774 	0x91, 0x89, 0x54, 0x7d, 0x1f, 0x1a, 0xd5, 0x35,
775 	0xad, 0x56, 0x6a, 0x0f, 0xeb, 0x4d, 0x00, 0xdf,
776 	0xe0, 0xf3, 0x7c, 0xd3, 0x2c, 0x5a, 0x48, 0x39,
777 	0xa1, 0xc1, 0xfa, 0x34, 0x5f, 0xf9, 0x0b, 0xcd,
778 	0x1f, 0x21, 0xc6, 0x46, 0xb3, 0xd8, 0x45, 0xc5,
779 	0x37, 0xf7, 0xd0, 0xda, 0x27, 0x0f, 0xec, 0xec,
780 	0x05, 0x81, 0x6f, 0x97, 0xca, 0x6d, 0xfa, 0x71,
781 	0xc9, 0x59, 0x84, 0xc3, 0x0d, 0x55, 0x12, 0xbf,
782 	0xe1, 0xd2, 0x7c, 0x51, 0x65, 0x8c, 0xc3, 0x8a,
783 	0x73, 0x2f, 0x1c, 0xd8, 0x13, 0x4a, 0xd1, 0x78,
784 	0xb2, 0xc8, 0x19, 0x09, 0xce, 0x7b, 0xb6, 0x77,
785 	0xcc, 0xc3, 0xe6, 0xee, 0x3a, 0x82, 0xf9, 0xc6,
786 	0x5a, 0x36, 0x46, 0xc0, 0x25, 0xee, 0xaf, 0x78,
787 };
788 
789 /*
790  * IV method encblkno1, blkno 1.
791  */
792 static const uint8_t bf_cbc_256_encblkno1_vec1_ctxt[SECSIZE] = {
793 	0x0b, 0xb6, 0x26, 0x92, 0x1d, 0x74, 0xc2, 0x10,
794 	0xb5, 0x99, 0x5f, 0x62, 0x7f, 0x3b, 0x49, 0x10,
795 	0xc1, 0x20, 0x9f, 0x38, 0x25, 0x0f, 0x59, 0xde,
796 	0xe4, 0xc8, 0xb5, 0x27, 0xb1, 0xec, 0x96, 0x40,
797 	0xe8, 0x05, 0x15, 0x40, 0x96, 0xe0, 0xff, 0xaf,
798 	0x53, 0x73, 0xa1, 0xa6, 0x73, 0x03, 0xcf, 0x1f,
799 	0x87, 0x48, 0x7d, 0x81, 0x0e, 0x35, 0x23, 0x7b,
800 	0xde, 0x12, 0xd8, 0xcd, 0x0a, 0xcb, 0x03, 0xc5,
801 	0x07, 0xf7, 0x7a, 0x04, 0xf3, 0xda, 0x7d, 0x3b,
802 	0x73, 0xc6, 0x31, 0xbc, 0x24, 0xde, 0x23, 0x05,
803 	0x3a, 0xdc, 0xe2, 0x96, 0x85, 0x06, 0xeb, 0x89,
804 	0xb0, 0x49, 0x3c, 0x79, 0x8e, 0xcf, 0x49, 0x0e,
805 	0x34, 0x04, 0xa5, 0xcf, 0x45, 0x56, 0xb6, 0xc2,
806 	0xf1, 0xf1, 0xab, 0x7c, 0x8a, 0xfc, 0xeb, 0xa0,
807 	0x8a, 0xe6, 0x73, 0xb4, 0xc3, 0x0c, 0x03, 0x5f,
808 	0x03, 0x53, 0x6f, 0x69, 0xa2, 0xd0, 0xa7, 0x48,
809 	0xc4, 0x11, 0x88, 0x75, 0xe1, 0xf3, 0xd0, 0x72,
810 	0x98, 0x6f, 0x84, 0xa6, 0xa8, 0x35, 0xbb, 0xac,
811 	0x4d, 0xac, 0x55, 0x88, 0x85, 0x86, 0x5a, 0xd9,
812 	0xb6, 0x57, 0xf9, 0x40, 0xf6, 0x7f, 0x1b, 0x4e,
813 	0x87, 0xc0, 0x56, 0x8a, 0x2f, 0x3a, 0xe5, 0xa6,
814 	0x67, 0x68, 0x21, 0x2b, 0xea, 0xfa, 0xee, 0x47,
815 	0xa0, 0x34, 0x56, 0x7d, 0xa0, 0x3d, 0x58, 0xd7,
816 	0xff, 0xa2, 0xb6, 0x03, 0x52, 0x16, 0xa5, 0x15,
817 	0x65, 0xdb, 0xe1, 0x1b, 0xdf, 0x69, 0xb1, 0x48,
818 	0x6a, 0xdf, 0xc1, 0x00, 0x07, 0xdc, 0x46, 0x4b,
819 	0x59, 0xcf, 0x15, 0x6b, 0xee, 0x4f, 0x72, 0x77,
820 	0x6e, 0xbf, 0x47, 0x0e, 0x84, 0x0b, 0xb1, 0xac,
821 	0x85, 0xce, 0x2b, 0x47, 0x7a, 0xcc, 0x30, 0x0c,
822 	0x2f, 0x10, 0x27, 0xaa, 0x83, 0x3f, 0x17, 0x39,
823 	0x84, 0x45, 0x8c, 0xb7, 0x31, 0xb3, 0x7c, 0xcd,
824 	0xed, 0x86, 0x7d, 0xa9, 0x06, 0x25, 0x1f, 0xe3,
825 	0x9a, 0x9b, 0x92, 0xdd, 0x07, 0x63, 0x3b, 0x51,
826 	0x32, 0x2e, 0xae, 0xdf, 0xad, 0xd4, 0x54, 0x5d,
827 	0x71, 0x36, 0xe9, 0xda, 0x70, 0xe9, 0xec, 0x75,
828 	0x0b, 0xbb, 0xcc, 0x5d, 0xc5, 0x45, 0x8e, 0x56,
829 	0x12, 0x87, 0x95, 0x0f, 0x0f, 0x5b, 0x22, 0xc2,
830 	0xe9, 0x71, 0xf2, 0x7e, 0x7b, 0xc2, 0xce, 0x1f,
831 	0xb4, 0x43, 0xa5, 0xf1, 0x80, 0x03, 0xd9, 0x44,
832 	0x3e, 0x97, 0xd6, 0x32, 0x80, 0x99, 0x6b, 0x5b,
833 	0x25, 0x8b, 0x73, 0x0c, 0x21, 0xda, 0x87, 0x29,
834 	0x57, 0x1e, 0xa3, 0x1f, 0xc1, 0xb2, 0xd6, 0xa4,
835 	0x72, 0x64, 0x4a, 0x6b, 0x6f, 0x4d, 0xa8, 0x03,
836 	0x59, 0x6f, 0xce, 0x8a, 0xd6, 0x1c, 0x63, 0x30,
837 	0x60, 0xd1, 0x55, 0xc5, 0x44, 0x9a, 0xa8, 0x69,
838 	0x9f, 0xc7, 0xbe, 0xca, 0x92, 0x83, 0xe9, 0xea,
839 	0x51, 0x00, 0x5a, 0xdc, 0xbb, 0xbd, 0x5d, 0xf2,
840 	0x6d, 0x3c, 0x09, 0xde, 0x68, 0x33, 0x5f, 0x5c,
841 	0x80, 0x8e, 0x22, 0x93, 0x28, 0x5b, 0x77, 0xae,
842 	0xcd, 0x0d, 0x08, 0xab, 0x94, 0xd6, 0x12, 0x72,
843 	0x3f, 0xd2, 0xb3, 0xff, 0x87, 0x0a, 0x6f, 0x72,
844 	0xa7, 0xff, 0xc1, 0xdc, 0x8a, 0x64, 0xdf, 0xeb,
845 	0x0e, 0x63, 0x71, 0x42, 0x88, 0x2b, 0x13, 0x17,
846 	0xf2, 0x3b, 0xf9, 0xbb, 0xc9, 0xcc, 0x32, 0x1f,
847 	0x12, 0x7f, 0xa0, 0x8e, 0x77, 0x31, 0x42, 0x46,
848 	0x3d, 0xb6, 0xa9, 0x14, 0x6e, 0x02, 0x5a, 0x4f,
849 	0xf1, 0x5b, 0x91, 0x7e, 0x93, 0xea, 0x94, 0xf1,
850 	0xcf, 0x0e, 0x10, 0xf8, 0xc2, 0x55, 0x87, 0x68,
851 	0xf9, 0x49, 0xfa, 0xeb, 0x0f, 0x2c, 0xd7, 0xd8,
852 	0x26, 0x1a, 0x5b, 0x1a, 0x42, 0x06, 0xea, 0x8a,
853 	0xb6, 0xec, 0x6e, 0xb0, 0x00, 0xb9, 0x3b, 0x50,
854 	0xe8, 0x9e, 0xc2, 0x51, 0x4f, 0x03, 0xcd, 0x9f,
855 	0x36, 0x27, 0xca, 0xa2, 0x98, 0x87, 0x5a, 0xae,
856 	0xd8, 0x87, 0x76, 0xb6, 0xb6, 0x19, 0x7d, 0x75,
857 };
858 
859 /*
860  * IV method encblkno1, blkno 2.
861  */
862 static const uint8_t bf_cbc_256_encblkno1_vec2_ctxt[SECSIZE] = {
863 	0x91, 0x45, 0x4e, 0xe8, 0xad, 0xe3, 0x95, 0x0f,
864 	0x40, 0x35, 0x21, 0x21, 0x77, 0x62, 0x1d, 0x65,
865 	0xe4, 0x93, 0x11, 0xd2, 0x20, 0xa4, 0xe4, 0x53,
866 	0x44, 0xff, 0x60, 0xe9, 0x34, 0xb2, 0x33, 0x87,
867 	0x3d, 0xb0, 0xd8, 0x37, 0x7e, 0x0e, 0x9a, 0x53,
868 	0x92, 0xeb, 0xee, 0x16, 0x41, 0x25, 0xe3, 0x80,
869 	0x0c, 0x53, 0xd8, 0x1f, 0xf0, 0x99, 0xcb, 0x31,
870 	0xd1, 0x00, 0x82, 0x03, 0xcc, 0xa9, 0x5c, 0x8d,
871 	0x1a, 0xbb, 0x03, 0x81, 0x80, 0x0d, 0x5d, 0x4a,
872 	0x96, 0x74, 0x79, 0xf4, 0xa7, 0x46, 0x97, 0x42,
873 	0x5e, 0xb6, 0x8d, 0xc1, 0x95, 0x1d, 0x98, 0x4d,
874 	0xe5, 0xe9, 0x70, 0x1a, 0x5a, 0xad, 0xf4, 0x3d,
875 	0xe1, 0xa7, 0x25, 0xc7, 0xfa, 0x0a, 0x75, 0x98,
876 	0x2f, 0xef, 0x16, 0x2e, 0xf2, 0x02, 0x8a, 0x4c,
877 	0x1f, 0x5a, 0xbb, 0x06, 0x1b, 0x4e, 0x50, 0xfb,
878 	0x03, 0xed, 0x2a, 0x53, 0xdc, 0x2a, 0x65, 0xad,
879 	0x57, 0x84, 0x48, 0xdb, 0xd2, 0x9b, 0xc0, 0x01,
880 	0x5f, 0x7d, 0x3e, 0x84, 0xe5, 0x15, 0x7d, 0xc5,
881 	0x60, 0x4b, 0x18, 0xa1, 0xf3, 0x00, 0x82, 0xd3,
882 	0x39, 0x2a, 0x1f, 0x8f, 0x6a, 0xb7, 0xeb, 0x76,
883 	0xfb, 0xf0, 0x5e, 0x66, 0xd8, 0xf1, 0x85, 0xa8,
884 	0x17, 0xdc, 0x6a, 0xee, 0x53, 0xd9, 0x72, 0x27,
885 	0xd1, 0x47, 0x73, 0x97, 0x2c, 0xd7, 0xd2, 0xb8,
886 	0xcd, 0xbe, 0x7b, 0xcc, 0xcc, 0x7d, 0x82, 0x10,
887 	0x05, 0x5d, 0xff, 0xb0, 0xe0, 0x3a, 0xda, 0x1b,
888 	0x39, 0x7b, 0x11, 0x30, 0x4f, 0xe7, 0xf9, 0xa6,
889 	0x43, 0x56, 0x01, 0xe4, 0xed, 0x1a, 0x22, 0x5b,
890 	0x53, 0x6b, 0x34, 0x58, 0x21, 0x3f, 0x0d, 0xca,
891 	0x95, 0x24, 0x9a, 0xb0, 0x03, 0xe3, 0x97, 0xf5,
892 	0x9b, 0xcb, 0x10, 0x6f, 0x1d, 0x8a, 0x8b, 0xaa,
893 	0x14, 0x0a, 0x89, 0x92, 0xa1, 0x07, 0xb1, 0x35,
894 	0x40, 0x7f, 0xb0, 0xc3, 0x9a, 0x2a, 0x1f, 0x94,
895 	0x6c, 0x8f, 0xd8, 0x40, 0x52, 0xec, 0x0e, 0xbf,
896 	0x91, 0x27, 0xbd, 0x65, 0x25, 0xf2, 0x36, 0xe8,
897 	0x8f, 0x49, 0x08, 0xa6, 0x8f, 0x82, 0xb3, 0x47,
898 	0xe9, 0xa4, 0xa6, 0x8e, 0xfb, 0x30, 0xb2, 0x4c,
899 	0xad, 0x76, 0x65, 0x25, 0xdb, 0x60, 0xa8, 0xeb,
900 	0xb9, 0xf9, 0x9a, 0x9c, 0x9c, 0x12, 0xab, 0xeb,
901 	0x4b, 0x96, 0xa5, 0xc3, 0x58, 0x9b, 0x68, 0x2c,
902 	0x41, 0xac, 0xe5, 0x03, 0xbc, 0xee, 0xb8, 0x05,
903 	0xf7, 0xe6, 0xb1, 0x07, 0xde, 0x46, 0x28, 0xc1,
904 	0x2c, 0x15, 0xa2, 0x34, 0xea, 0xe7, 0xc3, 0x36,
905 	0xe6, 0x18, 0x20, 0x4e, 0x20, 0x3f, 0x32, 0xa8,
906 	0x29, 0x05, 0xf6, 0xa5, 0xf2, 0xa3, 0xeb, 0x7a,
907 	0x25, 0x5e, 0x14, 0x1f, 0xd0, 0xe1, 0x8e, 0xfb,
908 	0x28, 0xc5, 0xa2, 0x42, 0xed, 0x4c, 0x12, 0x15,
909 	0x2a, 0x08, 0xfb, 0x0b, 0xfb, 0x94, 0x64, 0xc0,
910 	0x8b, 0xbb, 0xbb, 0x2c, 0xef, 0xab, 0x0b, 0x4c,
911 	0x27, 0x40, 0x94, 0x3e, 0x93, 0x77, 0x98, 0xcc,
912 	0x64, 0xe3, 0xba, 0x22, 0x95, 0xd7, 0xc1, 0xe3,
913 	0xa7, 0xcd, 0xf9, 0x25, 0xdc, 0xc4, 0xd2, 0xee,
914 	0x5b, 0x53, 0x72, 0x59, 0x8b, 0xea, 0xbf, 0xde,
915 	0x2b, 0x35, 0xd5, 0x27, 0x57, 0x2e, 0x13, 0xa7,
916 	0x50, 0x2d, 0xa5, 0xd5, 0x43, 0x0b, 0x49, 0x87,
917 	0xd0, 0xbd, 0xdd, 0xec, 0x4b, 0xd1, 0x8b, 0xf6,
918 	0xf6, 0xd0, 0x97, 0xcb, 0x8d, 0x58, 0x35, 0x27,
919 	0xa5, 0x7e, 0x4a, 0xda, 0x93, 0xa4, 0x1e, 0x39,
920 	0x53, 0x59, 0x87, 0xfe, 0x82, 0x09, 0xda, 0x03,
921 	0x33, 0xcf, 0x94, 0x60, 0xb1, 0x0c, 0xa1, 0x0e,
922 	0xd6, 0xaa, 0xb0, 0x09, 0x96, 0x8b, 0x72, 0x15,
923 	0xfb, 0xb0, 0x7d, 0x06, 0xf5, 0x2d, 0x64, 0xcd,
924 	0x03, 0xf0, 0xfa, 0xed, 0x6f, 0x43, 0xe3, 0xf3,
925 	0x33, 0xaf, 0x65, 0x82, 0x1d, 0xad, 0x03, 0x62,
926 	0xbe, 0x12, 0x14, 0x85, 0x66, 0x45, 0x03, 0x79,
927 };
928 
929 /*
930  * IV method encblkno1, blkno 3.
931  */
932 static const uint8_t bf_cbc_256_encblkno1_vec3_ctxt[SECSIZE] = {
933 	0x65, 0xbb, 0x30, 0x13, 0x9a, 0x26, 0xe9, 0x3d,
934 	0x54, 0x28, 0x77, 0xf1, 0x3f, 0x9b, 0xe1, 0x3e,
935 	0x70, 0x90, 0x6f, 0x16, 0xfc, 0x2f, 0x27, 0xb3,
936 	0xc6, 0x3c, 0x38, 0x31, 0x11, 0xe1, 0x3b, 0x72,
937 	0x22, 0x1c, 0x01, 0xc5, 0xa6, 0x70, 0x16, 0x4d,
938 	0xd2, 0xbd, 0xcb, 0x15, 0x00, 0x22, 0xab, 0x65,
939 	0x6a, 0x96, 0x5e, 0x45, 0x7f, 0xfd, 0x76, 0x18,
940 	0x43, 0x25, 0x75, 0x73, 0xa4, 0x24, 0xe4, 0x5b,
941 	0xca, 0xf7, 0x6f, 0xfe, 0xc6, 0x4c, 0x81, 0x77,
942 	0xe5, 0x1b, 0xb4, 0x7b, 0x64, 0xc2, 0x0d, 0x2b,
943 	0xa9, 0x76, 0xae, 0x5d, 0xab, 0x81, 0x77, 0xa6,
944 	0x48, 0xe9, 0x0c, 0x6d, 0x93, 0xbd, 0x7e, 0xdc,
945 	0x39, 0x89, 0x72, 0xd2, 0x07, 0x87, 0x44, 0xa6,
946 	0x7d, 0x08, 0x54, 0xc6, 0x90, 0x1d, 0xa2, 0xd7,
947 	0xfd, 0xd5, 0x59, 0x67, 0xd9, 0x5f, 0x5c, 0xbc,
948 	0x60, 0xc7, 0xf6, 0x98, 0xad, 0x21, 0xdf, 0xde,
949 	0x27, 0xca, 0x73, 0x2f, 0x56, 0xb7, 0xd7, 0x54,
950 	0x6e, 0xc3, 0x09, 0x6f, 0x1b, 0x82, 0x6f, 0xf8,
951 	0x1b, 0xb2, 0x54, 0x47, 0x54, 0x55, 0x67, 0x1c,
952 	0x4a, 0x10, 0x44, 0xb8, 0x8e, 0x85, 0x71, 0x70,
953 	0x02, 0x49, 0xdd, 0x4f, 0xd4, 0xd4, 0x8a, 0x60,
954 	0x04, 0x17, 0x84, 0xbf, 0xb4, 0x0a, 0x6f, 0xc1,
955 	0xec, 0x1f, 0x5d, 0x79, 0x59, 0x15, 0x7b, 0x87,
956 	0xa2, 0xfe, 0x81, 0xa1, 0x0b, 0x74, 0xfa, 0xef,
957 	0xce, 0x96, 0xec, 0x4b, 0xd8, 0x8e, 0xe9, 0xc2,
958 	0x6b, 0x15, 0xd9, 0xe4, 0x1d, 0x81, 0xb2, 0x12,
959 	0xb9, 0x8b, 0x64, 0x3d, 0xfa, 0xf6, 0x29, 0x25,
960 	0x88, 0x4f, 0xfa, 0x56, 0x34, 0x85, 0xa6, 0xbe,
961 	0xf7, 0x9f, 0x54, 0xc4, 0xb7, 0x17, 0xd5, 0x00,
962 	0x2d, 0x06, 0xca, 0xf0, 0xec, 0xf9, 0x52, 0x62,
963 	0x12, 0xef, 0xc0, 0x57, 0xd1, 0xf3, 0xf2, 0xb1,
964 	0x3d, 0xc5, 0x69, 0x04, 0x95, 0xaf, 0xc6, 0x54,
965 	0x18, 0x08, 0x2f, 0xe2, 0xc2, 0xdb, 0x28, 0x63,
966 	0x7c, 0xf5, 0xba, 0xa4, 0xdf, 0xbd, 0xdd, 0xac,
967 	0x98, 0xec, 0x9e, 0x07, 0x48, 0xee, 0xb9, 0x6f,
968 	0x40, 0xba, 0x08, 0xd5, 0x74, 0x97, 0x34, 0x98,
969 	0x7a, 0x80, 0xc5, 0x78, 0x69, 0x11, 0xd9, 0xcb,
970 	0x3b, 0x6f, 0xe7, 0xb7, 0x78, 0xb0, 0x5e, 0x02,
971 	0xaf, 0x6c, 0xef, 0x36, 0x00, 0xca, 0x97, 0x1a,
972 	0x01, 0x2e, 0xe8, 0xc0, 0x8b, 0xc6, 0x78, 0xf4,
973 	0x2d, 0x60, 0x2c, 0x04, 0x3f, 0x0b, 0xca, 0x7e,
974 	0xf1, 0x2e, 0x67, 0x8f, 0x9d, 0xa7, 0xaa, 0xab,
975 	0xcf, 0xb3, 0x84, 0x9e, 0x14, 0x35, 0x15, 0x3b,
976 	0x88, 0x9a, 0x33, 0x5d, 0x68, 0x82, 0x29, 0x53,
977 	0x94, 0x18, 0x0d, 0x14, 0x9e, 0x5f, 0xc1, 0x32,
978 	0x0a, 0x95, 0x6e, 0xa3, 0x82, 0x4b, 0x58, 0x0f,
979 	0x9c, 0xf0, 0x26, 0x4b, 0x2f, 0x02, 0x60, 0x85,
980 	0xdd, 0x2c, 0xb8, 0x87, 0x8b, 0x14, 0x9c, 0x54,
981 	0x0a, 0x5a, 0x02, 0xbe, 0xe2, 0x71, 0xcc, 0x07,
982 	0xae, 0x67, 0x00, 0xa8, 0xd4, 0x09, 0x7c, 0xee,
983 	0x0d, 0x29, 0x17, 0x67, 0x96, 0x68, 0x41, 0xfa,
984 	0x72, 0x29, 0x98, 0x2b, 0x23, 0xd1, 0xa9, 0x89,
985 	0x1c, 0xcc, 0xaf, 0x88, 0xdb, 0xb5, 0x1e, 0xb1,
986 	0xae, 0x17, 0x5f, 0x29, 0x8d, 0x1c, 0x0a, 0x5c,
987 	0xb9, 0xa7, 0x59, 0x8b, 0x91, 0x41, 0xee, 0x89,
988 	0xe1, 0x0e, 0x7e, 0x0a, 0xee, 0xbc, 0x35, 0xab,
989 	0xf1, 0x5a, 0x58, 0x03, 0xa2, 0xcf, 0x33, 0xa3,
990 	0x74, 0x82, 0xd3, 0xa0, 0x32, 0xfc, 0x3b, 0x9c,
991 	0xdf, 0xc0, 0x3a, 0x76, 0xe1, 0xea, 0xf0, 0x6d,
992 	0xc8, 0xe7, 0x97, 0xec, 0x03, 0xc1, 0x72, 0x94,
993 	0xe5, 0xc4, 0x04, 0x2a, 0x38, 0xb4, 0xef, 0x47,
994 	0x1d, 0xf9, 0xb8, 0x0a, 0xa9, 0x45, 0xc1, 0x63,
995 	0xf8, 0x32, 0xdb, 0x5d, 0xb1, 0xa2, 0x80, 0x8c,
996 	0x23, 0xd3, 0x60, 0xfb, 0xf8, 0x84, 0x57, 0x8b,
997 };
998 
999 const struct testvec bf_cbc_256_1_vectors[] = {
1000 	{
1001 		.blkno = 0,
1002 		.ptxt = bf_cbc_ptxt,
1003 		.ctxt = bf_cbc_256_encblkno1_vec0_ctxt,
1004 	},
1005 	{
1006 		.blkno = 1,
1007 		.ptxt = bf_cbc_ptxt,
1008 		.ctxt = bf_cbc_256_encblkno1_vec1_ctxt,
1009 	},
1010 	{
1011 		.blkno = 2,
1012 		.ptxt = bf_cbc_ptxt,
1013 		.ctxt = bf_cbc_256_encblkno1_vec2_ctxt,
1014 	},
1015 	{
1016 		.blkno = 3,
1017 		.ptxt = bf_cbc_ptxt,
1018 		.ctxt = bf_cbc_256_encblkno1_vec3_ctxt,
1019 	},
1020 };
1021 
1022 /*
1023  * IV method encblkno8, blkno 0.
1024  */
1025 static const uint8_t bf_cbc_256_encblkno8_vec0_ctxt[SECSIZE] = {
1026 	0x90, 0x3d, 0xd2, 0xc0, 0xd3, 0x75, 0xe8, 0x04,
1027 	0x34, 0x66, 0x76, 0x25, 0x70, 0xde, 0x41, 0xf1,
1028 	0x35, 0x63, 0x5c, 0xac, 0x8f, 0x28, 0x17, 0xd3,
1029 	0xae, 0x43, 0xfd, 0x8a, 0xb8, 0xc2, 0xd3, 0x88,
1030 	0xef, 0xfa, 0x21, 0xeb, 0xb4, 0x33, 0x75, 0x69,
1031 	0x7d, 0xe9, 0x27, 0x1c, 0x03, 0xcf, 0x90, 0xcf,
1032 	0xf0, 0xaa, 0x3e, 0x01, 0x41, 0x24, 0xdc, 0x01,
1033 	0x5a, 0xe8, 0x92, 0xea, 0xde, 0x87, 0xbf, 0x75,
1034 	0xe4, 0x0b, 0xf7, 0xa3, 0x42, 0x27, 0xc4, 0xde,
1035 	0x01, 0x6f, 0x5c, 0xec, 0x6d, 0x37, 0x38, 0xd7,
1036 	0x4f, 0x85, 0xc0, 0xc2, 0x3a, 0xa7, 0x2d, 0x15,
1037 	0xd5, 0x1c, 0xee, 0x15, 0x13, 0x7a, 0x4e, 0x33,
1038 	0xc7, 0x59, 0x93, 0x73, 0xe9, 0xf5, 0x39, 0xb0,
1039 	0xad, 0x8b, 0x61, 0xca, 0x4d, 0x31, 0xaa, 0x44,
1040 	0xf6, 0x5c, 0xb7, 0x99, 0xe5, 0x92, 0x3d, 0x47,
1041 	0x79, 0x9b, 0x29, 0x16, 0xe1, 0x2c, 0x30, 0x8b,
1042 	0x1e, 0x17, 0xf0, 0x91, 0x59, 0x00, 0xab, 0x6d,
1043 	0x4d, 0xa7, 0x4d, 0x96, 0xc3, 0xe4, 0x3d, 0x17,
1044 	0x5c, 0x8e, 0xfc, 0x59, 0x48, 0xd4, 0xdd, 0xf4,
1045 	0xea, 0x3a, 0x68, 0xc8, 0xb1, 0x74, 0x69, 0xcb,
1046 	0x49, 0x1a, 0xec, 0x24, 0x4e, 0x7e, 0xe9, 0xba,
1047 	0x75, 0xfb, 0x52, 0x85, 0x75, 0xe9, 0x41, 0x9a,
1048 	0xc6, 0x40, 0x9c, 0x92, 0x3f, 0xe8, 0x99, 0x81,
1049 	0x84, 0x14, 0x2b, 0x62, 0x94, 0xba, 0x56, 0x00,
1050 	0xde, 0x88, 0xe1, 0x35, 0xea, 0x25, 0x88, 0xd1,
1051 	0xce, 0xd4, 0xfc, 0xde, 0xee, 0x1a, 0xfd, 0xb1,
1052 	0xa7, 0x46, 0x9d, 0x0c, 0x99, 0xa6, 0xab, 0x23,
1053 	0x55, 0x2f, 0x46, 0xd7, 0xb3, 0xcd, 0x2c, 0xab,
1054 	0x93, 0x3e, 0xdb, 0xe2, 0x34, 0x69, 0x1a, 0x56,
1055 	0x21, 0x92, 0x56, 0xf4, 0x05, 0xe1, 0x24, 0xee,
1056 	0x4d, 0x5e, 0x89, 0xeb, 0x23, 0x26, 0xdc, 0x14,
1057 	0xde, 0x56, 0x3f, 0x0c, 0x15, 0x3e, 0x42, 0x71,
1058 	0x9b, 0xe8, 0xc5, 0xfd, 0x5e, 0x4a, 0xb6, 0xd9,
1059 	0xa0, 0x18, 0x5d, 0xbd, 0xef, 0x80, 0xb4, 0xf6,
1060 	0x1e, 0x56, 0x2a, 0x57, 0x13, 0xba, 0x24, 0xa4,
1061 	0x6f, 0x4c, 0xd4, 0xaa, 0x31, 0x5e, 0x69, 0x26,
1062 	0xd2, 0xee, 0xef, 0x7f, 0x83, 0x9c, 0x8e, 0x6a,
1063 	0x17, 0xe3, 0xda, 0xf4, 0x59, 0xad, 0x26, 0x83,
1064 	0x53, 0x4c, 0x0d, 0x62, 0xe5, 0x9a, 0x30, 0xc5,
1065 	0x0a, 0xa8, 0xb1, 0x3b, 0x1b, 0x41, 0x5c, 0x74,
1066 	0x42, 0x7b, 0x0c, 0x9e, 0x3c, 0x12, 0x04, 0x46,
1067 	0xc3, 0xc7, 0x10, 0xea, 0xf1, 0x3b, 0xb1, 0x01,
1068 	0xfe, 0x1b, 0xe8, 0xf8, 0x42, 0xbc, 0xe9, 0x11,
1069 	0x9b, 0x63, 0x29, 0x99, 0x18, 0x79, 0x9e, 0xd2,
1070 	0xbf, 0x9d, 0x93, 0x4d, 0x16, 0x0f, 0x14, 0x41,
1071 	0xb6, 0x0c, 0xa5, 0x07, 0x13, 0x29, 0x21, 0x0d,
1072 	0x8f, 0xf9, 0x0a, 0x0a, 0x54, 0xaf, 0xa6, 0x22,
1073 	0x25, 0x79, 0x07, 0xe5, 0x3e, 0x49, 0x6b, 0x12,
1074 	0x9e, 0xfc, 0x91, 0xdb, 0xf3, 0x7c, 0xdf, 0x03,
1075 	0x9c, 0x78, 0xa7, 0xc3, 0x5e, 0x14, 0xde, 0xb5,
1076 	0x6a, 0x7b, 0x3b, 0xe3, 0x4f, 0x8a, 0x49, 0xce,
1077 	0xc9, 0x14, 0x29, 0x96, 0x84, 0xca, 0xe1, 0x49,
1078 	0x41, 0x73, 0xb3, 0x2a, 0xbe, 0x37, 0xb6, 0x2d,
1079 	0xff, 0xf2, 0x8e, 0x3d, 0x02, 0xeb, 0xd4, 0xd3,
1080 	0x15, 0x8f, 0xc0, 0x00, 0x91, 0xd5, 0xe7, 0x76,
1081 	0xf5, 0x6e, 0x81, 0x38, 0x38, 0x07, 0xa6, 0xe8,
1082 	0x72, 0x14, 0x3b, 0x36, 0xef, 0xbc, 0x5b, 0x26,
1083 	0xb0, 0x60, 0x25, 0x49, 0x7e, 0xfc, 0xd8, 0x3b,
1084 	0x63, 0xdc, 0x7f, 0x80, 0xd5, 0x43, 0x78, 0xbb,
1085 	0xf1, 0xf9, 0x3e, 0x75, 0x1d, 0x58, 0xb2, 0xc7,
1086 	0xb6, 0x52, 0xfb, 0xe7, 0x42, 0xef, 0x87, 0xfd,
1087 	0x3a, 0x02, 0x7a, 0xf9, 0xbc, 0xa8, 0x2f, 0xd6,
1088 	0xc1, 0x5f, 0xa4, 0x57, 0x62, 0x83, 0x82, 0x8e,
1089 	0x1e, 0xbb, 0x85, 0xf7, 0x1b, 0x2e, 0xe2, 0xb0,
1090 };
1091 
1092 /*
1093  * IV method encblkno8, blkno 1.
1094  */
1095 static const uint8_t bf_cbc_256_encblkno8_vec1_ctxt[SECSIZE] = {
1096 	0x2b, 0xf6, 0xd4, 0x61, 0x3b, 0x1f, 0x5b, 0xe9,
1097 	0x32, 0xab, 0x27, 0xa1, 0xaf, 0x5e, 0xf4, 0xa7,
1098 	0xaa, 0xc5, 0x2a, 0x3c, 0x0d, 0x34, 0xd8, 0xb3,
1099 	0xfd, 0xb2, 0xca, 0xfb, 0x3c, 0x38, 0x96, 0x71,
1100 	0x47, 0xaa, 0xa7, 0x2f, 0x48, 0x2c, 0x39, 0x88,
1101 	0x2d, 0xc6, 0xb1, 0xf7, 0xc7, 0x2d, 0xda, 0xe9,
1102 	0xfb, 0x4f, 0x9b, 0x1f, 0xe1, 0x0c, 0x24, 0x89,
1103 	0xfe, 0x70, 0xe0, 0xb2, 0x51, 0x89, 0x51, 0xa9,
1104 	0xae, 0xd1, 0x92, 0x4f, 0x56, 0x5c, 0x2a, 0xf4,
1105 	0xbc, 0x4e, 0x77, 0x4a, 0xb8, 0xab, 0x02, 0x76,
1106 	0xef, 0x69, 0xfb, 0x5e, 0x06, 0xb5, 0xff, 0x31,
1107 	0xce, 0x2b, 0xfc, 0x48, 0x4c, 0x82, 0xe9, 0x3c,
1108 	0x61, 0x69, 0x68, 0x1d, 0xb1, 0xc6, 0x40, 0x10,
1109 	0xd7, 0x0e, 0xd2, 0x26, 0x33, 0x5b, 0x0b, 0xe7,
1110 	0xc2, 0xbe, 0xf4, 0x24, 0x1a, 0xa6, 0x70, 0x31,
1111 	0xa7, 0x15, 0x76, 0xc7, 0x90, 0x8d, 0x60, 0xe0,
1112 	0xee, 0x5b, 0x73, 0xa9, 0xe1, 0xe1, 0xaf, 0xf0,
1113 	0x5e, 0x6f, 0x32, 0x98, 0x92, 0xbe, 0x24, 0x81,
1114 	0x26, 0x9f, 0xb8, 0x67, 0xd0, 0xca, 0x9d, 0x8f,
1115 	0x14, 0xc8, 0x81, 0x2e, 0x57, 0x1c, 0x3a, 0xe0,
1116 	0xdb, 0x49, 0xad, 0x47, 0x51, 0x07, 0x7d, 0xec,
1117 	0xbc, 0xa5, 0x8f, 0xdf, 0x84, 0xe4, 0xdf, 0x76,
1118 	0x8f, 0x0b, 0xef, 0xc4, 0x41, 0xd5, 0x7c, 0xf5,
1119 	0x3c, 0x21, 0x62, 0xc0, 0x1f, 0xbd, 0x39, 0xbe,
1120 	0xe5, 0x75, 0x64, 0xcd, 0xa4, 0xa0, 0x03, 0xf4,
1121 	0x8a, 0x16, 0x3e, 0xde, 0x79, 0x9a, 0x96, 0xff,
1122 	0xf2, 0xbe, 0x88, 0xfd, 0xac, 0xc1, 0x9d, 0x5b,
1123 	0xbf, 0x2f, 0xde, 0xf0, 0x26, 0x2f, 0xc9, 0x45,
1124 	0xbd, 0x26, 0xa5, 0x2c, 0x3c, 0x12, 0x8b, 0xc0,
1125 	0xc8, 0x7a, 0x71, 0xbb, 0xc3, 0xe9, 0xf6, 0x15,
1126 	0x01, 0x6e, 0x94, 0x37, 0xbc, 0xc5, 0x9a, 0x93,
1127 	0x6f, 0x9c, 0x04, 0x7e, 0xe9, 0xb2, 0xba, 0xe8,
1128 	0x86, 0xa1, 0x9c, 0x1f, 0x4b, 0x77, 0x6f, 0x99,
1129 	0x2d, 0x8f, 0x23, 0x34, 0x32, 0x1a, 0x82, 0x2d,
1130 	0x32, 0x41, 0x3e, 0xb8, 0x6a, 0x67, 0xa9, 0x81,
1131 	0xd5, 0x1b, 0x76, 0x9f, 0xd1, 0xb0, 0x06, 0xaf,
1132 	0x10, 0x9e, 0x00, 0x2e, 0xb3, 0x80, 0xde, 0xae,
1133 	0xf2, 0x96, 0x12, 0x5b, 0xe7, 0xc7, 0x25, 0xb7,
1134 	0xd9, 0x1c, 0x04, 0xe5, 0x05, 0xaf, 0x77, 0xfa,
1135 	0x6d, 0xa8, 0x04, 0x74, 0xf8, 0x9c, 0x09, 0xcf,
1136 	0xe2, 0xc2, 0xd1, 0xb6, 0xac, 0xed, 0xb4, 0xbc,
1137 	0x2e, 0xc2, 0xf6, 0x3c, 0xc4, 0x47, 0xc8, 0x81,
1138 	0x3a, 0x50, 0x3c, 0x5c, 0x7c, 0x86, 0x17, 0x22,
1139 	0xe7, 0xa3, 0xff, 0x73, 0x5e, 0x91, 0xbf, 0xb3,
1140 	0x59, 0x07, 0xb7, 0xa4, 0xd5, 0x1b, 0x5c, 0xce,
1141 	0x56, 0xde, 0x5f, 0xae, 0x89, 0xcb, 0x6a, 0xfe,
1142 	0xaf, 0xe7, 0xd4, 0x34, 0x8d, 0x18, 0x22, 0x4d,
1143 	0xd9, 0x91, 0xa6, 0xec, 0x97, 0x0e, 0x29, 0x4d,
1144 	0xf6, 0xd8, 0xb3, 0x50, 0x1c, 0xc9, 0x66, 0x9d,
1145 	0x2e, 0x5e, 0x27, 0xce, 0x36, 0xcb, 0x47, 0x35,
1146 	0x41, 0x16, 0x0c, 0x4e, 0x73, 0x90, 0x52, 0xc5,
1147 	0x65, 0xb8, 0x0c, 0xdc, 0x36, 0x8d, 0xdc, 0xca,
1148 	0x97, 0x0b, 0xbc, 0xcb, 0x79, 0xc7, 0x4c, 0xd2,
1149 	0x21, 0x5c, 0xbd, 0xeb, 0xea, 0xfb, 0x87, 0xe1,
1150 	0xe0, 0x75, 0x39, 0xb9, 0x84, 0x1e, 0xa7, 0xfe,
1151 	0x7d, 0x41, 0x75, 0x15, 0x88, 0x98, 0xd4, 0x80,
1152 	0x42, 0x57, 0xb5, 0x65, 0xbf, 0xb8, 0xbd, 0x19,
1153 	0x28, 0xd8, 0xa7, 0x6c, 0xe7, 0xc1, 0x00, 0xdc,
1154 	0xde, 0xcb, 0x30, 0x3d, 0x29, 0x5e, 0xa6, 0x9c,
1155 	0xbb, 0xb8, 0xec, 0x28, 0x23, 0x36, 0x23, 0x27,
1156 	0xee, 0xdd, 0x24, 0x7d, 0x9a, 0xc9, 0xb5, 0x3c,
1157 	0x7a, 0x3f, 0x1d, 0xd9, 0x32, 0x47, 0xc0, 0x4d,
1158 	0x86, 0x9b, 0x2d, 0xa9, 0x5c, 0x93, 0x90, 0x51,
1159 	0x70, 0xe6, 0x8f, 0x35, 0x96, 0xe0, 0x11, 0x00,
1160 };
1161 
1162 /*
1163  * IV method encblkno8, blkno 2.
1164  */
1165 static const uint8_t bf_cbc_256_encblkno8_vec2_ctxt[SECSIZE] = {
1166 	0x28, 0x93, 0x0f, 0x23, 0xfb, 0xa4, 0x9e, 0xe5,
1167 	0x11, 0x38, 0x2b, 0xbd, 0x8d, 0x2d, 0xdb, 0x11,
1168 	0xfa, 0xac, 0x74, 0x28, 0x95, 0x29, 0xf2, 0x92,
1169 	0x8d, 0x00, 0x8a, 0x8a, 0x04, 0x92, 0x92, 0x33,
1170 	0x8c, 0x4b, 0x29, 0x8e, 0xde, 0x59, 0xf4, 0x72,
1171 	0xae, 0x2f, 0xe4, 0xe9, 0xd4, 0xe4, 0xb6, 0x69,
1172 	0xc5, 0x1b, 0xbe, 0x02, 0x85, 0x4b, 0x24, 0x1e,
1173 	0x79, 0xb9, 0x22, 0x29, 0x4c, 0x60, 0x8c, 0xc5,
1174 	0x03, 0x1d, 0x79, 0xfe, 0x3d, 0x9e, 0x47, 0xb6,
1175 	0xf7, 0x17, 0x65, 0x24, 0x15, 0x5d, 0x75, 0x4d,
1176 	0xdb, 0xbc, 0x68, 0x67, 0x3b, 0xc3, 0x5a, 0x7e,
1177 	0x9d, 0x98, 0x67, 0xe4, 0x8f, 0x9a, 0xd1, 0x31,
1178 	0xe0, 0x26, 0xa1, 0x68, 0xbe, 0x53, 0x73, 0x7c,
1179 	0xfd, 0xce, 0x6c, 0xd6, 0x1f, 0x51, 0xe6, 0x84,
1180 	0x54, 0x7a, 0xe3, 0x7f, 0x7c, 0x8f, 0x2f, 0x88,
1181 	0x58, 0xfe, 0x5e, 0x82, 0x11, 0xc9, 0xa5, 0x89,
1182 	0xa4, 0x49, 0x92, 0x21, 0x0f, 0x03, 0xdb, 0x16,
1183 	0xc4, 0xc0, 0x80, 0xb7, 0x16, 0x4c, 0x29, 0xbe,
1184 	0x18, 0xfa, 0x2d, 0xdf, 0x4a, 0x23, 0x34, 0x9a,
1185 	0x27, 0xea, 0xed, 0x95, 0x25, 0x14, 0xa8, 0x2e,
1186 	0x17, 0x59, 0x04, 0xb0, 0x5c, 0x6d, 0xc7, 0xeb,
1187 	0xed, 0xf6, 0x73, 0xae, 0x18, 0x0e, 0x4b, 0xec,
1188 	0xc6, 0xb7, 0x39, 0xe7, 0x62, 0xf0, 0x84, 0x30,
1189 	0x10, 0xb6, 0xf3, 0x27, 0x6d, 0xfe, 0x32, 0xe7,
1190 	0xfe, 0xff, 0x43, 0xba, 0x89, 0xfe, 0x24, 0xa8,
1191 	0x0e, 0x7c, 0xf2, 0x23, 0x9d, 0x66, 0x6f, 0x9c,
1192 	0xe6, 0x88, 0xbc, 0x3f, 0x44, 0x4c, 0x73, 0x13,
1193 	0x77, 0x95, 0x6f, 0xcb, 0xc8, 0xa5, 0x7a, 0xa9,
1194 	0xeb, 0xe1, 0x0f, 0x9e, 0x25, 0xbe, 0x99, 0x1a,
1195 	0x99, 0x7f, 0xbb, 0xec, 0x89, 0x91, 0x3e, 0x52,
1196 	0xb5, 0xac, 0xc9, 0xd3, 0xea, 0xb0, 0xf2, 0x0c,
1197 	0xc8, 0x58, 0x4b, 0x93, 0xa3, 0x9f, 0xad, 0x5a,
1198 	0x80, 0x4e, 0x02, 0x20, 0x9d, 0xac, 0x4b, 0xe0,
1199 	0x59, 0x4d, 0xb5, 0x51, 0x07, 0xf5, 0xa6, 0xb3,
1200 	0xc9, 0x20, 0x58, 0x7e, 0x45, 0xec, 0x58, 0xea,
1201 	0x49, 0xbb, 0x03, 0xf5, 0x6c, 0xdd, 0xcc, 0xa3,
1202 	0x13, 0x21, 0x79, 0xc9, 0xc2, 0x92, 0x60, 0xd5,
1203 	0xb2, 0x3b, 0x74, 0xbc, 0x57, 0xa6, 0x70, 0x36,
1204 	0x75, 0xf5, 0x01, 0xd1, 0xb2, 0xe9, 0xfd, 0xc5,
1205 	0x93, 0x5e, 0x60, 0x6b, 0xfd, 0xd2, 0x56, 0xc0,
1206 	0x1f, 0xe4, 0xcd, 0x4c, 0xfa, 0xc4, 0xd8, 0xc2,
1207 	0x2d, 0xf9, 0x9f, 0x82, 0x0f, 0x40, 0x7b, 0xad,
1208 	0x35, 0x63, 0x95, 0x7e, 0x49, 0x4a, 0xfe, 0x8f,
1209 	0xaa, 0x57, 0x3a, 0x0c, 0x59, 0x69, 0xe7, 0xb8,
1210 	0xfc, 0x71, 0x5c, 0x4f, 0x18, 0x12, 0xe5, 0xef,
1211 	0xdb, 0x1f, 0x66, 0x9a, 0xe2, 0x1a, 0x92, 0x1f,
1212 	0xfe, 0x20, 0x81, 0xe5, 0x83, 0x97, 0xfb, 0xaf,
1213 	0xeb, 0x31, 0x6c, 0x81, 0xf2, 0x2f, 0xf4, 0x41,
1214 	0xf1, 0xd9, 0x61, 0xfb, 0x36, 0x4e, 0xab, 0xc5,
1215 	0x8b, 0x9c, 0x37, 0xea, 0x88, 0xeb, 0x1e, 0x4c,
1216 	0x84, 0x1a, 0xac, 0x4c, 0x19, 0x39, 0x51, 0x53,
1217 	0xe0, 0x50, 0xb0, 0xdf, 0xe6, 0xc5, 0xbb, 0x80,
1218 	0x06, 0x30, 0x14, 0xf5, 0x0e, 0x73, 0xd2, 0xdb,
1219 	0x19, 0x45, 0x30, 0xdc, 0xd0, 0x4d, 0xe6, 0xd6,
1220 	0x0e, 0x2d, 0x77, 0xa3, 0xb3, 0x27, 0xda, 0x99,
1221 	0x62, 0x88, 0x35, 0xba, 0x64, 0x15, 0xec, 0xaf,
1222 	0x70, 0x97, 0x94, 0x81, 0x30, 0x6d, 0x63, 0x42,
1223 	0x71, 0x3e, 0x06, 0xec, 0x50, 0x96, 0x87, 0x59,
1224 	0xe7, 0x26, 0x9c, 0xcf, 0xc7, 0xe7, 0x62, 0x82,
1225 	0x3b, 0xd7, 0xfe, 0xb4, 0x48, 0x45, 0x9d, 0x54,
1226 	0x18, 0x15, 0x13, 0x74, 0x92, 0x6f, 0x43, 0xb3,
1227 	0xa9, 0x82, 0xd4, 0xc2, 0xef, 0x61, 0x9d, 0x5e,
1228 	0x1d, 0xc6, 0x80, 0xd3, 0xe9, 0xdd, 0x52, 0x9c,
1229 	0x4d, 0x04, 0x05, 0xa0, 0x43, 0x36, 0xb6, 0x89,
1230 };
1231 
1232 /*
1233  * IV method encblkno8, blkno 3.
1234  */
1235 static const uint8_t bf_cbc_256_encblkno8_vec3_ctxt[SECSIZE] = {
1236 	0x60, 0x91, 0x19, 0x89, 0xee, 0xac, 0x12, 0xe5,
1237 	0x60, 0x6c, 0xfd, 0xf9, 0xe4, 0xc6, 0xc9, 0xbd,
1238 	0x75, 0xe1, 0xa5, 0xe6, 0xf4, 0xed, 0x4b, 0xf4,
1239 	0x16, 0xf4, 0x57, 0xa4, 0xe6, 0x60, 0x8e, 0x1b,
1240 	0x97, 0x0e, 0xd5, 0x09, 0xa1, 0x3c, 0x6c, 0xe8,
1241 	0x91, 0xaf, 0x19, 0x96, 0x2a, 0x7b, 0x77, 0x30,
1242 	0xc7, 0x99, 0xe6, 0xaa, 0xb0, 0xe2, 0x29, 0x1c,
1243 	0x39, 0x54, 0x1c, 0x0a, 0x4a, 0x51, 0xa2, 0xa2,
1244 	0x22, 0x96, 0x05, 0x8b, 0x12, 0x80, 0x16, 0x28,
1245 	0xdc, 0xfa, 0x22, 0x90, 0xa4, 0x33, 0xb1, 0x84,
1246 	0x13, 0x52, 0x5d, 0xb5, 0xd4, 0xe8, 0x60, 0x18,
1247 	0x6a, 0xb8, 0x1b, 0xdb, 0xb4, 0x69, 0xf6, 0x09,
1248 	0x95, 0x71, 0xdd, 0x43, 0x21, 0xad, 0x7e, 0xf7,
1249 	0x8e, 0x7a, 0x0d, 0xf0, 0x52, 0x54, 0xb8, 0xdc,
1250 	0x7d, 0x72, 0x29, 0x97, 0x2b, 0x9c, 0x2c, 0xef,
1251 	0xc3, 0x26, 0x68, 0x72, 0xae, 0x29, 0x0f, 0x67,
1252 	0xbf, 0xea, 0x92, 0x27, 0xd1, 0xba, 0x8d, 0x32,
1253 	0x8b, 0x26, 0x91, 0x30, 0x88, 0xcc, 0x47, 0xaf,
1254 	0x54, 0x8c, 0x88, 0x88, 0x2f, 0x59, 0x76, 0x34,
1255 	0x43, 0x35, 0x44, 0xc3, 0x16, 0x28, 0x62, 0x4b,
1256 	0xbb, 0x47, 0x99, 0x7c, 0x26, 0x51, 0xe2, 0x7d,
1257 	0xd8, 0x2c, 0x35, 0xf4, 0x24, 0xf1, 0x5b, 0x01,
1258 	0xcc, 0x9a, 0x54, 0xd8, 0xc1, 0x73, 0x85, 0x83,
1259 	0xdd, 0x0d, 0xd5, 0x75, 0xac, 0x67, 0x68, 0x59,
1260 	0x3e, 0x6e, 0x9a, 0x4a, 0x7f, 0xbd, 0x85, 0xeb,
1261 	0x36, 0x3e, 0xfd, 0x03, 0xfe, 0x2b, 0xe6, 0x97,
1262 	0x16, 0x6b, 0xd0, 0x22, 0xb1, 0x00, 0xcc, 0x7c,
1263 	0x03, 0xb1, 0x7c, 0x23, 0x7a, 0xca, 0x5e, 0x0b,
1264 	0xba, 0x37, 0xa6, 0x08, 0x5b, 0xa6, 0x2b, 0x57,
1265 	0x58, 0x0b, 0x5a, 0x58, 0x91, 0x3c, 0xf9, 0x46,
1266 	0x05, 0x03, 0x0a, 0x9b, 0xca, 0x2d, 0x71, 0xe2,
1267 	0xbb, 0x1e, 0xd3, 0xc5, 0xc2, 0xb4, 0xde, 0x7b,
1268 	0xbb, 0x8b, 0x45, 0x39, 0xf5, 0x3d, 0xa2, 0xe5,
1269 	0xb1, 0x40, 0x3b, 0x9e, 0x47, 0x93, 0xf9, 0x9c,
1270 	0x50, 0x5c, 0x9b, 0x8d, 0x18, 0x47, 0xd3, 0xe8,
1271 	0x61, 0xbc, 0x93, 0xdc, 0xf7, 0x20, 0x5a, 0x00,
1272 	0x0e, 0xb8, 0xee, 0x5e, 0x83, 0x06, 0x48, 0x06,
1273 	0x91, 0x08, 0x9e, 0x9c, 0x73, 0x6d, 0xb9, 0x31,
1274 	0x62, 0xdc, 0x8a, 0x37, 0x17, 0x47, 0x2f, 0x0f,
1275 	0xc0, 0x02, 0x02, 0xf3, 0x06, 0x26, 0x6c, 0x9d,
1276 	0x96, 0x9f, 0xb0, 0xb3, 0x3b, 0x72, 0x18, 0x59,
1277 	0xf4, 0xb7, 0x26, 0xcc, 0xa4, 0x46, 0xdb, 0x51,
1278 	0xad, 0xed, 0xd8, 0x3a, 0xc4, 0x3a, 0x09, 0x30,
1279 	0x72, 0xd9, 0x2c, 0xfe, 0x5f, 0xa8, 0x46, 0x75,
1280 	0xf7, 0xba, 0x46, 0x1e, 0x7e, 0x4c, 0xd6, 0xdd,
1281 	0x92, 0x2b, 0x23, 0xc6, 0x59, 0x19, 0xda, 0x9a,
1282 	0x01, 0x9c, 0x5c, 0xc1, 0xaa, 0xcf, 0x6d, 0xd0,
1283 	0xa5, 0x06, 0xc7, 0x5e, 0x6b, 0x60, 0x64, 0x9f,
1284 	0xfe, 0xa8, 0x3f, 0x64, 0xa8, 0xed, 0xf8, 0x62,
1285 	0xd7, 0x6d, 0x34, 0x41, 0x3e, 0x5e, 0x74, 0xc7,
1286 	0xe6, 0x62, 0xb1, 0x5a, 0xec, 0x6a, 0xc1, 0x71,
1287 	0x19, 0xf3, 0xf1, 0xe7, 0x46, 0x13, 0xd6, 0xb6,
1288 	0x5a, 0xf4, 0xca, 0x3f, 0xe3, 0xa1, 0x1f, 0xe4,
1289 	0xda, 0xd6, 0x0c, 0x62, 0x6a, 0x33, 0x42, 0x99,
1290 	0x6f, 0x5d, 0x3a, 0xe0, 0xe7, 0xfa, 0x2d, 0x47,
1291 	0x4a, 0xec, 0xaa, 0x71, 0xb5, 0xeb, 0x62, 0xb8,
1292 	0x31, 0x34, 0x07, 0x44, 0xa2, 0x18, 0xec, 0x76,
1293 	0xf7, 0x77, 0x56, 0x86, 0xc7, 0xe0, 0x1e, 0x8e,
1294 	0xec, 0x16, 0x2b, 0xeb, 0xff, 0xaa, 0xba, 0x83,
1295 	0x1f, 0xdc, 0x32, 0x23, 0x27, 0xea, 0xea, 0x0c,
1296 	0x3a, 0x5f, 0x2b, 0xb4, 0xee, 0x0c, 0xf2, 0x73,
1297 	0xbb, 0x59, 0x9b, 0x73, 0xf7, 0xfa, 0xe1, 0x1f,
1298 	0x3b, 0xdb, 0x40, 0x29, 0xf0, 0x6c, 0xbe, 0x8f,
1299 	0x2e, 0xd0, 0x83, 0xf7, 0xe8, 0x2a, 0x81, 0x82,
1300 };
1301 
1302 const struct testvec bf_cbc_256_8_vectors[] = {
1303 	{
1304 		.blkno = 0,
1305 		.ptxt = bf_cbc_ptxt,
1306 		.ctxt = bf_cbc_256_encblkno8_vec0_ctxt,
1307 	},
1308 	{
1309 		.blkno = 1,
1310 		.ptxt = bf_cbc_ptxt,
1311 		.ctxt = bf_cbc_256_encblkno8_vec1_ctxt,
1312 	},
1313 	{
1314 		.blkno = 2,
1315 		.ptxt = bf_cbc_ptxt,
1316 		.ctxt = bf_cbc_256_encblkno8_vec2_ctxt,
1317 	},
1318 	{
1319 		.blkno = 3,
1320 		.ptxt = bf_cbc_ptxt,
1321 		.ctxt = bf_cbc_256_encblkno8_vec3_ctxt,
1322 	},
1323 };
1324 
1325 /*
1326  * IV method encblkno1, blkno 0.
1327  */
1328 static const uint8_t bf_cbc_448_encblkno1_vec0_ctxt[SECSIZE] = {
1329 	0xb0, 0x1b, 0x43, 0xc9, 0x84, 0x53, 0x51, 0x72,
1330 	0x1f, 0x93, 0x62, 0x94, 0x13, 0x1f, 0xe3, 0xc1,
1331 	0x30, 0xee, 0xc4, 0x35, 0x98, 0xb8, 0x11, 0x9b,
1332 	0xd1, 0x23, 0xfa, 0x2d, 0xc1, 0xe6, 0xf3, 0x8f,
1333 	0x8b, 0x05, 0x8d, 0xc5, 0x1d, 0xc3, 0x29, 0x1a,
1334 	0xff, 0x08, 0xb0, 0x97, 0x88, 0x50, 0x8f, 0x41,
1335 	0x66, 0xc6, 0x70, 0x37, 0xca, 0xb2, 0xcd, 0x91,
1336 	0x89, 0x41, 0x1b, 0x42, 0xce, 0x02, 0xec, 0xe8,
1337 	0x9b, 0xf3, 0x50, 0x95, 0x5f, 0xba, 0xda, 0xd5,
1338 	0x0c, 0x2f, 0x29, 0x2a, 0x14, 0x96, 0x4a, 0x60,
1339 	0x04, 0x43, 0x62, 0x80, 0x89, 0xcf, 0xfd, 0xb6,
1340 	0xc7, 0x2d, 0xb2, 0xac, 0xce, 0x51, 0xf5, 0xd1,
1341 	0xcd, 0x41, 0x59, 0x8b, 0xf5, 0x02, 0x2d, 0xe8,
1342 	0xc4, 0xee, 0xe9, 0x40, 0x6f, 0xcd, 0xbe, 0x3b,
1343 	0xd0, 0x8d, 0x3e, 0x6c, 0x42, 0x2a, 0x17, 0xfd,
1344 	0x78, 0xf6, 0xb2, 0xde, 0x69, 0x81, 0xbb, 0xae,
1345 	0xd9, 0x1f, 0x49, 0xa6, 0x4c, 0x5a, 0xe9, 0x94,
1346 	0x49, 0x9b, 0x7e, 0x32, 0x6d, 0x11, 0xea, 0x88,
1347 	0xda, 0xf0, 0xc7, 0x8d, 0x07, 0x98, 0xab, 0xc7,
1348 	0xf3, 0xcf, 0x2e, 0xda, 0x27, 0x44, 0x68, 0xc7,
1349 	0xdc, 0xda, 0x00, 0xd0, 0x6d, 0x64, 0x5b, 0x39,
1350 	0x46, 0x3d, 0x98, 0x24, 0xee, 0x3b, 0x36, 0x23,
1351 	0x62, 0xf6, 0x8e, 0xb9, 0x8d, 0xc1, 0x9a, 0x7b,
1352 	0xd7, 0x03, 0x6b, 0xb7, 0x81, 0x19, 0xec, 0x2f,
1353 	0x0c, 0x0b, 0x32, 0x5a, 0xb3, 0x25, 0xf5, 0xcc,
1354 	0xa3, 0x60, 0xe6, 0x4e, 0x03, 0xcd, 0xdc, 0x67,
1355 	0xe5, 0x26, 0xda, 0xe0, 0x1f, 0x33, 0x99, 0xc3,
1356 	0x43, 0x8c, 0x9c, 0x1a, 0x85, 0xb1, 0x15, 0x04,
1357 	0xc1, 0x06, 0xd1, 0x2d, 0xc9, 0x67, 0x72, 0xe7,
1358 	0xd6, 0x6d, 0x1f, 0x22, 0x56, 0x56, 0xfa, 0x8a,
1359 	0xd7, 0x16, 0x37, 0x3f, 0x3e, 0x67, 0xa5, 0xb7,
1360 	0xee, 0x3e, 0xd2, 0x38, 0xd5, 0xce, 0xa9, 0x62,
1361 	0x82, 0x17, 0xae, 0xae, 0x62, 0xe6, 0xb7, 0xf2,
1362 	0x73, 0xf1, 0xc1, 0xb7, 0xe9, 0x62, 0x79, 0x3b,
1363 	0x3b, 0x3f, 0xaa, 0x0d, 0x42, 0x03, 0x35, 0x3f,
1364 	0x5d, 0xa4, 0xba, 0x02, 0x23, 0x65, 0x40, 0x0e,
1365 	0x61, 0x31, 0xc9, 0xd5, 0x79, 0x36, 0x76, 0x7c,
1366 	0x21, 0x4a, 0x75, 0xb2, 0xa0, 0x2b, 0xc1, 0xb8,
1367 	0xba, 0xf8, 0x10, 0x7a, 0x85, 0x32, 0x81, 0xbf,
1368 	0x2d, 0x58, 0x3c, 0x22, 0x2f, 0x0b, 0xce, 0x03,
1369 	0x12, 0xce, 0x13, 0xce, 0x4a, 0x81, 0x77, 0x1d,
1370 	0x68, 0x99, 0xc0, 0x25, 0xeb, 0xd9, 0x80, 0x0d,
1371 	0xe7, 0x17, 0xc8, 0x41, 0xbd, 0x4b, 0x9c, 0xdd,
1372 	0x41, 0x74, 0x90, 0x2a, 0x65, 0x92, 0x05, 0xff,
1373 	0x06, 0x24, 0xeb, 0x89, 0xd8, 0x41, 0xaa, 0x41,
1374 	0xac, 0x8a, 0x31, 0xc6, 0x82, 0x44, 0x12, 0x5a,
1375 	0xd9, 0x1c, 0xca, 0x76, 0x2b, 0x4e, 0xe8, 0x18,
1376 	0x7e, 0x50, 0xf5, 0x8c, 0x7c, 0x11, 0xe7, 0x0e,
1377 	0xfd, 0x08, 0x5e, 0x64, 0x8b, 0x5b, 0x9f, 0x94,
1378 	0x8b, 0x0d, 0x83, 0x7e, 0xef, 0x89, 0x30, 0x4a,
1379 	0x55, 0xce, 0x10, 0x5f, 0x15, 0xd2, 0xe7, 0x07,
1380 	0x0c, 0x34, 0x92, 0xda, 0xae, 0x84, 0x26, 0x28,
1381 	0x36, 0x1a, 0x96, 0xc6, 0xf1, 0x41, 0x2b, 0xb6,
1382 	0x01, 0xfe, 0x20, 0x05, 0x43, 0x80, 0x45, 0xdf,
1383 	0x5c, 0xc2, 0x96, 0xc8, 0x41, 0x68, 0x87, 0x78,
1384 	0xbc, 0xf8, 0x34, 0xfb, 0x19, 0x61, 0xab, 0x7f,
1385 	0x15, 0x56, 0x7f, 0x1a, 0xf5, 0x08, 0xf1, 0x1c,
1386 	0x59, 0x70, 0x92, 0x3a, 0xda, 0x1a, 0xfd, 0xfc,
1387 	0x4d, 0xe1, 0x12, 0x61, 0xc1, 0xd8, 0xdb, 0x63,
1388 	0x6e, 0x6b, 0x19, 0x96, 0x68, 0x17, 0x9b, 0xf5,
1389 	0xa9, 0x5d, 0x2c, 0xaf, 0xad, 0xc6, 0x26, 0x9e,
1390 	0x09, 0xcb, 0x67, 0x4e, 0x50, 0x7d, 0x2f, 0xae,
1391 	0x4e, 0x73, 0xd9, 0x5a, 0xaa, 0x5d, 0x54, 0x20,
1392 	0x7b, 0x77, 0xcf, 0xf8, 0xad, 0x88, 0x6b, 0xc8,
1393 };
1394 
1395 /*
1396  * IV method encblkno1, blkno 1.
1397  */
1398 static const uint8_t bf_cbc_448_encblkno1_vec1_ctxt[SECSIZE] = {
1399 	0x8b, 0x2a, 0xcf, 0x7d, 0x38, 0x1b, 0xaa, 0x33,
1400 	0x1c, 0xe6, 0xa1, 0x37, 0x6e, 0x9e, 0xb3, 0x48,
1401 	0x2a, 0xb8, 0x61, 0x11, 0x00, 0xe5, 0x48, 0xea,
1402 	0xb5, 0x9f, 0x6c, 0xa4, 0xdf, 0x8d, 0x5a, 0xd8,
1403 	0x03, 0x55, 0x4d, 0x07, 0x7d, 0x5f, 0x1b, 0x18,
1404 	0xd1, 0x86, 0x52, 0xc1, 0x13, 0xda, 0x99, 0x23,
1405 	0xeb, 0xab, 0xb2, 0x93, 0x40, 0x7c, 0x6a, 0x8a,
1406 	0xaa, 0xf8, 0xf1, 0x66, 0xf1, 0x10, 0x1d, 0xcd,
1407 	0x25, 0xc7, 0x84, 0x55, 0x02, 0x1d, 0xc0, 0x3c,
1408 	0xba, 0xf4, 0xbf, 0xe2, 0xe4, 0xc3, 0x57, 0xdc,
1409 	0x0d, 0xfd, 0xeb, 0xb3, 0x7d, 0x31, 0x82, 0x6b,
1410 	0x5c, 0x0e, 0x92, 0xa5, 0x42, 0x8b, 0x7f, 0x36,
1411 	0x74, 0x4d, 0xfd, 0x2f, 0xd7, 0x19, 0x0d, 0x23,
1412 	0xa7, 0x36, 0xe8, 0xe4, 0xe5, 0xff, 0xc8, 0x0d,
1413 	0xe1, 0x48, 0x25, 0x79, 0xa9, 0x22, 0xac, 0x72,
1414 	0x86, 0x28, 0xcb, 0x63, 0xa6, 0xa0, 0x46, 0x08,
1415 	0x53, 0xb8, 0x59, 0xab, 0x0f, 0x8f, 0xb1, 0x78,
1416 	0xf8, 0x4e, 0x6d, 0x1a, 0xb5, 0xdd, 0x12, 0x02,
1417 	0x57, 0x55, 0xf8, 0xab, 0x78, 0x7d, 0x75, 0x61,
1418 	0x81, 0x20, 0xd6, 0x4b, 0x7d, 0x76, 0x05, 0xc9,
1419 	0x56, 0xf2, 0xe9, 0x3f, 0xb6, 0xb5, 0x02, 0x2b,
1420 	0x1c, 0x29, 0xbf, 0x07, 0xe9, 0x5f, 0x9b, 0x18,
1421 	0x38, 0x26, 0xa0, 0x09, 0xde, 0x24, 0x5b, 0x37,
1422 	0x72, 0x74, 0xf4, 0x9f, 0x86, 0x28, 0x89, 0xb6,
1423 	0x0c, 0x95, 0x24, 0x2f, 0x88, 0x80, 0x6a, 0xc7,
1424 	0x3a, 0xdc, 0x89, 0xb0, 0xa3, 0xfe, 0x6e, 0x38,
1425 	0xec, 0x0b, 0x1d, 0xbc, 0xd5, 0x90, 0x48, 0xfb,
1426 	0xb1, 0x54, 0xac, 0x6e, 0x35, 0xb0, 0x71, 0x9e,
1427 	0x57, 0x07, 0x81, 0x90, 0xcb, 0x63, 0xb2, 0x7f,
1428 	0x4c, 0x81, 0xe1, 0x58, 0xda, 0x27, 0xef, 0x77,
1429 	0xe7, 0xde, 0x96, 0x83, 0x2a, 0xb1, 0x6b, 0x08,
1430 	0x62, 0x89, 0xdc, 0x3a, 0x3f, 0x08, 0xff, 0xdc,
1431 	0x50, 0x3e, 0xc1, 0xe4, 0x33, 0x8b, 0xad, 0x19,
1432 	0x90, 0x0b, 0x8e, 0xc3, 0x55, 0x77, 0xf0, 0xc2,
1433 	0x24, 0xf9, 0x0c, 0x99, 0x84, 0xb2, 0xcc, 0x23,
1434 	0x8c, 0xab, 0x79, 0x0d, 0xff, 0x75, 0x3a, 0xe0,
1435 	0xc9, 0xe8, 0x1e, 0x15, 0x02, 0xd5, 0x67, 0x8e,
1436 	0x32, 0xe3, 0x1f, 0xda, 0xfb, 0x88, 0xeb, 0xa5,
1437 	0x23, 0xea, 0x1d, 0xaa, 0xc3, 0x62, 0x7f, 0x27,
1438 	0x38, 0x2a, 0xf6, 0xa2, 0x6a, 0x0e, 0x05, 0xff,
1439 	0xe4, 0x63, 0x70, 0xec, 0xf8, 0x25, 0x96, 0x08,
1440 	0xcb, 0x22, 0x2a, 0xaa, 0xbc, 0x45, 0x04, 0xb9,
1441 	0xbc, 0x64, 0x07, 0x09, 0x31, 0xee, 0x5f, 0x9a,
1442 	0xb1, 0x71, 0x85, 0x10, 0x60, 0xfb, 0x3c, 0x56,
1443 	0xeb, 0xfe, 0x91, 0xab, 0x3f, 0x09, 0x76, 0xba,
1444 	0x3c, 0xfc, 0xa6, 0x0d, 0xce, 0x9f, 0x59, 0xd4,
1445 	0x83, 0x8d, 0x98, 0xf5, 0x0d, 0x60, 0x1f, 0xd1,
1446 	0x10, 0x61, 0x77, 0x0d, 0xd1, 0xcd, 0xc2, 0xc2,
1447 	0x2c, 0x7d, 0xf6, 0x15, 0x16, 0x90, 0xc9, 0xc5,
1448 	0x1e, 0xe9, 0xf5, 0x7b, 0xb4, 0x49, 0x47, 0x91,
1449 	0x6a, 0x94, 0x26, 0x94, 0xb3, 0xb5, 0xa7, 0x9e,
1450 	0xcb, 0xb1, 0x9c, 0xb7, 0x5d, 0x25, 0x3c, 0x2d,
1451 	0x8c, 0xa8, 0xa1, 0xb1, 0x79, 0x8e, 0x60, 0xa2,
1452 	0x3e, 0x04, 0xfa, 0x3f, 0xb4, 0x43, 0xde, 0x0a,
1453 	0xde, 0xf4, 0x58, 0xe7, 0xd1, 0x04, 0x1d, 0xb7,
1454 	0x1d, 0xa6, 0xcb, 0x49, 0x41, 0x30, 0xb5, 0x41,
1455 	0xb5, 0x14, 0x19, 0xe4, 0xeb, 0x2c, 0xe2, 0xf0,
1456 	0x66, 0x59, 0xe3, 0xc6, 0xb0, 0xd0, 0x1e, 0xaa,
1457 	0x9f, 0xa5, 0x0b, 0xb8, 0xfd, 0xae, 0x62, 0xcf,
1458 	0x3e, 0xe2, 0xea, 0x79, 0xc5, 0x3e, 0xcf, 0xf0,
1459 	0x40, 0x00, 0x8c, 0x81, 0x97, 0xed, 0xac, 0xf9,
1460 	0x61, 0x75, 0x4e, 0xd7, 0xb7, 0xb2, 0x02, 0x14,
1461 	0x04, 0xf6, 0xbf, 0x25, 0xbe, 0x78, 0x2a, 0xea,
1462 	0xd2, 0x61, 0xf2, 0x7e, 0x45, 0x6b, 0x20, 0xca,
1463 };
1464 
1465 /*
1466  * IV method encblkno1, blkno 2.
1467  */
1468 static const uint8_t bf_cbc_448_encblkno1_vec2_ctxt[SECSIZE] = {
1469 	0x35, 0x34, 0x49, 0x29, 0x12, 0x3f, 0xc6, 0x2f,
1470 	0xc9, 0x3d, 0xc9, 0x54, 0x46, 0xf3, 0x26, 0xf9,
1471 	0x5e, 0x45, 0xb4, 0xba, 0x6d, 0x0f, 0x98, 0x53,
1472 	0x8b, 0x7a, 0x00, 0x47, 0xb6, 0xbd, 0x70, 0x89,
1473 	0x60, 0x8e, 0x52, 0x0b, 0xe3, 0x0a, 0xd8, 0x0e,
1474 	0x48, 0xf3, 0xcc, 0x66, 0x8d, 0x71, 0xaa, 0x0e,
1475 	0xc2, 0x68, 0x03, 0x05, 0xf9, 0xef, 0x1d, 0x14,
1476 	0x5a, 0x85, 0x88, 0x70, 0x77, 0xcf, 0xe3, 0xdf,
1477 	0x18, 0xe5, 0xfb, 0xea, 0xe1, 0xe8, 0xe0, 0x25,
1478 	0xb2, 0x14, 0x61, 0x5d, 0x2f, 0xce, 0x61, 0xec,
1479 	0x68, 0xc8, 0x06, 0x60, 0x41, 0xc1, 0xe3, 0x0a,
1480 	0x5e, 0x96, 0x15, 0x9b, 0x2c, 0x5b, 0xfd, 0xba,
1481 	0x17, 0x2e, 0x50, 0xb6, 0x68, 0x39, 0x21, 0x56,
1482 	0x31, 0x2e, 0xb5, 0x29, 0xff, 0x4a, 0x12, 0x34,
1483 	0x02, 0x54, 0xb1, 0x7f, 0xd8, 0x35, 0xec, 0x79,
1484 	0x9e, 0xef, 0x62, 0xf3, 0x4b, 0x58, 0x96, 0xf1,
1485 	0x83, 0x26, 0x57, 0x3d, 0x55, 0xb9, 0xb0, 0xa7,
1486 	0x48, 0x65, 0x06, 0xee, 0x14, 0x88, 0xb5, 0x58,
1487 	0xc8, 0x4d, 0x6e, 0xd8, 0x44, 0x76, 0x21, 0x16,
1488 	0xa4, 0xdf, 0x68, 0x4b, 0xff, 0x69, 0x23, 0x66,
1489 	0x18, 0x75, 0xe6, 0x29, 0xea, 0x95, 0x87, 0x1c,
1490 	0xed, 0x2d, 0xbd, 0xbf, 0x22, 0x56, 0x11, 0xd5,
1491 	0x59, 0x90, 0x24, 0xd7, 0xae, 0xda, 0x99, 0x49,
1492 	0xe3, 0x23, 0x03, 0x24, 0x3b, 0x02, 0x49, 0x1d,
1493 	0xa5, 0x57, 0x2f, 0xea, 0xd1, 0x6a, 0x17, 0x53,
1494 	0x0f, 0xb3, 0xa9, 0x64, 0x8a, 0xdb, 0x62, 0x17,
1495 	0xad, 0x5c, 0x7d, 0x56, 0x14, 0x0f, 0xfb, 0x14,
1496 	0xbe, 0x7e, 0xa1, 0xa8, 0x27, 0xf0, 0xf0, 0x3a,
1497 	0xe7, 0xc5, 0x26, 0x98, 0x9d, 0x29, 0xf7, 0xfd,
1498 	0x43, 0x13, 0x34, 0xe2, 0xb8, 0x0b, 0x14, 0xe9,
1499 	0x79, 0x66, 0x7a, 0xf2, 0xed, 0x79, 0x37, 0x16,
1500 	0x75, 0x2b, 0xf2, 0x99, 0xa1, 0xba, 0xf1, 0xc1,
1501 	0x61, 0x8d, 0x78, 0x46, 0x3a, 0x67, 0x58, 0x6a,
1502 	0x55, 0x0d, 0x2e, 0x08, 0x47, 0xfc, 0x94, 0x2f,
1503 	0x65, 0xa1, 0x1a, 0xfe, 0x05, 0xfa, 0x41, 0x00,
1504 	0x6c, 0x42, 0xbc, 0x65, 0x37, 0xd9, 0x25, 0x9c,
1505 	0xf4, 0x83, 0x8a, 0xdb, 0x91, 0x96, 0xc5, 0xa9,
1506 	0x02, 0x44, 0xbc, 0x9a, 0x26, 0x9c, 0xd1, 0xfa,
1507 	0x06, 0x8b, 0xd6, 0x40, 0x8f, 0x0a, 0xd2, 0x5b,
1508 	0xd8, 0x57, 0xd5, 0x61, 0x1b, 0x86, 0xa6, 0x49,
1509 	0x15, 0xe4, 0x06, 0x6c, 0x48, 0x24, 0xb8, 0xe3,
1510 	0x23, 0xed, 0xcf, 0x39, 0x44, 0x4d, 0xf0, 0x4e,
1511 	0x89, 0x44, 0x0d, 0x3a, 0xe6, 0x1b, 0x7c, 0x39,
1512 	0xfd, 0x79, 0x0e, 0x78, 0xc7, 0xf6, 0xa3, 0x91,
1513 	0x18, 0x2a, 0xfb, 0x92, 0x48, 0xcc, 0x8b, 0xbb,
1514 	0x33, 0x07, 0x42, 0xf5, 0xd0, 0x01, 0x8b, 0x12,
1515 	0xd9, 0x5e, 0x9d, 0xe4, 0x13, 0x99, 0x11, 0x18,
1516 	0x86, 0x8a, 0xb7, 0xa6, 0xe2, 0x38, 0x34, 0x12,
1517 	0x67, 0xd6, 0x4b, 0xc0, 0x23, 0x56, 0xba, 0x53,
1518 	0xbe, 0x20, 0xe5, 0xec, 0x16, 0xf9, 0x74, 0x92,
1519 	0x62, 0xfc, 0xb9, 0xe8, 0xa3, 0xbf, 0x3b, 0x06,
1520 	0x76, 0xa5, 0xf5, 0x56, 0x81, 0x72, 0x50, 0xc8,
1521 	0x55, 0x80, 0x7d, 0xe1, 0x46, 0x92, 0xa1, 0xeb,
1522 	0x41, 0xaf, 0xce, 0x52, 0xb1, 0xb3, 0x51, 0xf2,
1523 	0xba, 0x03, 0xb4, 0xcb, 0x16, 0xd2, 0x92, 0x3d,
1524 	0x0c, 0x9b, 0xe9, 0xd9, 0x5d, 0xcf, 0x79, 0x05,
1525 	0xbd, 0xe0, 0x44, 0x39, 0xf0, 0x35, 0x2d, 0x7a,
1526 	0x31, 0x3b, 0x24, 0xb3, 0xb4, 0xa5, 0x08, 0xf5,
1527 	0xac, 0x51, 0xf1, 0x09, 0x52, 0x14, 0xc7, 0xb5,
1528 	0xe0, 0x65, 0x47, 0x30, 0xdd, 0xa4, 0xfd, 0x71,
1529 	0x68, 0xa5, 0x4b, 0x00, 0x72, 0xe2, 0xc4, 0xa9,
1530 	0x5d, 0x21, 0x6d, 0x83, 0x4e, 0x88, 0xaa, 0x76,
1531 	0x07, 0xf0, 0xf7, 0x36, 0xa2, 0x5e, 0xd5, 0x4c,
1532 	0x7f, 0x9b, 0x74, 0x89, 0x0a, 0x18, 0xdc, 0x9a,
1533 };
1534 
1535 /*
1536  * IV method encblkno1, blkno 3.
1537  */
1538 static const uint8_t bf_cbc_448_encblkno1_vec3_ctxt[SECSIZE] = {
1539 	0xc3, 0xd3, 0xae, 0x7e, 0x4f, 0xbe, 0x0d, 0x50,
1540 	0xd6, 0x63, 0x2c, 0xa2, 0xfd, 0x07, 0xf1, 0x33,
1541 	0x2a, 0x15, 0x8f, 0xd7, 0x63, 0xb6, 0x5f, 0x04,
1542 	0x69, 0x90, 0xa3, 0x1a, 0xd3, 0xdd, 0xe0, 0x70,
1543 	0xb1, 0xcd, 0xd5, 0xe0, 0x75, 0xd2, 0x31, 0x38,
1544 	0xcc, 0x65, 0xbb, 0xc3, 0x3b, 0xc6, 0xc9, 0x33,
1545 	0x43, 0x9c, 0x32, 0x69, 0x95, 0x10, 0x74, 0x36,
1546 	0x3a, 0x05, 0x9c, 0x26, 0x2f, 0x80, 0x20, 0x92,
1547 	0x74, 0x31, 0xc0, 0xf4, 0xb1, 0x42, 0x58, 0xc8,
1548 	0x3e, 0xaa, 0xd4, 0xba, 0xba, 0x4b, 0x5f, 0x47,
1549 	0x1a, 0x9e, 0x43, 0xaf, 0x25, 0x64, 0x0c, 0x2e,
1550 	0xa3, 0xf5, 0xde, 0x6e, 0x28, 0x5e, 0xb9, 0x9e,
1551 	0xc9, 0xdf, 0x85, 0xda, 0xc9, 0xa8, 0x30, 0xf9,
1552 	0x44, 0x9b, 0x16, 0xcb, 0x4b, 0x47, 0x6f, 0x11,
1553 	0x5c, 0xd7, 0xc9, 0xb7, 0x9c, 0x50, 0x04, 0x3b,
1554 	0x2f, 0x13, 0xab, 0xb6, 0x72, 0xe7, 0x11, 0x29,
1555 	0x35, 0xf3, 0xae, 0x5e, 0x2a, 0xa7, 0x1a, 0xac,
1556 	0xb7, 0x4c, 0x7b, 0x69, 0x89, 0xfc, 0xff, 0x37,
1557 	0x24, 0xf8, 0x65, 0xc0, 0x87, 0x89, 0x69, 0x1e,
1558 	0xa6, 0x7e, 0xe7, 0xb3, 0xb7, 0xa8, 0x42, 0x73,
1559 	0x83, 0xdb, 0x56, 0x4f, 0xce, 0xb9, 0x6e, 0x38,
1560 	0x40, 0x24, 0xb8, 0xdd, 0xab, 0x25, 0x3b, 0xc6,
1561 	0x58, 0xed, 0xc7, 0x2b, 0xe0, 0x11, 0x8b, 0x62,
1562 	0xe8, 0x4f, 0xcf, 0xba, 0x2e, 0xd7, 0x6d, 0xf0,
1563 	0x14, 0xa5, 0xee, 0x24, 0xd3, 0x3a, 0xb4, 0xf2,
1564 	0xdc, 0x0d, 0x79, 0xc6, 0x14, 0x52, 0x14, 0x4b,
1565 	0xd1, 0x8c, 0x18, 0xef, 0x1f, 0xd8, 0xe7, 0x60,
1566 	0xf3, 0x28, 0xce, 0xf1, 0x59, 0xc8, 0x43, 0x02,
1567 	0x0e, 0x08, 0x72, 0xe5, 0x7d, 0x5b, 0xc5, 0x80,
1568 	0xfb, 0xca, 0x2a, 0x63, 0x8d, 0x3c, 0x54, 0x04,
1569 	0x1e, 0xdf, 0x94, 0x53, 0xf8, 0x44, 0xe5, 0xc2,
1570 	0x5c, 0x36, 0xc9, 0x75, 0x1c, 0xa2, 0x98, 0x3d,
1571 	0xd6, 0xee, 0x38, 0xf9, 0xab, 0x2d, 0x1a, 0xdb,
1572 	0x87, 0x2c, 0x86, 0xfd, 0xf9, 0xb2, 0x4d, 0x21,
1573 	0xb7, 0xc0, 0x8f, 0x75, 0x21, 0x53, 0xc7, 0xd7,
1574 	0x3e, 0xc6, 0x6c, 0x98, 0x2c, 0x6d, 0x44, 0x13,
1575 	0x40, 0xea, 0xaa, 0x84, 0xd9, 0x47, 0xfd, 0x65,
1576 	0x2c, 0x3d, 0xb0, 0x76, 0xe7, 0xdd, 0xd7, 0x06,
1577 	0x8a, 0x79, 0xa7, 0x6c, 0x3a, 0x2d, 0x32, 0xf7,
1578 	0xae, 0xe7, 0xd2, 0xb1, 0xf2, 0xe0, 0x3a, 0x10,
1579 	0x19, 0xa1, 0x79, 0x7b, 0x76, 0x0b, 0xeb, 0xf3,
1580 	0x01, 0x6e, 0x9f, 0xa1, 0x5d, 0x16, 0x09, 0xec,
1581 	0x6b, 0x64, 0xe3, 0x96, 0xb8, 0x89, 0x99, 0x8c,
1582 	0x77, 0xcf, 0x3f, 0x37, 0x42, 0x51, 0x82, 0x5a,
1583 	0x63, 0x89, 0x12, 0x12, 0x59, 0x38, 0xe3, 0xcf,
1584 	0xa0, 0xda, 0xbc, 0x69, 0x75, 0x48, 0x7c, 0x3e,
1585 	0x56, 0x75, 0x12, 0x10, 0xc5, 0x96, 0x5b, 0x34,
1586 	0x52, 0x2e, 0xce, 0xba, 0xd2, 0x7f, 0x8f, 0x1c,
1587 	0xbd, 0x35, 0x3b, 0x74, 0x5b, 0x6c, 0xfe, 0xa7,
1588 	0xf1, 0x4a, 0x07, 0x95, 0xff, 0xa8, 0xa0, 0x2a,
1589 	0x85, 0xec, 0xd7, 0x56, 0x3b, 0x28, 0x2e, 0x09,
1590 	0x50, 0x43, 0xbd, 0x49, 0x22, 0xdc, 0x78, 0x0e,
1591 	0x7e, 0x68, 0x78, 0xd5, 0x57, 0xc2, 0xd6, 0x7c,
1592 	0x2f, 0xd0, 0x4a, 0x62, 0x16, 0x38, 0x04, 0x23,
1593 	0x43, 0x21, 0xaa, 0xe1, 0x96, 0x0e, 0xa9, 0x22,
1594 	0xe7, 0x2c, 0xb8, 0x5e, 0x8f, 0xc6, 0x2d, 0xbd,
1595 	0x99, 0x25, 0x33, 0xb8, 0x47, 0x99, 0x8d, 0xf5,
1596 	0x22, 0x08, 0x9b, 0xd5, 0xad, 0x83, 0x67, 0xec,
1597 	0x05, 0x89, 0xda, 0xd6, 0xe4, 0xe2, 0xd5, 0xef,
1598 	0x7f, 0x61, 0x1e, 0x03, 0x81, 0x03, 0xb1, 0x98,
1599 	0x5a, 0x29, 0x69, 0x13, 0xb2, 0xe6, 0xe1, 0x2c,
1600 	0x66, 0x88, 0x39, 0x90, 0xf9, 0xae, 0x5d, 0x71,
1601 	0xfe, 0x07, 0x30, 0x7d, 0xba, 0xa9, 0x37, 0xb5,
1602 	0xff, 0x2c, 0xa9, 0xe6, 0x95, 0x48, 0xb2, 0xc8,
1603 };
1604 
1605 const struct testvec bf_cbc_448_1_vectors[] = {
1606 	{
1607 		.blkno = 0,
1608 		.ptxt = bf_cbc_ptxt,
1609 		.ctxt = bf_cbc_448_encblkno1_vec0_ctxt,
1610 	},
1611 	{
1612 		.blkno = 1,
1613 		.ptxt = bf_cbc_ptxt,
1614 		.ctxt = bf_cbc_448_encblkno1_vec1_ctxt,
1615 	},
1616 	{
1617 		.blkno = 2,
1618 		.ptxt = bf_cbc_ptxt,
1619 		.ctxt = bf_cbc_448_encblkno1_vec2_ctxt,
1620 	},
1621 	{
1622 		.blkno = 3,
1623 		.ptxt = bf_cbc_ptxt,
1624 		.ctxt = bf_cbc_448_encblkno1_vec3_ctxt,
1625 	},
1626 };
1627 
1628 /*
1629  * IV method encblkno8, blkno 0.
1630  */
1631 static const uint8_t bf_cbc_448_encblkno8_vec0_ctxt[SECSIZE] = {
1632 	0x91, 0xb4, 0x8f, 0x78, 0x34, 0xbe, 0x03, 0xe9,
1633 	0x4b, 0xca, 0xf4, 0xfa, 0x27, 0x99, 0xa0, 0xd0,
1634 	0xa0, 0x85, 0xf9, 0xca, 0xcc, 0x2e, 0x0d, 0x41,
1635 	0x91, 0xdb, 0xf9, 0x71, 0xcd, 0x49, 0xf7, 0x66,
1636 	0x9b, 0x0c, 0x70, 0x49, 0x36, 0x72, 0xf4, 0xc0,
1637 	0x17, 0xdd, 0xd8, 0x6a, 0xd2, 0x17, 0xfe, 0x50,
1638 	0xa3, 0x2b, 0xa8, 0x7c, 0x9c, 0x12, 0x8c, 0x08,
1639 	0x3d, 0xb5, 0x20, 0xc0, 0x83, 0xc1, 0xf5, 0x34,
1640 	0x4b, 0xa5, 0xcc, 0x7c, 0xc6, 0x9f, 0x4b, 0x7f,
1641 	0x09, 0x0c, 0x04, 0xe3, 0x02, 0xfe, 0xe2, 0x5a,
1642 	0x45, 0xee, 0x4a, 0xcb, 0xc0, 0xe1, 0xf1, 0xae,
1643 	0x1a, 0x22, 0x95, 0xb9, 0x30, 0xe8, 0x2d, 0x90,
1644 	0xe5, 0x6a, 0x2f, 0x0a, 0x59, 0x15, 0xfc, 0x60,
1645 	0xa5, 0x91, 0x95, 0x1a, 0xa2, 0xf5, 0x87, 0xa3,
1646 	0x97, 0x45, 0x1b, 0xfb, 0x78, 0x62, 0x8b, 0xb6,
1647 	0x86, 0xc6, 0x94, 0x9a, 0x9d, 0x09, 0x46, 0xc9,
1648 	0x1f, 0x5f, 0x2e, 0x6c, 0xed, 0x5e, 0xe2, 0xab,
1649 	0xca, 0x30, 0xdb, 0x13, 0x37, 0x8d, 0xb7, 0xc6,
1650 	0xce, 0x74, 0xe3, 0xe2, 0x64, 0x7b, 0x74, 0x3e,
1651 	0x9f, 0x18, 0x4e, 0xe2, 0x2b, 0x52, 0x08, 0x60,
1652 	0x2b, 0x6d, 0x17, 0x1a, 0xff, 0xae, 0xfb, 0xea,
1653 	0x59, 0x1d, 0x45, 0xe8, 0xf9, 0x0c, 0x56, 0xb8,
1654 	0xb5, 0xc7, 0x8f, 0xa7, 0x9e, 0x67, 0x87, 0xbb,
1655 	0xe2, 0x37, 0x56, 0x49, 0xed, 0x75, 0x27, 0x54,
1656 	0xb5, 0x16, 0x34, 0xb6, 0xa6, 0xe0, 0x27, 0x48,
1657 	0x91, 0xfb, 0x80, 0x4f, 0x5e, 0xef, 0x40, 0x6d,
1658 	0x28, 0x8f, 0x2e, 0x56, 0xab, 0x6c, 0x7d, 0xde,
1659 	0xbd, 0xa5, 0xa6, 0x47, 0xe2, 0xc9, 0xb0, 0xc5,
1660 	0x69, 0x5d, 0x57, 0x18, 0x59, 0x08, 0x66, 0x1b,
1661 	0xdc, 0x4f, 0xa4, 0xe2, 0xb5, 0xff, 0x72, 0x4d,
1662 	0x25, 0x79, 0x38, 0x8f, 0xca, 0x23, 0x81, 0x31,
1663 	0x1d, 0xeb, 0x7b, 0x7e, 0x04, 0xc3, 0xa6, 0xac,
1664 	0x12, 0x92, 0x95, 0x44, 0x08, 0xae, 0x25, 0xb5,
1665 	0xc2, 0x39, 0x88, 0x28, 0xc5, 0xc7, 0x3c, 0xfe,
1666 	0x95, 0xe1, 0x1a, 0x27, 0xbe, 0xfd, 0x0a, 0xc7,
1667 	0xd1, 0x02, 0x1a, 0xae, 0x03, 0xfb, 0xce, 0x79,
1668 	0xe6, 0xea, 0x4a, 0xa1, 0x0e, 0x68, 0x61, 0x2f,
1669 	0xfa, 0x7a, 0xb8, 0xda, 0xd1, 0x4a, 0xbe, 0x88,
1670 	0xd2, 0xa0, 0x6b, 0x90, 0xc3, 0x37, 0x18, 0x77,
1671 	0x2e, 0xc8, 0x44, 0x2e, 0x9d, 0xa2, 0x4a, 0xc7,
1672 	0x54, 0xb2, 0x38, 0x9b, 0x60, 0x5e, 0x5b, 0xb0,
1673 	0x31, 0x4c, 0x10, 0xf0, 0x1d, 0x8c, 0xab, 0x9b,
1674 	0x25, 0x86, 0x05, 0xfc, 0xd9, 0x39, 0x11, 0x2b,
1675 	0x7e, 0x07, 0xfd, 0x6b, 0xb3, 0x28, 0x57, 0x66,
1676 	0x94, 0xc6, 0xfc, 0x48, 0x71, 0xeb, 0x7b, 0x9a,
1677 	0x26, 0x8f, 0x9f, 0x97, 0xb6, 0x83, 0x9a, 0xdc,
1678 	0x5d, 0x84, 0x96, 0x9d, 0xe3, 0xa5, 0x12, 0x97,
1679 	0x8c, 0x87, 0xa6, 0x2a, 0xa8, 0x15, 0x9a, 0xb0,
1680 	0x0e, 0x31, 0x55, 0xf7, 0x1b, 0x5c, 0x9c, 0xaf,
1681 	0x13, 0x20, 0x13, 0x50, 0xaf, 0xc9, 0xf4, 0xd9,
1682 	0x47, 0x16, 0xcc, 0x9d, 0xec, 0xa9, 0x2d, 0xfc,
1683 	0x3d, 0x5d, 0x48, 0x89, 0x86, 0x91, 0x6f, 0x1a,
1684 	0xa5, 0xf0, 0xb6, 0x9b, 0xa9, 0x08, 0xf2, 0x05,
1685 	0xad, 0xe5, 0xe0, 0xd8, 0x2e, 0x09, 0xbe, 0x3a,
1686 	0xf2, 0xdc, 0xeb, 0x14, 0xe6, 0x8c, 0x21, 0x20,
1687 	0xbb, 0x42, 0x6a, 0xba, 0x55, 0x79, 0x54, 0x8b,
1688 	0xa8, 0x43, 0x14, 0x28, 0x66, 0xd2, 0x44, 0x65,
1689 	0x9c, 0xa9, 0xdc, 0x3b, 0x3f, 0xab, 0x36, 0xb4,
1690 	0xbc, 0x9d, 0x22, 0x92, 0x24, 0xa8, 0x29, 0x18,
1691 	0x98, 0x3a, 0xbe, 0xa1, 0xb4, 0xf8, 0x7f, 0xea,
1692 	0x2f, 0x58, 0x69, 0xce, 0xee, 0x99, 0x76, 0x2c,
1693 	0x53, 0x84, 0xf5, 0x9e, 0xa3, 0x98, 0xe6, 0x94,
1694 	0x39, 0xfa, 0xfa, 0x6d, 0x66, 0xe2, 0x39, 0x2b,
1695 	0x4b, 0x84, 0x14, 0x89, 0x18, 0xa2, 0x03, 0xdd,
1696 };
1697 
1698 /*
1699  * IV method encblkno8, blkno 1.
1700  */
1701 static const uint8_t bf_cbc_448_encblkno8_vec1_ctxt[SECSIZE] = {
1702 	0x90, 0x3d, 0xee, 0x58, 0xf7, 0xe3, 0xc4, 0x18,
1703 	0xaf, 0xfa, 0xaf, 0xed, 0x9a, 0x45, 0xe7, 0xa8,
1704 	0xbe, 0xcd, 0x0f, 0xb9, 0x53, 0x18, 0xc6, 0x14,
1705 	0xbe, 0xbb, 0x90, 0x1c, 0x5c, 0x60, 0x93, 0xcb,
1706 	0x62, 0xb3, 0xdb, 0x31, 0x19, 0x39, 0xce, 0x3f,
1707 	0xe4, 0x8f, 0x44, 0xc1, 0x10, 0x80, 0x05, 0x6b,
1708 	0x77, 0xe3, 0xe1, 0xe5, 0xd2, 0x6d, 0x93, 0xf2,
1709 	0xb3, 0x81, 0x03, 0xf8, 0xbc, 0x7b, 0x5a, 0x71,
1710 	0x15, 0x16, 0x3a, 0x2f, 0x03, 0xbb, 0x67, 0x6a,
1711 	0xd9, 0xf5, 0x63, 0x6f, 0x3d, 0x75, 0x1b, 0x0a,
1712 	0x4b, 0x9d, 0x04, 0x11, 0x7e, 0xe8, 0x3e, 0x2d,
1713 	0x04, 0x8f, 0xbf, 0x8a, 0xb2, 0x35, 0x76, 0xc5,
1714 	0xcc, 0x6d, 0x9e, 0x99, 0x71, 0x13, 0xf6, 0x5e,
1715 	0xeb, 0x74, 0x96, 0x8a, 0x29, 0x38, 0x0b, 0x25,
1716 	0x4b, 0x89, 0xa9, 0x43, 0x3c, 0x2f, 0x03, 0x14,
1717 	0x8d, 0x0f, 0xe3, 0xe7, 0x01, 0xd1, 0x2e, 0x14,
1718 	0x08, 0x51, 0xba, 0x06, 0x39, 0x76, 0x35, 0xbc,
1719 	0x14, 0xa6, 0x16, 0x36, 0x47, 0xcc, 0x48, 0xe0,
1720 	0xd6, 0xd7, 0x07, 0xb0, 0xf0, 0x30, 0x6c, 0xf8,
1721 	0x68, 0x9d, 0x6c, 0x4b, 0x69, 0x33, 0x78, 0x0e,
1722 	0x4a, 0xfa, 0x97, 0xfb, 0x0c, 0x0d, 0x0a, 0xc3,
1723 	0x4b, 0x7b, 0x77, 0x77, 0x18, 0x9a, 0x74, 0x85,
1724 	0x2f, 0xae, 0xc7, 0x90, 0x45, 0x4b, 0xa2, 0x06,
1725 	0x3e, 0xa2, 0x48, 0xe7, 0x6c, 0x86, 0x65, 0x78,
1726 	0x97, 0x0b, 0x97, 0xc1, 0x70, 0x91, 0x12, 0x79,
1727 	0xae, 0xf0, 0x2b, 0x44, 0xe9, 0x84, 0x8d, 0x78,
1728 	0x53, 0xf8, 0x3a, 0xf5, 0x9f, 0x27, 0x3d, 0x49,
1729 	0x69, 0xd1, 0x18, 0xa4, 0xb2, 0xd0, 0xbb, 0xf2,
1730 	0x57, 0x76, 0xb7, 0x77, 0x16, 0x2f, 0xf8, 0x0c,
1731 	0xa5, 0x86, 0x43, 0x0d, 0x2d, 0xfe, 0x84, 0xc6,
1732 	0xbb, 0x58, 0x81, 0x47, 0x3d, 0xa3, 0x93, 0xb0,
1733 	0x50, 0xfc, 0x25, 0xf7, 0xc5, 0x05, 0xe5, 0xf2,
1734 	0xb3, 0x79, 0x12, 0xe4, 0x37, 0x71, 0x2d, 0xe8,
1735 	0xa5, 0x0b, 0xce, 0x67, 0x51, 0x4f, 0xab, 0xc7,
1736 	0x7b, 0x3b, 0xac, 0x78, 0x97, 0x82, 0x02, 0xf4,
1737 	0x62, 0x20, 0x1b, 0x8b, 0xac, 0x07, 0x3b, 0xd7,
1738 	0x0b, 0x99, 0x27, 0x85, 0x52, 0x7a, 0x79, 0x18,
1739 	0xfb, 0x81, 0x3a, 0x05, 0x76, 0x6c, 0x3c, 0x6a,
1740 	0x35, 0xe1, 0x2b, 0x03, 0x48, 0x70, 0x1a, 0xa8,
1741 	0x30, 0x33, 0x61, 0xe2, 0xd8, 0x99, 0x86, 0x7f,
1742 	0xfd, 0xe0, 0x4a, 0xe4, 0x62, 0xa1, 0xac, 0xcb,
1743 	0xb8, 0x8a, 0xf3, 0xaa, 0xd6, 0x61, 0x9d, 0xc5,
1744 	0xdb, 0xf5, 0x53, 0x39, 0x1d, 0xd7, 0xf8, 0x96,
1745 	0xc6, 0x2b, 0xca, 0xbf, 0x83, 0x4e, 0x89, 0x63,
1746 	0x53, 0x6f, 0x17, 0xaa, 0xf3, 0x61, 0x9b, 0x75,
1747 	0x8c, 0x5a, 0xf8, 0x21, 0x84, 0x52, 0xb8, 0x76,
1748 	0xbc, 0xf5, 0x9b, 0xd6, 0x98, 0x26, 0x58, 0xec,
1749 	0xdd, 0xa8, 0xf1, 0xee, 0x9e, 0x14, 0x24, 0x94,
1750 	0x7c, 0xb6, 0x45, 0x8b, 0xc7, 0x85, 0x50, 0x4e,
1751 	0x30, 0xd7, 0x51, 0x8c, 0x33, 0xeb, 0xeb, 0x5d,
1752 	0x52, 0x58, 0x43, 0xcb, 0x25, 0x4a, 0x77, 0x34,
1753 	0xe6, 0x70, 0x5b, 0x6f, 0x8f, 0xe8, 0x07, 0xee,
1754 	0x76, 0x4a, 0xad, 0xab, 0x11, 0x8a, 0x1b, 0x92,
1755 	0x60, 0x79, 0xb8, 0xe0, 0x88, 0xa7, 0x3a, 0xe0,
1756 	0x15, 0xf6, 0x57, 0xf0, 0xe8, 0x87, 0xda, 0xf8,
1757 	0x90, 0x4e, 0xe7, 0xb3, 0xb4, 0xe7, 0x73, 0x5c,
1758 	0xd3, 0x69, 0xfb, 0x23, 0x4f, 0x4f, 0xc8, 0xd2,
1759 	0xfb, 0xf5, 0xf5, 0x76, 0x80, 0xb6, 0xb7, 0xe2,
1760 	0xb7, 0x96, 0x1a, 0x97, 0x12, 0x40, 0x16, 0x86,
1761 	0xd6, 0x66, 0xf5, 0x46, 0x9e, 0x04, 0x62, 0xaa,
1762 	0x9c, 0xc9, 0x45, 0x39, 0x5c, 0xd3, 0x58, 0x40,
1763 	0xb4, 0x32, 0xd8, 0x6c, 0x19, 0xfa, 0xa5, 0x5f,
1764 	0x1e, 0x83, 0x5a, 0x32, 0x5e, 0x1d, 0xab, 0xa9,
1765 	0x48, 0x1b, 0x1b, 0x37, 0x66, 0xf8, 0x67, 0xd7,
1766 };
1767 
1768 /*
1769  * IV method encblkno8, blkno 2.
1770  */
1771 static const uint8_t bf_cbc_448_encblkno8_vec2_ctxt[SECSIZE] = {
1772 	0xb3, 0x2d, 0x0d, 0x90, 0x7a, 0x50, 0xb6, 0x29,
1773 	0x9d, 0xd4, 0x12, 0x1a, 0xc9, 0x71, 0x56, 0xc4,
1774 	0xce, 0x3d, 0x74, 0xf9, 0x91, 0xe4, 0x79, 0x8a,
1775 	0x42, 0x34, 0x1a, 0xd4, 0x84, 0xaa, 0x01, 0x85,
1776 	0x13, 0xe8, 0xab, 0xaa, 0xb6, 0x81, 0x82, 0xd6,
1777 	0x32, 0xd6, 0x9f, 0x63, 0x69, 0x55, 0x10, 0x5f,
1778 	0x2e, 0xb3, 0x51, 0x74, 0x80, 0x5c, 0xe9, 0x8d,
1779 	0x27, 0xd8, 0x41, 0x2d, 0x27, 0x07, 0xb4, 0x13,
1780 	0xcd, 0xc0, 0xb3, 0x96, 0xaa, 0x59, 0x9c, 0x3e,
1781 	0x16, 0x9e, 0x18, 0xa5, 0x92, 0x52, 0x59, 0x19,
1782 	0x19, 0x62, 0xeb, 0xd9, 0xdf, 0x9d, 0x10, 0x77,
1783 	0xfb, 0x3c, 0xf1, 0xeb, 0x70, 0xf6, 0x6a, 0x9b,
1784 	0xad, 0x99, 0x35, 0xd7, 0xf8, 0xde, 0x2b, 0x52,
1785 	0x85, 0xdd, 0x36, 0x07, 0x3a, 0x88, 0xa6, 0xbb,
1786 	0x98, 0x7a, 0xe3, 0xb0, 0xe6, 0xae, 0x33, 0x5d,
1787 	0x47, 0x0c, 0x6c, 0xd4, 0x84, 0x33, 0x7e, 0xf4,
1788 	0xea, 0xfd, 0xf1, 0x1c, 0xdb, 0x8b, 0xfe, 0x01,
1789 	0x77, 0xa3, 0x07, 0x21, 0x09, 0xac, 0x0c, 0xe4,
1790 	0x63, 0xaa, 0x3d, 0xb3, 0x05, 0xf8, 0x73, 0x03,
1791 	0x69, 0x53, 0x2f, 0xd3, 0x53, 0x29, 0xf2, 0x02,
1792 	0x60, 0x41, 0xed, 0xc7, 0xe9, 0x2e, 0xba, 0x54,
1793 	0xa4, 0xfe, 0x26, 0xf0, 0xd9, 0x2c, 0x58, 0x2d,
1794 	0x90, 0x94, 0x19, 0xf9, 0xe5, 0xaa, 0xe2, 0x13,
1795 	0x9a, 0x67, 0x90, 0x44, 0x61, 0x36, 0xd0, 0x3f,
1796 	0xe7, 0xe8, 0x7e, 0x47, 0x2b, 0x84, 0x97, 0xe2,
1797 	0x0b, 0x8a, 0xfa, 0x2f, 0xbc, 0x1a, 0x70, 0xed,
1798 	0xb2, 0x93, 0x36, 0x0e, 0xe6, 0xb1, 0xa2, 0x5a,
1799 	0x04, 0x04, 0x8d, 0x2f, 0x82, 0xdb, 0x49, 0x5e,
1800 	0x1b, 0x90, 0xc1, 0x27, 0x2a, 0x2f, 0x64, 0x5b,
1801 	0xce, 0x35, 0x06, 0x0d, 0xb6, 0x05, 0x50, 0x5a,
1802 	0x90, 0xc8, 0x21, 0xd0, 0xf0, 0xb9, 0xf3, 0x43,
1803 	0x25, 0xd8, 0xb9, 0x86, 0xb7, 0xd0, 0x29, 0x75,
1804 	0xdc, 0xf6, 0xf6, 0x14, 0x5e, 0x1f, 0xad, 0x54,
1805 	0x28, 0x63, 0x92, 0xcd, 0xcd, 0x75, 0xb2, 0xe8,
1806 	0xf3, 0x1f, 0xfd, 0x88, 0x72, 0x04, 0xab, 0xe2,
1807 	0x77, 0x21, 0xc1, 0xb4, 0x87, 0xa7, 0x98, 0x86,
1808 	0x2d, 0x7f, 0x01, 0x24, 0xed, 0x3a, 0x23, 0x83,
1809 	0xb7, 0xa4, 0xb7, 0x08, 0x4e, 0xee, 0x10, 0x77,
1810 	0x29, 0x22, 0xab, 0xea, 0x4a, 0x68, 0x1f, 0x7f,
1811 	0xd6, 0xe6, 0x90, 0x11, 0xbc, 0x23, 0x2e, 0x47,
1812 	0x78, 0xea, 0x1d, 0x33, 0x7c, 0x02, 0x09, 0x55,
1813 	0x7a, 0xbc, 0xa7, 0x3d, 0x9a, 0xd0, 0x4d, 0x40,
1814 	0x6c, 0xc2, 0x99, 0xc2, 0xe9, 0x0e, 0xcf, 0x06,
1815 	0x82, 0x61, 0x5c, 0x76, 0xca, 0xef, 0x8f, 0xd3,
1816 	0x78, 0x2a, 0xae, 0x39, 0x29, 0x4e, 0xc1, 0x2c,
1817 	0xb1, 0xbc, 0xcd, 0x76, 0x4f, 0x25, 0xf0, 0x5b,
1818 	0x78, 0x3a, 0xa4, 0x39, 0x52, 0x5a, 0xc7, 0xcf,
1819 	0x17, 0x3d, 0xb0, 0x39, 0x63, 0xf9, 0xf9, 0xfb,
1820 	0x6f, 0x35, 0xb7, 0xf1, 0x49, 0x10, 0xd8, 0x12,
1821 	0x8d, 0xa2, 0xdf, 0xc5, 0x26, 0x37, 0xd1, 0xb8,
1822 	0xef, 0xdc, 0x04, 0x1b, 0x0d, 0x60, 0xbf, 0xbc,
1823 	0xc0, 0xff, 0x56, 0x8b, 0xd3, 0x6e, 0x71, 0xfc,
1824 	0x87, 0x00, 0x86, 0x10, 0x78, 0x3b, 0xce, 0x8b,
1825 	0xe8, 0x5f, 0x8c, 0xce, 0x03, 0xa2, 0x89, 0x8c,
1826 	0x16, 0x00, 0x0e, 0xd8, 0x53, 0xaf, 0x7f, 0x77,
1827 	0x78, 0x40, 0x5e, 0x5e, 0xd1, 0x7d, 0xf8, 0x41,
1828 	0xa8, 0x1e, 0xa5, 0xe5, 0xe9, 0xd6, 0x17, 0x2c,
1829 	0x2f, 0x1b, 0xff, 0xef, 0xf5, 0x53, 0x31, 0xf3,
1830 	0x5b, 0xe4, 0x84, 0x7c, 0xe2, 0x45, 0x3c, 0x82,
1831 	0x5b, 0xf6, 0x03, 0x35, 0xdd, 0x03, 0x22, 0xbe,
1832 	0x77, 0x9c, 0x6a, 0x7d, 0xc8, 0x29, 0x41, 0x53,
1833 	0xbb, 0xab, 0x6e, 0xa5, 0x00, 0xaf, 0x3b, 0x1d,
1834 	0x76, 0x12, 0xac, 0x44, 0x5c, 0x7d, 0xd2, 0x3b,
1835 	0x3a, 0x95, 0xb0, 0xa9, 0x4f, 0x27, 0x76, 0x17,
1836 };
1837 
1838 /*
1839  * IV method encblkno8, blkno 3.
1840  */
1841 static const uint8_t bf_cbc_448_encblkno8_vec3_ctxt[SECSIZE] = {
1842 	0x8e, 0xc4, 0x56, 0x64, 0x1e, 0x2a, 0x0d, 0x60,
1843 	0x54, 0x5c, 0xcd, 0xe0, 0x6d, 0xa7, 0x4c, 0x30,
1844 	0x7e, 0x85, 0x21, 0xdf, 0xaa, 0xb2, 0x32, 0xde,
1845 	0xc0, 0xc6, 0x56, 0xe0, 0x43, 0xc2, 0x3e, 0x6c,
1846 	0x8c, 0x62, 0x35, 0xaa, 0xf9, 0xba, 0xc9, 0x52,
1847 	0x38, 0x72, 0x06, 0xcc, 0x02, 0xa2, 0xb8, 0x85,
1848 	0xf7, 0xcc, 0xe6, 0x8c, 0x86, 0x8f, 0x9c, 0xd6,
1849 	0x1f, 0xf8, 0x24, 0x9d, 0xca, 0xe8, 0xed, 0x3c,
1850 	0x80, 0x0b, 0xaf, 0x0c, 0x78, 0x4f, 0x5b, 0x2a,
1851 	0x0f, 0xfe, 0xe5, 0xe6, 0x12, 0x8a, 0xff, 0xc7,
1852 	0x6a, 0x97, 0xd9, 0xcb, 0xc8, 0x6a, 0x83, 0x12,
1853 	0xa1, 0x12, 0x84, 0xc8, 0x72, 0x1c, 0xb7, 0x68,
1854 	0x23, 0x24, 0xff, 0x5a, 0x78, 0x99, 0x9d, 0xb8,
1855 	0x03, 0x70, 0x0a, 0x09, 0xa1, 0x3d, 0xfe, 0xe0,
1856 	0xc5, 0x1b, 0xea, 0x58, 0xbc, 0x52, 0x70, 0xa2,
1857 	0x4e, 0xcc, 0x43, 0xfb, 0xb7, 0xc4, 0xbd, 0xb6,
1858 	0xa9, 0x1e, 0xff, 0xf6, 0x69, 0xaa, 0xab, 0xa4,
1859 	0xd7, 0x07, 0x0d, 0xda, 0x41, 0x4b, 0xe3, 0xa5,
1860 	0xef, 0x94, 0x9f, 0xb4, 0xd8, 0xd1, 0x41, 0xd0,
1861 	0x9e, 0xa0, 0x0a, 0x70, 0xdb, 0xb8, 0x5e, 0x27,
1862 	0xc6, 0x08, 0x38, 0x6a, 0x31, 0xe3, 0xa0, 0xd6,
1863 	0x90, 0xad, 0x19, 0x0c, 0x7e, 0x1d, 0x21, 0xc8,
1864 	0x66, 0x30, 0x73, 0x8e, 0x06, 0x97, 0xec, 0xc6,
1865 	0xfe, 0x5c, 0xc6, 0xc0, 0xd1, 0x5c, 0x5f, 0xf8,
1866 	0x01, 0xb3, 0xac, 0x18, 0x66, 0x1e, 0x04, 0xaf,
1867 	0xa7, 0xd3, 0x6d, 0x10, 0x74, 0xa1, 0x9a, 0x36,
1868 	0x10, 0xa0, 0xd6, 0x28, 0x61, 0x93, 0x98, 0x14,
1869 	0x67, 0x6f, 0x7d, 0x52, 0x86, 0x48, 0x17, 0x99,
1870 	0x53, 0xa3, 0xee, 0xe5, 0x93, 0xf6, 0x80, 0xe1,
1871 	0x52, 0xf0, 0x39, 0x48, 0x5c, 0x20, 0x05, 0xd9,
1872 	0xae, 0xa2, 0xe3, 0x25, 0x4e, 0x60, 0x84, 0xf8,
1873 	0xad, 0xd6, 0xf6, 0x95, 0x8e, 0x95, 0xd0, 0x49,
1874 	0x1c, 0x65, 0xd0, 0xc8, 0xa5, 0x26, 0xc0, 0xdf,
1875 	0x32, 0xbe, 0xbc, 0xb7, 0x6d, 0xe5, 0x5e, 0x6d,
1876 	0x38, 0x7d, 0x03, 0xd5, 0x94, 0x7a, 0x14, 0x2b,
1877 	0x02, 0xe0, 0x09, 0x00, 0x50, 0xf1, 0x52, 0x69,
1878 	0x06, 0x33, 0x4b, 0x5b, 0xa2, 0xbc, 0x2e, 0xa9,
1879 	0x1a, 0xb7, 0xca, 0xa8, 0xb4, 0xa2, 0x5b, 0xcd,
1880 	0x35, 0xe4, 0x03, 0xdd, 0x8f, 0x66, 0x3a, 0x34,
1881 	0xc6, 0x2a, 0xd6, 0x90, 0xa2, 0xef, 0xe2, 0xfa,
1882 	0x7c, 0xc1, 0x6c, 0x21, 0xd0, 0xfd, 0x96, 0x92,
1883 	0xb5, 0x99, 0xe4, 0xb7, 0x66, 0xd4, 0xf2, 0x50,
1884 	0x22, 0xef, 0x66, 0x1e, 0x5f, 0x62, 0xd1, 0x77,
1885 	0x87, 0x52, 0xed, 0x40, 0x69, 0xfd, 0xab, 0x66,
1886 	0xe4, 0x0e, 0x2b, 0xa8, 0x67, 0x4c, 0x6d, 0xce,
1887 	0xb0, 0x61, 0x8e, 0x6c, 0xc5, 0x34, 0xab, 0x03,
1888 	0x3e, 0x8a, 0xe5, 0x2b, 0xa2, 0xa4, 0x04, 0xa2,
1889 	0x01, 0x81, 0x79, 0x72, 0xfc, 0x19, 0xbd, 0x38,
1890 	0x39, 0xee, 0xb3, 0x95, 0xc5, 0x6f, 0xed, 0xaa,
1891 	0x6e, 0xca, 0xeb, 0xc6, 0xaf, 0xeb, 0x76, 0xb4,
1892 	0xd7, 0xc3, 0x1b, 0x65, 0x99, 0xc6, 0xa3, 0xe8,
1893 	0x96, 0x5e, 0xc1, 0x0c, 0xd2, 0xf8, 0x65, 0xcf,
1894 	0x42, 0xc5, 0x8f, 0x52, 0x5d, 0x90, 0x21, 0x55,
1895 	0xec, 0x9d, 0x93, 0x81, 0xb7, 0x9a, 0xa4, 0x35,
1896 	0xe7, 0xef, 0xef, 0x2d, 0x4c, 0x02, 0xf7, 0x2b,
1897 	0x26, 0xe0, 0x9e, 0x3a, 0x31, 0xfd, 0x94, 0xb3,
1898 	0xa7, 0x8a, 0x93, 0xf3, 0xe1, 0x77, 0x79, 0xdf,
1899 	0xcf, 0x1f, 0x99, 0x55, 0x20, 0xc3, 0x7d, 0x8a,
1900 	0xbc, 0xff, 0x63, 0x64, 0x87, 0xa9, 0x42, 0x63,
1901 	0xc9, 0x67, 0x7e, 0x51, 0x99, 0x9c, 0xcb, 0x47,
1902 	0xa9, 0xc8, 0x5e, 0x83, 0x87, 0x55, 0x7c, 0x45,
1903 	0x3a, 0xb4, 0xfe, 0x97, 0x24, 0x17, 0x1d, 0x5e,
1904 	0xdf, 0xe0, 0xe8, 0x17, 0xa6, 0x31, 0x99, 0xeb,
1905 	0xb7, 0xb5, 0xd5, 0xd7, 0x7c, 0x2f, 0x22, 0x26,
1906 };
1907 
1908 const struct testvec bf_cbc_448_8_vectors[] = {
1909 	{
1910 		.blkno = 0,
1911 		.ptxt = bf_cbc_ptxt,
1912 		.ctxt = bf_cbc_448_encblkno8_vec0_ctxt,
1913 	},
1914 	{
1915 		.blkno = 1,
1916 		.ptxt = bf_cbc_ptxt,
1917 		.ctxt = bf_cbc_448_encblkno8_vec1_ctxt,
1918 	},
1919 	{
1920 		.blkno = 2,
1921 		.ptxt = bf_cbc_ptxt,
1922 		.ctxt = bf_cbc_448_encblkno8_vec2_ctxt,
1923 	},
1924 	{
1925 		.blkno = 3,
1926 		.ptxt = bf_cbc_ptxt,
1927 		.ctxt = bf_cbc_448_encblkno8_vec3_ctxt,
1928 	},
1929 };
1930 
1931 static int
open_disk(const char * devpath,const char * imgpath,size_t size)1932 open_disk(const char *devpath, const char *imgpath, size_t size)
1933 {
1934 	int fd;
1935 
1936 	fd = open(imgpath, O_CREAT | O_RDWR | O_TRUNC, 0600);
1937 	if (fd < 0)
1938 		return -1;
1939 
1940 	if (ftruncate(fd, size) < 0)
1941 		goto fail;
1942 
1943 	if (rump_pub_etfs_register_withsize(devpath,
1944 	    imgpath, RUMP_ETFS_BLK, 0, size) < 0) {
1945 		goto fail;
1946 	}
1947 
1948 	unlink(imgpath);
1949 	return fd;
1950 fail:
1951 	close(fd);
1952 	unlink(imgpath);
1953 	return -1;
1954 }
1955 
1956 static int
open_cgd(int devno)1957 open_cgd(int devno)
1958 {
1959 	char devpath[32];
1960 
1961 	sprintf(devpath, "/dev/rcgd%d%c", devno, getrawpartition() + 'a');
1962 
1963 	return rump_sys_open(devpath, O_RDWR, 0);
1964 }
1965 
1966 static int
configure_cgd(int fd,const char * dkpath,const char * alg,const char * ivmethod,const char * key,size_t keylen)1967 configure_cgd(int fd, const char *dkpath, const char *alg,
1968     const char *ivmethod, const char *key, size_t keylen)
1969 {
1970 	struct cgd_ioctl ci;
1971 
1972 	memset(&ci, 0, sizeof(ci));
1973 	ci.ci_disk = dkpath;
1974 	ci.ci_alg = alg;
1975 	ci.ci_ivmethod = ivmethod;
1976 	ci.ci_keylen = 8 * keylen - 8; /* Exclude the NUL terminator. */
1977 	ci.ci_key = key;
1978 	ci.ci_blocksize = 64;
1979 
1980 	return rump_sys_ioctl(fd, CGDIOCSET, &ci);
1981 }
1982 
1983 static int
unconfigure_cgd(int fd)1984 unconfigure_cgd(int fd)
1985 {
1986 	struct cgd_ioctl ci;
1987 
1988 	return rump_sys_ioctl(fd, CGDIOCCLR, &ci);
1989 }
1990 
1991 static int
write_testvec(int cgdfd,const struct testvec * tv)1992 write_testvec(int cgdfd, const struct testvec *tv)
1993 {
1994 
1995 	if (rump_sys_lseek(cgdfd, tv->blkno * SECSIZE, SEEK_SET) < 0)
1996 		return -1;
1997 
1998 	if (rump_sys_write(cgdfd, tv->ptxt, SECSIZE) != SECSIZE)
1999 		return -1;
2000 
2001 	return 0;
2002 }
2003 
2004 static int
read_testvec(int cgdfd,const struct testvec * tv)2005 read_testvec(int cgdfd, const struct testvec *tv)
2006 {
2007 	char *buf;
2008 	int res = -1;
2009 
2010 	buf = malloc(SECSIZE);
2011 	if (buf == NULL)
2012 		return -1;
2013 
2014 	if (rump_sys_lseek(cgdfd, tv->blkno * SECSIZE, SEEK_SET) < 0)
2015 		goto fail;
2016 
2017 	if (rump_sys_read(cgdfd, buf, SECSIZE) != SECSIZE)
2018 		goto fail;
2019 
2020 	res = memcmp(buf, tv->ptxt, SECSIZE);
2021 fail:
2022 	free(buf);
2023 	return res;
2024 }
2025 
2026 static int
check_testvec(int dkfd,const struct testvec * tv)2027 check_testvec(int dkfd, const struct testvec *tv)
2028 {
2029 	char *buf;
2030 	int res = -1;
2031 
2032 	buf = malloc(SECSIZE);
2033 	if (buf == NULL)
2034 		return -1;
2035 
2036 	if (lseek(dkfd, tv->blkno * SECSIZE, SEEK_SET) < 0)
2037 		goto fail;
2038 
2039 	if (read(dkfd, buf, SECSIZE) != SECSIZE)
2040 		goto fail;
2041 
2042 	res = memcmp(buf, tv->ctxt, SECSIZE);
2043 fail:
2044 	free(buf);
2045 	return res;
2046 }
2047 
2048 ATF_TC(cgd_bf_cbc_128_encblkno1);
ATF_TC_HEAD(cgd_bf_cbc_128_encblkno1,tc)2049 ATF_TC_HEAD(cgd_bf_cbc_128_encblkno1, tc)
2050 {
2051 	atf_tc_set_md_var(tc, "descr",
2052 	    "Test blowfish-cbc with 128 bits key, ivmethod encblkno1");
2053 }
2054 
ATF_TC_BODY(cgd_bf_cbc_128_encblkno1,tc)2055 ATF_TC_BODY(cgd_bf_cbc_128_encblkno1, tc)
2056 {
2057 	const char imgpath[] = "blowfish-cbc-128-encblkno1.img";
2058 	const char *dkpath = "/dev/dk";
2059 	const size_t dksize = 4 * SECSIZE; /* Last blkno is 3. */
2060 	int dkfd, cgdfd;
2061 
2062 	rump_init();
2063 
2064 	RL(dkfd = open_disk(dkpath, imgpath, dksize));
2065 
2066 	RL(cgdfd = open_cgd(0));
2067 	RL(configure_cgd(cgdfd, dkpath, "blowfish-cbc", "encblkno1",
2068 	    bf_cbc_128_key, sizeof(bf_cbc_128_key)));
2069 
2070 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_128_1_vectors[0]), 0);
2071 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_128_1_vectors[1]), 0);
2072 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_128_1_vectors[2]), 0);
2073 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_128_1_vectors[3]), 0);
2074 
2075 	RL(unconfigure_cgd(cgdfd));
2076 	RL(configure_cgd(cgdfd, dkpath, "blowfish-cbc", "encblkno1",
2077 	    bf_cbc_128_key, sizeof(bf_cbc_128_key)));
2078 
2079 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_128_1_vectors[0]), 0);
2080 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_128_1_vectors[1]), 0);
2081 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_128_1_vectors[2]), 0);
2082 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_128_1_vectors[3]), 0);
2083 
2084 	RL(unconfigure_cgd(cgdfd));
2085 	RL(rump_sys_close(cgdfd));
2086 
2087 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_128_1_vectors[0]), 0);
2088 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_128_1_vectors[1]), 0);
2089 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_128_1_vectors[2]), 0);
2090 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_128_1_vectors[3]), 0);
2091 
2092 	RL(close(dkfd));
2093 }
2094 
2095 ATF_TC(cgd_bf_cbc_128_encblkno8);
ATF_TC_HEAD(cgd_bf_cbc_128_encblkno8,tc)2096 ATF_TC_HEAD(cgd_bf_cbc_128_encblkno8, tc)
2097 {
2098 	atf_tc_set_md_var(tc, "descr",
2099 	    "Test blowfish-cbc with 128 bits key, ivmethod encblkno8");
2100 }
2101 
ATF_TC_BODY(cgd_bf_cbc_128_encblkno8,tc)2102 ATF_TC_BODY(cgd_bf_cbc_128_encblkno8, tc)
2103 {
2104 	const char imgpath[] = "blowfish-cbc-128-encblkno8.img";
2105 	const char *dkpath = "/dev/dk";
2106 	const size_t dksize = 4 * SECSIZE; /* Last blkno is 3. */
2107 	int dkfd, cgdfd;
2108 
2109 	rump_init();
2110 
2111 	RL(dkfd = open_disk(dkpath, imgpath, dksize));
2112 
2113 	RL(cgdfd = open_cgd(0));
2114 	RL(configure_cgd(cgdfd, dkpath, "blowfish-cbc", "encblkno8",
2115 	    bf_cbc_128_key, sizeof(bf_cbc_128_key)));
2116 
2117 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_128_8_vectors[0]), 0);
2118 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_128_8_vectors[1]), 0);
2119 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_128_8_vectors[2]), 0);
2120 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_128_8_vectors[3]), 0);
2121 
2122 	RL(unconfigure_cgd(cgdfd));
2123 	RL(configure_cgd(cgdfd, dkpath, "blowfish-cbc", "encblkno8",
2124 	    bf_cbc_128_key, sizeof(bf_cbc_128_key)));
2125 
2126 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_128_8_vectors[0]), 0);
2127 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_128_8_vectors[1]), 0);
2128 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_128_8_vectors[2]), 0);
2129 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_128_8_vectors[3]), 0);
2130 
2131 	RL(unconfigure_cgd(cgdfd));
2132 	RL(rump_sys_close(cgdfd));
2133 
2134 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_128_8_vectors[0]), 0);
2135 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_128_8_vectors[1]), 0);
2136 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_128_8_vectors[2]), 0);
2137 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_128_8_vectors[3]), 0);
2138 
2139 	RL(close(dkfd));
2140 }
2141 
2142 ATF_TC(cgd_bf_cbc_256_encblkno1);
ATF_TC_HEAD(cgd_bf_cbc_256_encblkno1,tc)2143 ATF_TC_HEAD(cgd_bf_cbc_256_encblkno1, tc)
2144 {
2145 	atf_tc_set_md_var(tc, "descr",
2146 	    "Test blowfish-cbc with 256 bits key, ivmethod encblkno1");
2147 }
2148 
ATF_TC_BODY(cgd_bf_cbc_256_encblkno1,tc)2149 ATF_TC_BODY(cgd_bf_cbc_256_encblkno1, tc)
2150 {
2151 	const char imgpath[] = "blowfish-cbc-256-encblkno1.img";
2152 	const char *dkpath = "/dev/dk";
2153 	const size_t dksize = 4 * SECSIZE; /* Last blkno is 3. */
2154 	int dkfd, cgdfd;
2155 
2156 	rump_init();
2157 
2158 	RL(dkfd = open_disk(dkpath, imgpath, dksize));
2159 
2160 	RL(cgdfd = open_cgd(0));
2161 	RL(configure_cgd(cgdfd, dkpath, "blowfish-cbc", "encblkno1",
2162 	    bf_cbc_256_key, sizeof(bf_cbc_256_key)));
2163 
2164 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_256_1_vectors[0]), 0);
2165 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_256_1_vectors[1]), 0);
2166 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_256_1_vectors[2]), 0);
2167 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_256_1_vectors[3]), 0);
2168 
2169 	RL(unconfigure_cgd(cgdfd));
2170 	RL(configure_cgd(cgdfd, dkpath, "blowfish-cbc", "encblkno1",
2171 	    bf_cbc_256_key, sizeof(bf_cbc_256_key)));
2172 
2173 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_256_1_vectors[0]), 0);
2174 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_256_1_vectors[1]), 0);
2175 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_256_1_vectors[2]), 0);
2176 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_256_1_vectors[3]), 0);
2177 
2178 	RL(unconfigure_cgd(cgdfd));
2179 	RL(rump_sys_close(cgdfd));
2180 
2181 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_256_1_vectors[0]), 0);
2182 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_256_1_vectors[1]), 0);
2183 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_256_1_vectors[2]), 0);
2184 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_256_1_vectors[3]), 0);
2185 
2186 	RL(close(dkfd));
2187 }
2188 
2189 ATF_TC(cgd_bf_cbc_256_encblkno8);
ATF_TC_HEAD(cgd_bf_cbc_256_encblkno8,tc)2190 ATF_TC_HEAD(cgd_bf_cbc_256_encblkno8, tc)
2191 {
2192 	atf_tc_set_md_var(tc, "descr",
2193 	    "Test blowfish-cbc with 256 bits key, ivmethod encblkno8");
2194 }
2195 
ATF_TC_BODY(cgd_bf_cbc_256_encblkno8,tc)2196 ATF_TC_BODY(cgd_bf_cbc_256_encblkno8, tc)
2197 {
2198 	const char imgpath[] = "blowfish-cbc-256-encblkno8.img";
2199 	const char *dkpath = "/dev/dk";
2200 	const size_t dksize = 4 * SECSIZE; /* Last blkno is 3. */
2201 	int dkfd, cgdfd;
2202 
2203 	rump_init();
2204 
2205 	RL(dkfd = open_disk(dkpath, imgpath, dksize));
2206 
2207 	RL(cgdfd = open_cgd(0));
2208 	RL(configure_cgd(cgdfd, dkpath, "blowfish-cbc", "encblkno8",
2209 	    bf_cbc_256_key, sizeof(bf_cbc_256_key)));
2210 
2211 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_256_8_vectors[0]), 0);
2212 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_256_8_vectors[1]), 0);
2213 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_256_8_vectors[2]), 0);
2214 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_256_8_vectors[3]), 0);
2215 
2216 	RL(unconfigure_cgd(cgdfd));
2217 	RL(configure_cgd(cgdfd, dkpath, "blowfish-cbc", "encblkno8",
2218 	    bf_cbc_256_key, sizeof(bf_cbc_256_key)));
2219 
2220 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_256_8_vectors[0]), 0);
2221 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_256_8_vectors[1]), 0);
2222 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_256_8_vectors[2]), 0);
2223 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_256_8_vectors[3]), 0);
2224 
2225 	RL(unconfigure_cgd(cgdfd));
2226 	RL(rump_sys_close(cgdfd));
2227 
2228 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_256_8_vectors[0]), 0);
2229 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_256_8_vectors[1]), 0);
2230 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_256_8_vectors[2]), 0);
2231 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_256_8_vectors[3]), 0);
2232 
2233 	RL(close(dkfd));
2234 }
2235 
2236 ATF_TC(cgd_bf_cbc_448_encblkno1);
ATF_TC_HEAD(cgd_bf_cbc_448_encblkno1,tc)2237 ATF_TC_HEAD(cgd_bf_cbc_448_encblkno1, tc)
2238 {
2239 	atf_tc_set_md_var(tc, "descr",
2240 	    "Test blowfish-cbc with 448 bits key, ivmethod encblkno1");
2241 }
2242 
ATF_TC_BODY(cgd_bf_cbc_448_encblkno1,tc)2243 ATF_TC_BODY(cgd_bf_cbc_448_encblkno1, tc)
2244 {
2245 	const char imgpath[] = "blowfish-cbc-448-encblkno1.img";
2246 	const char *dkpath = "/dev/dk";
2247 	const size_t dksize = 4 * SECSIZE; /* Last blkno is 3. */
2248 	int dkfd, cgdfd;
2249 
2250 	rump_init();
2251 
2252 	RL(dkfd = open_disk(dkpath, imgpath, dksize));
2253 
2254 	RL(cgdfd = open_cgd(0));
2255 	RL(configure_cgd(cgdfd, dkpath, "blowfish-cbc", "encblkno1",
2256 	    bf_cbc_448_key, sizeof(bf_cbc_448_key)));
2257 
2258 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_448_1_vectors[0]), 0);
2259 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_448_1_vectors[1]), 0);
2260 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_448_1_vectors[2]), 0);
2261 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_448_1_vectors[3]), 0);
2262 
2263 	RL(unconfigure_cgd(cgdfd));
2264 	RL(configure_cgd(cgdfd, dkpath, "blowfish-cbc", "encblkno1",
2265 	    bf_cbc_448_key, sizeof(bf_cbc_448_key)));
2266 
2267 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_448_1_vectors[0]), 0);
2268 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_448_1_vectors[1]), 0);
2269 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_448_1_vectors[2]), 0);
2270 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_448_1_vectors[3]), 0);
2271 
2272 	RL(unconfigure_cgd(cgdfd));
2273 	RL(rump_sys_close(cgdfd));
2274 
2275 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_448_1_vectors[0]), 0);
2276 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_448_1_vectors[1]), 0);
2277 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_448_1_vectors[2]), 0);
2278 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_448_1_vectors[3]), 0);
2279 
2280 	RL(close(dkfd));
2281 }
2282 
2283 ATF_TC(cgd_bf_cbc_448_encblkno8);
ATF_TC_HEAD(cgd_bf_cbc_448_encblkno8,tc)2284 ATF_TC_HEAD(cgd_bf_cbc_448_encblkno8, tc)
2285 {
2286 	atf_tc_set_md_var(tc, "descr",
2287 	    "Test blowfish-cbc with 448 bits key, ivmethod encblkno8");
2288 }
2289 
ATF_TC_BODY(cgd_bf_cbc_448_encblkno8,tc)2290 ATF_TC_BODY(cgd_bf_cbc_448_encblkno8, tc)
2291 {
2292 	const char imgpath[] = "blowfish-cbc-448-encblkno8.img";
2293 	const char *dkpath = "/dev/dk";
2294 	const size_t dksize = 4 * SECSIZE; /* Last blkno is 3. */
2295 	int dkfd, cgdfd;
2296 
2297 	rump_init();
2298 
2299 	RL(dkfd = open_disk(dkpath, imgpath, dksize));
2300 
2301 	RL(cgdfd = open_cgd(0));
2302 	RL(configure_cgd(cgdfd, dkpath, "blowfish-cbc", "encblkno8",
2303 	    bf_cbc_448_key, sizeof(bf_cbc_448_key)));
2304 
2305 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_448_8_vectors[0]), 0);
2306 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_448_8_vectors[1]), 0);
2307 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_448_8_vectors[2]), 0);
2308 	ATF_CHECK_EQ(write_testvec(cgdfd, &bf_cbc_448_8_vectors[3]), 0);
2309 
2310 	RL(unconfigure_cgd(cgdfd));
2311 	RL(configure_cgd(cgdfd, dkpath, "blowfish-cbc", "encblkno8",
2312 	    bf_cbc_448_key, sizeof(bf_cbc_448_key)));
2313 
2314 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_448_8_vectors[0]), 0);
2315 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_448_8_vectors[1]), 0);
2316 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_448_8_vectors[2]), 0);
2317 	ATF_CHECK_EQ(read_testvec(cgdfd, &bf_cbc_448_8_vectors[3]), 0);
2318 
2319 	RL(unconfigure_cgd(cgdfd));
2320 	RL(rump_sys_close(cgdfd));
2321 
2322 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_448_8_vectors[0]), 0);
2323 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_448_8_vectors[1]), 0);
2324 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_448_8_vectors[2]), 0);
2325 	ATF_CHECK_EQ(check_testvec(dkfd, &bf_cbc_448_8_vectors[3]), 0);
2326 
2327 	RL(close(dkfd));
2328 }
2329 
ATF_TP_ADD_TCS(tp)2330 ATF_TP_ADD_TCS(tp)
2331 {
2332 
2333 	ATF_TP_ADD_TC(tp, cgd_bf_cbc_128_encblkno1);
2334 	ATF_TP_ADD_TC(tp, cgd_bf_cbc_128_encblkno8);
2335 	ATF_TP_ADD_TC(tp, cgd_bf_cbc_256_encblkno1);
2336 	ATF_TP_ADD_TC(tp, cgd_bf_cbc_256_encblkno8);
2337 	ATF_TP_ADD_TC(tp, cgd_bf_cbc_448_encblkno1);
2338 	ATF_TP_ADD_TC(tp, cgd_bf_cbc_448_encblkno8);
2339 
2340 	return atf_no_error();
2341 }
2342