1 /* $NetBSD: t_cgd_aes.c,v 1.6 2017/01/13 21:30:39 christos Exp $ */
2 /*-
3 * Copyright (c) 2016 The NetBSD Foundation, Inc.
4 * Copyright (c) 2007 The Institute of Electrical and Electronics Engineers, Inc
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Alexander Nasonov.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 *
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in
18 * the documentation and/or other materials provided with the
19 * distribution.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 */
34
35 #include <sys/types.h>
36 #include <sys/ioctl.h>
37 #include <sys/sysctl.h>
38
39 #include <atf-c.h>
40 #include <fcntl.h>
41 #include <stdio.h>
42 #include <stdlib.h>
43 #include <string.h>
44 #include <unistd.h>
45 #include <util.h>
46
47 #include <dev/cgdvar.h>
48
49 #include <rump/rump.h>
50 #include <rump/rump_syscalls.h>
51
52 #include "h_macros.h"
53
54 #define SECSIZE 512
55
56 struct testvec {
57 unsigned int blkno;
58 const uint8_t *ptxt; /* PlainText */
59 const uint8_t *ctxt; /* CipherText */
60 };
61
62 /*
63 * 128 bits CBC key, NUL terminated.
64 */
65 static const char aes_cbc_128_key[17] = {
66 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 01234567 */
67 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, /* 89ABCDEF */
68 0
69 };
70
71 /*
72 * 192 bits CBC key, NUL terminated.
73 */
74 static const char aes_cbc_192_key[25] = {
75 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, /* ABCDEFGH */
76 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, /* IJKLMNOP */
77 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, /* QRSTUVWX */
78 0
79 };
80
81 /*
82 * 256 bits CBC key, NUL terminated.
83 */
84 static const char aes_cbc_256_key[33] = {
85 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 01234567 */
86 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, /* 89ABCDEF */
87 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 01234567 */
88 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, /* 89abcdef */
89 0
90 };
91
92 static const uint8_t aes_cbc_ptxt[SECSIZE] =
93 " abcdefghijklmnop"
94 " abcdefghijklmnop"
95 " abcdefghijklmnop"
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
110 /*
111 * IV method encblkno1, blkno 0.
112 */
113 static const uint8_t aes_cbc_128_encblkno1_vec0_ctxt[SECSIZE] = {
114 0x1e, 0x95, 0x12, 0x15, 0xf6, 0xe0, 0xa7, 0x56,
115 0x95, 0xa0, 0xa7, 0x35, 0x77, 0xf4, 0xdd, 0xdc,
116 0x37, 0xc0, 0x28, 0x20, 0x00, 0x79, 0xa0, 0x35,
117 0xe0, 0x83, 0x23, 0x95, 0x4e, 0xea, 0x8d, 0xa2,
118 0x11, 0xbf, 0x9a, 0xd5, 0x21, 0x1e, 0x15, 0xb9,
119 0xd1, 0x2e, 0xd2, 0xd9, 0xa5, 0xcc, 0x26, 0x75,
120 0xba, 0x3e, 0x30, 0x11, 0xb2, 0x40, 0xdd, 0x1d,
121 0x07, 0x3b, 0xe6, 0x00, 0xa7, 0x31, 0x9e, 0x58,
122 0x41, 0xf3, 0x02, 0xf5, 0xad, 0x35, 0x79, 0x9a,
123 0x9e, 0x03, 0xc8, 0x7a, 0x9d, 0x1d, 0x58, 0x9f,
124 0x98, 0x67, 0xe2, 0x49, 0x81, 0x0c, 0x23, 0x90,
125 0xd8, 0xc6, 0xf0, 0xc5, 0x73, 0x46, 0xd5, 0x14,
126 0x1d, 0x78, 0x24, 0x7c, 0x9f, 0x5c, 0x8c, 0xe6,
127 0x5d, 0x85, 0x7a, 0x5f, 0x76, 0xcc, 0xd8, 0xe9,
128 0x03, 0xff, 0xfd, 0xd4, 0x12, 0x3f, 0xcb, 0xb0,
129 0xfe, 0xfd, 0x86, 0x00, 0x0c, 0xe3, 0xdd, 0xa6,
130 0x89, 0x92, 0xfe, 0xc8, 0x07, 0x5a, 0x94, 0x55,
131 0x75, 0xae, 0x68, 0x47, 0xba, 0x84, 0x75, 0x58,
132 0x33, 0x30, 0x2c, 0x16, 0x5b, 0xe9, 0x3f, 0x2a,
133 0x09, 0xf9, 0x69, 0x23, 0x77, 0xd7, 0x2b, 0x95,
134 0x4b, 0x78, 0x59, 0xcc, 0xfa, 0xf5, 0x79, 0xd2,
135 0x05, 0x87, 0x66, 0x57, 0x93, 0xbf, 0x05, 0x90,
136 0x4d, 0x6d, 0xd2, 0x72, 0x92, 0x24, 0xec, 0x14,
137 0xe7, 0xbf, 0x82, 0x57, 0xbb, 0x14, 0x51, 0xe6,
138 0xce, 0x3f, 0xa1, 0xfc, 0x63, 0x75, 0xee, 0xde,
139 0xf9, 0x31, 0xd3, 0xa0, 0x07, 0xcd, 0x4d, 0x8f,
140 0x83, 0x7d, 0x65, 0xe1, 0xc6, 0x60, 0x9e, 0x5c,
141 0x51, 0x76, 0xfa, 0x64, 0xdf, 0xdc, 0xaf, 0x38,
142 0xee, 0xe9, 0x8f, 0x4b, 0xa0, 0x3a, 0x21, 0xdf,
143 0x58, 0x3b, 0x73, 0xf5, 0x30, 0xbb, 0x29, 0xe0,
144 0xff, 0x60, 0xf0, 0x05, 0x5e, 0x37, 0xbc, 0x78,
145 0x95, 0x3f, 0xa8, 0xd4, 0xb4, 0x82, 0x0d, 0xe1,
146 0x10, 0xe3, 0xa7, 0x61, 0x37, 0x58, 0x28, 0x14,
147 0x22, 0x57, 0x32, 0x28, 0x80, 0x98, 0x3e, 0x5f,
148 0x71, 0xcf, 0x34, 0xb8, 0x6d, 0x6b, 0xc0, 0x23,
149 0xc1, 0x9e, 0x58, 0x4f, 0xd5, 0xa4, 0x14, 0x03,
150 0x2a, 0xed, 0xc4, 0xa7, 0x77, 0x7c, 0x4f, 0x94,
151 0x91, 0x1d, 0x47, 0x34, 0x82, 0xe8, 0x9d, 0x32,
152 0x5c, 0xc7, 0x38, 0xe9, 0x92, 0xcd, 0x35, 0xfd,
153 0x1c, 0xcc, 0x3c, 0x28, 0x75, 0x6f, 0xff, 0xd5,
154 0xe8, 0xbf, 0x90, 0x92, 0x34, 0x13, 0x11, 0x89,
155 0xe0, 0xa2, 0x25, 0xeb, 0x82, 0x63, 0x31, 0x80,
156 0x50, 0x6c, 0x99, 0xaa, 0x97, 0x0e, 0x59, 0x45,
157 0x64, 0xb8, 0x77, 0x78, 0x6b, 0x24, 0xac, 0xc0,
158 0xc9, 0xa9, 0xbc, 0x13, 0xd1, 0x5e, 0x50, 0x9a,
159 0x91, 0x1a, 0x08, 0xf7, 0xc5, 0x18, 0x9f, 0x87,
160 0x97, 0x9c, 0x0a, 0x27, 0xf1, 0x66, 0xf8, 0x09,
161 0x52, 0x09, 0x41, 0x07, 0xc1, 0xa1, 0x91, 0xa4,
162 0x59, 0x09, 0x75, 0x57, 0x5b, 0x53, 0x79, 0x58,
163 0xa2, 0x9e, 0x49, 0xa2, 0x5e, 0xf7, 0x28, 0x1c,
164 0x43, 0xa6, 0xcb, 0x88, 0x46, 0x84, 0xc9, 0x7f,
165 0x84, 0xdb, 0x45, 0x0c, 0xb3, 0x7f, 0x01, 0x40,
166 0x71, 0x3e, 0x48, 0x12, 0x1f, 0xbc, 0x1e, 0xdf,
167 0x41, 0x50, 0xb2, 0x11, 0x67, 0x83, 0x19, 0x04,
168 0x0e, 0x21, 0xd5, 0xf2, 0x54, 0x99, 0xfb, 0x47,
169 0xf2, 0x5e, 0x02, 0x4b, 0x61, 0x6d, 0xef, 0x78,
170 0x29, 0xe4, 0x3a, 0x56, 0x14, 0x20, 0x6f, 0x70,
171 0x82, 0xea, 0x5d, 0xbc, 0x48, 0x89, 0x34, 0x69,
172 0xdb, 0x4a, 0x06, 0xa7, 0xd6, 0xc7, 0xb7, 0x06,
173 0x8e, 0x64, 0x21, 0x3e, 0xa6, 0x32, 0x61, 0x59,
174 0x03, 0xea, 0xc3, 0x71, 0xf0, 0x26, 0x02, 0xe0,
175 0x71, 0x95, 0x38, 0x11, 0x32, 0xe6, 0x3b, 0x25,
176 0x53, 0x14, 0x24, 0x34, 0xe8, 0x8c, 0xa8, 0xef,
177 0x52, 0xfe, 0x06, 0x2c, 0x20, 0x88, 0x4f, 0xa6,
178 };
179
180 /*
181 * IV method encblkno1, blkno 1.
182 */
183 static const uint8_t aes_cbc_128_encblkno1_vec1_ctxt[SECSIZE] = {
184 0x2f, 0x69, 0x3e, 0x95, 0x87, 0x91, 0x99, 0xd4,
185 0xd9, 0x5d, 0xf2, 0x52, 0x32, 0x54, 0x2a, 0x80,
186 0xa0, 0x77, 0x6e, 0x73, 0x15, 0xb4, 0xc9, 0x13,
187 0x85, 0xed, 0x79, 0x9b, 0x84, 0x0a, 0x7e, 0xdb,
188 0xee, 0x09, 0x78, 0x11, 0x28, 0xd5, 0x26, 0xec,
189 0x1d, 0x52, 0xba, 0x33, 0x26, 0xeb, 0x91, 0xc6,
190 0x4b, 0xf0, 0x38, 0xdf, 0x9f, 0x9d, 0x6c, 0xd8,
191 0x49, 0x83, 0x88, 0xbe, 0x62, 0x2d, 0x5e, 0x88,
192 0xc0, 0x35, 0xe4, 0xc3, 0xc9, 0x9f, 0x62, 0x59,
193 0x16, 0xa7, 0x2e, 0xc0, 0xda, 0x3c, 0x2e, 0x10,
194 0x53, 0xf0, 0x84, 0x27, 0x38, 0xd0, 0xf4, 0xb5,
195 0x7c, 0x4a, 0x63, 0x04, 0x51, 0x22, 0xae, 0xf3,
196 0xe7, 0x97, 0x53, 0xee, 0xe6, 0xaf, 0xc3, 0x49,
197 0x3a, 0x5a, 0x74, 0x83, 0x18, 0xa3, 0x6b, 0xf3,
198 0x6a, 0x3b, 0xe2, 0x1b, 0xd4, 0x64, 0x41, 0xdf,
199 0xd1, 0xd2, 0xdd, 0x22, 0xa8, 0x66, 0xbd, 0x8e,
200 0xc4, 0x9a, 0x6d, 0x15, 0x38, 0x5b, 0x50, 0x9a,
201 0x65, 0x48, 0x97, 0xf1, 0x04, 0x85, 0x8b, 0x5c,
202 0x44, 0x32, 0x15, 0xea, 0x28, 0x5f, 0x98, 0x53,
203 0xb4, 0x80, 0xd0, 0x2c, 0x59, 0x04, 0x08, 0xaf,
204 0xa4, 0xb7, 0x49, 0xd1, 0x98, 0x87, 0xb9, 0xb6,
205 0x3d, 0x89, 0xd1, 0xbe, 0xf4, 0x89, 0xec, 0xf9,
206 0x2d, 0xc7, 0xc6, 0xe9, 0xe6, 0xfa, 0x1e, 0x67,
207 0x68, 0xe7, 0xb7, 0x91, 0x55, 0x77, 0xf3, 0x27,
208 0x38, 0x23, 0xcf, 0x2e, 0x3e, 0x8b, 0xfd, 0xb3,
209 0x90, 0xd8, 0x6b, 0x1e, 0x93, 0x8f, 0xb6, 0xc1,
210 0x27, 0xc2, 0xb7, 0x76, 0x10, 0x69, 0xe8, 0x7f,
211 0xfc, 0x03, 0x59, 0xa4, 0xd3, 0x7f, 0x2f, 0x03,
212 0x1c, 0x21, 0x6d, 0x2e, 0xae, 0xba, 0xa2, 0x04,
213 0x67, 0xe9, 0x33, 0xc9, 0x3a, 0x96, 0xb6, 0x7c,
214 0xf6, 0x21, 0x6b, 0x34, 0x9a, 0x5b, 0xa0, 0x8b,
215 0x51, 0xf0, 0xd4, 0x3a, 0xa3, 0xcb, 0x22, 0xfb,
216 0x8a, 0x56, 0xab, 0x9a, 0x15, 0x75, 0x07, 0x87,
217 0x32, 0xa7, 0x15, 0xc7, 0xd9, 0x40, 0x95, 0xe5,
218 0xfb, 0xb0, 0xc5, 0xb1, 0x60, 0xf8, 0xcc, 0x8b,
219 0x30, 0x20, 0xd9, 0x84, 0x6f, 0xa2, 0xcb, 0x72,
220 0xf5, 0xa5, 0x2c, 0xa3, 0xc6, 0x1c, 0xd2, 0x74,
221 0x01, 0x74, 0xdd, 0xb4, 0x68, 0x3b, 0x3b, 0x3e,
222 0x4f, 0xb5, 0x67, 0x9a, 0x9c, 0x37, 0x3d, 0xbf,
223 0xd3, 0xab, 0xd7, 0x70, 0x03, 0x28, 0x5c, 0x3b,
224 0xb7, 0x08, 0x38, 0x3d, 0x69, 0xa9, 0xcb, 0x63,
225 0x04, 0x95, 0x8a, 0x16, 0x4c, 0xff, 0x9f, 0x0c,
226 0xe2, 0x51, 0x95, 0x44, 0x52, 0x3b, 0x59, 0x9d,
227 0x0b, 0x77, 0xa0, 0x39, 0x40, 0xea, 0x33, 0x25,
228 0xc8, 0xc5, 0x90, 0x47, 0x23, 0xe3, 0x03, 0x8c,
229 0x6a, 0xe0, 0x4f, 0x76, 0xe7, 0x72, 0x82, 0xcc,
230 0xb2, 0xfd, 0xfb, 0x82, 0x1a, 0x28, 0x30, 0x89,
231 0x0e, 0x25, 0xa7, 0x63, 0x85, 0x2e, 0x9b, 0xa6,
232 0x0b, 0xa0, 0xb5, 0x34, 0xa2, 0x2e, 0x7f, 0xd4,
233 0xe5, 0xd6, 0x95, 0xe8, 0x09, 0x3d, 0x4d, 0xdf,
234 0xd9, 0xc0, 0x63, 0x17, 0xa5, 0x9c, 0xf6, 0xa3,
235 0x59, 0x17, 0xc0, 0xf8, 0xa2, 0x11, 0x14, 0x88,
236 0xf0, 0x1e, 0x4a, 0x4b, 0x13, 0xf6, 0xd6, 0x09,
237 0xac, 0xf8, 0x39, 0x5d, 0x4c, 0x68, 0x69, 0x99,
238 0x08, 0xd4, 0xf5, 0x39, 0x6d, 0x78, 0xde, 0xb5,
239 0x6f, 0x34, 0xc4, 0x28, 0x73, 0x6c, 0x29, 0xa1,
240 0xef, 0xfe, 0xed, 0x56, 0xb2, 0x70, 0x7b, 0xd5,
241 0x5b, 0xd1, 0x09, 0x6a, 0x9a, 0x59, 0xe9, 0x79,
242 0xe9, 0xee, 0xa4, 0x03, 0xc1, 0x67, 0xce, 0x62,
243 0xf6, 0x4f, 0x04, 0xa5, 0x04, 0x71, 0x13, 0xeb,
244 0x3d, 0x0a, 0x65, 0x2f, 0x57, 0xb0, 0xc0, 0xa4,
245 0xf2, 0x8d, 0x78, 0x90, 0xeb, 0xc9, 0x5e, 0x8b,
246 0xd8, 0xfb, 0xbc, 0x74, 0x1a, 0x70, 0x94, 0x2c,
247 0xeb, 0xf2, 0x5e, 0x6d, 0xbb, 0x96, 0x7a, 0x2c,
248 };
249
250 /*
251 * IV method encblkno1, blkno 2.
252 */
253 static const uint8_t aes_cbc_128_encblkno1_vec2_ctxt[SECSIZE] = {
254 0xbc, 0x49, 0x35, 0x2c, 0xe3, 0x10, 0x12, 0x65,
255 0x7a, 0xf4, 0xde, 0xd3, 0xf8, 0xe1, 0x49, 0x97,
256 0x0a, 0x07, 0x93, 0x6c, 0xf8, 0x0e, 0xb7, 0xdf,
257 0x53, 0xba, 0x1e, 0x8e, 0x14, 0xbd, 0xf6, 0x81,
258 0xd6, 0xf6, 0x3d, 0xb2, 0xe7, 0x6a, 0x9d, 0x50,
259 0x68, 0xc2, 0x75, 0x8e, 0xfb, 0x44, 0xfa, 0xc8,
260 0x9f, 0x30, 0x15, 0xd5, 0xbe, 0xce, 0x04, 0xc1,
261 0x99, 0xde, 0x3d, 0x2b, 0xc1, 0xc4, 0x8a, 0xb1,
262 0xc5, 0x54, 0x47, 0x52, 0xf6, 0x38, 0x11, 0xcb,
263 0x11, 0xf6, 0xb7, 0xbd, 0x4d, 0x24, 0xa1, 0xac,
264 0x04, 0x17, 0x7e, 0x3c, 0xbc, 0x3b, 0xa0, 0x8d,
265 0xfb, 0x22, 0x82, 0x56, 0xa2, 0xbe, 0xfe, 0xe7,
266 0xde, 0xa4, 0xe9, 0xeb, 0xa0, 0x7a, 0x45, 0xc9,
267 0x18, 0x0b, 0x14, 0xd5, 0xff, 0x4c, 0xe5, 0x86,
268 0xac, 0xac, 0xaa, 0xb4, 0x70, 0x0c, 0x4a, 0x20,
269 0xb6, 0xd8, 0x2d, 0xac, 0x09, 0xd8, 0xf6, 0x24,
270 0xdf, 0xa5, 0x62, 0xef, 0x8c, 0x01, 0xa8, 0x1d,
271 0x8f, 0x52, 0xee, 0xa6, 0x2f, 0x9b, 0x81, 0x18,
272 0x0e, 0x6b, 0xa3, 0xe5, 0x67, 0xb3, 0xd5, 0x30,
273 0xb1, 0x9f, 0x87, 0x05, 0xd0, 0x52, 0x62, 0x6f,
274 0xb9, 0x3b, 0xbc, 0x0c, 0x0c, 0xcb, 0x73, 0x55,
275 0x23, 0x83, 0x14, 0x78, 0x05, 0x5b, 0x05, 0xf5,
276 0x3e, 0xa7, 0xf3, 0x4d, 0x0d, 0x34, 0x6f, 0xe0,
277 0x58, 0x52, 0x0a, 0x82, 0xa7, 0x49, 0x8a, 0xd2,
278 0x23, 0xb1, 0xc5, 0x0d, 0xa7, 0x0f, 0x56, 0xfc,
279 0x7e, 0xf6, 0x19, 0x4b, 0xe7, 0x63, 0x72, 0x4c,
280 0xb8, 0x5c, 0x80, 0x54, 0xf5, 0x1f, 0xb0, 0x29,
281 0x40, 0x88, 0x75, 0x54, 0x42, 0xca, 0x2c, 0xc3,
282 0xcf, 0xd7, 0xc1, 0xb2, 0xd6, 0x90, 0x70, 0x5e,
283 0xf5, 0x58, 0x70, 0xe0, 0xff, 0x5a, 0xf5, 0xee,
284 0x32, 0x4f, 0x61, 0x1c, 0xf6, 0xbf, 0xd5, 0x7c,
285 0x73, 0xb9, 0x1d, 0x30, 0xc2, 0xfb, 0x2f, 0x9a,
286 0xf7, 0x57, 0x2e, 0x87, 0x7d, 0xcb, 0xdd, 0x7e,
287 0xda, 0xec, 0x47, 0x1a, 0x0e, 0x70, 0x2d, 0x6e,
288 0x18, 0x2b, 0x89, 0xc1, 0x85, 0x58, 0x6d, 0x4b,
289 0x45, 0x11, 0xcf, 0x82, 0x9f, 0x31, 0xd0, 0x42,
290 0x11, 0xca, 0xa8, 0x52, 0x66, 0xf7, 0xf1, 0x1d,
291 0x86, 0xe3, 0xb4, 0x41, 0xcb, 0x92, 0xb1, 0x9f,
292 0x8d, 0x8e, 0x08, 0xe9, 0xc4, 0x66, 0xce, 0x9d,
293 0xae, 0x91, 0xaf, 0xe6, 0xa6, 0x2e, 0x06, 0x3a,
294 0xf5, 0x27, 0x48, 0xe4, 0x31, 0x0f, 0xc5, 0xdf,
295 0x29, 0x56, 0xed, 0x62, 0xf3, 0xef, 0xca, 0xa6,
296 0x58, 0xd1, 0x84, 0x99, 0xd3, 0x34, 0x67, 0x92,
297 0x6a, 0xb2, 0xd1, 0xd1, 0x50, 0x1f, 0xe9, 0xd8,
298 0x3c, 0xbe, 0x12, 0x97, 0x7c, 0x4f, 0xc0, 0xbe,
299 0x91, 0x32, 0x15, 0xd5, 0xf2, 0x5e, 0xe6, 0x13,
300 0x86, 0xfa, 0xc6, 0xde, 0xd8, 0xe1, 0x70, 0xb4,
301 0xf7, 0x5b, 0x9f, 0x79, 0x55, 0x22, 0x7a, 0xe1,
302 0x54, 0x40, 0x39, 0x11, 0xe1, 0x78, 0x01, 0x01,
303 0xc0, 0x44, 0xeb, 0x92, 0xb9, 0x01, 0xdd, 0x56,
304 0xb9, 0x7e, 0xa0, 0x50, 0x41, 0x58, 0xb2, 0x13,
305 0x12, 0x44, 0xd2, 0x39, 0xf2, 0x76, 0x3c, 0x53,
306 0x36, 0xfe, 0x17, 0x74, 0x91, 0x8d, 0xbe, 0xc5,
307 0x40, 0xf7, 0xa2, 0xe9, 0x65, 0xd9, 0xdf, 0x80,
308 0x7b, 0xd9, 0xc3, 0x1f, 0xb4, 0xfc, 0x9f, 0x8d,
309 0x7a, 0x4e, 0x1e, 0x32, 0x6d, 0xb1, 0x82, 0x1e,
310 0x0c, 0xb6, 0x0b, 0xe6, 0x15, 0x82, 0x5c, 0xcc,
311 0xc8, 0x4a, 0x73, 0x56, 0x9d, 0x11, 0xfa, 0xcd,
312 0x21, 0x95, 0x23, 0x71, 0xe8, 0xfe, 0x06, 0x43,
313 0xf6, 0x17, 0x51, 0x28, 0x0d, 0xfb, 0x0a, 0x49,
314 0x1b, 0x35, 0x1e, 0x4a, 0x38, 0x08, 0x6b, 0xcd,
315 0x67, 0x21, 0x94, 0x09, 0x28, 0xca, 0x0a, 0x18,
316 0xdf, 0x6c, 0x86, 0x47, 0x10, 0x29, 0x81, 0x9a,
317 0x73, 0xba, 0x78, 0xbd, 0xc0, 0x61, 0xee, 0x23,
318 };
319
320 /*
321 * IV method encblkno1, blkno 3.
322 */
323 static const uint8_t aes_cbc_128_encblkno1_vec3_ctxt[SECSIZE] = {
324 0x29, 0x9f, 0xb1, 0x0f, 0x7d, 0xb4, 0xd9, 0xbb,
325 0xf9, 0x06, 0x60, 0xdc, 0xb9, 0xeb, 0x73, 0x6e,
326 0xfe, 0xdb, 0x99, 0x29, 0xe8, 0x42, 0x46, 0xe7,
327 0x49, 0xcf, 0x90, 0x2d, 0x08, 0xd7, 0xd5, 0xbf,
328 0x0f, 0x4f, 0x66, 0xce, 0xcd, 0xb1, 0x8a, 0xc7,
329 0x47, 0xc9, 0x8e, 0xe3, 0x9f, 0x80, 0x79, 0xc6,
330 0xa8, 0xe5, 0x20, 0x66, 0x58, 0xde, 0xab, 0x87,
331 0x5e, 0x7e, 0xcd, 0x55, 0x81, 0x09, 0x40, 0xd9,
332 0x8b, 0x7e, 0xd3, 0xf9, 0x16, 0x55, 0x72, 0x7d,
333 0xe8, 0x36, 0x76, 0x06, 0x77, 0x47, 0xa5, 0xdc,
334 0x80, 0x33, 0x7d, 0x88, 0x5f, 0x56, 0x48, 0x0f,
335 0x66, 0xb5, 0x91, 0x9d, 0xf8, 0xdb, 0x83, 0x0d,
336 0xd4, 0xc6, 0x13, 0xfc, 0xd4, 0xe5, 0x34, 0x81,
337 0x70, 0x4d, 0x96, 0x82, 0x5d, 0xb2, 0x36, 0x37,
338 0xdf, 0xd2, 0x5e, 0x31, 0xf0, 0x9d, 0x6d, 0xb7,
339 0xf9, 0x2d, 0xcb, 0x77, 0xb8, 0x59, 0xa0, 0xbb,
340 0x4f, 0x8d, 0xa0, 0xd1, 0x49, 0x17, 0x93, 0x3c,
341 0xf0, 0x4e, 0x72, 0xdd, 0x99, 0x9a, 0x87, 0xf1,
342 0x01, 0x89, 0xdf, 0xef, 0xed, 0x04, 0x86, 0x3d,
343 0x9b, 0xab, 0x6c, 0xa7, 0xef, 0x1b, 0xbb, 0x24,
344 0xbc, 0x65, 0x01, 0x06, 0x12, 0x3f, 0x7e, 0x9f,
345 0x83, 0xf3, 0xd4, 0x43, 0x18, 0x03, 0xa3, 0x07,
346 0xbc, 0x85, 0xe8, 0xdb, 0x6c, 0x8f, 0xaf, 0x70,
347 0x71, 0x5d, 0xbc, 0x6d, 0x14, 0x05, 0xdf, 0xce,
348 0x9f, 0xe2, 0xa3, 0x51, 0x66, 0x92, 0x52, 0x19,
349 0x98, 0xbd, 0xb2, 0x68, 0x79, 0xf4, 0x5d, 0x71,
350 0xcb, 0xa0, 0x1b, 0x77, 0x34, 0x46, 0x69, 0x3c,
351 0xa4, 0x0f, 0x72, 0xf5, 0x73, 0xf6, 0xa0, 0xe9,
352 0x72, 0xef, 0xa1, 0xcc, 0x43, 0xfc, 0xb7, 0xf3,
353 0x59, 0xeb, 0x40, 0x61, 0x02, 0x26, 0x9b, 0x71,
354 0x57, 0x17, 0x36, 0xac, 0xc8, 0xd5, 0x9d, 0xcb,
355 0x4d, 0x4f, 0xf7, 0xc1, 0x58, 0xce, 0xbf, 0x73,
356 0xe7, 0xd0, 0x58, 0x0d, 0x08, 0x01, 0x8f, 0x68,
357 0x1b, 0x3f, 0x3a, 0x7b, 0xdb, 0x9e, 0xa7, 0x33,
358 0x59, 0x91, 0xa8, 0xe3, 0x58, 0x22, 0x3f, 0x97,
359 0xe1, 0xdb, 0xd6, 0x99, 0x0e, 0xdd, 0x76, 0xcd,
360 0x4d, 0x02, 0x28, 0x43, 0x8a, 0xdd, 0x10, 0xad,
361 0x55, 0xe0, 0x62, 0xf7, 0x44, 0xbc, 0x3f, 0x99,
362 0x3c, 0x09, 0x25, 0xfb, 0xfd, 0x1e, 0x4c, 0x45,
363 0x0e, 0x6e, 0x75, 0x15, 0x48, 0x19, 0x08, 0xc3,
364 0x2b, 0x81, 0x60, 0x5f, 0x19, 0x09, 0x74, 0x0a,
365 0xbd, 0x0d, 0x8d, 0x94, 0x55, 0x04, 0x2b, 0x8e,
366 0x0d, 0x10, 0x60, 0x64, 0x0d, 0x7f, 0x63, 0x2e,
367 0x89, 0x0b, 0xfc, 0x1c, 0xbc, 0xf3, 0x66, 0xc5,
368 0x80, 0x93, 0x3a, 0x74, 0x15, 0x11, 0xd5, 0xba,
369 0xbc, 0x06, 0x3f, 0x85, 0xcc, 0x6c, 0xd3, 0xf2,
370 0x74, 0xc6, 0x10, 0x15, 0x0a, 0x02, 0x66, 0xa4,
371 0xa8, 0x93, 0x0b, 0x5c, 0xe7, 0x13, 0x96, 0x90,
372 0xdd, 0xe3, 0x25, 0x22, 0x46, 0x7b, 0x49, 0xde,
373 0x72, 0x55, 0xf3, 0x30, 0x62, 0x5f, 0x7a, 0x2a,
374 0x37, 0x88, 0xea, 0x57, 0x99, 0x64, 0x50, 0x2d,
375 0xd3, 0x6a, 0x09, 0x4b, 0xd6, 0x61, 0xf2, 0x22,
376 0x53, 0x36, 0xf7, 0x42, 0x21, 0xde, 0xda, 0xcb,
377 0x8b, 0x6f, 0xf3, 0x4e, 0x2c, 0x16, 0xfb, 0xfc,
378 0x13, 0xa7, 0xd1, 0xd8, 0xfd, 0x16, 0x39, 0x20,
379 0xe0, 0xb2, 0xb4, 0xd5, 0x40, 0x93, 0x30, 0xf3,
380 0xab, 0x88, 0xe3, 0xfb, 0xbe, 0xb8, 0x02, 0x3a,
381 0x78, 0x2d, 0x56, 0x4b, 0x92, 0x5b, 0x0a, 0x8d,
382 0x18, 0xa4, 0x5b, 0x11, 0x60, 0x0b, 0x45, 0xad,
383 0x0b, 0x64, 0x96, 0x7d, 0x84, 0xf2, 0x20, 0xa8,
384 0x95, 0x78, 0xb3, 0xb5, 0x98, 0x1f, 0xa7, 0x3e,
385 0x30, 0x77, 0x43, 0xd2, 0x8c, 0x20, 0xc5, 0x5e,
386 0x76, 0xcd, 0x2c, 0x7c, 0xfa, 0x34, 0x36, 0xda,
387 0x39, 0x00, 0x2e, 0x69, 0x4a, 0xb3, 0x0f, 0x6f,
388 };
389
390 const struct testvec aes_cbc_128_1_vectors[] = {
391 {
392 .blkno = 0,
393 .ptxt = aes_cbc_ptxt,
394 .ctxt = aes_cbc_128_encblkno1_vec0_ctxt,
395 },
396 {
397 .blkno = 1,
398 .ptxt = aes_cbc_ptxt,
399 .ctxt = aes_cbc_128_encblkno1_vec1_ctxt,
400 },
401 {
402 .blkno = 2,
403 .ptxt = aes_cbc_ptxt,
404 .ctxt = aes_cbc_128_encblkno1_vec2_ctxt,
405 },
406 {
407 .blkno = 3,
408 .ptxt = aes_cbc_ptxt,
409 .ctxt = aes_cbc_128_encblkno1_vec3_ctxt,
410 },
411 };
412
413 /*
414 * IV method encblkno8, blkno 0.
415 */
416 static const uint8_t aes_cbc_128_encblkno8_vec0_ctxt[SECSIZE] = {
417 0xa6, 0x64, 0xef, 0x0f, 0xc4, 0x45, 0xcc, 0x5e,
418 0xf8, 0x27, 0x42, 0x5e, 0xbd, 0x93, 0x99, 0xcd,
419 0x79, 0xa8, 0x7d, 0x72, 0xc4, 0x02, 0x99, 0xa6,
420 0xe4, 0x69, 0x57, 0x82, 0xdf, 0x32, 0x4e, 0x67,
421 0x2a, 0xd9, 0x58, 0x8c, 0x9f, 0xfc, 0x4d, 0xcf,
422 0x7b, 0xa4, 0xa1, 0xfa, 0xd9, 0x4d, 0xb5, 0x67,
423 0x06, 0x4a, 0x9e, 0x6d, 0xe8, 0xaa, 0xdd, 0xae,
424 0x8c, 0xda, 0xcf, 0x26, 0xd5, 0x94, 0x8d, 0x12,
425 0xf8, 0xdd, 0x21, 0x4c, 0xcb, 0xc8, 0x5d, 0xd1,
426 0x6a, 0x89, 0x37, 0xd0, 0x32, 0xe4, 0x87, 0xbc,
427 0x5d, 0xef, 0xca, 0x38, 0xd5, 0x08, 0xfb, 0xcf,
428 0xb7, 0x8d, 0x65, 0x52, 0x13, 0xea, 0x2d, 0x30,
429 0xd3, 0x9a, 0xe8, 0x9c, 0x76, 0x25, 0x44, 0x2a,
430 0xf1, 0xe1, 0xbb, 0xcd, 0xbc, 0x9c, 0xf5, 0xa3,
431 0xfb, 0x23, 0x53, 0x95, 0x61, 0xea, 0x46, 0x97,
432 0xf6, 0xbf, 0xdf, 0xf9, 0xb7, 0x94, 0x73, 0xa8,
433 0xc1, 0xaa, 0x64, 0xfb, 0x66, 0x26, 0x0f, 0x4c,
434 0xee, 0x3c, 0xb6, 0x3f, 0x13, 0x88, 0xaa, 0x7d,
435 0x91, 0x01, 0x1a, 0x95, 0x3b, 0xb5, 0x7e, 0x1f,
436 0xc1, 0x84, 0xa6, 0x83, 0x99, 0xe6, 0xaf, 0x21,
437 0x33, 0xff, 0x2e, 0xc9, 0xfe, 0xf2, 0xa1, 0x37,
438 0xed, 0x91, 0x73, 0x70, 0x4f, 0xb4, 0x69, 0x69,
439 0x98, 0x1d, 0x6d, 0xd4, 0xa4, 0xac, 0x73, 0x61,
440 0x04, 0xf5, 0x13, 0x50, 0x2a, 0xa9, 0xf7, 0x61,
441 0x78, 0xf5, 0x87, 0x26, 0xc5, 0x4a, 0x30, 0xbb,
442 0x94, 0x55, 0x51, 0xb4, 0xa0, 0x83, 0x30, 0xe6,
443 0xf7, 0xc7, 0x89, 0x61, 0x73, 0xd9, 0xbd, 0xe1,
444 0x4e, 0x14, 0x8a, 0x02, 0x3d, 0x7a, 0x58, 0x92,
445 0x41, 0xe7, 0x90, 0x8d, 0xd7, 0x67, 0x62, 0xf8,
446 0x99, 0xa7, 0x9d, 0x55, 0xec, 0x18, 0x6b, 0x42,
447 0xaf, 0x27, 0x97, 0xe5, 0x51, 0xa9, 0x10, 0x27,
448 0x5e, 0x3f, 0xac, 0xda, 0xd3, 0xb5, 0x2b, 0x43,
449 0x2e, 0x10, 0xdc, 0xd9, 0xe2, 0x2f, 0x4f, 0xfe,
450 0xf3, 0x0d, 0x06, 0x76, 0xf9, 0x25, 0xcd, 0x26,
451 0xef, 0x8e, 0x9b, 0xc2, 0xb3, 0x20, 0x2b, 0x00,
452 0xb6, 0xe6, 0x2e, 0xf7, 0x17, 0xc7, 0xa8, 0x3c,
453 0x00, 0xfc, 0x78, 0x8d, 0x10, 0x38, 0xd1, 0x11,
454 0x94, 0xed, 0xb4, 0x22, 0x13, 0xcb, 0x52, 0x0f,
455 0x0f, 0xd7, 0x33, 0x3b, 0xbd, 0x01, 0x04, 0x56,
456 0xfa, 0x2c, 0xaa, 0xaf, 0x2b, 0x93, 0xde, 0xf4,
457 0x31, 0x36, 0x13, 0x71, 0xef, 0x7a, 0xf0, 0xae,
458 0xbd, 0xa7, 0x4a, 0x57, 0xa5, 0xc5, 0xf3, 0x5c,
459 0x08, 0x2b, 0xe7, 0x12, 0x42, 0x4b, 0x4b, 0x12,
460 0x49, 0x3a, 0x2e, 0x26, 0x67, 0x67, 0xa1, 0xd5,
461 0x59, 0xa6, 0x18, 0x96, 0x22, 0x2b, 0xeb, 0x56,
462 0x1e, 0x0a, 0x08, 0x75, 0xb4, 0x2b, 0x5c, 0x0a,
463 0x4e, 0x9d, 0x17, 0xd4, 0x0c, 0xfe, 0x46, 0x60,
464 0x6d, 0xfa, 0xc0, 0xb9, 0x5e, 0x1f, 0x88, 0x0e,
465 0x08, 0x2c, 0xf3, 0xb4, 0x3a, 0x15, 0xc5, 0xf9,
466 0x5b, 0x85, 0x92, 0x94, 0xa8, 0x8f, 0x2c, 0x3a,
467 0x7e, 0x22, 0x86, 0x88, 0x51, 0x03, 0xee, 0xf9,
468 0x2e, 0x83, 0xce, 0x39, 0x0c, 0x76, 0x64, 0xe5,
469 0x5a, 0x88, 0xef, 0xc5, 0x06, 0xb2, 0xe4, 0x13,
470 0x82, 0xc9, 0xee, 0xba, 0x6d, 0x56, 0xa8, 0x87,
471 0x51, 0x69, 0x3b, 0x86, 0x29, 0x8e, 0xe8, 0xb4,
472 0x44, 0x42, 0x07, 0x5b, 0xff, 0x0e, 0x1e, 0x9f,
473 0x42, 0xb1, 0xc8, 0x5f, 0xab, 0x3b, 0xc7, 0xba,
474 0x75, 0x20, 0xe6, 0x9f, 0x93, 0xb5, 0xcf, 0x8f,
475 0x7c, 0x1c, 0xf3, 0xdb, 0x6a, 0xf4, 0xde, 0x00,
476 0xe9, 0xaf, 0xd5, 0xf4, 0x36, 0x98, 0x14, 0x2d,
477 0x53, 0x20, 0x74, 0xab, 0x0c, 0xf6, 0xcd, 0x15,
478 0x32, 0xa6, 0x01, 0x8d, 0x24, 0x1b, 0x4b, 0x1f,
479 0xa3, 0xfc, 0x38, 0x82, 0x3a, 0xa1, 0xb5, 0x52,
480 0x53, 0xc7, 0x2b, 0x30, 0x7c, 0x65, 0xb9, 0x7d,
481 };
482
483 /*
484 * IV method encblkno8, blkno 1.
485 */
486 static const uint8_t aes_cbc_128_encblkno8_vec1_ctxt[SECSIZE] = {
487 0x63, 0x45, 0x16, 0x0c, 0xe4, 0x4f, 0x51, 0xde,
488 0x74, 0xf8, 0x7b, 0xf5, 0x05, 0x17, 0x13, 0x1e,
489 0xa5, 0x3d, 0x84, 0xfa, 0x35, 0x5a, 0x2d, 0x3c,
490 0xb7, 0x61, 0x68, 0xff, 0xcd, 0x33, 0x1f, 0x0b,
491 0x53, 0x79, 0xf2, 0x2f, 0xbc, 0x8d, 0xac, 0xb9,
492 0xf9, 0xb7, 0x9c, 0x0a, 0x9d, 0xa1, 0x4d, 0x78,
493 0x9e, 0x4e, 0xfa, 0xe8, 0xc8, 0x46, 0x4b, 0x99,
494 0x91, 0x7e, 0x33, 0x6e, 0x18, 0x24, 0x01, 0xc3,
495 0x9f, 0x8c, 0x43, 0xb5, 0x15, 0x7e, 0xdd, 0xf9,
496 0x1b, 0xb0, 0xf2, 0xc3, 0x97, 0x1f, 0x7c, 0x3f,
497 0x43, 0x4c, 0x9f, 0x93, 0x29, 0x83, 0x8f, 0xad,
498 0xd1, 0x5e, 0x92, 0x1a, 0x17, 0xd1, 0xa0, 0x05,
499 0x6e, 0x62, 0x59, 0x80, 0x50, 0x6d, 0xe3, 0x28,
500 0x9a, 0x43, 0xdc, 0x81, 0x4f, 0x49, 0xc4, 0x98,
501 0xcd, 0x6d, 0x28, 0xb4, 0x86, 0xe4, 0x83, 0x45,
502 0xd4, 0x43, 0x52, 0x8a, 0xd6, 0xc8, 0x1c, 0x90,
503 0xeb, 0xf0, 0xe7, 0x76, 0xb4, 0x43, 0x9b, 0x56,
504 0x48, 0x73, 0xdd, 0x01, 0x50, 0x1c, 0x61, 0xfc,
505 0x22, 0xac, 0xf4, 0x27, 0x94, 0x02, 0x54, 0xd3,
506 0x7d, 0x25, 0xf6, 0x14, 0x29, 0xbb, 0x2b, 0x22,
507 0xc8, 0xe8, 0x7f, 0xa1, 0xfe, 0x19, 0x79, 0x97,
508 0xb6, 0xa6, 0xba, 0x5b, 0x89, 0xdf, 0x73, 0x6d,
509 0x79, 0x38, 0x5b, 0xf8, 0x89, 0xa2, 0x95, 0x1d,
510 0xda, 0x38, 0x17, 0x4b, 0x01, 0xf1, 0x7d, 0x0a,
511 0xa2, 0x8f, 0x5a, 0x02, 0x51, 0xb0, 0x88, 0x10,
512 0x16, 0xc8, 0x82, 0xb9, 0x06, 0x9f, 0x01, 0x94,
513 0xf9, 0xe0, 0x2e, 0x86, 0x8a, 0xb1, 0x7f, 0x74,
514 0x22, 0xce, 0xee, 0xa6, 0x66, 0xee, 0xe2, 0x1d,
515 0x98, 0x1b, 0x46, 0x22, 0x7e, 0x89, 0x0c, 0xc4,
516 0x91, 0xfb, 0xe4, 0xd7, 0x36, 0x2a, 0xa9, 0x53,
517 0xe9, 0xaf, 0x6c, 0xc1, 0xdd, 0x69, 0x4f, 0xde,
518 0xd8, 0xd0, 0x7f, 0xc9, 0xf4, 0x8f, 0x84, 0xfe,
519 0x0f, 0x16, 0x36, 0x90, 0x09, 0xd6, 0x0f, 0xbc,
520 0x85, 0xad, 0xe9, 0xc3, 0xa1, 0x8d, 0x14, 0x5c,
521 0x40, 0x7d, 0x0f, 0x22, 0xfe, 0x5e, 0xaf, 0xd9,
522 0x0f, 0xe5, 0x2e, 0xa6, 0x04, 0xda, 0x35, 0x90,
523 0x7f, 0x9a, 0x1f, 0xb8, 0x34, 0x1c, 0xd0, 0xf5,
524 0x5c, 0x29, 0xce, 0xbe, 0x57, 0xd8, 0x55, 0x15,
525 0x2d, 0x4c, 0x3c, 0x16, 0x93, 0x96, 0x3c, 0xf3,
526 0xa8, 0x2f, 0x09, 0xb3, 0x8b, 0xe3, 0xce, 0xf7,
527 0x3e, 0x8e, 0xcf, 0x47, 0xe2, 0xf2, 0xad, 0x06,
528 0x00, 0x9a, 0x3a, 0x55, 0xf5, 0x9e, 0xbf, 0x5a,
529 0x2e, 0x5a, 0x6c, 0x2b, 0x8f, 0x33, 0x71, 0x2c,
530 0x56, 0x43, 0xd1, 0x8b, 0xd2, 0x98, 0x14, 0xb7,
531 0x5a, 0xdc, 0x8b, 0xbc, 0xfe, 0x50, 0x99, 0x84,
532 0x48, 0x5f, 0xcd, 0xed, 0xce, 0x61, 0x6f, 0xa6,
533 0x83, 0xa3, 0x34, 0xbe, 0xf2, 0x66, 0xf3, 0x09,
534 0xf3, 0xd3, 0x97, 0xd4, 0xee, 0x66, 0x9a, 0x81,
535 0x62, 0x84, 0x85, 0x7f, 0x79, 0x18, 0xd2, 0x82,
536 0xd6, 0x96, 0x09, 0x61, 0x1e, 0x53, 0x97, 0x80,
537 0x0a, 0x81, 0x4b, 0x93, 0xf0, 0x03, 0x65, 0x18,
538 0x93, 0x5b, 0x60, 0x2f, 0xb5, 0xfe, 0x82, 0xaf,
539 0x85, 0xb7, 0x79, 0x7c, 0xee, 0xad, 0xea, 0xfa,
540 0x9b, 0xad, 0xca, 0x38, 0x21, 0x3d, 0x46, 0x8a,
541 0x5b, 0xa7, 0x55, 0x3d, 0x88, 0x4a, 0x52, 0xdb,
542 0xf2, 0x07, 0xed, 0xd6, 0x3c, 0x9f, 0x1b, 0x42,
543 0xb4, 0x14, 0x12, 0xb7, 0x00, 0xfc, 0x6a, 0x79,
544 0x61, 0x0b, 0x43, 0xaa, 0x44, 0x48, 0x30, 0x15,
545 0x48, 0x76, 0x27, 0x32, 0x7a, 0x2e, 0x25, 0x6a,
546 0x8c, 0x8c, 0x64, 0x67, 0x86, 0x54, 0x4a, 0x93,
547 0x14, 0xfe, 0x81, 0xf5, 0xcf, 0x98, 0x92, 0xd3,
548 0x92, 0xf5, 0x6a, 0x74, 0x28, 0x10, 0x6b, 0xd4,
549 0x1d, 0x64, 0x7e, 0x05, 0x32, 0xba, 0xf7, 0x4c,
550 0xe9, 0xa8, 0xa9, 0xc5, 0x35, 0x34, 0x26, 0x41,
551 };
552
553 /*
554 * IV method encblkno8, blkno 2.
555 */
556 static const uint8_t aes_cbc_128_encblkno8_vec2_ctxt[SECSIZE] = {
557 0x64, 0x7b, 0x62, 0x7a, 0xa6, 0xa9, 0xb3, 0x47,
558 0xbc, 0x03, 0x14, 0x3d, 0x9b, 0x56, 0xfc, 0x13,
559 0x08, 0x32, 0x81, 0xe3, 0x57, 0x3c, 0x0d, 0xbb,
560 0x85, 0x44, 0x47, 0x12, 0xc4, 0x80, 0x35, 0x37,
561 0xe1, 0xb4, 0x3f, 0x35, 0x98, 0x7c, 0xb0, 0x3b,
562 0x85, 0xab, 0x3d, 0x0b, 0xd3, 0x6f, 0xf9, 0x92,
563 0x00, 0x6b, 0x18, 0xe7, 0x31, 0x8b, 0x77, 0x4c,
564 0xd0, 0x7b, 0x1d, 0xfc, 0x95, 0xe6, 0x02, 0x01,
565 0x9c, 0x17, 0x4d, 0x9b, 0x3a, 0x1d, 0x12, 0x23,
566 0xd4, 0x24, 0xf8, 0x47, 0x5e, 0x2d, 0xfd, 0xc8,
567 0x74, 0x28, 0xb4, 0x3a, 0x99, 0x6b, 0xcc, 0xba,
568 0xe5, 0x51, 0x0b, 0xab, 0x4d, 0x63, 0xfc, 0x6d,
569 0x2d, 0xd9, 0x2b, 0x4f, 0xa4, 0x26, 0xc7, 0x8d,
570 0x9d, 0x12, 0x7f, 0xc7, 0x6b, 0x15, 0x8b, 0x4a,
571 0x41, 0xf8, 0x50, 0x32, 0x76, 0x10, 0xca, 0x8e,
572 0xfe, 0x08, 0x7d, 0x9a, 0xb5, 0x1a, 0xdb, 0x10,
573 0xb3, 0x6a, 0x5f, 0xd9, 0x0a, 0x5f, 0x31, 0x19,
574 0x3e, 0xa9, 0xa1, 0x72, 0x1f, 0x6c, 0x97, 0x20,
575 0xd4, 0xab, 0xb8, 0xad, 0xf7, 0x70, 0x12, 0xd0,
576 0x8f, 0x70, 0x24, 0x58, 0x2e, 0x99, 0xcd, 0xd4,
577 0xf4, 0xcd, 0xef, 0x93, 0xfb, 0x4f, 0x9a, 0x40,
578 0x46, 0x92, 0x6b, 0xd0, 0x25, 0x24, 0xec, 0x4d,
579 0x4c, 0x42, 0x50, 0x61, 0xb6, 0x21, 0xa6, 0x2e,
580 0xc1, 0x42, 0x9e, 0x86, 0x9f, 0x57, 0x2a, 0x2c,
581 0x82, 0xbd, 0xc2, 0x25, 0xb6, 0x9f, 0x2d, 0x9f,
582 0xba, 0xe0, 0xa6, 0x06, 0x04, 0x08, 0xc5, 0x1d,
583 0x8c, 0x0f, 0xbf, 0x21, 0x85, 0x6d, 0x61, 0x4d,
584 0x93, 0xc0, 0xa2, 0x8b, 0xca, 0x07, 0xd0, 0x88,
585 0x74, 0xf9, 0x42, 0x92, 0xd5, 0x0d, 0x0c, 0x34,
586 0xa6, 0xa5, 0x86, 0x51, 0xcf, 0x40, 0x36, 0x66,
587 0x35, 0x9f, 0xa8, 0x95, 0x0b, 0xfb, 0x0c, 0xe8,
588 0xdc, 0x12, 0x78, 0x4c, 0x52, 0xf4, 0xfc, 0x4a,
589 0x77, 0xdd, 0x77, 0x34, 0xf7, 0x35, 0x94, 0x7a,
590 0x31, 0x16, 0x86, 0x44, 0x50, 0x30, 0x1c, 0x6d,
591 0x9f, 0x66, 0x49, 0xb5, 0xe6, 0x71, 0x00, 0x83,
592 0xd1, 0xa0, 0x01, 0xff, 0xc3, 0x27, 0xaa, 0x9a,
593 0xdb, 0xad, 0x24, 0xdb, 0xbd, 0xde, 0xfd, 0xa6,
594 0xaa, 0x87, 0x98, 0x98, 0xde, 0x90, 0xd5, 0x40,
595 0x20, 0x8f, 0xe9, 0xdd, 0xa8, 0xec, 0xd3, 0x18,
596 0x20, 0x85, 0x5e, 0xd5, 0xe7, 0x50, 0x58, 0x15,
597 0x69, 0x03, 0xa5, 0xe8, 0xa9, 0x7a, 0x0f, 0xd1,
598 0x7d, 0x22, 0x8a, 0xe0, 0xc6, 0x17, 0x33, 0x00,
599 0x57, 0xcb, 0xf6, 0x8d, 0xf0, 0xc1, 0x7b, 0xb5,
600 0x96, 0x0f, 0x08, 0x84, 0x5b, 0x7e, 0xa6, 0x1e,
601 0xd8, 0x5e, 0x0c, 0xca, 0x30, 0x4b, 0xe0, 0x87,
602 0x2f, 0xbc, 0x07, 0x83, 0x35, 0x76, 0x36, 0x17,
603 0xcf, 0xdb, 0x27, 0x53, 0x43, 0xf5, 0x07, 0xd0,
604 0x91, 0x83, 0xa1, 0xaa, 0x8d, 0xdb, 0x00, 0x2b,
605 0xd1, 0x88, 0xe5, 0x59, 0x47, 0x17, 0xf0, 0xe8,
606 0xce, 0x3b, 0xa0, 0x73, 0x1f, 0x22, 0x9b, 0x1b,
607 0x59, 0x02, 0xe6, 0xaf, 0x3f, 0xdd, 0xfe, 0xba,
608 0xc3, 0x6b, 0xe5, 0x82, 0x02, 0x92, 0x0c, 0x5e,
609 0x5a, 0x87, 0x88, 0x91, 0x00, 0xb5, 0x30, 0x37,
610 0xf5, 0xc6, 0xdf, 0x0a, 0x7f, 0x03, 0x1c, 0x1f,
611 0x20, 0xf1, 0xd4, 0x5f, 0x94, 0xc3, 0x6f, 0x21,
612 0x5e, 0xf2, 0x77, 0x5a, 0x42, 0xfd, 0xd3, 0xc4,
613 0x31, 0xaf, 0xd6, 0x6c, 0x6c, 0xde, 0x8c, 0x50,
614 0x01, 0x8f, 0x57, 0x90, 0x88, 0x43, 0xf9, 0x44,
615 0x09, 0x4d, 0x27, 0x58, 0x9f, 0xae, 0x50, 0x28,
616 0x12, 0x47, 0x20, 0x79, 0x2b, 0xe4, 0x02, 0x97,
617 0xcd, 0xab, 0x53, 0x28, 0x8f, 0x8f, 0xe3, 0x3b,
618 0xd6, 0xc9, 0xc8, 0xff, 0xbf, 0x18, 0x3b, 0x75,
619 0xdb, 0xcf, 0x07, 0x8c, 0xfe, 0x58, 0xee, 0x75,
620 0x01, 0x98, 0x98, 0xe4, 0x60, 0xfe, 0xe6, 0x7f,
621 };
622
623 /*
624 * IV method encblkno8, blkno 3.
625 */
626 static const uint8_t aes_cbc_128_encblkno8_vec3_ctxt[SECSIZE] = {
627 0x98, 0xae, 0x82, 0x1d, 0x76, 0x3a, 0xfe, 0x80,
628 0x04, 0xa3, 0x43, 0xf0, 0x06, 0x45, 0x83, 0xb7,
629 0xe2, 0xb5, 0x73, 0x46, 0x78, 0x01, 0x2f, 0xd6,
630 0x0d, 0x49, 0x64, 0x4c, 0xeb, 0x8d, 0xdc, 0xa9,
631 0xdc, 0xea, 0x22, 0x25, 0xd4, 0x8f, 0xba, 0x9f,
632 0xd4, 0x7a, 0x3c, 0x9e, 0xd0, 0xd9, 0xcd, 0xa4,
633 0x12, 0xdf, 0x8f, 0x50, 0x24, 0x18, 0xa2, 0x0b,
634 0xd9, 0x7f, 0xda, 0x78, 0xd6, 0x11, 0xf3, 0x99,
635 0xc4, 0xec, 0x95, 0xe2, 0x85, 0xe1, 0xa0, 0x0d,
636 0x07, 0x22, 0x56, 0xaf, 0x2f, 0xf5, 0x7d, 0x63,
637 0xf2, 0x90, 0x6c, 0x26, 0x4f, 0xa5, 0x47, 0xcd,
638 0x66, 0x2d, 0x4c, 0x4d, 0x94, 0x6a, 0x3c, 0x98,
639 0xe4, 0x5e, 0x3b, 0x42, 0x3a, 0x93, 0x02, 0xd0,
640 0x90, 0xc7, 0xcd, 0x87, 0x0e, 0x84, 0x82, 0xf5,
641 0x77, 0x7b, 0x29, 0xe4, 0xea, 0x5b, 0x60, 0x50,
642 0xf7, 0x60, 0x8d, 0xf7, 0xd8, 0xd7, 0x7d, 0x99,
643 0x8a, 0xdc, 0xe2, 0xb9, 0x40, 0xac, 0x4b, 0x9f,
644 0x55, 0x30, 0xcb, 0x5a, 0x73, 0x64, 0xf2, 0xca,
645 0x76, 0x88, 0xf7, 0x55, 0xb5, 0x33, 0xc0, 0x44,
646 0xdf, 0x42, 0xee, 0xc9, 0xc5, 0x2a, 0x47, 0x18,
647 0x8b, 0x74, 0xb9, 0x4f, 0x2c, 0xd8, 0x7a, 0xd1,
648 0x12, 0x19, 0xf9, 0x21, 0x8d, 0x21, 0x7e, 0x2a,
649 0xcf, 0xd5, 0xbb, 0x69, 0xaa, 0x20, 0x25, 0xe0,
650 0xf5, 0x3b, 0x33, 0x77, 0x63, 0xb2, 0x05, 0x5c,
651 0x10, 0x9c, 0x61, 0x48, 0xf5, 0xe6, 0x04, 0xd3,
652 0xc8, 0xb4, 0xf6, 0xcf, 0x22, 0x1c, 0xf6, 0xbb,
653 0x4b, 0xd7, 0x5d, 0x23, 0xfa, 0x0e, 0xc0, 0xac,
654 0x27, 0x38, 0x95, 0xd0, 0xdd, 0x83, 0xad, 0x9e,
655 0xcf, 0xde, 0x99, 0xe7, 0x04, 0xb7, 0x23, 0x9f,
656 0x46, 0x91, 0xb8, 0xcb, 0x18, 0xd0, 0xc5, 0xf8,
657 0xec, 0xfc, 0x33, 0xb7, 0xbe, 0x2d, 0xe9, 0x3a,
658 0x7f, 0x83, 0x5e, 0x44, 0x0f, 0x12, 0x6d, 0x05,
659 0xaa, 0xfb, 0x80, 0x7a, 0xf6, 0xdb, 0x25, 0xc6,
660 0x51, 0xf3, 0x5d, 0xf3, 0xa9, 0xb8, 0x34, 0x88,
661 0x88, 0x25, 0xd5, 0xa3, 0xe5, 0x8e, 0xb2, 0xc7,
662 0xdc, 0xd5, 0x2e, 0x99, 0xb9, 0xc5, 0x1d, 0x91,
663 0x49, 0x7b, 0xa3, 0x5e, 0x4b, 0xaf, 0x29, 0x7b,
664 0x37, 0xb5, 0x39, 0x2c, 0xdf, 0x3b, 0xb1, 0xd8,
665 0xba, 0x14, 0xc9, 0xd3, 0x6d, 0x67, 0x6a, 0x80,
666 0x89, 0x6f, 0x11, 0xc8, 0xbc, 0xd6, 0xc7, 0xab,
667 0x42, 0x1f, 0xf4, 0xa2, 0xc0, 0x9c, 0x2d, 0xca,
668 0x5f, 0xe6, 0x65, 0xfa, 0x28, 0x49, 0x99, 0xa3,
669 0x0b, 0x7b, 0x7d, 0x39, 0xaa, 0xa6, 0xd8, 0x0a,
670 0xfd, 0xde, 0x31, 0x86, 0x15, 0x95, 0x1e, 0x5c,
671 0x05, 0x4e, 0x3c, 0x18, 0xee, 0xa9, 0x56, 0x9c,
672 0x3c, 0xc3, 0x67, 0x84, 0x57, 0x77, 0x8d, 0xff,
673 0xea, 0x34, 0x3c, 0xf9, 0x58, 0xb8, 0xdc, 0x4e,
674 0xa1, 0x92, 0x2d, 0x9a, 0x91, 0x61, 0x23, 0x6a,
675 0xd9, 0xb7, 0x41, 0xc5, 0x0d, 0xb6, 0x57, 0x58,
676 0x42, 0x39, 0x4a, 0x86, 0x7e, 0x9d, 0xeb, 0x7d,
677 0xa8, 0x14, 0x1a, 0x5c, 0xa1, 0x54, 0x34, 0xb6,
678 0xb6, 0xbc, 0x1f, 0xf5, 0xe2, 0xb5, 0xe4, 0xa8,
679 0x42, 0xe3, 0x3d, 0x06, 0x6b, 0x50, 0xbb, 0xa1,
680 0x6b, 0x63, 0xe5, 0x60, 0x28, 0x07, 0x49, 0x06,
681 0x61, 0x0e, 0xa3, 0x6c, 0xc3, 0xc8, 0x3e, 0x5a,
682 0x9c, 0xa5, 0xb3, 0x9b, 0x8d, 0x46, 0xb9, 0xf5,
683 0x4a, 0x4d, 0xbe, 0xc0, 0xc1, 0x24, 0x92, 0x09,
684 0x7c, 0x9a, 0x21, 0x2c, 0x08, 0x8a, 0x0d, 0xfc,
685 0xff, 0xda, 0xdc, 0xf1, 0x45, 0x66, 0xf9, 0xcd,
686 0x64, 0x7c, 0x2f, 0x0e, 0x95, 0x5e, 0xec, 0x92,
687 0xd1, 0x03, 0x03, 0xa0, 0xcc, 0x73, 0x92, 0x15,
688 0x74, 0x42, 0x54, 0x48, 0x77, 0xbe, 0x96, 0xfb,
689 0x1f, 0x0c, 0x7a, 0x25, 0x67, 0x6b, 0x85, 0x71,
690 0x06, 0x15, 0xd3, 0x11, 0xfe, 0xf7, 0xa9, 0xb1,
691 };
692
693 const struct testvec aes_cbc_128_8_vectors[] = {
694 {
695 .blkno = 0,
696 .ptxt = aes_cbc_ptxt,
697 .ctxt = aes_cbc_128_encblkno8_vec0_ctxt,
698 },
699 {
700 .blkno = 1,
701 .ptxt = aes_cbc_ptxt,
702 .ctxt = aes_cbc_128_encblkno8_vec1_ctxt,
703 },
704 {
705 .blkno = 2,
706 .ptxt = aes_cbc_ptxt,
707 .ctxt = aes_cbc_128_encblkno8_vec2_ctxt,
708 },
709 {
710 .blkno = 3,
711 .ptxt = aes_cbc_ptxt,
712 .ctxt = aes_cbc_128_encblkno8_vec3_ctxt,
713 },
714 };
715
716 /*
717 * IV method encblkno1, blkno 0.
718 */
719 static const uint8_t aes_cbc_192_encblkno1_vec0_ctxt[SECSIZE] = {
720 0x7c, 0xc4, 0xec, 0x89, 0x7c, 0x13, 0xac, 0x99,
721 0x49, 0xa9, 0x96, 0xe7, 0xb1, 0x1a, 0xd6, 0xb0,
722 0xeb, 0x89, 0x27, 0x0f, 0x8b, 0x1b, 0xab, 0x8e,
723 0x2c, 0xd4, 0x00, 0x66, 0x12, 0x3a, 0x9a, 0x03,
724 0xc4, 0x49, 0xa4, 0xf0, 0xc1, 0x90, 0xf9, 0x38,
725 0xb2, 0x5c, 0xa5, 0x0d, 0x1b, 0x60, 0x94, 0xf6,
726 0x31, 0x4a, 0x72, 0xdb, 0xfc, 0xe1, 0x3c, 0xd6,
727 0x9d, 0x03, 0x07, 0x45, 0xdb, 0xad, 0xdb, 0xb3,
728 0x86, 0xfa, 0xce, 0x2c, 0xeb, 0xa2, 0xac, 0x05,
729 0xd9, 0x52, 0xb8, 0xae, 0xa9, 0x91, 0x86, 0x4b,
730 0xbb, 0xf8, 0x03, 0xb0, 0x6c, 0x40, 0xcc, 0xbf,
731 0xa3, 0x76, 0x60, 0xf7, 0x29, 0x03, 0xe6, 0x44,
732 0xcc, 0x2a, 0xe7, 0x74, 0x8e, 0x62, 0xfe, 0x99,
733 0x6a, 0x6d, 0x04, 0x1b, 0xe7, 0xf7, 0x9f, 0x13,
734 0xa7, 0x1d, 0x93, 0x0e, 0x8f, 0xe0, 0x77, 0x9b,
735 0xe3, 0x91, 0x67, 0x12, 0x33, 0x12, 0x42, 0x55,
736 0x28, 0x04, 0x2d, 0x01, 0x2b, 0xd2, 0xda, 0xbe,
737 0x7c, 0x83, 0xf2, 0x87, 0x71, 0x67, 0xaf, 0x6b,
738 0x50, 0x6c, 0x8c, 0x9f, 0x48, 0xee, 0x90, 0x0c,
739 0x9a, 0x9e, 0x40, 0xa8, 0x13, 0x2f, 0x58, 0xfb,
740 0xdc, 0xb1, 0xda, 0xff, 0x06, 0x9c, 0xeb, 0x5e,
741 0x0f, 0xaf, 0xc0, 0x9a, 0x47, 0x88, 0x25, 0xfd,
742 0x19, 0x5e, 0xd4, 0xe0, 0x7f, 0xe0, 0x71, 0x7a,
743 0x60, 0x54, 0xe7, 0x0d, 0xfe, 0x11, 0x9d, 0x77,
744 0xbd, 0x9b, 0xd0, 0xf8, 0x77, 0xe4, 0x5b, 0x88,
745 0x90, 0x12, 0x29, 0x88, 0xb6, 0xd9, 0x1e, 0x6c,
746 0xbf, 0xa4, 0x18, 0xe1, 0xe0, 0x5e, 0xed, 0x48,
747 0x9b, 0x05, 0x13, 0x37, 0x0f, 0x41, 0x54, 0xc8,
748 0xe4, 0x25, 0x0e, 0x82, 0x5f, 0x81, 0xba, 0x5d,
749 0x79, 0x8f, 0x9c, 0x17, 0x4b, 0x59, 0xf4, 0x5d,
750 0xd6, 0x83, 0xfd, 0x44, 0xd0, 0xe1, 0x89, 0x09,
751 0xf9, 0xe2, 0xb6, 0x9c, 0x1c, 0xbd, 0x13, 0xaa,
752 0xa0, 0x43, 0xaa, 0xaf, 0x6d, 0x65, 0x73, 0xba,
753 0x3a, 0x55, 0x69, 0x51, 0xb9, 0x52, 0x09, 0xaa,
754 0x9f, 0x91, 0x3c, 0x65, 0xe2, 0x81, 0xdb, 0xe8,
755 0x5a, 0xe3, 0x74, 0x11, 0x7b, 0xec, 0x2f, 0x18,
756 0x8d, 0x4c, 0x8f, 0xf2, 0x06, 0x3d, 0x22, 0xc6,
757 0x43, 0xef, 0x42, 0x7d, 0xe1, 0xe7, 0xde, 0x4c,
758 0x58, 0xad, 0x40, 0xbb, 0x8b, 0xce, 0x1f, 0x57,
759 0x8e, 0x6a, 0x27, 0x43, 0x46, 0x7f, 0x94, 0xe5,
760 0x45, 0x67, 0x12, 0xc8, 0x99, 0x85, 0x08, 0x2a,
761 0x37, 0x40, 0x0b, 0xb5, 0xd9, 0xa3, 0xf7, 0xc8,
762 0x87, 0xb1, 0xe6, 0x87, 0x2f, 0x86, 0xd8, 0x9c,
763 0x7b, 0xec, 0xcf, 0xa4, 0xe5, 0xd5, 0x50, 0x3f,
764 0xdf, 0xc9, 0xb7, 0x29, 0x97, 0xd6, 0x33, 0xba,
765 0xf0, 0x72, 0xf0, 0x76, 0x12, 0xd3, 0x99, 0x4f,
766 0x1b, 0x36, 0xda, 0xa1, 0x83, 0xfe, 0xf5, 0x94,
767 0x9e, 0x61, 0x82, 0x62, 0xe0, 0x08, 0x3a, 0xbd,
768 0xba, 0x8b, 0x3d, 0xd6, 0xbd, 0x16, 0x5f, 0xd7,
769 0x1d, 0x6c, 0x0e, 0x92, 0x89, 0x8c, 0x38, 0x62,
770 0x80, 0xee, 0x7e, 0x63, 0x82, 0x88, 0x0b, 0xbf,
771 0xdd, 0x9f, 0xbc, 0xba, 0xa7, 0x5a, 0xc6, 0x0d,
772 0x87, 0x59, 0xbf, 0x0a, 0x85, 0x06, 0xa3, 0xb4,
773 0x66, 0x63, 0xda, 0x12, 0x29, 0x5f, 0x2e, 0x4d,
774 0x60, 0xfd, 0x85, 0x76, 0xaf, 0xf7, 0x87, 0xed,
775 0x1f, 0x46, 0xc2, 0xd6, 0x6c, 0x98, 0x6b, 0x4b,
776 0x60, 0x04, 0xed, 0x89, 0x3b, 0x85, 0x6c, 0xe9,
777 0x46, 0xd9, 0xfa, 0x35, 0x61, 0xe8, 0x0c, 0x84,
778 0x1b, 0x93, 0xc0, 0xfe, 0x5d, 0x29, 0x14, 0xe1,
779 0x1c, 0x66, 0x73, 0xc8, 0x0b, 0x98, 0xff, 0x1a,
780 0x78, 0x2b, 0x6a, 0x93, 0x7a, 0x29, 0xd8, 0x7b,
781 0xb1, 0x39, 0xf0, 0xad, 0x93, 0x4d, 0x2d, 0xab,
782 0x67, 0x3c, 0xa4, 0xa1, 0x08, 0x36, 0x0b, 0xe9,
783 0x77, 0xd0, 0xe3, 0x45, 0x7d, 0x99, 0x75, 0xc3,
784 };
785
786 /*
787 * IV method encblkno1, blkno 1.
788 */
789 static const uint8_t aes_cbc_192_encblkno1_vec1_ctxt[SECSIZE] = {
790 0xe6, 0x41, 0x75, 0xd6, 0x80, 0xdf, 0x44, 0x37,
791 0xa7, 0xa2, 0xb2, 0x29, 0x0d, 0xf0, 0x02, 0x78,
792 0x92, 0xb2, 0x06, 0x5f, 0x86, 0xd3, 0x9c, 0xa3,
793 0xd0, 0xc5, 0x08, 0x03, 0x6d, 0x41, 0x9d, 0x61,
794 0xb4, 0xb9, 0xa1, 0x69, 0x6e, 0x3a, 0x78, 0xd7,
795 0x04, 0x94, 0xf2, 0x53, 0xed, 0xd1, 0xf6, 0xd8,
796 0x98, 0xe2, 0x49, 0x75, 0x15, 0x85, 0xe0, 0x78,
797 0x5b, 0x28, 0x5e, 0xe6, 0xfa, 0x60, 0x3d, 0x4b,
798 0x8c, 0xf1, 0x1a, 0xfd, 0x1f, 0xe8, 0xad, 0xb4,
799 0xa1, 0xe7, 0xd3, 0x71, 0x16, 0xdf, 0xc6, 0x95,
800 0xd4, 0x43, 0xaf, 0x92, 0xab, 0x74, 0x0f, 0x77,
801 0x75, 0x4d, 0xd7, 0x13, 0x97, 0x18, 0xea, 0x43,
802 0x92, 0x0d, 0x88, 0xc8, 0x41, 0xf7, 0x15, 0x34,
803 0x0f, 0x63, 0xbf, 0x50, 0x18, 0xbe, 0x9d, 0x3b,
804 0xfc, 0x17, 0x7d, 0x03, 0x39, 0xc2, 0x39, 0x28,
805 0xb2, 0x23, 0x1c, 0x7f, 0x3f, 0x19, 0x6c, 0x2f,
806 0x64, 0xbd, 0xc9, 0x7d, 0xbe, 0x98, 0xe0, 0x83,
807 0xa4, 0x48, 0xfc, 0x89, 0xe7, 0xe0, 0x93, 0x93,
808 0x7b, 0x15, 0x35, 0xaf, 0xf8, 0x00, 0x81, 0xcc,
809 0x04, 0x80, 0x8b, 0x20, 0xc8, 0x6a, 0xb7, 0x5e,
810 0x95, 0xce, 0x69, 0x50, 0x39, 0x88, 0x90, 0x41,
811 0x3f, 0xa8, 0x62, 0x42, 0xf1, 0xa9, 0x56, 0xce,
812 0x25, 0x53, 0x1d, 0x97, 0x5d, 0x3a, 0x4e, 0x6b,
813 0x1f, 0xd6, 0xea, 0x20, 0x81, 0x6c, 0xe5, 0xa1,
814 0x0d, 0x9a, 0xd9, 0x3c, 0xbb, 0xbc, 0xc1, 0x77,
815 0xe2, 0xf4, 0x9c, 0x11, 0x3a, 0x2f, 0xd0, 0x77,
816 0x10, 0xa6, 0x36, 0xd1, 0xbf, 0x3b, 0x50, 0x39,
817 0x4b, 0x2c, 0x62, 0x06, 0x1a, 0xe4, 0x18, 0xc0,
818 0x35, 0x7c, 0xc3, 0xd0, 0x22, 0xf8, 0xee, 0x19,
819 0xa5, 0x3d, 0x69, 0xa9, 0x34, 0xe6, 0x29, 0xf9,
820 0xf1, 0xff, 0x26, 0x7a, 0x66, 0x13, 0x1a, 0xa2,
821 0xc6, 0xac, 0x84, 0xf6, 0x6b, 0x09, 0xbd, 0x32,
822 0x6f, 0x26, 0x37, 0x7c, 0x7d, 0x74, 0xe4, 0xa0,
823 0xeb, 0x85, 0x7a, 0xa1, 0x92, 0x19, 0x2e, 0x64,
824 0x82, 0x7c, 0x89, 0x1b, 0x14, 0x92, 0xd1, 0xf4,
825 0x1f, 0x29, 0x84, 0x04, 0x70, 0x09, 0x13, 0x4c,
826 0x62, 0x9a, 0xb4, 0xf7, 0xc1, 0x7b, 0x83, 0xd1,
827 0x2d, 0x1a, 0xbe, 0x83, 0x9b, 0x73, 0xba, 0x8d,
828 0xbb, 0xb0, 0xf2, 0x5c, 0x72, 0x75, 0x01, 0x0b,
829 0xa6, 0x43, 0x6b, 0x76, 0x56, 0x4e, 0x71, 0x1b,
830 0xb2, 0x34, 0x1f, 0x70, 0x44, 0xe6, 0xfb, 0x67,
831 0xd1, 0x4d, 0x63, 0xce, 0x17, 0x46, 0x9b, 0x11,
832 0xda, 0x93, 0xf8, 0x03, 0x11, 0x8f, 0x90, 0xff,
833 0x80, 0x85, 0x02, 0x1f, 0xb6, 0x6a, 0x28, 0x3f,
834 0x01, 0xa8, 0x36, 0x2e, 0xc7, 0x42, 0xd4, 0x02,
835 0x26, 0xea, 0xb5, 0x84, 0x6c, 0x9f, 0xa0, 0x4a,
836 0x73, 0x49, 0xea, 0x91, 0x4d, 0x62, 0xf8, 0x23,
837 0xe4, 0x3d, 0x91, 0xfb, 0x53, 0x2c, 0x8c, 0xa4,
838 0xfe, 0x81, 0x05, 0x5d, 0x4b, 0x9a, 0x75, 0x29,
839 0xf8, 0xbe, 0x3f, 0x05, 0xb4, 0x8f, 0xdc, 0xcc,
840 0xfa, 0xcc, 0xd7, 0xb2, 0x06, 0x03, 0xd4, 0xf3,
841 0x8e, 0x09, 0x09, 0x80, 0xf8, 0xc3, 0x3b, 0x66,
842 0xe9, 0x9c, 0x5b, 0x16, 0xed, 0x2d, 0x35, 0x1c,
843 0x99, 0x3b, 0x1f, 0x0e, 0x04, 0x30, 0x23, 0x3a,
844 0x83, 0x0c, 0xec, 0x76, 0xf2, 0x5d, 0x13, 0x54,
845 0x15, 0x62, 0x36, 0x26, 0x6b, 0x21, 0x62, 0xdd,
846 0xb4, 0x1a, 0x57, 0x16, 0xfd, 0xa0, 0x9c, 0xfa,
847 0x37, 0xb3, 0xda, 0xe0, 0x46, 0x91, 0xb3, 0x20,
848 0xe7, 0xe2, 0xf3, 0x0e, 0x20, 0x3c, 0x98, 0x1b,
849 0xe4, 0xc2, 0xd3, 0xa9, 0x97, 0xaf, 0x12, 0x69,
850 0x23, 0x97, 0x62, 0x6e, 0xae, 0x54, 0x9c, 0x82,
851 0x92, 0x50, 0x74, 0x07, 0x4a, 0xb1, 0xdc, 0xcf,
852 0x53, 0x1d, 0xc8, 0x29, 0x1f, 0x6e, 0xf1, 0x13,
853 0xec, 0xb6, 0x60, 0xb1, 0x4c, 0x9d, 0xd7, 0x77,
854 };
855
856 /*
857 * IV method encblkno1, blkno 2.
858 */
859 static const uint8_t aes_cbc_192_encblkno1_vec2_ctxt[SECSIZE] = {
860 0x33, 0xfd, 0xfa, 0x44, 0x64, 0x75, 0x22, 0x7e,
861 0xe3, 0xb3, 0xa0, 0x75, 0x99, 0x96, 0xc0, 0xec,
862 0x56, 0x06, 0x7d, 0x19, 0x0b, 0x66, 0x89, 0xe0,
863 0x69, 0x1d, 0x93, 0x91, 0xd7, 0x0f, 0xf8, 0xf5,
864 0x5a, 0x39, 0x30, 0xad, 0x64, 0x42, 0x06, 0xa3,
865 0xce, 0x3f, 0x67, 0xd6, 0x6e, 0xcd, 0x3b, 0xf5,
866 0x03, 0x2b, 0x07, 0x83, 0x18, 0x1a, 0x4f, 0x4c,
867 0xe7, 0x6b, 0xe8, 0xf9, 0x19, 0xa5, 0x23, 0x8f,
868 0x46, 0x35, 0x13, 0x7b, 0x61, 0x05, 0xfc, 0x7d,
869 0x17, 0x39, 0x03, 0xa8, 0xec, 0x7a, 0xd2, 0x5f,
870 0x91, 0xa7, 0x26, 0x07, 0x9d, 0xd7, 0x0c, 0xd7,
871 0xd4, 0x8e, 0x37, 0xf3, 0x1a, 0x3c, 0x04, 0x83,
872 0x04, 0x71, 0x06, 0xa6, 0x5f, 0x82, 0xe0, 0x6d,
873 0x87, 0x5c, 0x7c, 0x03, 0x25, 0x03, 0x4b, 0x24,
874 0x07, 0x40, 0xad, 0xe4, 0x1d, 0x1d, 0xcb, 0x34,
875 0xc2, 0x53, 0x1d, 0x13, 0xc5, 0x87, 0xab, 0xa7,
876 0x95, 0x11, 0x8b, 0xbb, 0xf0, 0xc3, 0x00, 0xeb,
877 0xe5, 0xb0, 0x9e, 0x88, 0x8b, 0xad, 0xca, 0xcb,
878 0x17, 0xf8, 0x92, 0x4d, 0x00, 0xb0, 0x08, 0x74,
879 0x08, 0xb9, 0x8b, 0x95, 0x96, 0xd9, 0x36, 0x35,
880 0x31, 0x92, 0x89, 0xf6, 0x35, 0x33, 0xfb, 0x18,
881 0x5b, 0x84, 0xa1, 0xfe, 0xe1, 0x62, 0x04, 0x6f,
882 0x3c, 0xc1, 0xd2, 0xc2, 0x10, 0xd7, 0x97, 0xba,
883 0x29, 0x7c, 0xe3, 0x85, 0xee, 0x59, 0x90, 0xaf,
884 0x7f, 0x6f, 0x97, 0x97, 0xa2, 0x41, 0x18, 0x7f,
885 0x2f, 0x06, 0x15, 0xb2, 0x46, 0x82, 0x49, 0x39,
886 0xd0, 0xfb, 0xa8, 0x48, 0x44, 0x28, 0x58, 0xff,
887 0xd8, 0xf2, 0x65, 0xf9, 0x4f, 0x2c, 0xbe, 0xec,
888 0xb6, 0xdf, 0x27, 0x1a, 0xf2, 0x05, 0x15, 0x5e,
889 0xe3, 0x2a, 0x98, 0x29, 0x92, 0x4a, 0x1b, 0x5d,
890 0x5c, 0x2c, 0x70, 0xf6, 0x41, 0xd4, 0xbe, 0x64,
891 0xa1, 0xd9, 0x79, 0xf1, 0x11, 0x16, 0xda, 0xa2,
892 0xaf, 0xdd, 0x4d, 0xa8, 0xed, 0xec, 0xbe, 0x7d,
893 0x49, 0x6c, 0x30, 0xf2, 0xf5, 0x36, 0x3c, 0xae,
894 0x4b, 0xa7, 0x77, 0xa3, 0xca, 0x22, 0xa5, 0xe2,
895 0x4d, 0x44, 0xcb, 0x36, 0xd5, 0x3f, 0x20, 0x13,
896 0xb6, 0xfb, 0xcd, 0x79, 0xd7, 0x42, 0xf9, 0x75,
897 0x09, 0x45, 0x28, 0x9e, 0xf2, 0xbd, 0x15, 0x57,
898 0xf8, 0x4b, 0xc0, 0xd3, 0xb3, 0xb8, 0xde, 0x55,
899 0x9e, 0x11, 0x67, 0xab, 0xc5, 0x5d, 0x58, 0xdb,
900 0x4d, 0x20, 0x34, 0x77, 0x33, 0x9c, 0x46, 0x76,
901 0x9b, 0x1e, 0x0e, 0x6b, 0x4e, 0xd9, 0x63, 0x68,
902 0x78, 0x5e, 0x7c, 0x52, 0xa2, 0x64, 0xa9, 0xfc,
903 0x21, 0x35, 0x17, 0x93, 0x18, 0x9e, 0x10, 0xcf,
904 0x95, 0x6b, 0xf0, 0x55, 0x46, 0xc3, 0x4b, 0xfc,
905 0x86, 0x8b, 0x0d, 0x3b, 0x5c, 0x30, 0xcc, 0xf1,
906 0x4c, 0x43, 0xf0, 0xd6, 0xf6, 0x3b, 0x0b, 0x68,
907 0x6f, 0x21, 0xd1, 0x61, 0xda, 0x35, 0x92, 0x94,
908 0xa5, 0x5d, 0x47, 0x39, 0x96, 0x50, 0x5f, 0xbd,
909 0x57, 0x22, 0xd2, 0x65, 0x73, 0x05, 0x8f, 0x2b,
910 0xf2, 0x96, 0x53, 0x6b, 0x8e, 0xd3, 0x1e, 0xe7,
911 0x92, 0xd4, 0xea, 0x41, 0xee, 0x92, 0x4d, 0x10,
912 0x9f, 0x68, 0xd8, 0xe9, 0xac, 0x1f, 0x38, 0x0b,
913 0x12, 0xa4, 0x1c, 0xb2, 0x63, 0x2b, 0x87, 0x07,
914 0xb8, 0x1e, 0x02, 0x2b, 0x4d, 0xad, 0x99, 0xdf,
915 0xe3, 0x98, 0x69, 0x29, 0x11, 0xe3, 0x77, 0x45,
916 0x9a, 0xe9, 0x6c, 0x47, 0x4e, 0xc0, 0x85, 0x15,
917 0x68, 0x58, 0x41, 0x37, 0xab, 0x96, 0x11, 0x94,
918 0x9e, 0xbb, 0xa8, 0x5d, 0x51, 0x05, 0x93, 0xdd,
919 0x2e, 0xb8, 0xdf, 0xcf, 0x83, 0xbc, 0xf6, 0x53,
920 0x95, 0x93, 0x27, 0xda, 0xa5, 0x20, 0x1b, 0x7d,
921 0x1d, 0xd9, 0x0c, 0xde, 0xe5, 0x3f, 0xc8, 0x60,
922 0x16, 0x32, 0x95, 0x24, 0xa7, 0x2b, 0x74, 0xf1,
923 0x67, 0xf9, 0xf2, 0x49, 0xda, 0x12, 0x97, 0xdd,
924 };
925
926 /*
927 * IV method encblkno1, blkno 3.
928 */
929 static const uint8_t aes_cbc_192_encblkno1_vec3_ctxt[SECSIZE] = {
930 0xa5, 0x81, 0x86, 0x78, 0x4a, 0xd7, 0x5b, 0x83,
931 0xcf, 0xbf, 0x7e, 0x3c, 0xd7, 0xcd, 0xaf, 0xfa,
932 0x82, 0x18, 0xce, 0xbd, 0x8b, 0xe6, 0xd9, 0x39,
933 0x22, 0x2d, 0x1e, 0x75, 0x65, 0xee, 0x61, 0xf2,
934 0xc3, 0x8b, 0xf4, 0x40, 0x03, 0x73, 0x8a, 0x21,
935 0x9f, 0xf3, 0xcc, 0x93, 0x08, 0x3d, 0xff, 0x8a,
936 0xbc, 0x0f, 0x19, 0xa1, 0x9f, 0xc8, 0x73, 0xe8,
937 0xa6, 0x14, 0x2e, 0x43, 0x19, 0x79, 0x61, 0x35,
938 0x8d, 0x55, 0x06, 0xeb, 0x96, 0xe7, 0xf5, 0x4b,
939 0x95, 0x5f, 0x9b, 0xb2, 0x18, 0x0d, 0x13, 0xc2,
940 0x96, 0x79, 0x50, 0x78, 0x98, 0x50, 0x88, 0x2b,
941 0xab, 0x05, 0x66, 0xa1, 0x3a, 0x25, 0x85, 0xe2,
942 0xd0, 0xe2, 0xac, 0xb5, 0x26, 0xde, 0x95, 0x04,
943 0x45, 0xe7, 0x22, 0x71, 0x02, 0xb3, 0x84, 0x4c,
944 0xb5, 0xad, 0x64, 0x5c, 0x27, 0x5c, 0x71, 0xcd,
945 0x0b, 0x62, 0x91, 0xd6, 0x84, 0x00, 0x62, 0x52,
946 0x54, 0xbd, 0x22, 0xc8, 0x57, 0xa7, 0x41, 0xac,
947 0xc7, 0xa8, 0x56, 0x6f, 0x1b, 0x7e, 0xce, 0x02,
948 0x29, 0x3b, 0xc0, 0x5d, 0x8e, 0x11, 0xa9, 0x54,
949 0xc2, 0xf2, 0xf0, 0x81, 0x6c, 0x9a, 0x24, 0x5b,
950 0x81, 0x7d, 0xf3, 0x84, 0x93, 0xc6, 0x2a, 0xd4,
951 0xd3, 0x1a, 0x2f, 0x97, 0x2e, 0x31, 0x8a, 0x62,
952 0x43, 0xcb, 0xc7, 0x3d, 0x73, 0x8e, 0xd6, 0x86,
953 0x17, 0x8f, 0x63, 0xd4, 0xb1, 0x50, 0x92, 0xce,
954 0x90, 0x37, 0x91, 0xce, 0x37, 0x13, 0x8e, 0x61,
955 0x21, 0xd8, 0x1a, 0xbf, 0x42, 0x65, 0x1d, 0x86,
956 0x07, 0x04, 0x9b, 0xd1, 0xd3, 0x26, 0x6b, 0x7c,
957 0xa1, 0x77, 0x54, 0x5b, 0x9f, 0x95, 0x62, 0x43,
958 0xb3, 0x71, 0x1e, 0x4c, 0x32, 0xd1, 0x3e, 0xe8,
959 0x60, 0x9c, 0x0c, 0x15, 0x55, 0xf0, 0x38, 0xb7,
960 0x1e, 0x40, 0xe5, 0x26, 0x4e, 0x46, 0x49, 0x47,
961 0x59, 0x3d, 0x49, 0x76, 0x28, 0xd3, 0xed, 0x03,
962 0xdd, 0xf8, 0x1a, 0xf4, 0x1a, 0xfe, 0xe4, 0x03,
963 0xb9, 0xa5, 0x8e, 0x7c, 0x91, 0x7a, 0xb2, 0x17,
964 0x84, 0x97, 0x3f, 0x12, 0x68, 0xaa, 0xf5, 0x73,
965 0xbc, 0x84, 0xdd, 0x03, 0x4a, 0xc4, 0xcd, 0xdb,
966 0xb0, 0x8a, 0x3b, 0xac, 0xf1, 0xdd, 0x10, 0x20,
967 0x69, 0xee, 0x94, 0xcd, 0x60, 0x3f, 0x01, 0xcf,
968 0xf4, 0xff, 0xdb, 0x91, 0x8a, 0xf3, 0xb8, 0x44,
969 0x62, 0xdc, 0xdc, 0xc8, 0x2b, 0xaf, 0x0d, 0x5e,
970 0x1b, 0x58, 0x7f, 0x6b, 0x0d, 0xc4, 0xd4, 0x1c,
971 0x89, 0x29, 0x60, 0x5d, 0xe9, 0x59, 0xbb, 0x19,
972 0x03, 0x7c, 0x25, 0x63, 0xc6, 0x89, 0x6f, 0xe6,
973 0xbe, 0xcd, 0xaa, 0xf2, 0xbf, 0x16, 0xcb, 0x47,
974 0xc6, 0x74, 0xdd, 0x90, 0x41, 0x75, 0x7f, 0x26,
975 0x7b, 0x5a, 0xb9, 0x11, 0xa0, 0xc7, 0x75, 0x60,
976 0xc5, 0x54, 0x7d, 0xb0, 0xb4, 0xd0, 0x95, 0x01,
977 0xff, 0x07, 0x49, 0x56, 0xfb, 0xec, 0xa9, 0x4c,
978 0x68, 0x28, 0x41, 0x81, 0x80, 0x05, 0x88, 0x58,
979 0xf5, 0xdc, 0x42, 0x99, 0xd8, 0xb7, 0x47, 0xd9,
980 0xf7, 0x0e, 0x2c, 0x0f, 0x95, 0x04, 0xb3, 0xc8,
981 0x8a, 0xe2, 0x21, 0x57, 0x8d, 0x64, 0x54, 0x40,
982 0xf6, 0xd0, 0x3c, 0x97, 0xcf, 0x22, 0xce, 0xcd,
983 0xbf, 0x05, 0x15, 0xaa, 0x89, 0xd9, 0x2b, 0x48,
984 0xaf, 0x34, 0xe0, 0xf5, 0xe3, 0x58, 0x06, 0xd7,
985 0x49, 0x00, 0x95, 0x3a, 0xb3, 0xc8, 0xcd, 0x2b,
986 0x3e, 0xe8, 0x1b, 0x60, 0xe8, 0xea, 0xaf, 0x09,
987 0xbb, 0xee, 0xce, 0xbc, 0xa0, 0x9b, 0x17, 0x90,
988 0x42, 0x40, 0x18, 0x35, 0x2e, 0x17, 0xa0, 0x6e,
989 0x43, 0xe7, 0xac, 0x89, 0x96, 0x3c, 0x16, 0xe0,
990 0xdb, 0x09, 0x51, 0x4a, 0x45, 0x33, 0x63, 0xe9,
991 0x4e, 0x3f, 0x32, 0x34, 0x36, 0x43, 0xd5, 0x0c,
992 0x5a, 0x2e, 0x0e, 0x8b, 0x80, 0xb7, 0xf4, 0xe4,
993 0x99, 0x9b, 0x05, 0xf5, 0xb2, 0xe4, 0x03, 0xe4,
994 };
995
996 const struct testvec aes_cbc_192_1_vectors[] = {
997 {
998 .blkno = 0,
999 .ptxt = aes_cbc_ptxt,
1000 .ctxt = aes_cbc_192_encblkno1_vec0_ctxt,
1001 },
1002 {
1003 .blkno = 1,
1004 .ptxt = aes_cbc_ptxt,
1005 .ctxt = aes_cbc_192_encblkno1_vec1_ctxt,
1006 },
1007 {
1008 .blkno = 2,
1009 .ptxt = aes_cbc_ptxt,
1010 .ctxt = aes_cbc_192_encblkno1_vec2_ctxt,
1011 },
1012 {
1013 .blkno = 3,
1014 .ptxt = aes_cbc_ptxt,
1015 .ctxt = aes_cbc_192_encblkno1_vec3_ctxt,
1016 },
1017 };
1018
1019 /*
1020 * IV method encblkno8, blkno 0.
1021 */
1022 static const uint8_t aes_cbc_192_encblkno8_vec0_ctxt[SECSIZE] = {
1023 0x87, 0x9c, 0x05, 0xd6, 0x25, 0xb9, 0xe0, 0xbe,
1024 0x78, 0x21, 0x85, 0x81, 0x8e, 0x2f, 0x13, 0x5e,
1025 0xf2, 0x73, 0x11, 0xfa, 0x73, 0x77, 0x93, 0x5e,
1026 0x71, 0x16, 0x98, 0x68, 0x6f, 0xe8, 0x22, 0x34,
1027 0xf5, 0x11, 0xfa, 0x61, 0xe6, 0x1a, 0xfb, 0x42,
1028 0xa7, 0xa3, 0x2e, 0x0d, 0xc1, 0x9d, 0x7d, 0xd9,
1029 0xfb, 0xbb, 0xc5, 0x08, 0x9d, 0xc2, 0xab, 0x5c,
1030 0xdf, 0x9b, 0x3c, 0x1a, 0xbd, 0x66, 0x5a, 0x91,
1031 0x1c, 0x00, 0x59, 0x2e, 0x92, 0xe9, 0x23, 0xf6,
1032 0x90, 0x3d, 0x5b, 0x72, 0x76, 0x78, 0xd9, 0xa2,
1033 0x48, 0x33, 0x29, 0xe2, 0xfd, 0x77, 0x14, 0xda,
1034 0x01, 0x92, 0x63, 0xdd, 0x8c, 0x1c, 0x2e, 0xf7,
1035 0x61, 0xfb, 0xc5, 0x76, 0xec, 0x7f, 0xef, 0xdc,
1036 0xbe, 0x2d, 0x3b, 0x69, 0x30, 0xb9, 0x08, 0x00,
1037 0xe8, 0x37, 0x09, 0xaa, 0x2a, 0x02, 0x80, 0x11,
1038 0x91, 0x16, 0x94, 0x7d, 0xb5, 0xdc, 0x9f, 0xb3,
1039 0xb0, 0x26, 0x72, 0x85, 0x93, 0x85, 0x19, 0x08,
1040 0x97, 0xef, 0x97, 0x57, 0xa8, 0x76, 0x0e, 0x85,
1041 0xb1, 0x1d, 0x79, 0xe3, 0x7a, 0xe8, 0x06, 0x3b,
1042 0xc4, 0x00, 0xbd, 0xaa, 0xd9, 0x17, 0x81, 0x37,
1043 0x12, 0x86, 0x52, 0xea, 0x04, 0xb2, 0x11, 0x0f,
1044 0x5a, 0x08, 0x68, 0xcb, 0x48, 0xca, 0x2f, 0xda,
1045 0xa3, 0x0a, 0x60, 0x57, 0xc7, 0x80, 0x36, 0x60,
1046 0x05, 0xce, 0xd5, 0x43, 0xc9, 0xbc, 0x6c, 0xe6,
1047 0x63, 0x38, 0x2e, 0x81, 0x90, 0x34, 0x11, 0x2c,
1048 0x84, 0x0c, 0x62, 0x68, 0xde, 0x17, 0x57, 0x43,
1049 0x19, 0xa5, 0x92, 0x9d, 0x91, 0x2b, 0xa2, 0x95,
1050 0x7c, 0x20, 0x72, 0xaa, 0x83, 0x24, 0x54, 0x94,
1051 0x10, 0x80, 0xd4, 0x3f, 0x58, 0xb9, 0x7b, 0x74,
1052 0x68, 0xd5, 0xfb, 0x3e, 0xdd, 0xb4, 0xdf, 0x65,
1053 0x72, 0x88, 0x45, 0x8a, 0xd0, 0x93, 0x6e, 0x99,
1054 0x84, 0xad, 0x39, 0x73, 0x16, 0x88, 0xdc, 0x89,
1055 0x33, 0x34, 0xd7, 0xd8, 0x97, 0xfb, 0x90, 0xd2,
1056 0xc5, 0x8e, 0x94, 0xc4, 0xf1, 0xfe, 0xbe, 0x23,
1057 0xf1, 0x3a, 0x10, 0x1c, 0x42, 0x6b, 0xf5, 0xee,
1058 0xe4, 0x78, 0x8a, 0x7e, 0x13, 0x02, 0x25, 0xcb,
1059 0xd1, 0x61, 0x1f, 0xab, 0x45, 0x1f, 0x90, 0x88,
1060 0x0f, 0x6b, 0xff, 0x61, 0xba, 0xf3, 0xac, 0x8e,
1061 0x13, 0xc2, 0xfb, 0xca, 0x41, 0xed, 0xfe, 0x6c,
1062 0xcb, 0xdf, 0x97, 0x60, 0x29, 0x8a, 0x72, 0x8d,
1063 0x7d, 0xad, 0x6e, 0xe9, 0x7b, 0xc4, 0x92, 0x14,
1064 0x5e, 0x33, 0x27, 0xe2, 0xda, 0x2f, 0x95, 0x5f,
1065 0x40, 0x27, 0xeb, 0xdb, 0x0d, 0x1e, 0xc5, 0xd4,
1066 0x43, 0x50, 0x1a, 0x62, 0x82, 0xbe, 0x24, 0x7f,
1067 0xb7, 0x46, 0xa8, 0x70, 0x10, 0x33, 0xb6, 0x3f,
1068 0xbf, 0xa8, 0xa8, 0x85, 0xab, 0x1d, 0xb4, 0x3f,
1069 0x84, 0x06, 0x91, 0xd6, 0x18, 0x3d, 0xeb, 0x8b,
1070 0x3f, 0x9b, 0x37, 0x9e, 0x2e, 0xd2, 0xec, 0xe5,
1071 0x2d, 0xf0, 0x3f, 0x45, 0xd5, 0x9d, 0xb9, 0x28,
1072 0x89, 0xe4, 0x0c, 0xa9, 0x38, 0xca, 0x22, 0x56,
1073 0x53, 0xdf, 0x49, 0xba, 0x5d, 0x99, 0xd6, 0x4b,
1074 0x1d, 0x0d, 0x6d, 0xee, 0x7c, 0xf2, 0x6f, 0x50,
1075 0x04, 0xf1, 0xf8, 0x49, 0xd1, 0x2f, 0x50, 0x3e,
1076 0xf1, 0x08, 0x49, 0x17, 0x08, 0xd2, 0xac, 0x5d,
1077 0x58, 0xe7, 0x27, 0xe6, 0x59, 0x02, 0x9f, 0x1c,
1078 0x40, 0xff, 0x6c, 0x67, 0xae, 0x49, 0x1a, 0x2a,
1079 0xab, 0xd9, 0x63, 0x25, 0x2d, 0x9b, 0xd8, 0x1a,
1080 0x41, 0xa6, 0xea, 0x72, 0xfd, 0x56, 0xa1, 0x57,
1081 0x59, 0xdd, 0xf5, 0xa3, 0xb2, 0x2f, 0x64, 0xb1,
1082 0xc5, 0xfe, 0x8d, 0x9b, 0x93, 0xd1, 0x51, 0x77,
1083 0x13, 0x50, 0x74, 0x30, 0x28, 0xe4, 0x7a, 0x06,
1084 0x69, 0xd4, 0xa8, 0x0a, 0xae, 0x02, 0x4a, 0x61,
1085 0x24, 0xc2, 0xcd, 0xc8, 0xd3, 0x12, 0x2e, 0xac,
1086 0x9a, 0x0c, 0x24, 0x06, 0xb8, 0x1e, 0x3d, 0x29,
1087 };
1088
1089 /*
1090 * IV method encblkno8, blkno 1.
1091 */
1092 static const uint8_t aes_cbc_192_encblkno8_vec1_ctxt[SECSIZE] = {
1093 0x1e, 0x3b, 0x66, 0x76, 0xd9, 0x9e, 0xf7, 0x82,
1094 0x17, 0x76, 0x69, 0x4d, 0x64, 0x63, 0xf1, 0x01,
1095 0x81, 0x8a, 0xa4, 0x97, 0x05, 0x42, 0xdb, 0x8c,
1096 0x27, 0xc8, 0xfd, 0x08, 0x21, 0x17, 0x87, 0xa9,
1097 0x0c, 0x86, 0x2d, 0xda, 0x17, 0xd5, 0x5d, 0x67,
1098 0x12, 0x93, 0x8d, 0x34, 0x5a, 0xfc, 0x2a, 0x49,
1099 0x1a, 0x1a, 0x77, 0x20, 0xfb, 0x1d, 0x5d, 0xd8,
1100 0x99, 0xb0, 0x8f, 0x1c, 0x13, 0x4d, 0x28, 0x6d,
1101 0x2d, 0x79, 0xa9, 0x8e, 0x04, 0x0c, 0x5a, 0xd5,
1102 0x52, 0x09, 0x15, 0x4a, 0xfb, 0x7a, 0xf8, 0xdc,
1103 0x3b, 0x77, 0xaf, 0xe0, 0x80, 0x6b, 0xac, 0x5f,
1104 0xc0, 0x0f, 0x0f, 0x29, 0xf5, 0xcc, 0xbc, 0x85,
1105 0x77, 0xe7, 0x9f, 0x59, 0x23, 0x83, 0x67, 0x74,
1106 0x3b, 0x1c, 0x0f, 0x75, 0xd8, 0x58, 0xa2, 0xce,
1107 0x8c, 0x3a, 0x80, 0xd7, 0xff, 0xa1, 0x83, 0xa3,
1108 0xe0, 0xad, 0x18, 0x7a, 0xc5, 0x28, 0x28, 0x71,
1109 0x46, 0xb5, 0x13, 0x76, 0x4d, 0x67, 0x37, 0x38,
1110 0x3f, 0x9e, 0xa6, 0x8b, 0xc2, 0xaf, 0x83, 0x7d,
1111 0x8b, 0x82, 0xd0, 0xe2, 0xec, 0x13, 0xce, 0x2b,
1112 0x1e, 0x13, 0xe7, 0xb6, 0xfa, 0x9e, 0xa2, 0x32,
1113 0xb7, 0xdc, 0xe5, 0xb5, 0x35, 0xa3, 0xb4, 0x84,
1114 0x57, 0x05, 0x2d, 0x3e, 0xb0, 0x0a, 0x52, 0x61,
1115 0x00, 0xe4, 0x84, 0xab, 0xf4, 0x98, 0xe4, 0xe6,
1116 0xcd, 0xb1, 0xd4, 0x40, 0x31, 0x5f, 0x8f, 0x73,
1117 0x16, 0x6e, 0xc0, 0x3d, 0x07, 0x5d, 0x6b, 0x91,
1118 0x70, 0x71, 0x8a, 0x4b, 0xfe, 0xeb, 0xbe, 0x04,
1119 0x5d, 0x75, 0x0a, 0x74, 0x52, 0x1e, 0xd3, 0x94,
1120 0xc5, 0xcd, 0xc1, 0xd6, 0x12, 0x6a, 0x58, 0x52,
1121 0x6e, 0x45, 0x1f, 0x49, 0x09, 0x4c, 0x32, 0xf3,
1122 0x3d, 0x3d, 0x73, 0x15, 0xa3, 0xa5, 0x2f, 0xf2,
1123 0x02, 0x10, 0x1e, 0xaf, 0xf5, 0xb4, 0x78, 0x48,
1124 0x8a, 0x6c, 0x58, 0x71, 0x77, 0x91, 0x95, 0x57,
1125 0x79, 0xbf, 0x1f, 0x3e, 0xb3, 0xf8, 0xc4, 0x33,
1126 0x07, 0x5d, 0x96, 0x41, 0x76, 0xb1, 0xe1, 0xe0,
1127 0xa9, 0x97, 0x14, 0x99, 0x1d, 0xaa, 0x91, 0xbb,
1128 0xdf, 0x89, 0xf1, 0x0d, 0xd0, 0x52, 0xf9, 0xa7,
1129 0x4c, 0x82, 0xc0, 0xeb, 0xb7, 0xaf, 0x7b, 0x4b,
1130 0x5a, 0x2a, 0x7a, 0x4e, 0xb2, 0x69, 0x87, 0x28,
1131 0x84, 0xf7, 0x76, 0x56, 0xee, 0xf8, 0x37, 0x35,
1132 0xc9, 0xbc, 0x08, 0x8b, 0xfe, 0x1e, 0x54, 0xb3,
1133 0x01, 0xa7, 0x0f, 0x20, 0x70, 0xac, 0xa6, 0x6b,
1134 0x9f, 0x98, 0xfe, 0xdb, 0x3e, 0x4f, 0x9f, 0xfc,
1135 0x95, 0x37, 0xf4, 0x90, 0x61, 0x62, 0x60, 0xeb,
1136 0x7a, 0x4a, 0x56, 0xae, 0x49, 0xcc, 0x92, 0xff,
1137 0xd3, 0x06, 0xc6, 0x62, 0x4c, 0x05, 0x28, 0xa7,
1138 0x3f, 0xe9, 0xee, 0x70, 0x6f, 0xd2, 0x80, 0x41,
1139 0x4d, 0xa0, 0xbc, 0x00, 0xaf, 0x30, 0xe4, 0x34,
1140 0x61, 0xda, 0xb4, 0xff, 0x2a, 0x85, 0x8b, 0x1a,
1141 0xbf, 0xb5, 0xe4, 0x7f, 0x27, 0xee, 0xf3, 0x25,
1142 0xe6, 0x52, 0x2a, 0x83, 0xbe, 0xe4, 0x64, 0xc3,
1143 0x67, 0x0c, 0x9e, 0x0f, 0xba, 0xb4, 0x67, 0xd1,
1144 0x1b, 0x4a, 0xb0, 0xb2, 0xb4, 0xf2, 0x8a, 0x1b,
1145 0x21, 0x34, 0x3c, 0x97, 0x5a, 0xdb, 0x92, 0x8b,
1146 0x2d, 0xe9, 0x94, 0x4e, 0x11, 0xfb, 0xd4, 0x2e,
1147 0xc2, 0xed, 0xf9, 0x75, 0xfd, 0x1a, 0xef, 0x3b,
1148 0x98, 0x5d, 0xa9, 0x75, 0xd5, 0x14, 0x0a, 0xe3,
1149 0xda, 0x07, 0xa6, 0x20, 0x7b, 0x49, 0x47, 0x87,
1150 0xff, 0xf0, 0xe8, 0x7e, 0xcf, 0xc4, 0x2c, 0x02,
1151 0xdd, 0x53, 0xe9, 0x79, 0xc7, 0x6d, 0x16, 0x9f,
1152 0x2b, 0xd7, 0x1a, 0x36, 0x25, 0x5c, 0xba, 0x5c,
1153 0xdb, 0x44, 0x88, 0x99, 0x32, 0x2e, 0xb6, 0x3f,
1154 0xb4, 0xdd, 0x15, 0xeb, 0xec, 0x2a, 0x9e, 0xc5,
1155 0x37, 0x30, 0x2a, 0xd5, 0xc4, 0x2a, 0x9b, 0x40,
1156 0x97, 0x83, 0x94, 0xe7, 0x79, 0x79, 0x63, 0x4b,
1157 };
1158
1159 /*
1160 * IV method encblkno8, blkno 2.
1161 */
1162 static const uint8_t aes_cbc_192_encblkno8_vec2_ctxt[SECSIZE] = {
1163 0x34, 0x07, 0x20, 0x14, 0x64, 0x0b, 0xa2, 0x2c,
1164 0xed, 0xba, 0x46, 0x24, 0xa0, 0xe6, 0x99, 0x8a,
1165 0x20, 0x75, 0x5f, 0x9f, 0x2a, 0x10, 0xa6, 0x1c,
1166 0x52, 0x60, 0x18, 0x67, 0xd6, 0x0d, 0x90, 0x4e,
1167 0xbc, 0x25, 0x5f, 0x81, 0xb4, 0x10, 0xdb, 0xd9,
1168 0xaf, 0x36, 0x84, 0x5c, 0x20, 0x25, 0x25, 0xbf,
1169 0x0d, 0xfa, 0xc5, 0x75, 0x2b, 0xec, 0xf2, 0xa6,
1170 0x69, 0x5c, 0xfe, 0xee, 0x21, 0xd8, 0x87, 0xdf,
1171 0xe3, 0x83, 0xeb, 0xb3, 0x3f, 0x5b, 0xda, 0x37,
1172 0x11, 0x05, 0xf7, 0xd8, 0xe0, 0x94, 0x08, 0x2b,
1173 0x75, 0x6b, 0xf3, 0x40, 0x53, 0x85, 0xde, 0x7a,
1174 0x64, 0xb1, 0x0e, 0x5f, 0x01, 0xb5, 0xfb, 0x74,
1175 0x48, 0x9a, 0xd4, 0x41, 0x33, 0x70, 0x9b, 0x08,
1176 0x7e, 0x34, 0x60, 0xfc, 0xfa, 0xe6, 0x2c, 0xec,
1177 0x0e, 0xb7, 0x1a, 0xf1, 0x49, 0x48, 0x0c, 0xd4,
1178 0xd7, 0xbc, 0x60, 0x28, 0xdb, 0x57, 0xa4, 0x29,
1179 0x55, 0x2d, 0x92, 0xa6, 0xca, 0x9a, 0xaf, 0x4d,
1180 0x7f, 0xb8, 0x29, 0x9f, 0x50, 0x98, 0x21, 0x94,
1181 0x7a, 0x94, 0x44, 0x3d, 0xd1, 0xcf, 0xf4, 0x6f,
1182 0xad, 0xb4, 0x58, 0x66, 0x74, 0x01, 0x2c, 0x5b,
1183 0x8f, 0x1b, 0xa6, 0x09, 0xd0, 0x3f, 0x79, 0xc9,
1184 0x4f, 0x3b, 0x37, 0x0d, 0xb8, 0x07, 0xb0, 0x61,
1185 0xbc, 0x5a, 0x40, 0x3a, 0x10, 0x3c, 0x12, 0xe6,
1186 0x04, 0xc7, 0xd1, 0xe1, 0x18, 0x6f, 0xde, 0x72,
1187 0xf5, 0xcf, 0x24, 0x58, 0x76, 0xe1, 0xcd, 0x62,
1188 0x90, 0xc3, 0x16, 0xcc, 0x3f, 0xda, 0xd6, 0x6b,
1189 0x6a, 0xcc, 0x61, 0x76, 0xc1, 0xaf, 0xdc, 0x53,
1190 0xef, 0x06, 0x23, 0x22, 0x93, 0x11, 0x59, 0xf5,
1191 0x7f, 0x46, 0xac, 0xb8, 0x6c, 0x3b, 0x36, 0x69,
1192 0xc5, 0x14, 0x0a, 0x51, 0xa1, 0x5f, 0xb9, 0xc7,
1193 0x37, 0xe3, 0xd9, 0xaf, 0x8c, 0xe9, 0x49, 0xd4,
1194 0xf9, 0xf9, 0x5e, 0x1f, 0x5f, 0x7c, 0x07, 0xb5,
1195 0x1c, 0x9e, 0xbd, 0x10, 0x75, 0xc3, 0x93, 0x48,
1196 0xdc, 0x32, 0xe7, 0x55, 0x90, 0x48, 0x42, 0xc0,
1197 0x73, 0x20, 0x40, 0x17, 0xbb, 0x71, 0x30, 0xfe,
1198 0xd1, 0x84, 0xe9, 0x7d, 0x92, 0xd4, 0xff, 0xbe,
1199 0x3e, 0xd9, 0x41, 0xfb, 0x41, 0x43, 0x2b, 0x9f,
1200 0x04, 0x7b, 0xe7, 0x81, 0xbb, 0x2a, 0xd6, 0x7b,
1201 0x96, 0x72, 0x29, 0x30, 0x52, 0x5c, 0xea, 0xcc,
1202 0x4c, 0x77, 0xed, 0x5a, 0xd9, 0xab, 0x51, 0x90,
1203 0x21, 0x3b, 0x5b, 0x26, 0xeb, 0x14, 0xd5, 0xea,
1204 0x01, 0xb0, 0x7c, 0xbd, 0xa6, 0x3d, 0x7f, 0x42,
1205 0xd7, 0x7e, 0xf1, 0x6c, 0x71, 0x7d, 0xc0, 0x25,
1206 0x61, 0xe9, 0x66, 0xe1, 0xf2, 0x67, 0x99, 0xa1,
1207 0xe7, 0x3a, 0x6f, 0x88, 0x1e, 0x8b, 0x76, 0xed,
1208 0x50, 0x2c, 0x4e, 0xac, 0x73, 0xd7, 0xf2, 0x85,
1209 0x8f, 0xcc, 0xb1, 0x4f, 0x6c, 0x9a, 0xf7, 0x45,
1210 0x28, 0x4f, 0xfc, 0x3f, 0xf1, 0x80, 0xc3, 0xf3,
1211 0xce, 0x5e, 0xfc, 0x56, 0xd9, 0x45, 0xdd, 0x81,
1212 0xe3, 0x48, 0x22, 0xc9, 0xb8, 0x13, 0xc1, 0x48,
1213 0x6c, 0x95, 0x97, 0xc0, 0x91, 0x37, 0xf5, 0x8a,
1214 0x11, 0x3b, 0xab, 0xce, 0x7a, 0xb0, 0xb4, 0x4c,
1215 0xba, 0xc0, 0x91, 0x7f, 0x3c, 0x27, 0xe9, 0xc0,
1216 0x58, 0x92, 0x70, 0x67, 0xf4, 0x80, 0x40, 0x92,
1217 0x51, 0x80, 0x8e, 0x9d, 0x2d, 0x87, 0x89, 0x8e,
1218 0xe7, 0xd1, 0xb5, 0xc5, 0x4f, 0xd0, 0x86, 0x31,
1219 0x7f, 0x90, 0x77, 0x05, 0x35, 0xfe, 0xa7, 0xcb,
1220 0x9d, 0x94, 0xf3, 0xf8, 0xbb, 0x4f, 0xe1, 0xb3,
1221 0x48, 0x57, 0xbf, 0xd1, 0x77, 0xe8, 0x72, 0x31,
1222 0x4d, 0x2f, 0xe8, 0xa0, 0xf4, 0x7c, 0x25, 0x9c,
1223 0xcd, 0xa5, 0x7e, 0xd3, 0x30, 0xda, 0x46, 0xf5,
1224 0x48, 0x9e, 0x39, 0x34, 0x94, 0xd6, 0x24, 0x10,
1225 0xfc, 0x74, 0x2b, 0x6d, 0xcc, 0x00, 0x76, 0x3e,
1226 0x3b, 0x85, 0xfa, 0xef, 0x87, 0x70, 0x53, 0x4e,
1227 };
1228
1229 /*
1230 * IV method encblkno8, blkno 3.
1231 */
1232 static const uint8_t aes_cbc_192_encblkno8_vec3_ctxt[SECSIZE] = {
1233 0xfe, 0xad, 0xf3, 0x4a, 0x9d, 0x64, 0x4e, 0x5d,
1234 0xaf, 0xa8, 0x44, 0x7e, 0xc9, 0x75, 0xe8, 0xd0,
1235 0x87, 0x73, 0x66, 0x4c, 0x77, 0x00, 0xfb, 0x7b,
1236 0x04, 0xe7, 0xd8, 0x82, 0x75, 0xe3, 0xa5, 0xbc,
1237 0xf3, 0x80, 0xae, 0x7c, 0xc9, 0x75, 0x9a, 0xc1,
1238 0x73, 0x49, 0x69, 0xf6, 0xa0, 0x49, 0x6e, 0x77,
1239 0x5f, 0x9b, 0x95, 0x9b, 0x9f, 0x41, 0x54, 0x57,
1240 0x0e, 0x3c, 0xe5, 0x2c, 0xbb, 0xbf, 0xd5, 0x76,
1241 0xf6, 0xb6, 0x05, 0xaa, 0x20, 0x5b, 0xdb, 0xcb,
1242 0x81, 0xad, 0x0c, 0x8a, 0x68, 0x94, 0x7d, 0x88,
1243 0xdc, 0x15, 0x6c, 0x89, 0x97, 0x53, 0x30, 0x96,
1244 0x4a, 0x54, 0xf9, 0x88, 0x00, 0xf7, 0x3b, 0x99,
1245 0xfc, 0x82, 0xe3, 0x48, 0xd2, 0x16, 0x2b, 0xba,
1246 0xd4, 0xba, 0x24, 0xd0, 0xd1, 0xb0, 0x8e, 0xcd,
1247 0x77, 0xdc, 0x01, 0xdf, 0xb2, 0x20, 0xc5, 0xa7,
1248 0x48, 0x2a, 0xcf, 0x56, 0xc8, 0x63, 0x6e, 0xc9,
1249 0xa8, 0xa4, 0xc2, 0x9c, 0x66, 0x25, 0x50, 0x77,
1250 0x08, 0x51, 0x92, 0xce, 0x3c, 0xaf, 0xff, 0xee,
1251 0x3e, 0x6d, 0x61, 0x37, 0xcd, 0x85, 0x67, 0x9c,
1252 0xe0, 0x7e, 0xa6, 0x17, 0x7b, 0x5f, 0x6a, 0xe2,
1253 0x4e, 0x76, 0xca, 0x95, 0x88, 0xdf, 0xad, 0x78,
1254 0x91, 0xfa, 0x9e, 0x71, 0x3e, 0xfd, 0x10, 0x78,
1255 0x32, 0x2b, 0x75, 0xbc, 0x3a, 0x06, 0x55, 0x8b,
1256 0x9b, 0xfb, 0x9c, 0x4b, 0xa1, 0x7d, 0x35, 0x3d,
1257 0x63, 0x80, 0x30, 0x61, 0xe0, 0x2d, 0x8a, 0x28,
1258 0xb4, 0x2d, 0x48, 0x9d, 0x27, 0x1a, 0x28, 0x86,
1259 0xfc, 0xfa, 0x93, 0xcf, 0x3e, 0x9c, 0x41, 0xc8,
1260 0xc5, 0x5e, 0x88, 0x22, 0xb8, 0xaf, 0x1d, 0x92,
1261 0xc5, 0x91, 0x1b, 0x1e, 0x95, 0x62, 0xbb, 0x80,
1262 0x0c, 0xae, 0x2a, 0xb3, 0x55, 0x77, 0x86, 0x39,
1263 0xa6, 0xed, 0xc1, 0xd2, 0xc4, 0x95, 0x7e, 0xd4,
1264 0xbe, 0xf3, 0x1b, 0xbc, 0x5e, 0x92, 0x0d, 0x9c,
1265 0x38, 0xb1, 0xb9, 0xd3, 0xf6, 0x3f, 0x97, 0xf9,
1266 0x48, 0x08, 0x2b, 0xa6, 0x98, 0x50, 0xc9, 0x84,
1267 0xec, 0x54, 0xe0, 0x1a, 0x65, 0x76, 0xf2, 0xbe,
1268 0x62, 0xb9, 0x40, 0x3a, 0xb1, 0xef, 0xa0, 0x51,
1269 0xab, 0x3a, 0xfa, 0xaf, 0x33, 0x32, 0xa5, 0x0c,
1270 0xc7, 0x9a, 0x9c, 0x5c, 0xa7, 0x8e, 0xc6, 0x4e,
1271 0x61, 0xe3, 0x83, 0xa1, 0xd4, 0x2c, 0xb2, 0x2c,
1272 0x46, 0x5a, 0xbf, 0x96, 0xeb, 0xda, 0x45, 0x2d,
1273 0x25, 0x37, 0x69, 0x1a, 0x6b, 0xd6, 0xbc, 0xe1,
1274 0x28, 0x65, 0xf9, 0xfc, 0xa7, 0xda, 0xf8, 0x79,
1275 0x87, 0x18, 0x99, 0x01, 0x74, 0x5a, 0x42, 0x79,
1276 0x8e, 0xe4, 0x23, 0x1a, 0x6c, 0xda, 0x93, 0x0f,
1277 0x19, 0xf0, 0xff, 0x0e, 0x25, 0x45, 0x1e, 0xbb,
1278 0x17, 0xca, 0x87, 0x6a, 0x9e, 0xd0, 0xd3, 0xd5,
1279 0x22, 0x5f, 0xce, 0x92, 0xeb, 0x82, 0x8e, 0x3e,
1280 0x4e, 0x99, 0x44, 0xa2, 0x9e, 0x78, 0x53, 0x89,
1281 0x4e, 0x45, 0x51, 0x41, 0x28, 0x91, 0xdb, 0x7e,
1282 0x8f, 0xac, 0xc2, 0xee, 0x09, 0xcb, 0xed, 0x04,
1283 0x7b, 0x37, 0xa1, 0x1d, 0x9c, 0x90, 0x19, 0xb1,
1284 0xdd, 0xc3, 0x22, 0xc8, 0x70, 0x07, 0x26, 0xce,
1285 0x4a, 0xc4, 0xde, 0xee, 0x87, 0xf3, 0x62, 0x69,
1286 0xed, 0xb2, 0x2d, 0x10, 0xc4, 0xfa, 0x86, 0x2e,
1287 0xd1, 0xb8, 0x58, 0xa3, 0xa4, 0x0b, 0x30, 0x87,
1288 0x23, 0x62, 0xed, 0xf3, 0x7b, 0x80, 0x7e, 0x4f,
1289 0xc2, 0xb3, 0xe8, 0xba, 0x25, 0x3e, 0xd3, 0x12,
1290 0x7e, 0x27, 0xd5, 0x72, 0x3b, 0x02, 0xf4, 0xfd,
1291 0x2f, 0x8b, 0xc2, 0x5f, 0x44, 0x40, 0x31, 0x88,
1292 0x73, 0x81, 0xa3, 0xcc, 0xc4, 0x78, 0x2b, 0xfc,
1293 0x41, 0x2e, 0xb2, 0xd0, 0xb4, 0x00, 0x29, 0xc1,
1294 0x46, 0xdf, 0xc1, 0xbd, 0x15, 0x59, 0xa3, 0x6a,
1295 0xc8, 0x2f, 0x29, 0x28, 0x12, 0x9b, 0x1e, 0xea,
1296 0x4e, 0xa9, 0x80, 0xa1, 0xb8, 0x89, 0x21, 0x3b,
1297 };
1298
1299 const struct testvec aes_cbc_192_8_vectors[] = {
1300 {
1301 .blkno = 0,
1302 .ptxt = aes_cbc_ptxt,
1303 .ctxt = aes_cbc_192_encblkno8_vec0_ctxt,
1304 },
1305 {
1306 .blkno = 1,
1307 .ptxt = aes_cbc_ptxt,
1308 .ctxt = aes_cbc_192_encblkno8_vec1_ctxt,
1309 },
1310 {
1311 .blkno = 2,
1312 .ptxt = aes_cbc_ptxt,
1313 .ctxt = aes_cbc_192_encblkno8_vec2_ctxt,
1314 },
1315 {
1316 .blkno = 3,
1317 .ptxt = aes_cbc_ptxt,
1318 .ctxt = aes_cbc_192_encblkno8_vec3_ctxt,
1319 },
1320 };
1321
1322 /*
1323 * IV method encblkno1, blkno 0.
1324 */
1325 static const uint8_t aes_cbc_256_encblkno1_vec0_ctxt[SECSIZE] = {
1326 0x1a, 0xa4, 0xe3, 0x09, 0x23, 0x2e, 0x91, 0x1b,
1327 0xa8, 0x3e, 0xda, 0x92, 0xb3, 0x22, 0xd2, 0xe8,
1328 0x8b, 0xed, 0x6c, 0xa7, 0x78, 0xe6, 0x32, 0x25,
1329 0xc4, 0x88, 0xd5, 0xb7, 0x6e, 0xef, 0xbf, 0x37,
1330 0x00, 0xd9, 0xb2, 0x55, 0x10, 0x4f, 0x7d, 0x84,
1331 0x3a, 0xae, 0xd2, 0xc6, 0x48, 0xdd, 0x3c, 0xd5,
1332 0x9b, 0xa7, 0xf8, 0xc2, 0xda, 0x6d, 0x14, 0xa2,
1333 0xdc, 0x54, 0x12, 0x8f, 0x1c, 0x22, 0x98, 0x6a,
1334 0xc0, 0x5f, 0x47, 0xa7, 0x78, 0xec, 0x79, 0x5d,
1335 0x04, 0xed, 0x5e, 0x20, 0x33, 0x53, 0x66, 0x40,
1336 0x83, 0x94, 0x5b, 0x34, 0x05, 0x25, 0x2e, 0x17,
1337 0xba, 0x23, 0x60, 0xb1, 0xd0, 0x27, 0xf0, 0x24,
1338 0xd2, 0x0b, 0xd3, 0xea, 0xa7, 0x13, 0x1e, 0xf9,
1339 0x56, 0xe1, 0xd4, 0xa2, 0x89, 0x5a, 0xaa, 0x42,
1340 0xa9, 0xd7, 0x85, 0x64, 0x9e, 0x44, 0x71, 0xa2,
1341 0xf9, 0xc3, 0xf4, 0x81, 0xbd, 0xa0, 0x40, 0xed,
1342 0x33, 0xeb, 0x09, 0x0f, 0x7f, 0x78, 0xe4, 0xd5,
1343 0x7b, 0x61, 0x42, 0xee, 0x65, 0x25, 0xcc, 0xba,
1344 0xc6, 0x99, 0x29, 0x25, 0x71, 0x9a, 0xf0, 0x0e,
1345 0x98, 0x3f, 0x12, 0xf2, 0xf9, 0x4d, 0x00, 0x3c,
1346 0xbe, 0x9f, 0x2b, 0x83, 0x1e, 0x5b, 0xab, 0x80,
1347 0x4c, 0x81, 0x82, 0x29, 0xbb, 0xeb, 0xc0, 0x89,
1348 0x07, 0x43, 0xdd, 0x69, 0xd3, 0x02, 0x6c, 0x1c,
1349 0x4b, 0xab, 0x44, 0x42, 0x6c, 0x25, 0xfc, 0xf5,
1350 0x73, 0xaa, 0x60, 0x48, 0xbc, 0xd2, 0x1c, 0x77,
1351 0x8b, 0x64, 0x3e, 0x5f, 0x24, 0xae, 0x14, 0x65,
1352 0xea, 0x18, 0xb1, 0xab, 0xbc, 0x3d, 0xa3, 0xb9,
1353 0xfc, 0xcc, 0x0f, 0x8d, 0x8e, 0x13, 0x0f, 0x4d,
1354 0x4e, 0xeb, 0x90, 0x9b, 0x1e, 0xbf, 0x2a, 0xc7,
1355 0xac, 0x5b, 0x11, 0xeb, 0x67, 0xf2, 0x9d, 0xef,
1356 0xf3, 0x66, 0x9e, 0x81, 0x9f, 0x24, 0x4d, 0xcd,
1357 0x4f, 0x31, 0xce, 0xc9, 0xa4, 0x2c, 0xd7, 0x58,
1358 0x7c, 0x2e, 0x88, 0xa2, 0xec, 0x4c, 0x02, 0x29,
1359 0x00, 0xbd, 0x14, 0x0f, 0xaa, 0xd8, 0xc3, 0x02,
1360 0x64, 0xdc, 0xa0, 0x15, 0xc8, 0xf6, 0x17, 0x8b,
1361 0x9c, 0xb3, 0xf2, 0x27, 0xc1, 0x3f, 0x60, 0x94,
1362 0x33, 0x10, 0x89, 0x49, 0x5f, 0xd2, 0x0e, 0xfe,
1363 0x9e, 0x99, 0x68, 0x95, 0xe4, 0x12, 0xfc, 0xe3,
1364 0x7f, 0xc4, 0xb1, 0x88, 0x4f, 0x66, 0xcd, 0x24,
1365 0x89, 0x09, 0xbb, 0x01, 0xf6, 0x9a, 0xe4, 0x41,
1366 0xee, 0x83, 0xd2, 0x28, 0xf5, 0x28, 0x49, 0x13,
1367 0x78, 0xfb, 0xb2, 0x0d, 0x5c, 0x97, 0xf4, 0x9c,
1368 0xe0, 0xdf, 0xef, 0x84, 0x36, 0x7d, 0xe5, 0x45,
1369 0xe0, 0xf8, 0xce, 0x82, 0x39, 0xc4, 0x54, 0x69,
1370 0xf1, 0x62, 0x7d, 0x1a, 0xf6, 0x6c, 0x20, 0x86,
1371 0x72, 0x4b, 0xf9, 0x3d, 0x87, 0x68, 0xec, 0x74,
1372 0x67, 0xee, 0xbd, 0xb8, 0xc6, 0x12, 0x91, 0x0f,
1373 0xf6, 0xd9, 0x4f, 0x34, 0x96, 0xa9, 0xe7, 0x52,
1374 0x7b, 0xe0, 0x08, 0x57, 0x0a, 0x8b, 0x09, 0xcb,
1375 0xd3, 0x3e, 0x4e, 0x64, 0xca, 0x38, 0x50, 0x07,
1376 0x0e, 0x7b, 0x95, 0x69, 0x1b, 0x82, 0xba, 0x50,
1377 0x93, 0x4f, 0x9a, 0x8e, 0x11, 0x9b, 0x64, 0xf5,
1378 0x6a, 0xd4, 0x81, 0xf0, 0x1f, 0xb8, 0x85, 0x90,
1379 0x9c, 0x79, 0xde, 0xcb, 0x50, 0xba, 0xa9, 0x56,
1380 0x66, 0xd1, 0x1e, 0x78, 0xa8, 0x6a, 0xd5, 0xa5,
1381 0x83, 0x73, 0xe2, 0x88, 0xf2, 0x04, 0x33, 0x61,
1382 0xdf, 0x89, 0xd5, 0x3d, 0x03, 0x4e, 0x94, 0xb0,
1383 0x0f, 0x8d, 0x4d, 0xb4, 0x09, 0xb2, 0xf1, 0xb0,
1384 0xe7, 0xfe, 0xb0, 0x18, 0xe2, 0xfc, 0x92, 0xeb,
1385 0x2d, 0x7d, 0x56, 0x29, 0xbd, 0x34, 0x20, 0x7c,
1386 0xb6, 0xe7, 0x7b, 0xd7, 0x95, 0xa5, 0x0d, 0x10,
1387 0xbc, 0x7d, 0x9d, 0xd9, 0xbe, 0xc7, 0x23, 0x44,
1388 0x37, 0xb3, 0x98, 0x36, 0x33, 0x1a, 0x11, 0xfe,
1389 0x41, 0xea, 0x59, 0x48, 0x75, 0x34, 0xf6, 0xc4,
1390 };
1391
1392 /*
1393 * IV method encblkno1, blkno 1.
1394 */
1395 static const uint8_t aes_cbc_256_encblkno1_vec1_ctxt[SECSIZE] = {
1396 0x58, 0xfc, 0x1e, 0x48, 0x66, 0x7d, 0x91, 0xc7,
1397 0x56, 0xa3, 0x41, 0x89, 0xe8, 0x1e, 0x02, 0x77,
1398 0x93, 0x38, 0x12, 0x99, 0x06, 0x0d, 0xf3, 0x6d,
1399 0x2a, 0x5d, 0x3d, 0x7b, 0x4e, 0x05, 0x4f, 0x8f,
1400 0xe3, 0x86, 0x76, 0xfe, 0x11, 0x9d, 0xde, 0xd4,
1401 0x83, 0xd9, 0x47, 0x8d, 0x51, 0xdf, 0x4a, 0x24,
1402 0x2d, 0x11, 0xf0, 0xbd, 0xde, 0x17, 0x7e, 0x52,
1403 0x20, 0xc7, 0x17, 0x88, 0x2e, 0xa4, 0xd5, 0xa0,
1404 0x1e, 0xbc, 0x61, 0x15, 0x1e, 0x52, 0xa1, 0x8b,
1405 0xe9, 0xe4, 0x1f, 0x81, 0x49, 0x64, 0x17, 0xd4,
1406 0xef, 0xb6, 0x40, 0x05, 0x2f, 0x36, 0xf7, 0x39,
1407 0x03, 0x05, 0x80, 0xff, 0xf2, 0x1a, 0x15, 0xf1,
1408 0xfc, 0xaf, 0x71, 0x51, 0x73, 0xc5, 0x9e, 0x2f,
1409 0xd1, 0x7a, 0x2d, 0xd7, 0xed, 0x90, 0x11, 0xd2,
1410 0x80, 0x49, 0x46, 0x9f, 0x13, 0xa7, 0x32, 0x33,
1411 0x24, 0x39, 0x59, 0xf1, 0xed, 0x64, 0x75, 0x61,
1412 0xc3, 0x14, 0x68, 0x48, 0xf7, 0xc7, 0xbd, 0xe0,
1413 0x21, 0x59, 0x91, 0x07, 0x70, 0x83, 0x8f, 0xfc,
1414 0x59, 0x72, 0xca, 0xdd, 0x60, 0xa0, 0xbb, 0xb1,
1415 0x2f, 0xb8, 0x98, 0x8d, 0xf2, 0x4d, 0x3a, 0x19,
1416 0xbc, 0x6b, 0x37, 0xad, 0xd2, 0xb5, 0x7d, 0x1c,
1417 0x4a, 0x7b, 0x58, 0x76, 0x2e, 0xf5, 0x6b, 0xaf,
1418 0x4c, 0x92, 0x00, 0x8a, 0xb4, 0xa3, 0x86, 0x66,
1419 0x07, 0xc7, 0xfc, 0x57, 0x3c, 0x73, 0xf4, 0x8b,
1420 0xef, 0xb6, 0xae, 0x01, 0xfb, 0x88, 0x13, 0x04,
1421 0xa8, 0xc7, 0xec, 0xc4, 0xe0, 0x67, 0x3a, 0xfb,
1422 0x67, 0xce, 0x83, 0x9b, 0x8e, 0x66, 0xff, 0xa6,
1423 0x17, 0x1b, 0x66, 0x27, 0xdf, 0x2a, 0xfe, 0xf3,
1424 0x9a, 0xba, 0x59, 0xce, 0x28, 0xd4, 0xd2, 0x40,
1425 0x78, 0xb6, 0xe9, 0x7d, 0x8b, 0xcc, 0x47, 0x5c,
1426 0xf6, 0x5d, 0xc2, 0x5d, 0xe0, 0xa7, 0x61, 0x8b,
1427 0xe6, 0x7d, 0x38, 0xb6, 0xea, 0xfb, 0x13, 0x31,
1428 0x33, 0x2a, 0xb5, 0x45, 0x7b, 0xf6, 0x9f, 0x29,
1429 0x06, 0x2d, 0xd8, 0xab, 0x36, 0x27, 0xe4, 0x6c,
1430 0xf1, 0xab, 0xcd, 0xb9, 0x08, 0x0f, 0x4b, 0x8f,
1431 0x22, 0xea, 0xe4, 0x5d, 0x22, 0x05, 0x2e, 0xd4,
1432 0xd7, 0xff, 0x58, 0x50, 0x38, 0x17, 0x6f, 0x80,
1433 0x61, 0x98, 0xdc, 0xd4, 0x9f, 0x8f, 0xeb, 0x13,
1434 0xd3, 0x86, 0xe9, 0xa9, 0xe7, 0x07, 0x6f, 0x4f,
1435 0x54, 0x9e, 0x37, 0x3d, 0xbc, 0x82, 0x5f, 0x4f,
1436 0xd5, 0x0c, 0x21, 0xaa, 0x91, 0xcb, 0x06, 0x9a,
1437 0xaf, 0x57, 0x14, 0xfb, 0x57, 0xd8, 0x63, 0x58,
1438 0x0a, 0x03, 0x12, 0x0e, 0xd3, 0x37, 0x0b, 0xbf,
1439 0x67, 0xb7, 0x9d, 0xb7, 0x6b, 0x38, 0xeb, 0x17,
1440 0xd8, 0xb9, 0x5a, 0x37, 0x9f, 0x98, 0xa6, 0xca,
1441 0x7e, 0x95, 0xa7, 0x27, 0xc4, 0xd3, 0x15, 0x00,
1442 0x7b, 0x5e, 0x05, 0xc0, 0xc1, 0xb0, 0xe0, 0x13,
1443 0x7d, 0x91, 0xed, 0x2b, 0x99, 0x74, 0x1c, 0x16,
1444 0x45, 0x55, 0x21, 0xbc, 0x7c, 0x52, 0x87, 0x0f,
1445 0xb9, 0xbf, 0x71, 0x7c, 0x3a, 0x81, 0x72, 0x97,
1446 0xf8, 0x86, 0x61, 0x20, 0x17, 0xd8, 0xc8, 0xe0,
1447 0xfc, 0x42, 0x0f, 0x5b, 0xd6, 0x7e, 0x99, 0x81,
1448 0x5c, 0x2e, 0x2e, 0x3e, 0xe8, 0xce, 0x12, 0xcf,
1449 0x2c, 0xe6, 0x7a, 0x00, 0x5d, 0x36, 0x00, 0x92,
1450 0x60, 0xc5, 0xc0, 0xfd, 0xe0, 0xa3, 0xb9, 0x3e,
1451 0x92, 0xf8, 0x8f, 0xe2, 0x0f, 0xe5, 0xb4, 0x6a,
1452 0xd6, 0x5b, 0xa4, 0x5d, 0xf9, 0xef, 0x7e, 0xae,
1453 0xdd, 0xd0, 0x5d, 0x40, 0xfe, 0xa7, 0xed, 0xda,
1454 0xa9, 0x48, 0x1d, 0x6f, 0xc2, 0xd3, 0x35, 0x65,
1455 0xd8, 0x67, 0xc2, 0x9d, 0xed, 0xf7, 0x9f, 0x7b,
1456 0x7c, 0xd4, 0x03, 0xe0, 0xa6, 0xf9, 0x3c, 0xd0,
1457 0x21, 0x98, 0x60, 0xa6, 0x59, 0x86, 0xbd, 0x40,
1458 0x17, 0x47, 0x82, 0xb9, 0xe1, 0x11, 0x8d, 0x4b,
1459 0xcd, 0x1f, 0x54, 0x96, 0x17, 0x42, 0x22, 0x44,
1460 };
1461
1462 /*
1463 * IV method encblkno1, blkno 2.
1464 */
1465 static const uint8_t aes_cbc_256_encblkno1_vec2_ctxt[SECSIZE] = {
1466 0x1d, 0x65, 0xb2, 0x4e, 0xfa, 0x3f, 0xdb, 0xab,
1467 0x34, 0x9d, 0x37, 0x03, 0x17, 0x44, 0xed, 0x5b,
1468 0xf7, 0x1b, 0x6b, 0xc0, 0x5c, 0xfe, 0x5b, 0xcd,
1469 0xf0, 0xaf, 0x26, 0x82, 0x97, 0x12, 0xb8, 0x4f,
1470 0x76, 0x3d, 0x07, 0xd8, 0x29, 0x56, 0x3c, 0xbd,
1471 0x0e, 0xac, 0xd1, 0x8f, 0x53, 0x1a, 0x8f, 0xcd,
1472 0x04, 0x5b, 0x49, 0xe0, 0xf0, 0xea, 0xc9, 0x8a,
1473 0x08, 0x3d, 0x1f, 0x2d, 0x8c, 0xec, 0xb8, 0xea,
1474 0xe9, 0x24, 0xd1, 0x93, 0xd7, 0x9a, 0x0f, 0xd7,
1475 0x0f, 0x6b, 0xa0, 0x08, 0x58, 0x81, 0x68, 0x2f,
1476 0xde, 0x36, 0xb5, 0x87, 0xd9, 0xcd, 0x82, 0x13,
1477 0x36, 0x16, 0x6a, 0x9a, 0x02, 0xca, 0xda, 0x6f,
1478 0x51, 0x87, 0x75, 0x47, 0x89, 0xa4, 0x10, 0x60,
1479 0xfb, 0x1a, 0x74, 0x55, 0x6d, 0x18, 0x8d, 0x42,
1480 0x74, 0x2d, 0x12, 0x56, 0xc0, 0xcd, 0xa2, 0x57,
1481 0x53, 0x31, 0x8c, 0x7a, 0x8b, 0xa8, 0x6d, 0x89,
1482 0x81, 0xaf, 0x9c, 0xd9, 0x56, 0xe6, 0xdc, 0xe7,
1483 0x84, 0x0f, 0x81, 0x56, 0x1a, 0xc8, 0x5d, 0xa3,
1484 0xe0, 0x93, 0xea, 0x62, 0x7d, 0xa4, 0x5a, 0x58,
1485 0x8f, 0x05, 0x85, 0x34, 0x0c, 0x74, 0x8e, 0xe7,
1486 0xb4, 0x47, 0x93, 0x61, 0xbf, 0x61, 0x0a, 0xa2,
1487 0x37, 0xcd, 0x82, 0x9d, 0x55, 0x9e, 0x32, 0x9e,
1488 0x30, 0xce, 0x61, 0x89, 0xed, 0x25, 0x9e, 0x7c,
1489 0x2a, 0xcd, 0x39, 0x45, 0x56, 0xbb, 0x1a, 0xe8,
1490 0xb0, 0x75, 0x8f, 0xa1, 0x59, 0x09, 0xf8, 0x7a,
1491 0xbd, 0x4f, 0x69, 0x8b, 0xe2, 0xf3, 0xbe, 0x9b,
1492 0xea, 0x5f, 0x2c, 0x1e, 0x84, 0x69, 0xb2, 0xfa,
1493 0xaf, 0x1d, 0xc8, 0xcf, 0x76, 0x91, 0xd0, 0x7a,
1494 0xc9, 0xd1, 0x3d, 0xa5, 0xae, 0xae, 0xd7, 0x23,
1495 0xbb, 0xb3, 0x5e, 0x8a, 0x10, 0xc6, 0xbe, 0xa6,
1496 0x79, 0x69, 0x40, 0x83, 0x81, 0xe6, 0xb1, 0xa3,
1497 0x7e, 0x57, 0x44, 0x66, 0xc9, 0x2e, 0x84, 0xdd,
1498 0x00, 0xb4, 0x93, 0xae, 0x8f, 0x23, 0x12, 0xd6,
1499 0x54, 0x56, 0xc3, 0x51, 0xe5, 0xf7, 0x69, 0x47,
1500 0x00, 0x97, 0x71, 0x29, 0xcb, 0xcf, 0xeb, 0xd9,
1501 0xaf, 0xc0, 0x2f, 0x5c, 0xd7, 0x3e, 0xe4, 0x07,
1502 0xc9, 0x65, 0x2e, 0x8c, 0xf4, 0x54, 0xce, 0x8b,
1503 0xc7, 0x0c, 0xb4, 0x74, 0x56, 0x79, 0xa6, 0x40,
1504 0x4a, 0x58, 0xfd, 0x3f, 0x7b, 0x4c, 0xe9, 0xdb,
1505 0x33, 0x85, 0x6f, 0xf7, 0x5a, 0x9f, 0x6f, 0xc4,
1506 0x60, 0xad, 0x1b, 0xe2, 0xf5, 0xeb, 0x42, 0x7d,
1507 0xa4, 0x43, 0x8d, 0x40, 0xfa, 0x53, 0xcc, 0xf0,
1508 0x5f, 0x90, 0x0d, 0x04, 0x51, 0xb1, 0x48, 0xc7,
1509 0x90, 0x65, 0xb2, 0xef, 0xca, 0xc5, 0x9a, 0xec,
1510 0xde, 0x84, 0x21, 0x22, 0xeb, 0x97, 0xdd, 0xa2,
1511 0x9d, 0x71, 0xb1, 0xe0, 0x86, 0x58, 0xc3, 0x57,
1512 0xd5, 0x5a, 0x6f, 0xdc, 0xe5, 0xcc, 0x64, 0xc7,
1513 0x80, 0x2a, 0xef, 0x90, 0x91, 0x96, 0xb4, 0xeb,
1514 0xda, 0x3b, 0x7b, 0xbc, 0x14, 0x60, 0x52, 0xe5,
1515 0xe5, 0xc8, 0x6a, 0x99, 0x46, 0x9d, 0x00, 0x77,
1516 0x3b, 0x60, 0x75, 0x04, 0x06, 0x4a, 0x5a, 0x64,
1517 0x6f, 0x2f, 0x58, 0x77, 0x27, 0x9a, 0xc5, 0x90,
1518 0x37, 0xa7, 0xf3, 0x89, 0x72, 0x47, 0x4e, 0x08,
1519 0xa5, 0x79, 0x11, 0x2f, 0x22, 0x5a, 0xbb, 0xcf,
1520 0x76, 0xb9, 0x28, 0xc8, 0xc4, 0x5a, 0xe5, 0x90,
1521 0xf7, 0x02, 0xe4, 0xf9, 0x0c, 0x4c, 0x9a, 0xb1,
1522 0xa7, 0x99, 0x34, 0xd4, 0x77, 0x66, 0xff, 0x3c,
1523 0x50, 0x9a, 0xff, 0x13, 0x49, 0xd6, 0x5a, 0xf6,
1524 0x17, 0x6f, 0xca, 0x1a, 0xef, 0x0a, 0x2d, 0xf1,
1525 0xdf, 0xd0, 0xa5, 0x6f, 0xa6, 0x22, 0x3c, 0x1f,
1526 0xcf, 0xe7, 0xec, 0x23, 0x39, 0x6e, 0xc0, 0x37,
1527 0x31, 0x84, 0xff, 0xe2, 0x5a, 0xd6, 0x88, 0x74,
1528 0x15, 0x15, 0x46, 0x21, 0x00, 0xe4, 0x13, 0x9a,
1529 0xfa, 0xb2, 0x49, 0x7e, 0x79, 0xfb, 0x8a, 0x2a,
1530 };
1531
1532 /*
1533 * IV method encblkno1, blkno 3.
1534 */
1535 static const uint8_t aes_cbc_256_encblkno1_vec3_ctxt[SECSIZE] = {
1536 0xc1, 0x4a, 0x3c, 0x90, 0xba, 0xd4, 0x9c, 0xe7,
1537 0xf2, 0x5b, 0x3a, 0xc4, 0xce, 0x4a, 0x26, 0x4a,
1538 0x9c, 0x3f, 0xe5, 0x7a, 0x15, 0xbb, 0xbd, 0x3e,
1539 0xc6, 0x49, 0x47, 0x04, 0x4e, 0x8b, 0x73, 0xa6,
1540 0x02, 0x3a, 0xc1, 0xa3, 0xfa, 0x1a, 0xd0, 0x03,
1541 0xf7, 0x26, 0x9f, 0xad, 0x06, 0x8f, 0x86, 0xdc,
1542 0xb8, 0x73, 0x87, 0xa2, 0x82, 0xc6, 0x80, 0xe1,
1543 0xac, 0x3d, 0x16, 0x4c, 0xc3, 0x7c, 0x86, 0x01,
1544 0xa5, 0x7a, 0x1c, 0x4b, 0x56, 0x68, 0xf6, 0x06,
1545 0x99, 0x32, 0x42, 0x40, 0xf1, 0xb7, 0x44, 0x4b,
1546 0xd1, 0xdb, 0xad, 0x4e, 0xa6, 0xc2, 0x5f, 0xee,
1547 0x21, 0x1d, 0x58, 0xc6, 0xd5, 0x02, 0xef, 0xb2,
1548 0x38, 0xef, 0x29, 0x25, 0xfd, 0x28, 0x8a, 0x5b,
1549 0x8b, 0x36, 0x1a, 0xd6, 0x68, 0xf8, 0x77, 0xed,
1550 0xba, 0xb3, 0xa5, 0x6f, 0x76, 0x5e, 0xb5, 0xd4,
1551 0xc3, 0xb8, 0xf9, 0x67, 0x7a, 0x18, 0x43, 0xb6,
1552 0x65, 0x07, 0x48, 0x1d, 0x56, 0x20, 0x11, 0xe1,
1553 0x62, 0x6b, 0x70, 0xc9, 0x18, 0xa9, 0xa7, 0x36,
1554 0xbf, 0x31, 0x74, 0xe3, 0x33, 0x02, 0x96, 0x7a,
1555 0xf5, 0xd9, 0x8d, 0x05, 0x2b, 0xfd, 0x85, 0x4f,
1556 0x03, 0x0f, 0xe1, 0xfb, 0x1a, 0x57, 0xaf, 0xdc,
1557 0xff, 0xff, 0x5a, 0x96, 0x27, 0xca, 0xf3, 0x0c,
1558 0xd8, 0x39, 0x3e, 0xbe, 0x41, 0x5a, 0x21, 0x95,
1559 0x66, 0xe0, 0x69, 0x14, 0x2b, 0x18, 0xf2, 0x9b,
1560 0xf4, 0x22, 0xdf, 0xa9, 0xe4, 0x7d, 0x32, 0x5d,
1561 0x98, 0xa0, 0xe0, 0xe1, 0xe1, 0xbe, 0xae, 0x58,
1562 0x63, 0xbe, 0x4b, 0x97, 0x83, 0xaa, 0x67, 0xd3,
1563 0x1a, 0x70, 0xca, 0x82, 0x98, 0x77, 0x74, 0x1a,
1564 0xf2, 0x3d, 0x6a, 0x7b, 0x8e, 0xc8, 0xca, 0x34,
1565 0x44, 0xb8, 0xc0, 0xd0, 0x77, 0x8c, 0x4a, 0x5c,
1566 0xae, 0xd3, 0x17, 0x7c, 0x12, 0x47, 0x3e, 0xe2,
1567 0x2e, 0x51, 0xe0, 0x52, 0x88, 0x8e, 0xe9, 0x68,
1568 0xb6, 0x13, 0xf8, 0x69, 0xc9, 0x4b, 0xdd, 0x91,
1569 0x27, 0xb0, 0x22, 0x0c, 0x7d, 0xad, 0xb0, 0x75,
1570 0xe8, 0x76, 0x34, 0xc2, 0xd9, 0xf3, 0x20, 0xf7,
1571 0x1d, 0x0f, 0x07, 0x61, 0xc2, 0xb8, 0x7d, 0x00,
1572 0xa6, 0x68, 0xad, 0xd4, 0x0b, 0xa4, 0xa0, 0x32,
1573 0x6d, 0xa5, 0xc0, 0x07, 0x65, 0xae, 0xda, 0x2e,
1574 0xd6, 0xb7, 0xd3, 0x99, 0x8b, 0x37, 0x08, 0x13,
1575 0x6a, 0x94, 0xe9, 0xe4, 0xea, 0x34, 0xee, 0x07,
1576 0xee, 0x77, 0xb1, 0x3f, 0x54, 0x05, 0xbe, 0x66,
1577 0x7f, 0xf2, 0x70, 0x34, 0x45, 0xa7, 0x4b, 0x27,
1578 0xef, 0xe6, 0x39, 0x2e, 0x13, 0x41, 0xdb, 0x2d,
1579 0x1f, 0x76, 0x11, 0x76, 0x33, 0xf3, 0x92, 0x33,
1580 0x69, 0x16, 0x34, 0x86, 0x23, 0xc5, 0xfa, 0xaf,
1581 0xff, 0xbf, 0xee, 0x84, 0x56, 0xf6, 0x1e, 0x54,
1582 0x37, 0x32, 0x79, 0x83, 0x45, 0x04, 0x6f, 0x0e,
1583 0x75, 0x75, 0xd9, 0xd6, 0x4a, 0x87, 0xfb, 0x3c,
1584 0xb1, 0xcf, 0x66, 0xab, 0xa4, 0xaa, 0xf6, 0x96,
1585 0xb0, 0xcd, 0xaf, 0xac, 0x2c, 0x6d, 0x72, 0xca,
1586 0x43, 0xef, 0xb7, 0xa0, 0x4c, 0x62, 0xba, 0x7e,
1587 0x59, 0x0b, 0xff, 0x90, 0x49, 0x63, 0xf6, 0x31,
1588 0x8b, 0x50, 0x20, 0x82, 0x7d, 0xf0, 0x2d, 0xe4,
1589 0x5b, 0xda, 0xdf, 0xb0, 0xfb, 0x07, 0x7b, 0xe3,
1590 0x5f, 0xac, 0xd8, 0xe5, 0xa0, 0x3e, 0xc5, 0x60,
1591 0x94, 0xbc, 0xf7, 0x7e, 0xdc, 0x18, 0x27, 0x20,
1592 0xb1, 0xdd, 0x51, 0x4a, 0xb2, 0xe0, 0xc0, 0xe7,
1593 0x5d, 0x0f, 0x88, 0xb2, 0xa0, 0x42, 0x73, 0xfb,
1594 0xc4, 0x24, 0xa7, 0x17, 0x8a, 0xc9, 0x6d, 0x34,
1595 0xe8, 0x7b, 0x51, 0x37, 0x32, 0x3f, 0xf8, 0x7e,
1596 0x92, 0xe4, 0x87, 0xd2, 0x89, 0x66, 0xb0, 0xf6,
1597 0xc2, 0xba, 0x2f, 0x42, 0x8f, 0x1d, 0x5d, 0x81,
1598 0xad, 0xfd, 0x00, 0xbc, 0xa9, 0x11, 0x96, 0xae,
1599 0x80, 0xf1, 0x27, 0xe0, 0xeb, 0x5b, 0x60, 0x39,
1600 };
1601
1602 const struct testvec aes_cbc_256_1_vectors[] = {
1603 {
1604 .blkno = 0,
1605 .ptxt = aes_cbc_ptxt,
1606 .ctxt = aes_cbc_256_encblkno1_vec0_ctxt,
1607 },
1608 {
1609 .blkno = 1,
1610 .ptxt = aes_cbc_ptxt,
1611 .ctxt = aes_cbc_256_encblkno1_vec1_ctxt,
1612 },
1613 {
1614 .blkno = 2,
1615 .ptxt = aes_cbc_ptxt,
1616 .ctxt = aes_cbc_256_encblkno1_vec2_ctxt,
1617 },
1618 {
1619 .blkno = 3,
1620 .ptxt = aes_cbc_ptxt,
1621 .ctxt = aes_cbc_256_encblkno1_vec3_ctxt,
1622 },
1623 };
1624
1625 /*
1626 * IV method encblkno8, blkno 0.
1627 */
1628 static const uint8_t aes_cbc_256_encblkno8_vec0_ctxt[SECSIZE] = {
1629 0xe5, 0x55, 0xd9, 0xae, 0xc0, 0x66, 0x2d, 0x2f,
1630 0x11, 0xb1, 0x27, 0xd2, 0xb2, 0x73, 0xe4, 0x0a,
1631 0x85, 0xb5, 0x3c, 0x79, 0x78, 0xd6, 0x35, 0x3d,
1632 0x46, 0xac, 0xa3, 0x81, 0x55, 0x76, 0x86, 0xfc,
1633 0x37, 0xa0, 0x95, 0xc2, 0x30, 0xc9, 0x19, 0xc2,
1634 0x5f, 0xb0, 0x13, 0xa2, 0xa8, 0xe1, 0xc7, 0xb7,
1635 0x61, 0x54, 0xd8, 0xe6, 0xca, 0x94, 0x6f, 0x47,
1636 0x87, 0x33, 0x58, 0xd9, 0xd5, 0xd2, 0x95, 0x73,
1637 0x87, 0x9a, 0x31, 0xe5, 0x2e, 0x95, 0x83, 0x7d,
1638 0xdc, 0x0f, 0xc5, 0x2f, 0x14, 0xbc, 0x80, 0xac,
1639 0x47, 0xd6, 0xd8, 0x17, 0x9e, 0xf7, 0xff, 0x5b,
1640 0x85, 0x05, 0x91, 0xe0, 0x73, 0xd2, 0x5c, 0xa7,
1641 0x41, 0xf8, 0xcb, 0x3d, 0x38, 0x14, 0x28, 0x3e,
1642 0x89, 0x6f, 0xd4, 0xac, 0xb6, 0x11, 0x35, 0x67,
1643 0x7b, 0xef, 0x0d, 0xd8, 0x4d, 0xdd, 0x7e, 0x73,
1644 0xcd, 0x58, 0x0f, 0x5a, 0xcf, 0x42, 0xc5, 0x2f,
1645 0x61, 0x62, 0x13, 0xde, 0xcd, 0x2e, 0x22, 0xab,
1646 0xb0, 0x47, 0x5c, 0x1e, 0x5c, 0xc5, 0x49, 0xc6,
1647 0x3b, 0x0c, 0xe3, 0xb3, 0x59, 0xbf, 0xbf, 0x85,
1648 0xf6, 0x0a, 0x3d, 0x14, 0x74, 0x2a, 0xcd, 0xea,
1649 0x67, 0xd6, 0x80, 0x42, 0x3c, 0x6a, 0x92, 0x50,
1650 0x95, 0x73, 0xb5, 0x7a, 0xb2, 0xbc, 0x76, 0xe5,
1651 0x8f, 0xf3, 0x85, 0x5e, 0xcd, 0xf9, 0xb4, 0x9d,
1652 0xa8, 0x0a, 0xda, 0x95, 0x11, 0x2e, 0x22, 0x0c,
1653 0x2f, 0xb0, 0xbf, 0x92, 0x6b, 0x45, 0xec, 0x20,
1654 0xd2, 0x2b, 0x98, 0x3f, 0x4f, 0x97, 0xf2, 0xed,
1655 0xf7, 0x9b, 0x89, 0x4e, 0xd6, 0x59, 0xbb, 0x24,
1656 0x22, 0x44, 0x9f, 0x03, 0xb5, 0x42, 0xc8, 0x97,
1657 0xc7, 0xdb, 0x21, 0xfc, 0xcf, 0x33, 0xa1, 0xf1,
1658 0xc0, 0x1f, 0x28, 0x77, 0xee, 0xa5, 0x6a, 0x12,
1659 0xef, 0x8b, 0x48, 0xd1, 0xb3, 0xac, 0x65, 0x69,
1660 0x46, 0x04, 0x39, 0xb1, 0x9e, 0xfa, 0xab, 0x21,
1661 0x51, 0xa4, 0x33, 0xe9, 0x58, 0x5d, 0xf1, 0xc6,
1662 0x69, 0x44, 0x8c, 0x17, 0xf9, 0xaa, 0x96, 0xcb,
1663 0x40, 0xb4, 0x5c, 0x83, 0x76, 0x1e, 0x8a, 0x2b,
1664 0x5f, 0x6b, 0xc1, 0x73, 0xd4, 0x5f, 0x48, 0xa3,
1665 0x0e, 0x07, 0x69, 0x12, 0xc1, 0xbd, 0x13, 0xad,
1666 0xe2, 0xcf, 0x3d, 0x96, 0xd8, 0xaf, 0xed, 0xdc,
1667 0x4c, 0x72, 0xf6, 0xce, 0x15, 0x86, 0x88, 0x8c,
1668 0xbb, 0x60, 0xb3, 0xb9, 0xde, 0x42, 0x58, 0x6e,
1669 0xc4, 0x58, 0xac, 0x77, 0x8d, 0x35, 0x23, 0x5f,
1670 0xc3, 0xf9, 0x33, 0x46, 0x17, 0x80, 0x31, 0xfd,
1671 0xcd, 0x0a, 0x1e, 0x9b, 0xac, 0x42, 0xda, 0x70,
1672 0x54, 0x9a, 0xeb, 0x22, 0x27, 0x09, 0x0c, 0x6c,
1673 0x18, 0x1d, 0x1a, 0x5b, 0x86, 0x4d, 0x80, 0xca,
1674 0x4d, 0xda, 0x0e, 0x9a, 0x8e, 0x61, 0x04, 0x68,
1675 0x29, 0x08, 0x3b, 0xae, 0x14, 0x7d, 0x8e, 0x43,
1676 0x7a, 0xa7, 0x83, 0xcf, 0xb3, 0x95, 0xd3, 0x42,
1677 0x2d, 0x6b, 0xd8, 0x5c, 0x43, 0x31, 0x5b, 0x9c,
1678 0x18, 0x30, 0x0d, 0x61, 0x9c, 0xab, 0x29, 0x55,
1679 0xdd, 0x84, 0x24, 0x21, 0xec, 0x44, 0xad, 0xf3,
1680 0xb3, 0x70, 0x77, 0x2b, 0xfc, 0x3f, 0x99, 0xb8,
1681 0x50, 0x26, 0x8d, 0x96, 0xa2, 0x22, 0x99, 0x33,
1682 0x53, 0xa8, 0x5d, 0x84, 0x9b, 0x76, 0x26, 0x6e,
1683 0x75, 0x14, 0x7e, 0x63, 0xc6, 0x7a, 0x4f, 0x5c,
1684 0xfe, 0x4b, 0x80, 0xee, 0xb3, 0x32, 0x8d, 0x25,
1685 0x1c, 0x80, 0x7b, 0x3d, 0xd3, 0x84, 0x01, 0x1e,
1686 0x16, 0xa4, 0xca, 0x0d, 0x38, 0x40, 0x03, 0x6f,
1687 0x81, 0x8b, 0x5c, 0xad, 0x22, 0xfa, 0x6f, 0xeb,
1688 0x60, 0xa1, 0xcb, 0x2d, 0x97, 0xf8, 0xa6, 0x5e,
1689 0xbe, 0x93, 0xb7, 0xe6, 0x66, 0xbf, 0x9b, 0xd2,
1690 0x5c, 0x31, 0xcc, 0x70, 0x0c, 0xf1, 0xfb, 0x9f,
1691 0x09, 0x1b, 0xc2, 0x85, 0x2f, 0x22, 0x7c, 0x95,
1692 0x58, 0x09, 0xce, 0x9c, 0x7c, 0x50, 0xca, 0x89,
1693 };
1694
1695 /*
1696 * IV method encblkno8, blkno 1.
1697 */
1698 static const uint8_t aes_cbc_256_encblkno8_vec1_ctxt[SECSIZE] = {
1699 0x37, 0x4d, 0x25, 0xdb, 0x35, 0xe0, 0x8b, 0x82,
1700 0x5f, 0x77, 0xd2, 0x53, 0xd1, 0x1f, 0xf0, 0x91,
1701 0x5b, 0xd8, 0x93, 0x2f, 0xb2, 0x81, 0xbd, 0x75,
1702 0xf0, 0xd8, 0xff, 0x46, 0x8c, 0x9d, 0xf6, 0xe2,
1703 0x99, 0x1e, 0x76, 0x9d, 0x00, 0x3a, 0xe3, 0xcf,
1704 0x6d, 0x24, 0xa8, 0xe8, 0xb4, 0xa7, 0xa0, 0x87,
1705 0xa8, 0x43, 0x01, 0x21, 0x29, 0x70, 0x39, 0x2d,
1706 0x0b, 0x2a, 0xe9, 0x11, 0x57, 0x86, 0x13, 0xd4,
1707 0x1c, 0x1b, 0x59, 0x19, 0xc4, 0x7d, 0x2c, 0x94,
1708 0xc7, 0x01, 0xb8, 0x96, 0x01, 0xd2, 0x01, 0x17,
1709 0x97, 0x41, 0x68, 0xab, 0xba, 0x9c, 0xc8, 0xad,
1710 0x4e, 0xd7, 0xa8, 0x4c, 0x96, 0x3f, 0xf9, 0xfc,
1711 0x7e, 0xd7, 0x59, 0xe8, 0x25, 0x51, 0x4d, 0x1d,
1712 0x99, 0xfd, 0x0b, 0xe9, 0x88, 0x23, 0xd1, 0x4b,
1713 0x30, 0x6e, 0x18, 0x7c, 0xe3, 0x7a, 0x54, 0x2a,
1714 0x4f, 0x2a, 0x99, 0x8f, 0xaf, 0xd7, 0x5e, 0x25,
1715 0xfe, 0x9c, 0x47, 0x09, 0x63, 0x38, 0x0d, 0x5f,
1716 0xb3, 0x43, 0xa6, 0x66, 0x9b, 0xc5, 0x3d, 0x88,
1717 0x5e, 0xc7, 0x60, 0x99, 0x8e, 0xcb, 0x6a, 0x65,
1718 0x60, 0x92, 0x88, 0xe1, 0x2b, 0xfe, 0x83, 0x34,
1719 0x92, 0xa6, 0x6c, 0x22, 0x56, 0x5b, 0x75, 0x8a,
1720 0x93, 0xc3, 0x72, 0xca, 0xff, 0x59, 0x3b, 0xd8,
1721 0xa0, 0x80, 0x56, 0x98, 0x62, 0x8a, 0x70, 0xf2,
1722 0x5d, 0xd9, 0x40, 0x6b, 0xbf, 0x9f, 0x71, 0x8d,
1723 0x2e, 0x38, 0xe8, 0x06, 0x42, 0xa9, 0x95, 0x70,
1724 0x31, 0xd1, 0xe9, 0x6c, 0xab, 0xbb, 0xed, 0x25,
1725 0xe8, 0xca, 0xe8, 0xa4, 0x98, 0x82, 0xf5, 0xe3,
1726 0x11, 0x3c, 0xc4, 0xea, 0xea, 0x88, 0x56, 0x91,
1727 0xd6, 0x5d, 0xaa, 0xf7, 0xe9, 0x49, 0x2f, 0x42,
1728 0x5b, 0x76, 0xef, 0xed, 0x03, 0x9e, 0x5f, 0x4d,
1729 0x65, 0x25, 0xa5, 0xe8, 0x26, 0xba, 0x03, 0x4f,
1730 0x0e, 0x39, 0xd2, 0x53, 0x62, 0x98, 0x81, 0x9d,
1731 0x8e, 0xad, 0x50, 0x17, 0x9f, 0xcc, 0x34, 0x45,
1732 0x19, 0x5c, 0x1c, 0xd1, 0xbc, 0x71, 0x89, 0xaa,
1733 0x9a, 0x65, 0x55, 0x6f, 0x78, 0xd4, 0xd3, 0x5b,
1734 0x27, 0x8d, 0x94, 0x46, 0xd9, 0x95, 0xb3, 0x5f,
1735 0xc4, 0x35, 0x8d, 0xba, 0x1c, 0x40, 0x52, 0xd1,
1736 0x99, 0x27, 0x5d, 0x42, 0x28, 0xef, 0xcb, 0x9b,
1737 0x10, 0x7a, 0x19, 0xbf, 0x72, 0xa3, 0x4a, 0xb9,
1738 0x56, 0x83, 0x39, 0xa6, 0xb2, 0xcd, 0x48, 0x85,
1739 0xf9, 0xcc, 0x72, 0x88, 0xb3, 0x5a, 0x9b, 0x45,
1740 0xb2, 0xd3, 0x66, 0x2d, 0x24, 0x51, 0x68, 0x91,
1741 0x9d, 0x47, 0x6a, 0xb3, 0x9a, 0x60, 0xb3, 0xcd,
1742 0x6b, 0x43, 0x96, 0x21, 0xa0, 0x65, 0x43, 0xde,
1743 0x4f, 0x6e, 0xb5, 0x81, 0x50, 0x7e, 0xca, 0x4b,
1744 0xdb, 0x30, 0xf2, 0xcb, 0x28, 0x3b, 0x19, 0x6a,
1745 0x0a, 0xfa, 0x05, 0x5e, 0x61, 0xde, 0x76, 0x7e,
1746 0xdf, 0xd9, 0xa9, 0x1b, 0xd0, 0x8a, 0xb5, 0x04,
1747 0x51, 0xf5, 0x66, 0xa2, 0x32, 0x21, 0xb2, 0xa9,
1748 0x40, 0x78, 0x60, 0x9d, 0xdc, 0x45, 0xbe, 0xb4,
1749 0x3a, 0xba, 0xd1, 0xec, 0x31, 0x53, 0x24, 0x22,
1750 0x70, 0x99, 0xda, 0xc8, 0x17, 0x04, 0x87, 0x2c,
1751 0x89, 0x86, 0x24, 0xec, 0x52, 0x12, 0x6a, 0x51,
1752 0x1e, 0x2a, 0x5e, 0x96, 0xfb, 0xac, 0x95, 0x4a,
1753 0x1a, 0x06, 0x8f, 0xdf, 0xa7, 0x26, 0xeb, 0x6c,
1754 0x79, 0x4a, 0x77, 0xea, 0xb3, 0xb1, 0x3a, 0x19,
1755 0xe6, 0x5e, 0xe2, 0x26, 0x1b, 0x85, 0x3c, 0x9b,
1756 0x1d, 0x05, 0x1d, 0xbe, 0x5c, 0x25, 0x7f, 0x45,
1757 0x4c, 0x09, 0x4c, 0xc1, 0x47, 0xa5, 0x44, 0xfc,
1758 0x04, 0x2b, 0xad, 0x53, 0xac, 0x57, 0x22, 0x54,
1759 0x13, 0x7c, 0xc9, 0x96, 0x44, 0xda, 0x74, 0x95,
1760 0x6e, 0x8c, 0xe6, 0x6a, 0x05, 0x05, 0xf3, 0x8c,
1761 0x81, 0xaf, 0xbc, 0xb1, 0x91, 0xe7, 0xfd, 0x81,
1762 0x3f, 0x47, 0xc2, 0x6f, 0x0d, 0x62, 0xf6, 0x6e,
1763 };
1764
1765 /*
1766 * IV method encblkno8, blkno 2.
1767 */
1768 static const uint8_t aes_cbc_256_encblkno8_vec2_ctxt[SECSIZE] = {
1769 0x5a, 0x24, 0xfd, 0xee, 0x9a, 0x44, 0xfb, 0xac,
1770 0x3e, 0x46, 0x53, 0x95, 0x9e, 0xeb, 0x1f, 0xd9,
1771 0xfd, 0xc6, 0x4f, 0xae, 0x0b, 0xc8, 0xf2, 0xbd,
1772 0x77, 0x16, 0x7a, 0x2e, 0x8e, 0xec, 0x7a, 0x53,
1773 0xf4, 0xe0, 0x34, 0xba, 0x6e, 0xfa, 0xc4, 0x69,
1774 0xd7, 0x50, 0x13, 0x03, 0xfb, 0xb9, 0x66, 0x96,
1775 0xd4, 0x21, 0x67, 0xcc, 0x4c, 0x4d, 0x10, 0x2f,
1776 0x17, 0xeb, 0x41, 0xf4, 0x65, 0x80, 0x0b, 0x57,
1777 0x2d, 0xdf, 0xcf, 0x9f, 0xb9, 0xd8, 0x53, 0x36,
1778 0xbc, 0x1d, 0x9a, 0xe3, 0x17, 0xe7, 0x08, 0x23,
1779 0xb3, 0x60, 0xfe, 0xdf, 0x24, 0x06, 0xc5, 0x86,
1780 0x74, 0x89, 0xa3, 0xb2, 0xfc, 0x4a, 0x57, 0xf5,
1781 0xa6, 0x96, 0xfb, 0x56, 0xf0, 0xf4, 0xdc, 0xdc,
1782 0xb8, 0x53, 0x5f, 0xb2, 0xb0, 0x8d, 0x2d, 0x90,
1783 0x3d, 0x78, 0x4d, 0x42, 0x3a, 0x74, 0xa4, 0x8e,
1784 0x41, 0x7c, 0x2a, 0xff, 0xe4, 0x57, 0x1c, 0x9d,
1785 0x94, 0xc5, 0x5d, 0xd8, 0x8b, 0x88, 0x48, 0x15,
1786 0x16, 0x8a, 0xf3, 0x07, 0x3a, 0xee, 0x65, 0x24,
1787 0xbc, 0x7f, 0x58, 0xad, 0xed, 0xf2, 0xbd, 0x18,
1788 0x88, 0x1a, 0x80, 0x6e, 0xb7, 0x93, 0xe0, 0x45,
1789 0x04, 0xb0, 0xfc, 0xf9, 0x48, 0x76, 0xaf, 0xec,
1790 0x08, 0xca, 0x99, 0x64, 0x85, 0x98, 0x2c, 0xd8,
1791 0x85, 0x72, 0x32, 0xbe, 0x92, 0x18, 0xdd, 0xab,
1792 0x20, 0x8f, 0x8e, 0x11, 0xc6, 0x08, 0xf9, 0x8b,
1793 0xaf, 0x5f, 0xa9, 0xe5, 0x11, 0xc7, 0x45, 0x91,
1794 0x6e, 0x47, 0xaa, 0x0f, 0x4c, 0xf4, 0xc1, 0xb0,
1795 0x75, 0x4c, 0xba, 0x1d, 0xb3, 0x33, 0xf7, 0x47,
1796 0xbe, 0x94, 0x0b, 0x2e, 0xfa, 0x38, 0x5e, 0x5f,
1797 0x0a, 0xc2, 0x0c, 0x4e, 0x72, 0x29, 0x16, 0xc1,
1798 0x82, 0x70, 0xd4, 0xd3, 0x1b, 0x25, 0xbe, 0x0d,
1799 0x6b, 0x0a, 0x13, 0x9f, 0x4d, 0x3d, 0x7b, 0x10,
1800 0x9f, 0x93, 0x43, 0x50, 0xd1, 0x17, 0x08, 0x77,
1801 0x23, 0x58, 0x35, 0x41, 0x23, 0xf6, 0x9c, 0x6f,
1802 0x2e, 0x81, 0x6e, 0x75, 0x9b, 0x9f, 0x37, 0x4f,
1803 0xb7, 0xa1, 0xce, 0xde, 0x0c, 0x74, 0x99, 0x31,
1804 0x0e, 0x27, 0x42, 0x99, 0xdd, 0x93, 0x03, 0x6b,
1805 0x44, 0x22, 0xd4, 0xc8, 0x67, 0xb5, 0xb2, 0x4d,
1806 0x11, 0x2e, 0x80, 0x09, 0xa2, 0x5b, 0xcf, 0x0c,
1807 0xff, 0xfa, 0x51, 0xe5, 0x9b, 0xdd, 0x11, 0xa1,
1808 0x17, 0x04, 0x9e, 0xc8, 0xd8, 0x1d, 0xc1, 0x5c,
1809 0xc3, 0xde, 0x83, 0x77, 0xa3, 0xec, 0x59, 0x7e,
1810 0xfb, 0xe8, 0x45, 0xff, 0xc3, 0xb3, 0xd3, 0x9e,
1811 0x3e, 0xc4, 0x75, 0xca, 0xc1, 0x77, 0xee, 0x1a,
1812 0xdc, 0x58, 0xab, 0x27, 0xc1, 0xfe, 0x21, 0x26,
1813 0x9a, 0xe0, 0x15, 0xab, 0x35, 0x8d, 0xbc, 0x22,
1814 0x37, 0xbb, 0x4e, 0xab, 0x9d, 0xa2, 0xaf, 0xf9,
1815 0x45, 0x17, 0xb1, 0xb8, 0xd4, 0x52, 0x1e, 0x67,
1816 0xeb, 0xac, 0xe0, 0x87, 0x6c, 0xe4, 0x7a, 0x03,
1817 0x73, 0xe4, 0x43, 0xeb, 0x3b, 0x57, 0x3f, 0x56,
1818 0x4b, 0x6c, 0x26, 0x81, 0x27, 0xbf, 0x7e, 0x59,
1819 0xcd, 0xab, 0x67, 0x8c, 0x4b, 0x6f, 0xa5, 0x47,
1820 0x2c, 0x45, 0x28, 0x5a, 0x3d, 0x88, 0x53, 0xf9,
1821 0x25, 0xdf, 0x5d, 0xba, 0xf7, 0x18, 0xa7, 0x3d,
1822 0x79, 0xb4, 0x43, 0x59, 0x77, 0xf9, 0xd5, 0x5d,
1823 0x4f, 0x31, 0x56, 0x8c, 0x21, 0xb5, 0xc0, 0xa2,
1824 0xca, 0x04, 0x62, 0x2c, 0xc8, 0xa8, 0x11, 0x82,
1825 0x1b, 0xde, 0xad, 0x20, 0x5b, 0xd2, 0x63, 0xfb,
1826 0x6d, 0xba, 0xd4, 0xcc, 0xb4, 0x9d, 0xe8, 0xa8,
1827 0xd1, 0x06, 0x81, 0xf0, 0xb9, 0xd4, 0x90, 0x30,
1828 0xcd, 0x0a, 0xe8, 0xd2, 0x8c, 0x7a, 0xbf, 0xf6,
1829 0x0d, 0xa0, 0xae, 0x1b, 0x21, 0x18, 0x93, 0x18,
1830 0x71, 0xe1, 0xa0, 0x63, 0x5a, 0x9d, 0x4e, 0x6a,
1831 0x52, 0x90, 0xaf, 0xdb, 0x26, 0x1e, 0xa9, 0xa1,
1832 0xc7, 0xf9, 0xf8, 0xa7, 0x3f, 0x85, 0xa1, 0xa4,
1833 };
1834
1835 /*
1836 * IV method encblkno8, blkno 3.
1837 */
1838 static const uint8_t aes_cbc_256_encblkno8_vec3_ctxt[SECSIZE] = {
1839 0x83, 0x77, 0xd8, 0xa8, 0x6a, 0x36, 0x41, 0x72,
1840 0xb6, 0x03, 0x4e, 0x5e, 0x39, 0x36, 0xe3, 0xf5,
1841 0xd0, 0x1b, 0x0d, 0x97, 0x78, 0x46, 0xee, 0xfd,
1842 0x34, 0x34, 0x16, 0xa0, 0x44, 0xcf, 0x0b, 0xdc,
1843 0xfb, 0x82, 0x98, 0xa2, 0x79, 0xc2, 0xe7, 0x1c,
1844 0x43, 0x43, 0x4c, 0x7f, 0xe7, 0xa6, 0xe6, 0x10,
1845 0x9e, 0x65, 0xb2, 0x09, 0xc7, 0x5f, 0xaa, 0xb7,
1846 0xb8, 0xad, 0x83, 0xd5, 0x9e, 0xd1, 0xb2, 0xce,
1847 0x4b, 0xa4, 0x5d, 0xbc, 0xd6, 0xf6, 0x0a, 0xe7,
1848 0x1b, 0xe9, 0x86, 0xbc, 0x72, 0xcc, 0x6f, 0xcc,
1849 0xf2, 0xde, 0x08, 0x48, 0xa2, 0x20, 0x31, 0x6a,
1850 0xdd, 0xbe, 0xc5, 0x36, 0x55, 0xff, 0xce, 0xfa,
1851 0xdf, 0x60, 0x26, 0x77, 0x7f, 0xd0, 0xfa, 0xd7,
1852 0x76, 0x70, 0x14, 0x11, 0xbf, 0x57, 0xc2, 0xdd,
1853 0x5f, 0xd3, 0x50, 0x49, 0xf8, 0xd1, 0xa7, 0xe2,
1854 0x8b, 0x89, 0xa0, 0xbc, 0x44, 0x42, 0x45, 0x10,
1855 0xfe, 0x66, 0x3d, 0x56, 0x09, 0x21, 0x7c, 0x49,
1856 0x30, 0xde, 0xe2, 0x4b, 0x26, 0x65, 0x8a, 0xe4,
1857 0x79, 0x08, 0x3a, 0xca, 0x36, 0x4f, 0x97, 0x3c,
1858 0xe4, 0x6a, 0xc3, 0xdb, 0xce, 0xac, 0x78, 0x76,
1859 0x25, 0x81, 0x7a, 0x01, 0x7b, 0xd8, 0xf1, 0x00,
1860 0x8d, 0x2e, 0xb7, 0x98, 0x3c, 0x86, 0x20, 0xa3,
1861 0x4c, 0x24, 0x2a, 0x78, 0x3a, 0x8d, 0xeb, 0xcd,
1862 0xae, 0xe1, 0x32, 0xf8, 0x21, 0x37, 0x30, 0x27,
1863 0xe1, 0xf3, 0x14, 0x60, 0x96, 0x77, 0x37, 0x50,
1864 0xa2, 0x92, 0xae, 0xe5, 0xd8, 0xea, 0x1a, 0x7e,
1865 0xa3, 0xd1, 0x04, 0x17, 0x03, 0x51, 0x2f, 0x21,
1866 0xa7, 0x00, 0x23, 0xb3, 0x24, 0xd8, 0x7d, 0xb7,
1867 0x4c, 0x51, 0xb1, 0xaf, 0xb0, 0x64, 0xe4, 0x62,
1868 0x91, 0x4c, 0xd5, 0x4b, 0xe8, 0xfb, 0x95, 0x61,
1869 0xa4, 0x6f, 0xf8, 0xb8, 0xea, 0xa9, 0xb2, 0x10,
1870 0xd3, 0x96, 0xcb, 0x1c, 0xdc, 0x86, 0x43, 0x26,
1871 0x2d, 0x39, 0xc2, 0xa7, 0x69, 0xfa, 0x8f, 0x3a,
1872 0xe7, 0xe0, 0x27, 0xbe, 0xc2, 0xe8, 0xd5, 0x05,
1873 0xbe, 0x5a, 0x96, 0xdc, 0x86, 0xcd, 0x93, 0x75,
1874 0x1b, 0x61, 0x40, 0x8c, 0x60, 0x64, 0x79, 0x85,
1875 0x6c, 0xed, 0x39, 0x72, 0x26, 0x69, 0xba, 0xb2,
1876 0xff, 0xa8, 0x68, 0x29, 0x03, 0xf7, 0x26, 0xe7,
1877 0x0f, 0x53, 0x1b, 0x5b, 0x37, 0x21, 0x68, 0x70,
1878 0x1c, 0x39, 0x7f, 0x5b, 0x31, 0xca, 0xde, 0xed,
1879 0x33, 0x8d, 0xaf, 0xe6, 0x01, 0xd5, 0x72, 0x5f,
1880 0x46, 0x44, 0x34, 0x1b, 0x4c, 0xd7, 0x75, 0xf0,
1881 0x47, 0x16, 0x6c, 0xd6, 0x65, 0x3c, 0xd3, 0xc2,
1882 0xb1, 0x46, 0x7d, 0xd5, 0x5c, 0x48, 0x5b, 0x61,
1883 0x3e, 0x88, 0xff, 0x24, 0x5c, 0x7b, 0xf7, 0xa9,
1884 0x44, 0xcb, 0x3b, 0x3e, 0x3b, 0x93, 0x24, 0x46,
1885 0x7e, 0x34, 0x8d, 0xc4, 0x2b, 0xb7, 0x8e, 0x22,
1886 0x9e, 0x87, 0x62, 0xca, 0xbc, 0x10, 0x09, 0x4a,
1887 0x4b, 0x0b, 0xdb, 0x57, 0x9b, 0xa9, 0x3e, 0xa8,
1888 0x99, 0x59, 0xa0, 0x12, 0xf3, 0xa5, 0xe4, 0x91,
1889 0xbb, 0xb9, 0x05, 0x8d, 0xcf, 0xb9, 0xcb, 0x36,
1890 0x97, 0xb2, 0x6a, 0x31, 0x8f, 0xcb, 0xf8, 0x5a,
1891 0x2f, 0x9e, 0xa1, 0xf9, 0x7a, 0xf4, 0x10, 0x0e,
1892 0xe7, 0x7f, 0x4c, 0xcb, 0xe3, 0x83, 0x17, 0x39,
1893 0x34, 0xef, 0x49, 0x35, 0x68, 0x50, 0x80, 0xf9,
1894 0xcd, 0x3a, 0x10, 0xf6, 0x71, 0x1a, 0x94, 0xc3,
1895 0xec, 0xb9, 0x36, 0x84, 0x36, 0xe7, 0x3f, 0x6f,
1896 0x9b, 0xa9, 0x2b, 0x5c, 0x96, 0x49, 0x26, 0xda,
1897 0xb3, 0x08, 0x3d, 0x5e, 0x9e, 0x59, 0xdf, 0x0f,
1898 0xfc, 0xbe, 0xa8, 0x0b, 0xbc, 0xaa, 0x32, 0xf0,
1899 0xa5, 0x21, 0x50, 0x15, 0x7e, 0x46, 0xb9, 0x76,
1900 0x09, 0x4e, 0x4b, 0x6f, 0x9f, 0xc7, 0x8c, 0x6d,
1901 0x80, 0x37, 0xf9, 0xaa, 0xd1, 0x5f, 0x12, 0xb9,
1902 0xb3, 0x15, 0xe4, 0x96, 0xa1, 0x01, 0xd5, 0xa0,
1903 };
1904
1905 const struct testvec aes_cbc_256_8_vectors[] = {
1906 {
1907 .blkno = 0,
1908 .ptxt = aes_cbc_ptxt,
1909 .ctxt = aes_cbc_256_encblkno8_vec0_ctxt,
1910 },
1911 {
1912 .blkno = 1,
1913 .ptxt = aes_cbc_ptxt,
1914 .ctxt = aes_cbc_256_encblkno8_vec1_ctxt,
1915 },
1916 {
1917 .blkno = 2,
1918 .ptxt = aes_cbc_ptxt,
1919 .ctxt = aes_cbc_256_encblkno8_vec2_ctxt,
1920 },
1921 {
1922 .blkno = 3,
1923 .ptxt = aes_cbc_ptxt,
1924 .ctxt = aes_cbc_256_encblkno8_vec3_ctxt,
1925 },
1926 };
1927
1928 /*
1929 * 256 bits key from IEEE 1619/D16, NUL terminated.
1930 */
1931 static const char aes_xts_256_key[33] = {
1932 0x27, 0x18, 0x28, 0x18, 0x28, 0x45, 0x90, 0x45,
1933 0x23, 0x53, 0x60, 0x28, 0x74, 0x71, 0x35, 0x26,
1934 0x31, 0x41, 0x59, 0x26, 0x53, 0x58, 0x97, 0x93,
1935 0x23, 0x84, 0x62, 0x64, 0x33, 0x83, 0x27, 0x95,
1936 0
1937 };
1938
1939 /*
1940 * 512 bits key from IEEE 1619/D16, NUL terminated.
1941 */
1942 static const char aes_xts_512_key[65] = {
1943 0x27, 0x18, 0x28, 0x18, 0x28, 0x45, 0x90, 0x45,
1944 0x23, 0x53, 0x60, 0x28, 0x74, 0x71, 0x35, 0x26,
1945 0x62, 0x49, 0x77, 0x57, 0x24, 0x70, 0x93, 0x69,
1946 0x99, 0x59, 0x57, 0x49, 0x66, 0x96, 0x76, 0x27,
1947 0x31, 0x41, 0x59, 0x26, 0x53, 0x58, 0x97, 0x93,
1948 0x23, 0x84, 0x62, 0x64, 0x33, 0x83, 0x27, 0x95,
1949 0x02, 0x88, 0x41, 0x97, 0x16, 0x93, 0x99, 0x37,
1950 0x51, 0x05, 0x82, 0x09, 0x74, 0x94, 0x45, 0x92,
1951 0
1952 };
1953
1954 /*
1955 * Vector 4 from IEEE 1619/D16, blkno 0.
1956 */
1957 static const uint8_t aes_xts_256_vec4_ptxt[SECSIZE] = {
1958 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1959 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
1960 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
1961 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
1962 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
1963 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
1964 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
1965 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
1966 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
1967 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
1968 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
1969 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
1970 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
1971 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
1972 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
1973 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
1974 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
1975 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
1976 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
1977 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
1978 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
1979 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
1980 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
1981 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
1982 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
1983 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
1984 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
1985 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
1986 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
1987 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
1988 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
1989 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
1990 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
1991 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
1992 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
1993 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
1994 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
1995 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
1996 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
1997 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
1998 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
1999 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
2000 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
2001 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
2002 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
2003 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
2004 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
2005 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
2006 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
2007 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
2008 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
2009 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
2010 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
2011 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
2012 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
2013 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
2014 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
2015 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
2016 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
2017 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
2018 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
2019 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
2020 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
2021 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
2022 };
2023
2024 static const uint8_t aes_xts_256_vec4_ctxt[SECSIZE] = {
2025 0x27, 0xa7, 0x47, 0x9b, 0xef, 0xa1, 0xd4, 0x76,
2026 0x48, 0x9f, 0x30, 0x8c, 0xd4, 0xcf, 0xa6, 0xe2,
2027 0xa9, 0x6e, 0x4b, 0xbe, 0x32, 0x08, 0xff, 0x25,
2028 0x28, 0x7d, 0xd3, 0x81, 0x96, 0x16, 0xe8, 0x9c,
2029 0xc7, 0x8c, 0xf7, 0xf5, 0xe5, 0x43, 0x44, 0x5f,
2030 0x83, 0x33, 0xd8, 0xfa, 0x7f, 0x56, 0x00, 0x00,
2031 0x05, 0x27, 0x9f, 0xa5, 0xd8, 0xb5, 0xe4, 0xad,
2032 0x40, 0xe7, 0x36, 0xdd, 0xb4, 0xd3, 0x54, 0x12,
2033 0x32, 0x80, 0x63, 0xfd, 0x2a, 0xab, 0x53, 0xe5,
2034 0xea, 0x1e, 0x0a, 0x9f, 0x33, 0x25, 0x00, 0xa5,
2035 0xdf, 0x94, 0x87, 0xd0, 0x7a, 0x5c, 0x92, 0xcc,
2036 0x51, 0x2c, 0x88, 0x66, 0xc7, 0xe8, 0x60, 0xce,
2037 0x93, 0xfd, 0xf1, 0x66, 0xa2, 0x49, 0x12, 0xb4,
2038 0x22, 0x97, 0x61, 0x46, 0xae, 0x20, 0xce, 0x84,
2039 0x6b, 0xb7, 0xdc, 0x9b, 0xa9, 0x4a, 0x76, 0x7a,
2040 0xae, 0xf2, 0x0c, 0x0d, 0x61, 0xad, 0x02, 0x65,
2041 0x5e, 0xa9, 0x2d, 0xc4, 0xc4, 0xe4, 0x1a, 0x89,
2042 0x52, 0xc6, 0x51, 0xd3, 0x31, 0x74, 0xbe, 0x51,
2043 0xa1, 0x0c, 0x42, 0x11, 0x10, 0xe6, 0xd8, 0x15,
2044 0x88, 0xed, 0xe8, 0x21, 0x03, 0xa2, 0x52, 0xd8,
2045 0xa7, 0x50, 0xe8, 0x76, 0x8d, 0xef, 0xff, 0xed,
2046 0x91, 0x22, 0x81, 0x0a, 0xae, 0xb9, 0x9f, 0x91,
2047 0x72, 0xaf, 0x82, 0xb6, 0x04, 0xdc, 0x4b, 0x8e,
2048 0x51, 0xbc, 0xb0, 0x82, 0x35, 0xa6, 0xf4, 0x34,
2049 0x13, 0x32, 0xe4, 0xca, 0x60, 0x48, 0x2a, 0x4b,
2050 0xa1, 0xa0, 0x3b, 0x3e, 0x65, 0x00, 0x8f, 0xc5,
2051 0xda, 0x76, 0xb7, 0x0b, 0xf1, 0x69, 0x0d, 0xb4,
2052 0xea, 0xe2, 0x9c, 0x5f, 0x1b, 0xad, 0xd0, 0x3c,
2053 0x5c, 0xcf, 0x2a, 0x55, 0xd7, 0x05, 0xdd, 0xcd,
2054 0x86, 0xd4, 0x49, 0x51, 0x1c, 0xeb, 0x7e, 0xc3,
2055 0x0b, 0xf1, 0x2b, 0x1f, 0xa3, 0x5b, 0x91, 0x3f,
2056 0x9f, 0x74, 0x7a, 0x8a, 0xfd, 0x1b, 0x13, 0x0e,
2057 0x94, 0xbf, 0xf9, 0x4e, 0xff, 0xd0, 0x1a, 0x91,
2058 0x73, 0x5c, 0xa1, 0x72, 0x6a, 0xcd, 0x0b, 0x19,
2059 0x7c, 0x4e, 0x5b, 0x03, 0x39, 0x36, 0x97, 0xe1,
2060 0x26, 0x82, 0x6f, 0xb6, 0xbb, 0xde, 0x8e, 0xcc,
2061 0x1e, 0x08, 0x29, 0x85, 0x16, 0xe2, 0xc9, 0xed,
2062 0x03, 0xff, 0x3c, 0x1b, 0x78, 0x60, 0xf6, 0xde,
2063 0x76, 0xd4, 0xce, 0xcd, 0x94, 0xc8, 0x11, 0x98,
2064 0x55, 0xef, 0x52, 0x97, 0xca, 0x67, 0xe9, 0xf3,
2065 0xe7, 0xff, 0x72, 0xb1, 0xe9, 0x97, 0x85, 0xca,
2066 0x0a, 0x7e, 0x77, 0x20, 0xc5, 0xb3, 0x6d, 0xc6,
2067 0xd7, 0x2c, 0xac, 0x95, 0x74, 0xc8, 0xcb, 0xbc,
2068 0x2f, 0x80, 0x1e, 0x23, 0xe5, 0x6f, 0xd3, 0x44,
2069 0xb0, 0x7f, 0x22, 0x15, 0x4b, 0xeb, 0xa0, 0xf0,
2070 0x8c, 0xe8, 0x89, 0x1e, 0x64, 0x3e, 0xd9, 0x95,
2071 0xc9, 0x4d, 0x9a, 0x69, 0xc9, 0xf1, 0xb5, 0xf4,
2072 0x99, 0x02, 0x7a, 0x78, 0x57, 0x2a, 0xee, 0xbd,
2073 0x74, 0xd2, 0x0c, 0xc3, 0x98, 0x81, 0xc2, 0x13,
2074 0xee, 0x77, 0x0b, 0x10, 0x10, 0xe4, 0xbe, 0xa7,
2075 0x18, 0x84, 0x69, 0x77, 0xae, 0x11, 0x9f, 0x7a,
2076 0x02, 0x3a, 0xb5, 0x8c, 0xca, 0x0a, 0xd7, 0x52,
2077 0xaf, 0xe6, 0x56, 0xbb, 0x3c, 0x17, 0x25, 0x6a,
2078 0x9f, 0x6e, 0x9b, 0xf1, 0x9f, 0xdd, 0x5a, 0x38,
2079 0xfc, 0x82, 0xbb, 0xe8, 0x72, 0xc5, 0x53, 0x9e,
2080 0xdb, 0x60, 0x9e, 0xf4, 0xf7, 0x9c, 0x20, 0x3e,
2081 0xbb, 0x14, 0x0f, 0x2e, 0x58, 0x3c, 0xb2, 0xad,
2082 0x15, 0xb4, 0xaa, 0x5b, 0x65, 0x50, 0x16, 0xa8,
2083 0x44, 0x92, 0x77, 0xdb, 0xd4, 0x77, 0xef, 0x2c,
2084 0x8d, 0x6c, 0x01, 0x7d, 0xb7, 0x38, 0xb1, 0x8d,
2085 0xeb, 0x4a, 0x42, 0x7d, 0x19, 0x23, 0xce, 0x3f,
2086 0xf2, 0x62, 0x73, 0x57, 0x79, 0xa4, 0x18, 0xf2,
2087 0x0a, 0x28, 0x2d, 0xf9, 0x20, 0x14, 0x7b, 0xea,
2088 0xbe, 0x42, 0x1e, 0xe5, 0x31, 0x9d, 0x05, 0x68,
2089 };
2090
2091 /*
2092 * Vector 5 from IEEE 1619/D16, blkno 1.
2093 */
2094 static const uint8_t aes_xts_256_vec5_ptxt[SECSIZE] = {
2095 0x27, 0xa7, 0x47, 0x9b, 0xef, 0xa1, 0xd4, 0x76,
2096 0x48, 0x9f, 0x30, 0x8c, 0xd4, 0xcf, 0xa6, 0xe2,
2097 0xa9, 0x6e, 0x4b, 0xbe, 0x32, 0x08, 0xff, 0x25,
2098 0x28, 0x7d, 0xd3, 0x81, 0x96, 0x16, 0xe8, 0x9c,
2099 0xc7, 0x8c, 0xf7, 0xf5, 0xe5, 0x43, 0x44, 0x5f,
2100 0x83, 0x33, 0xd8, 0xfa, 0x7f, 0x56, 0x00, 0x00,
2101 0x05, 0x27, 0x9f, 0xa5, 0xd8, 0xb5, 0xe4, 0xad,
2102 0x40, 0xe7, 0x36, 0xdd, 0xb4, 0xd3, 0x54, 0x12,
2103 0x32, 0x80, 0x63, 0xfd, 0x2a, 0xab, 0x53, 0xe5,
2104 0xea, 0x1e, 0x0a, 0x9f, 0x33, 0x25, 0x00, 0xa5,
2105 0xdf, 0x94, 0x87, 0xd0, 0x7a, 0x5c, 0x92, 0xcc,
2106 0x51, 0x2c, 0x88, 0x66, 0xc7, 0xe8, 0x60, 0xce,
2107 0x93, 0xfd, 0xf1, 0x66, 0xa2, 0x49, 0x12, 0xb4,
2108 0x22, 0x97, 0x61, 0x46, 0xae, 0x20, 0xce, 0x84,
2109 0x6b, 0xb7, 0xdc, 0x9b, 0xa9, 0x4a, 0x76, 0x7a,
2110 0xae, 0xf2, 0x0c, 0x0d, 0x61, 0xad, 0x02, 0x65,
2111 0x5e, 0xa9, 0x2d, 0xc4, 0xc4, 0xe4, 0x1a, 0x89,
2112 0x52, 0xc6, 0x51, 0xd3, 0x31, 0x74, 0xbe, 0x51,
2113 0xa1, 0x0c, 0x42, 0x11, 0x10, 0xe6, 0xd8, 0x15,
2114 0x88, 0xed, 0xe8, 0x21, 0x03, 0xa2, 0x52, 0xd8,
2115 0xa7, 0x50, 0xe8, 0x76, 0x8d, 0xef, 0xff, 0xed,
2116 0x91, 0x22, 0x81, 0x0a, 0xae, 0xb9, 0x9f, 0x91,
2117 0x72, 0xaf, 0x82, 0xb6, 0x04, 0xdc, 0x4b, 0x8e,
2118 0x51, 0xbc, 0xb0, 0x82, 0x35, 0xa6, 0xf4, 0x34,
2119 0x13, 0x32, 0xe4, 0xca, 0x60, 0x48, 0x2a, 0x4b,
2120 0xa1, 0xa0, 0x3b, 0x3e, 0x65, 0x00, 0x8f, 0xc5,
2121 0xda, 0x76, 0xb7, 0x0b, 0xf1, 0x69, 0x0d, 0xb4,
2122 0xea, 0xe2, 0x9c, 0x5f, 0x1b, 0xad, 0xd0, 0x3c,
2123 0x5c, 0xcf, 0x2a, 0x55, 0xd7, 0x05, 0xdd, 0xcd,
2124 0x86, 0xd4, 0x49, 0x51, 0x1c, 0xeb, 0x7e, 0xc3,
2125 0x0b, 0xf1, 0x2b, 0x1f, 0xa3, 0x5b, 0x91, 0x3f,
2126 0x9f, 0x74, 0x7a, 0x8a, 0xfd, 0x1b, 0x13, 0x0e,
2127 0x94, 0xbf, 0xf9, 0x4e, 0xff, 0xd0, 0x1a, 0x91,
2128 0x73, 0x5c, 0xa1, 0x72, 0x6a, 0xcd, 0x0b, 0x19,
2129 0x7c, 0x4e, 0x5b, 0x03, 0x39, 0x36, 0x97, 0xe1,
2130 0x26, 0x82, 0x6f, 0xb6, 0xbb, 0xde, 0x8e, 0xcc,
2131 0x1e, 0x08, 0x29, 0x85, 0x16, 0xe2, 0xc9, 0xed,
2132 0x03, 0xff, 0x3c, 0x1b, 0x78, 0x60, 0xf6, 0xde,
2133 0x76, 0xd4, 0xce, 0xcd, 0x94, 0xc8, 0x11, 0x98,
2134 0x55, 0xef, 0x52, 0x97, 0xca, 0x67, 0xe9, 0xf3,
2135 0xe7, 0xff, 0x72, 0xb1, 0xe9, 0x97, 0x85, 0xca,
2136 0x0a, 0x7e, 0x77, 0x20, 0xc5, 0xb3, 0x6d, 0xc6,
2137 0xd7, 0x2c, 0xac, 0x95, 0x74, 0xc8, 0xcb, 0xbc,
2138 0x2f, 0x80, 0x1e, 0x23, 0xe5, 0x6f, 0xd3, 0x44,
2139 0xb0, 0x7f, 0x22, 0x15, 0x4b, 0xeb, 0xa0, 0xf0,
2140 0x8c, 0xe8, 0x89, 0x1e, 0x64, 0x3e, 0xd9, 0x95,
2141 0xc9, 0x4d, 0x9a, 0x69, 0xc9, 0xf1, 0xb5, 0xf4,
2142 0x99, 0x02, 0x7a, 0x78, 0x57, 0x2a, 0xee, 0xbd,
2143 0x74, 0xd2, 0x0c, 0xc3, 0x98, 0x81, 0xc2, 0x13,
2144 0xee, 0x77, 0x0b, 0x10, 0x10, 0xe4, 0xbe, 0xa7,
2145 0x18, 0x84, 0x69, 0x77, 0xae, 0x11, 0x9f, 0x7a,
2146 0x02, 0x3a, 0xb5, 0x8c, 0xca, 0x0a, 0xd7, 0x52,
2147 0xaf, 0xe6, 0x56, 0xbb, 0x3c, 0x17, 0x25, 0x6a,
2148 0x9f, 0x6e, 0x9b, 0xf1, 0x9f, 0xdd, 0x5a, 0x38,
2149 0xfc, 0x82, 0xbb, 0xe8, 0x72, 0xc5, 0x53, 0x9e,
2150 0xdb, 0x60, 0x9e, 0xf4, 0xf7, 0x9c, 0x20, 0x3e,
2151 0xbb, 0x14, 0x0f, 0x2e, 0x58, 0x3c, 0xb2, 0xad,
2152 0x15, 0xb4, 0xaa, 0x5b, 0x65, 0x50, 0x16, 0xa8,
2153 0x44, 0x92, 0x77, 0xdb, 0xd4, 0x77, 0xef, 0x2c,
2154 0x8d, 0x6c, 0x01, 0x7d, 0xb7, 0x38, 0xb1, 0x8d,
2155 0xeb, 0x4a, 0x42, 0x7d, 0x19, 0x23, 0xce, 0x3f,
2156 0xf2, 0x62, 0x73, 0x57, 0x79, 0xa4, 0x18, 0xf2,
2157 0x0a, 0x28, 0x2d, 0xf9, 0x20, 0x14, 0x7b, 0xea,
2158 0xbe, 0x42, 0x1e, 0xe5, 0x31, 0x9d, 0x05, 0x68,
2159 };
2160
2161 static const uint8_t aes_xts_256_vec5_ctxt[SECSIZE] = {
2162 0x26, 0x4d, 0x3c, 0xa8, 0x51, 0x21, 0x94, 0xfe,
2163 0xc3, 0x12, 0xc8, 0xc9, 0x89, 0x1f, 0x27, 0x9f,
2164 0xef, 0xdd, 0x60, 0x8d, 0x0c, 0x02, 0x7b, 0x60,
2165 0x48, 0x3a, 0x3f, 0xa8, 0x11, 0xd6, 0x5e, 0xe5,
2166 0x9d, 0x52, 0xd9, 0xe4, 0x0e, 0xc5, 0x67, 0x2d,
2167 0x81, 0x53, 0x2b, 0x38, 0xb6, 0xb0, 0x89, 0xce,
2168 0x95, 0x1f, 0x0f, 0x9c, 0x35, 0x59, 0x0b, 0x8b,
2169 0x97, 0x8d, 0x17, 0x52, 0x13, 0xf3, 0x29, 0xbb,
2170 0x1c, 0x2f, 0xd3, 0x0f, 0x2f, 0x7f, 0x30, 0x49,
2171 0x2a, 0x61, 0xa5, 0x32, 0xa7, 0x9f, 0x51, 0xd3,
2172 0x6f, 0x5e, 0x31, 0xa7, 0xc9, 0xa1, 0x2c, 0x28,
2173 0x60, 0x82, 0xff, 0x7d, 0x23, 0x94, 0xd1, 0x8f,
2174 0x78, 0x3e, 0x1a, 0x8e, 0x72, 0xc7, 0x22, 0xca,
2175 0xaa, 0xa5, 0x2d, 0x8f, 0x06, 0x56, 0x57, 0xd2,
2176 0x63, 0x1f, 0xd2, 0x5b, 0xfd, 0x8e, 0x5b, 0xaa,
2177 0xd6, 0xe5, 0x27, 0xd7, 0x63, 0x51, 0x75, 0x01,
2178 0xc6, 0x8c, 0x5e, 0xdc, 0x3c, 0xdd, 0x55, 0x43,
2179 0x5c, 0x53, 0x2d, 0x71, 0x25, 0xc8, 0x61, 0x4d,
2180 0xee, 0xd9, 0xad, 0xaa, 0x3a, 0xca, 0xde, 0x58,
2181 0x88, 0xb8, 0x7b, 0xef, 0x64, 0x1c, 0x4c, 0x99,
2182 0x4c, 0x80, 0x91, 0xb5, 0xbc, 0xd3, 0x87, 0xf3,
2183 0x96, 0x3f, 0xb5, 0xbc, 0x37, 0xaa, 0x92, 0x2f,
2184 0xbf, 0xe3, 0xdf, 0x4e, 0x5b, 0x91, 0x5e, 0x6e,
2185 0xb5, 0x14, 0x71, 0x7b, 0xdd, 0x2a, 0x74, 0x07,
2186 0x9a, 0x50, 0x73, 0xf5, 0xc4, 0xbf, 0xd4, 0x6a,
2187 0xdf, 0x7d, 0x28, 0x2e, 0x7a, 0x39, 0x3a, 0x52,
2188 0x57, 0x9d, 0x11, 0xa0, 0x28, 0xda, 0x4d, 0x9c,
2189 0xd9, 0xc7, 0x71, 0x24, 0xf9, 0x64, 0x8e, 0xe3,
2190 0x83, 0xb1, 0xac, 0x76, 0x39, 0x30, 0xe7, 0x16,
2191 0x2a, 0x8d, 0x37, 0xf3, 0x50, 0xb2, 0xf7, 0x4b,
2192 0x84, 0x72, 0xcf, 0x09, 0x90, 0x20, 0x63, 0xc6,
2193 0xb3, 0x2e, 0x8c, 0x2d, 0x92, 0x90, 0xce, 0xfb,
2194 0xd7, 0x34, 0x6d, 0x1c, 0x77, 0x9a, 0x0d, 0xf5,
2195 0x0e, 0xdc, 0xde, 0x45, 0x31, 0xda, 0x07, 0xb0,
2196 0x99, 0xc6, 0x38, 0xe8, 0x3a, 0x75, 0x59, 0x44,
2197 0xdf, 0x2a, 0xef, 0x1a, 0xa3, 0x17, 0x52, 0xfd,
2198 0x32, 0x3d, 0xcb, 0x71, 0x0f, 0xb4, 0xbf, 0xbb,
2199 0x9d, 0x22, 0xb9, 0x25, 0xbc, 0x35, 0x77, 0xe1,
2200 0xb8, 0x94, 0x9e, 0x72, 0x9a, 0x90, 0xbb, 0xaf,
2201 0xea, 0xcf, 0x7f, 0x78, 0x79, 0xe7, 0xb1, 0x14,
2202 0x7e, 0x28, 0xba, 0x0b, 0xae, 0x94, 0x0d, 0xb7,
2203 0x95, 0xa6, 0x1b, 0x15, 0xec, 0xf4, 0xdf, 0x8d,
2204 0xb0, 0x7b, 0x82, 0x4b, 0xb0, 0x62, 0x80, 0x2c,
2205 0xc9, 0x8a, 0x95, 0x45, 0xbb, 0x2a, 0xae, 0xed,
2206 0x77, 0xcb, 0x3f, 0xc6, 0xdb, 0x15, 0xdc, 0xd7,
2207 0xd8, 0x0d, 0x7d, 0x5b, 0xc4, 0x06, 0xc4, 0x97,
2208 0x0a, 0x34, 0x78, 0xad, 0xa8, 0x89, 0x9b, 0x32,
2209 0x91, 0x98, 0xeb, 0x61, 0xc1, 0x93, 0xfb, 0x62,
2210 0x75, 0xaa, 0x8c, 0xa3, 0x40, 0x34, 0x4a, 0x75,
2211 0xa8, 0x62, 0xae, 0xbe, 0x92, 0xee, 0xe1, 0xce,
2212 0x03, 0x2f, 0xd9, 0x50, 0xb4, 0x7d, 0x77, 0x04,
2213 0xa3, 0x87, 0x69, 0x23, 0xb4, 0xad, 0x62, 0x84,
2214 0x4b, 0xf4, 0xa0, 0x9c, 0x4d, 0xbe, 0x8b, 0x43,
2215 0x97, 0x18, 0x4b, 0x74, 0x71, 0x36, 0x0c, 0x95,
2216 0x64, 0x88, 0x0a, 0xed, 0xdd, 0xb9, 0xba, 0xa4,
2217 0xaf, 0x2e, 0x75, 0x39, 0x4b, 0x08, 0xcd, 0x32,
2218 0xff, 0x47, 0x9c, 0x57, 0xa0, 0x7d, 0x3e, 0xab,
2219 0x5d, 0x54, 0xde, 0x5f, 0x97, 0x38, 0xb8, 0xd2,
2220 0x7f, 0x27, 0xa9, 0xf0, 0xab, 0x11, 0x79, 0x9d,
2221 0x7b, 0x7f, 0xfe, 0xfb, 0x27, 0x04, 0xc9, 0x5c,
2222 0x6a, 0xd1, 0x2c, 0x39, 0xf1, 0xe8, 0x67, 0xa4,
2223 0xb7, 0xb1, 0xd7, 0x81, 0x8a, 0x4b, 0x75, 0x3d,
2224 0xfd, 0x2a, 0x89, 0xcc, 0xb4, 0x5e, 0x00, 0x1a,
2225 0x03, 0xa8, 0x67, 0xb1, 0x87, 0xf2, 0x25, 0xdd,
2226 };
2227
2228 /*
2229 * Vector 6 from IEEE 1619/D16, blkno 2.
2230 */
2231 static const uint8_t aes_xts_256_vec6_ptxt[SECSIZE] = {
2232 0x26, 0x4d, 0x3c, 0xa8, 0x51, 0x21, 0x94, 0xfe,
2233 0xc3, 0x12, 0xc8, 0xc9, 0x89, 0x1f, 0x27, 0x9f,
2234 0xef, 0xdd, 0x60, 0x8d, 0x0c, 0x02, 0x7b, 0x60,
2235 0x48, 0x3a, 0x3f, 0xa8, 0x11, 0xd6, 0x5e, 0xe5,
2236 0x9d, 0x52, 0xd9, 0xe4, 0x0e, 0xc5, 0x67, 0x2d,
2237 0x81, 0x53, 0x2b, 0x38, 0xb6, 0xb0, 0x89, 0xce,
2238 0x95, 0x1f, 0x0f, 0x9c, 0x35, 0x59, 0x0b, 0x8b,
2239 0x97, 0x8d, 0x17, 0x52, 0x13, 0xf3, 0x29, 0xbb,
2240 0x1c, 0x2f, 0xd3, 0x0f, 0x2f, 0x7f, 0x30, 0x49,
2241 0x2a, 0x61, 0xa5, 0x32, 0xa7, 0x9f, 0x51, 0xd3,
2242 0x6f, 0x5e, 0x31, 0xa7, 0xc9, 0xa1, 0x2c, 0x28,
2243 0x60, 0x82, 0xff, 0x7d, 0x23, 0x94, 0xd1, 0x8f,
2244 0x78, 0x3e, 0x1a, 0x8e, 0x72, 0xc7, 0x22, 0xca,
2245 0xaa, 0xa5, 0x2d, 0x8f, 0x06, 0x56, 0x57, 0xd2,
2246 0x63, 0x1f, 0xd2, 0x5b, 0xfd, 0x8e, 0x5b, 0xaa,
2247 0xd6, 0xe5, 0x27, 0xd7, 0x63, 0x51, 0x75, 0x01,
2248 0xc6, 0x8c, 0x5e, 0xdc, 0x3c, 0xdd, 0x55, 0x43,
2249 0x5c, 0x53, 0x2d, 0x71, 0x25, 0xc8, 0x61, 0x4d,
2250 0xee, 0xd9, 0xad, 0xaa, 0x3a, 0xca, 0xde, 0x58,
2251 0x88, 0xb8, 0x7b, 0xef, 0x64, 0x1c, 0x4c, 0x99,
2252 0x4c, 0x80, 0x91, 0xb5, 0xbc, 0xd3, 0x87, 0xf3,
2253 0x96, 0x3f, 0xb5, 0xbc, 0x37, 0xaa, 0x92, 0x2f,
2254 0xbf, 0xe3, 0xdf, 0x4e, 0x5b, 0x91, 0x5e, 0x6e,
2255 0xb5, 0x14, 0x71, 0x7b, 0xdd, 0x2a, 0x74, 0x07,
2256 0x9a, 0x50, 0x73, 0xf5, 0xc4, 0xbf, 0xd4, 0x6a,
2257 0xdf, 0x7d, 0x28, 0x2e, 0x7a, 0x39, 0x3a, 0x52,
2258 0x57, 0x9d, 0x11, 0xa0, 0x28, 0xda, 0x4d, 0x9c,
2259 0xd9, 0xc7, 0x71, 0x24, 0xf9, 0x64, 0x8e, 0xe3,
2260 0x83, 0xb1, 0xac, 0x76, 0x39, 0x30, 0xe7, 0x16,
2261 0x2a, 0x8d, 0x37, 0xf3, 0x50, 0xb2, 0xf7, 0x4b,
2262 0x84, 0x72, 0xcf, 0x09, 0x90, 0x20, 0x63, 0xc6,
2263 0xb3, 0x2e, 0x8c, 0x2d, 0x92, 0x90, 0xce, 0xfb,
2264 0xd7, 0x34, 0x6d, 0x1c, 0x77, 0x9a, 0x0d, 0xf5,
2265 0x0e, 0xdc, 0xde, 0x45, 0x31, 0xda, 0x07, 0xb0,
2266 0x99, 0xc6, 0x38, 0xe8, 0x3a, 0x75, 0x59, 0x44,
2267 0xdf, 0x2a, 0xef, 0x1a, 0xa3, 0x17, 0x52, 0xfd,
2268 0x32, 0x3d, 0xcb, 0x71, 0x0f, 0xb4, 0xbf, 0xbb,
2269 0x9d, 0x22, 0xb9, 0x25, 0xbc, 0x35, 0x77, 0xe1,
2270 0xb8, 0x94, 0x9e, 0x72, 0x9a, 0x90, 0xbb, 0xaf,
2271 0xea, 0xcf, 0x7f, 0x78, 0x79, 0xe7, 0xb1, 0x14,
2272 0x7e, 0x28, 0xba, 0x0b, 0xae, 0x94, 0x0d, 0xb7,
2273 0x95, 0xa6, 0x1b, 0x15, 0xec, 0xf4, 0xdf, 0x8d,
2274 0xb0, 0x7b, 0x82, 0x4b, 0xb0, 0x62, 0x80, 0x2c,
2275 0xc9, 0x8a, 0x95, 0x45, 0xbb, 0x2a, 0xae, 0xed,
2276 0x77, 0xcb, 0x3f, 0xc6, 0xdb, 0x15, 0xdc, 0xd7,
2277 0xd8, 0x0d, 0x7d, 0x5b, 0xc4, 0x06, 0xc4, 0x97,
2278 0x0a, 0x34, 0x78, 0xad, 0xa8, 0x89, 0x9b, 0x32,
2279 0x91, 0x98, 0xeb, 0x61, 0xc1, 0x93, 0xfb, 0x62,
2280 0x75, 0xaa, 0x8c, 0xa3, 0x40, 0x34, 0x4a, 0x75,
2281 0xa8, 0x62, 0xae, 0xbe, 0x92, 0xee, 0xe1, 0xce,
2282 0x03, 0x2f, 0xd9, 0x50, 0xb4, 0x7d, 0x77, 0x04,
2283 0xa3, 0x87, 0x69, 0x23, 0xb4, 0xad, 0x62, 0x84,
2284 0x4b, 0xf4, 0xa0, 0x9c, 0x4d, 0xbe, 0x8b, 0x43,
2285 0x97, 0x18, 0x4b, 0x74, 0x71, 0x36, 0x0c, 0x95,
2286 0x64, 0x88, 0x0a, 0xed, 0xdd, 0xb9, 0xba, 0xa4,
2287 0xaf, 0x2e, 0x75, 0x39, 0x4b, 0x08, 0xcd, 0x32,
2288 0xff, 0x47, 0x9c, 0x57, 0xa0, 0x7d, 0x3e, 0xab,
2289 0x5d, 0x54, 0xde, 0x5f, 0x97, 0x38, 0xb8, 0xd2,
2290 0x7f, 0x27, 0xa9, 0xf0, 0xab, 0x11, 0x79, 0x9d,
2291 0x7b, 0x7f, 0xfe, 0xfb, 0x27, 0x04, 0xc9, 0x5c,
2292 0x6a, 0xd1, 0x2c, 0x39, 0xf1, 0xe8, 0x67, 0xa4,
2293 0xb7, 0xb1, 0xd7, 0x81, 0x8a, 0x4b, 0x75, 0x3d,
2294 0xfd, 0x2a, 0x89, 0xcc, 0xb4, 0x5e, 0x00, 0x1a,
2295 0x03, 0xa8, 0x67, 0xb1, 0x87, 0xf2, 0x25, 0xdd,
2296 };
2297
2298 static const uint8_t aes_xts_256_vec6_ctxt[SECSIZE] = {
2299 0xfa, 0x76, 0x2a, 0x36, 0x80, 0xb7, 0x60, 0x07,
2300 0x92, 0x8e, 0xd4, 0xa4, 0xf4, 0x9a, 0x94, 0x56,
2301 0x03, 0x1b, 0x70, 0x47, 0x82, 0xe6, 0x5e, 0x16,
2302 0xce, 0xcb, 0x54, 0xed, 0x7d, 0x01, 0x7b, 0x5e,
2303 0x18, 0xab, 0xd6, 0x7b, 0x33, 0x8e, 0x81, 0x07,
2304 0x8f, 0x21, 0xed, 0xb7, 0x86, 0x8d, 0x90, 0x1e,
2305 0xbe, 0x9c, 0x73, 0x1a, 0x7c, 0x18, 0xb5, 0xe6,
2306 0xde, 0xc1, 0xd6, 0xa7, 0x2e, 0x07, 0x8a, 0xc9,
2307 0xa4, 0x26, 0x2f, 0x86, 0x0b, 0xee, 0xfa, 0x14,
2308 0xf4, 0xe8, 0x21, 0x01, 0x82, 0x72, 0xe4, 0x11,
2309 0xa9, 0x51, 0x50, 0x2b, 0x6e, 0x79, 0x06, 0x6e,
2310 0x84, 0x25, 0x2c, 0x33, 0x46, 0xf3, 0xaa, 0x62,
2311 0x34, 0x43, 0x51, 0xa2, 0x91, 0xd4, 0xbe, 0xdc,
2312 0x7a, 0x07, 0x61, 0x8b, 0xde, 0xa2, 0xaf, 0x63,
2313 0x14, 0x5c, 0xc7, 0xa4, 0xb8, 0xd4, 0x07, 0x06,
2314 0x91, 0xae, 0x89, 0x0c, 0xd6, 0x57, 0x33, 0xe7,
2315 0x94, 0x6e, 0x90, 0x21, 0xa1, 0xdf, 0xfc, 0x4c,
2316 0x59, 0xf1, 0x59, 0x42, 0x5e, 0xe6, 0xd5, 0x0c,
2317 0xa9, 0xb1, 0x35, 0xfa, 0x61, 0x62, 0xce, 0xa1,
2318 0x8a, 0x93, 0x98, 0x38, 0xdc, 0x00, 0x0f, 0xb3,
2319 0x86, 0xfa, 0xd0, 0x86, 0xac, 0xce, 0x5a, 0xc0,
2320 0x7c, 0xb2, 0xec, 0xe7, 0xfd, 0x58, 0x0b, 0x00,
2321 0xcf, 0xa5, 0xe9, 0x85, 0x89, 0x63, 0x1d, 0xc2,
2322 0x5e, 0x8e, 0x2a, 0x3d, 0xaf, 0x2f, 0xfd, 0xec,
2323 0x26, 0x53, 0x16, 0x59, 0x91, 0x2c, 0x9d, 0x8f,
2324 0x7a, 0x15, 0xe5, 0x86, 0x5e, 0xa8, 0xfb, 0x58,
2325 0x16, 0xd6, 0x20, 0x70, 0x52, 0xbd, 0x71, 0x28,
2326 0xcd, 0x74, 0x3c, 0x12, 0xc8, 0x11, 0x87, 0x91,
2327 0xa4, 0x73, 0x68, 0x11, 0x93, 0x5e, 0xb9, 0x82,
2328 0xa5, 0x32, 0x34, 0x9e, 0x31, 0xdd, 0x40, 0x1e,
2329 0x0b, 0x66, 0x0a, 0x56, 0x8c, 0xb1, 0xa4, 0x71,
2330 0x1f, 0x55, 0x2f, 0x55, 0xde, 0xd5, 0x9f, 0x1f,
2331 0x15, 0xbf, 0x71, 0x96, 0xb3, 0xca, 0x12, 0xa9,
2332 0x1e, 0x48, 0x8e, 0xf5, 0x9d, 0x64, 0xf3, 0xa0,
2333 0x2b, 0xf4, 0x52, 0x39, 0x49, 0x9a, 0xc6, 0x17,
2334 0x6a, 0xe3, 0x21, 0xc4, 0xa2, 0x11, 0xec, 0x54,
2335 0x53, 0x65, 0x97, 0x1c, 0x5d, 0x3f, 0x4f, 0x09,
2336 0xd4, 0xeb, 0x13, 0x9b, 0xfd, 0xf2, 0x07, 0x3d,
2337 0x33, 0x18, 0x0b, 0x21, 0x00, 0x2b, 0x65, 0xcc,
2338 0x98, 0x65, 0xe7, 0x6c, 0xb2, 0x4c, 0xd9, 0x2c,
2339 0x87, 0x4c, 0x24, 0xc1, 0x83, 0x50, 0x39, 0x9a,
2340 0x93, 0x6a, 0xb3, 0x63, 0x70, 0x79, 0x29, 0x5d,
2341 0x76, 0xc4, 0x17, 0x77, 0x6b, 0x94, 0xef, 0xce,
2342 0x3a, 0x0e, 0xf7, 0x20, 0x6b, 0x15, 0x11, 0x05,
2343 0x19, 0x65, 0x5c, 0x95, 0x6c, 0xbd, 0x8b, 0x24,
2344 0x89, 0x40, 0x5e, 0xe2, 0xb0, 0x9a, 0x6b, 0x6e,
2345 0xeb, 0xe0, 0xc5, 0x37, 0x90, 0xa1, 0x2a, 0x89,
2346 0x98, 0x37, 0x8b, 0x33, 0xa5, 0xb7, 0x11, 0x59,
2347 0x62, 0x5f, 0x4b, 0xa4, 0x9d, 0x2a, 0x2f, 0xdb,
2348 0xa5, 0x9f, 0xbf, 0x08, 0x97, 0xbc, 0x7a, 0xab,
2349 0xd8, 0xd7, 0x07, 0xdc, 0x14, 0x0a, 0x80, 0xf0,
2350 0xf3, 0x09, 0xf8, 0x35, 0xd3, 0xda, 0x54, 0xab,
2351 0x58, 0x4e, 0x50, 0x1d, 0xfa, 0x0e, 0xe9, 0x77,
2352 0xfe, 0xc5, 0x43, 0xf7, 0x41, 0x86, 0xa8, 0x02,
2353 0xb9, 0xa3, 0x7a, 0xdb, 0x3e, 0x82, 0x91, 0xec,
2354 0xa0, 0x4d, 0x66, 0x52, 0x0d, 0x22, 0x9e, 0x60,
2355 0x40, 0x1e, 0x72, 0x82, 0xbe, 0xf4, 0x86, 0xae,
2356 0x05, 0x9a, 0xa7, 0x06, 0x96, 0xe0, 0xe3, 0x05,
2357 0xd7, 0x77, 0x14, 0x0a, 0x7a, 0x88, 0x3e, 0xcd,
2358 0xcb, 0x69, 0xb9, 0xff, 0x93, 0x8e, 0x8a, 0x42,
2359 0x31, 0x86, 0x4c, 0x69, 0xca, 0x2c, 0x20, 0x43,
2360 0xbe, 0xd0, 0x07, 0xff, 0x3e, 0x60, 0x5e, 0x01,
2361 0x4b, 0xcf, 0x51, 0x81, 0x38, 0xdc, 0x3a, 0x25,
2362 0xc5, 0xe2, 0x36, 0x17, 0x1a, 0x2d, 0x01, 0xd6,
2363 };
2364
2365 /*
2366 * Vector 7 from IEEE 1619/D16, blkno 0xfd.
2367 */
2368 static const uint8_t aes_xts_256_vec7_ptxt[SECSIZE] = {
2369 0x8e, 0x41, 0xb7, 0x8c, 0x39, 0x0b, 0x5a, 0xf9,
2370 0xd7, 0x58, 0xbb, 0x21, 0x4a, 0x67, 0xe9, 0xf6,
2371 0xbf, 0x77, 0x27, 0xb0, 0x9a, 0xc6, 0x12, 0x40,
2372 0x84, 0xc3, 0x76, 0x11, 0x39, 0x8f, 0xa4, 0x5d,
2373 0xaa, 0xd9, 0x48, 0x68, 0x60, 0x0e, 0xd3, 0x91,
2374 0xfb, 0x1a, 0xcd, 0x48, 0x57, 0xa9, 0x5b, 0x46,
2375 0x6e, 0x62, 0xef, 0x9f, 0x4b, 0x37, 0x72, 0x44,
2376 0xd1, 0xc1, 0x52, 0xe7, 0xb3, 0x0d, 0x73, 0x1a,
2377 0xad, 0x30, 0xc7, 0x16, 0xd2, 0x14, 0xb7, 0x07,
2378 0xae, 0xd9, 0x9e, 0xb5, 0xb5, 0xe5, 0x80, 0xb3,
2379 0xe8, 0x87, 0xcf, 0x74, 0x97, 0x46, 0x56, 0x51,
2380 0xd4, 0xb6, 0x0e, 0x60, 0x42, 0x05, 0x1d, 0xa3,
2381 0x69, 0x3c, 0x3b, 0x78, 0xc1, 0x44, 0x89, 0x54,
2382 0x3b, 0xe8, 0xb6, 0xad, 0x0b, 0xa6, 0x29, 0x56,
2383 0x5b, 0xba, 0x20, 0x23, 0x13, 0xba, 0x7b, 0x0d,
2384 0x0c, 0x94, 0xa3, 0x25, 0x2b, 0x67, 0x6f, 0x46,
2385 0xcc, 0x02, 0xce, 0x0f, 0x8a, 0x7d, 0x34, 0xc0,
2386 0xed, 0x22, 0x91, 0x29, 0x67, 0x3c, 0x1f, 0x61,
2387 0xae, 0xd5, 0x79, 0xd0, 0x8a, 0x92, 0x03, 0xa2,
2388 0x5a, 0xac, 0x3a, 0x77, 0xe9, 0xdb, 0x60, 0x26,
2389 0x79, 0x96, 0xdb, 0x38, 0xdf, 0x63, 0x73, 0x56,
2390 0xd9, 0xdc, 0xd1, 0x63, 0x2e, 0x36, 0x99, 0x39,
2391 0xf2, 0xa2, 0x9d, 0x89, 0x34, 0x5c, 0x66, 0xe0,
2392 0x50, 0x66, 0xf1, 0xa3, 0x67, 0x7a, 0xef, 0x18,
2393 0xde, 0xa4, 0x11, 0x3f, 0xae, 0xb6, 0x29, 0xe4,
2394 0x67, 0x21, 0xa6, 0x6d, 0x0a, 0x7e, 0x78, 0x5d,
2395 0x3e, 0x29, 0xaf, 0x25, 0x94, 0xeb, 0x67, 0xdf,
2396 0xa9, 0x82, 0xaf, 0xfe, 0x0a, 0xac, 0x05, 0x8f,
2397 0x6e, 0x15, 0x86, 0x42, 0x69, 0xb1, 0x35, 0x41,
2398 0x82, 0x61, 0xfc, 0x3a, 0xfb, 0x08, 0x94, 0x72,
2399 0xcf, 0x68, 0xc4, 0x5d, 0xd7, 0xf2, 0x31, 0xc6,
2400 0x24, 0x9b, 0xa0, 0x25, 0x5e, 0x1e, 0x03, 0x38,
2401 0x33, 0xfc, 0x4d, 0x00, 0xa3, 0xfe, 0x02, 0x13,
2402 0x2d, 0x7b, 0xc3, 0x87, 0x36, 0x14, 0xb8, 0xae,
2403 0xe3, 0x42, 0x73, 0x58, 0x1e, 0xa0, 0x32, 0x5c,
2404 0x81, 0xf0, 0x27, 0x0a, 0xff, 0xa1, 0x36, 0x41,
2405 0xd0, 0x52, 0xd3, 0x6f, 0x07, 0x57, 0xd4, 0x84,
2406 0x01, 0x43, 0x54, 0xd0, 0x2d, 0x68, 0x83, 0xca,
2407 0x15, 0xc2, 0x4d, 0x8c, 0x39, 0x56, 0xb1, 0xbd,
2408 0x02, 0x7b, 0xcf, 0x41, 0xf1, 0x51, 0xfd, 0x80,
2409 0x23, 0xc5, 0x34, 0x0e, 0x56, 0x06, 0xf3, 0x7e,
2410 0x90, 0xfd, 0xb8, 0x7c, 0x86, 0xfb, 0x4f, 0xa6,
2411 0x34, 0xb3, 0x71, 0x8a, 0x30, 0xba, 0xce, 0x06,
2412 0xa6, 0x6e, 0xaf, 0x8f, 0x63, 0xc4, 0xaa, 0x3b,
2413 0x63, 0x78, 0x26, 0xa8, 0x7f, 0xe8, 0xcf, 0xa4,
2414 0x42, 0x82, 0xe9, 0x2c, 0xb1, 0x61, 0x5a, 0xf3,
2415 0xa2, 0x8e, 0x53, 0xbc, 0x74, 0xc7, 0xcb, 0xa1,
2416 0xa0, 0x97, 0x7b, 0xe9, 0x06, 0x5d, 0x0c, 0x1a,
2417 0x5d, 0xec, 0x6c, 0x54, 0xae, 0x38, 0xd3, 0x7f,
2418 0x37, 0xaa, 0x35, 0x28, 0x3e, 0x04, 0x8e, 0x55,
2419 0x30, 0xa8, 0x5c, 0x4e, 0x7a, 0x29, 0xd7, 0xb9,
2420 0x2e, 0xc0, 0xc3, 0x16, 0x9c, 0xdf, 0x2a, 0x80,
2421 0x5c, 0x76, 0x04, 0xbc, 0xe6, 0x00, 0x49, 0xb9,
2422 0xfb, 0x7b, 0x8e, 0xaa, 0xc1, 0x0f, 0x51, 0xae,
2423 0x23, 0x79, 0x4c, 0xeb, 0xa6, 0x8b, 0xb5, 0x81,
2424 0x12, 0xe2, 0x93, 0xb9, 0xb6, 0x92, 0xca, 0x72,
2425 0x1b, 0x37, 0xc6, 0x62, 0xf8, 0x57, 0x4e, 0xd4,
2426 0xdb, 0xa6, 0xf8, 0x8e, 0x17, 0x08, 0x81, 0xc8,
2427 0x2c, 0xdd, 0xc1, 0x03, 0x4a, 0x0c, 0xa7, 0xe2,
2428 0x84, 0xbf, 0x09, 0x62, 0xb6, 0xb2, 0x62, 0x92,
2429 0xd8, 0x36, 0xfa, 0x9f, 0x73, 0xc1, 0xac, 0x77,
2430 0x0e, 0xef, 0x0f, 0x2d, 0x3a, 0x1e, 0xaf, 0x61,
2431 0xd3, 0xe0, 0x35, 0x55, 0xfd, 0x42, 0x4e, 0xed,
2432 0xd6, 0x7e, 0x18, 0xa1, 0x80, 0x94, 0xf8, 0x88,
2433 };
2434
2435 static const uint8_t aes_xts_256_vec7_ctxt[SECSIZE] = {
2436 0xd5, 0x5f, 0x68, 0x4f, 0x81, 0xf4, 0x42, 0x6e,
2437 0x9f, 0xde, 0x92, 0xa5, 0xff, 0x02, 0xdf, 0x2a,
2438 0xc8, 0x96, 0xaf, 0x63, 0x96, 0x28, 0x88, 0xa9,
2439 0x79, 0x10, 0xc1, 0x37, 0x9e, 0x20, 0xb0, 0xa3,
2440 0xb1, 0xdb, 0x61, 0x3f, 0xb7, 0xfe, 0x2e, 0x07,
2441 0x00, 0x43, 0x29, 0xea, 0x5c, 0x22, 0xbf, 0xd3,
2442 0x3e, 0x3d, 0xbe, 0x4c, 0xf5, 0x8c, 0xc6, 0x08,
2443 0xc2, 0xc2, 0x6c, 0x19, 0xa2, 0xe2, 0xfe, 0x22,
2444 0xf9, 0x87, 0x32, 0xc2, 0xb5, 0xcb, 0x84, 0x4c,
2445 0xc6, 0xc0, 0x70, 0x2d, 0x91, 0xe1, 0xd5, 0x0f,
2446 0xc4, 0x38, 0x2a, 0x7e, 0xba, 0x56, 0x35, 0xcd,
2447 0x60, 0x24, 0x32, 0xa2, 0x30, 0x6a, 0xc4, 0xce,
2448 0x82, 0xf8, 0xd7, 0x0c, 0x8d, 0x9b, 0xc1, 0x5f,
2449 0x91, 0x8f, 0xe7, 0x1e, 0x74, 0xc6, 0x22, 0xd5,
2450 0xcf, 0x71, 0x17, 0x8b, 0xf6, 0xe0, 0xb9, 0xcc,
2451 0x9f, 0x2b, 0x41, 0xdd, 0x8d, 0xbe, 0x44, 0x1c,
2452 0x41, 0xcd, 0x0c, 0x73, 0xa6, 0xdc, 0x47, 0xa3,
2453 0x48, 0xf6, 0x70, 0x2f, 0x9d, 0x0e, 0x9b, 0x1b,
2454 0x14, 0x31, 0xe9, 0x48, 0xe2, 0x99, 0xb9, 0xec,
2455 0x22, 0x72, 0xab, 0x2c, 0x5f, 0x0c, 0x7b, 0xe8,
2456 0x6a, 0xff, 0xa5, 0xde, 0xc8, 0x7a, 0x0b, 0xee,
2457 0x81, 0xd3, 0xd5, 0x00, 0x07, 0xed, 0xaa, 0x2b,
2458 0xcf, 0xcc, 0xb3, 0x56, 0x05, 0x15, 0x5f, 0xf3,
2459 0x6e, 0xd8, 0xed, 0xd4, 0xa4, 0x0d, 0xcd, 0x4b,
2460 0x24, 0x3a, 0xcd, 0x11, 0xb2, 0xb9, 0x87, 0xbd,
2461 0xbf, 0xaf, 0x91, 0xa7, 0xca, 0xc2, 0x7e, 0x9c,
2462 0x5a, 0xea, 0x52, 0x5e, 0xe5, 0x3d, 0xe7, 0xb2,
2463 0xd3, 0x33, 0x2c, 0x86, 0x44, 0x40, 0x2b, 0x82,
2464 0x3e, 0x94, 0xa7, 0xdb, 0x26, 0x27, 0x6d, 0x2d,
2465 0x23, 0xaa, 0x07, 0x18, 0x0f, 0x76, 0xb4, 0xfd,
2466 0x29, 0xb9, 0xc0, 0x82, 0x30, 0x99, 0xc9, 0xd6,
2467 0x2c, 0x51, 0x98, 0x80, 0xae, 0xe7, 0xe9, 0x69,
2468 0x76, 0x17, 0xc1, 0x49, 0x7d, 0x47, 0xbf, 0x3e,
2469 0x57, 0x19, 0x50, 0x31, 0x14, 0x21, 0xb6, 0xb7,
2470 0x34, 0xd3, 0x8b, 0x0d, 0xb9, 0x1e, 0xb8, 0x53,
2471 0x31, 0xb9, 0x1e, 0xa9, 0xf6, 0x15, 0x30, 0xf5,
2472 0x45, 0x12, 0xa5, 0xa5, 0x2a, 0x4b, 0xad, 0x58,
2473 0x9e, 0xb6, 0x97, 0x81, 0xd5, 0x37, 0xf2, 0x32,
2474 0x97, 0xbb, 0x45, 0x9b, 0xda, 0xd2, 0x94, 0x8a,
2475 0x29, 0xe1, 0x55, 0x0b, 0xf4, 0x78, 0x7e, 0x0b,
2476 0xe9, 0x5b, 0xb1, 0x73, 0xcf, 0x5f, 0xab, 0x17,
2477 0xda, 0xb7, 0xa1, 0x3a, 0x05, 0x2a, 0x63, 0x45,
2478 0x3d, 0x97, 0xcc, 0xec, 0x1a, 0x32, 0x19, 0x54,
2479 0x88, 0x6b, 0x7a, 0x12, 0x99, 0xfa, 0xae, 0xec,
2480 0xae, 0x35, 0xc6, 0xea, 0xac, 0xa7, 0x53, 0xb0,
2481 0x41, 0xb5, 0xe5, 0xf0, 0x93, 0xbf, 0x83, 0x39,
2482 0x7f, 0xd2, 0x1d, 0xd6, 0xb3, 0x01, 0x20, 0x66,
2483 0xfc, 0xc0, 0x58, 0xcc, 0x32, 0xc3, 0xb0, 0x9d,
2484 0x75, 0x62, 0xde, 0xe2, 0x95, 0x09, 0xb5, 0x83,
2485 0x93, 0x92, 0xc9, 0xff, 0x05, 0xf5, 0x1f, 0x31,
2486 0x66, 0xaa, 0xac, 0x4a, 0xc5, 0xf2, 0x38, 0x03,
2487 0x8a, 0x30, 0x45, 0xe6, 0xf7, 0x2e, 0x48, 0xef,
2488 0x0f, 0xe8, 0xbc, 0x67, 0x5e, 0x82, 0xc3, 0x18,
2489 0xa2, 0x68, 0xe4, 0x39, 0x70, 0x27, 0x1b, 0xf1,
2490 0x19, 0xb8, 0x1b, 0xf6, 0xa9, 0x82, 0x74, 0x65,
2491 0x54, 0xf8, 0x4e, 0x72, 0xb9, 0xf0, 0x02, 0x80,
2492 0xa3, 0x20, 0xa0, 0x81, 0x42, 0x92, 0x3c, 0x23,
2493 0xc8, 0x83, 0x42, 0x3f, 0xf9, 0x49, 0x82, 0x7f,
2494 0x29, 0xbb, 0xac, 0xdc, 0x1c, 0xcd, 0xb0, 0x49,
2495 0x38, 0xce, 0x60, 0x98, 0xc9, 0x5b, 0xa6, 0xb3,
2496 0x25, 0x28, 0xf4, 0xef, 0x78, 0xee, 0xd7, 0x78,
2497 0xb2, 0xe1, 0x22, 0xdd, 0xfd, 0x1c, 0xbd, 0xd1,
2498 0x1d, 0x1c, 0x0a, 0x67, 0x83, 0xe0, 0x11, 0xfc,
2499 0x53, 0x6d, 0x63, 0xd0, 0x53, 0x26, 0x06, 0x37,
2500 };
2501
2502 /*
2503 * Vector 8 from IEEE 1619/D16, blkno 0xfe.
2504 */
2505 static const uint8_t aes_xts_256_vec8_ptxt[SECSIZE] = {
2506 0xd5, 0x5f, 0x68, 0x4f, 0x81, 0xf4, 0x42, 0x6e,
2507 0x9f, 0xde, 0x92, 0xa5, 0xff, 0x02, 0xdf, 0x2a,
2508 0xc8, 0x96, 0xaf, 0x63, 0x96, 0x28, 0x88, 0xa9,
2509 0x79, 0x10, 0xc1, 0x37, 0x9e, 0x20, 0xb0, 0xa3,
2510 0xb1, 0xdb, 0x61, 0x3f, 0xb7, 0xfe, 0x2e, 0x07,
2511 0x00, 0x43, 0x29, 0xea, 0x5c, 0x22, 0xbf, 0xd3,
2512 0x3e, 0x3d, 0xbe, 0x4c, 0xf5, 0x8c, 0xc6, 0x08,
2513 0xc2, 0xc2, 0x6c, 0x19, 0xa2, 0xe2, 0xfe, 0x22,
2514 0xf9, 0x87, 0x32, 0xc2, 0xb5, 0xcb, 0x84, 0x4c,
2515 0xc6, 0xc0, 0x70, 0x2d, 0x91, 0xe1, 0xd5, 0x0f,
2516 0xc4, 0x38, 0x2a, 0x7e, 0xba, 0x56, 0x35, 0xcd,
2517 0x60, 0x24, 0x32, 0xa2, 0x30, 0x6a, 0xc4, 0xce,
2518 0x82, 0xf8, 0xd7, 0x0c, 0x8d, 0x9b, 0xc1, 0x5f,
2519 0x91, 0x8f, 0xe7, 0x1e, 0x74, 0xc6, 0x22, 0xd5,
2520 0xcf, 0x71, 0x17, 0x8b, 0xf6, 0xe0, 0xb9, 0xcc,
2521 0x9f, 0x2b, 0x41, 0xdd, 0x8d, 0xbe, 0x44, 0x1c,
2522 0x41, 0xcd, 0x0c, 0x73, 0xa6, 0xdc, 0x47, 0xa3,
2523 0x48, 0xf6, 0x70, 0x2f, 0x9d, 0x0e, 0x9b, 0x1b,
2524 0x14, 0x31, 0xe9, 0x48, 0xe2, 0x99, 0xb9, 0xec,
2525 0x22, 0x72, 0xab, 0x2c, 0x5f, 0x0c, 0x7b, 0xe8,
2526 0x6a, 0xff, 0xa5, 0xde, 0xc8, 0x7a, 0x0b, 0xee,
2527 0x81, 0xd3, 0xd5, 0x00, 0x07, 0xed, 0xaa, 0x2b,
2528 0xcf, 0xcc, 0xb3, 0x56, 0x05, 0x15, 0x5f, 0xf3,
2529 0x6e, 0xd8, 0xed, 0xd4, 0xa4, 0x0d, 0xcd, 0x4b,
2530 0x24, 0x3a, 0xcd, 0x11, 0xb2, 0xb9, 0x87, 0xbd,
2531 0xbf, 0xaf, 0x91, 0xa7, 0xca, 0xc2, 0x7e, 0x9c,
2532 0x5a, 0xea, 0x52, 0x5e, 0xe5, 0x3d, 0xe7, 0xb2,
2533 0xd3, 0x33, 0x2c, 0x86, 0x44, 0x40, 0x2b, 0x82,
2534 0x3e, 0x94, 0xa7, 0xdb, 0x26, 0x27, 0x6d, 0x2d,
2535 0x23, 0xaa, 0x07, 0x18, 0x0f, 0x76, 0xb4, 0xfd,
2536 0x29, 0xb9, 0xc0, 0x82, 0x30, 0x99, 0xc9, 0xd6,
2537 0x2c, 0x51, 0x98, 0x80, 0xae, 0xe7, 0xe9, 0x69,
2538 0x76, 0x17, 0xc1, 0x49, 0x7d, 0x47, 0xbf, 0x3e,
2539 0x57, 0x19, 0x50, 0x31, 0x14, 0x21, 0xb6, 0xb7,
2540 0x34, 0xd3, 0x8b, 0x0d, 0xb9, 0x1e, 0xb8, 0x53,
2541 0x31, 0xb9, 0x1e, 0xa9, 0xf6, 0x15, 0x30, 0xf5,
2542 0x45, 0x12, 0xa5, 0xa5, 0x2a, 0x4b, 0xad, 0x58,
2543 0x9e, 0xb6, 0x97, 0x81, 0xd5, 0x37, 0xf2, 0x32,
2544 0x97, 0xbb, 0x45, 0x9b, 0xda, 0xd2, 0x94, 0x8a,
2545 0x29, 0xe1, 0x55, 0x0b, 0xf4, 0x78, 0x7e, 0x0b,
2546 0xe9, 0x5b, 0xb1, 0x73, 0xcf, 0x5f, 0xab, 0x17,
2547 0xda, 0xb7, 0xa1, 0x3a, 0x05, 0x2a, 0x63, 0x45,
2548 0x3d, 0x97, 0xcc, 0xec, 0x1a, 0x32, 0x19, 0x54,
2549 0x88, 0x6b, 0x7a, 0x12, 0x99, 0xfa, 0xae, 0xec,
2550 0xae, 0x35, 0xc6, 0xea, 0xac, 0xa7, 0x53, 0xb0,
2551 0x41, 0xb5, 0xe5, 0xf0, 0x93, 0xbf, 0x83, 0x39,
2552 0x7f, 0xd2, 0x1d, 0xd6, 0xb3, 0x01, 0x20, 0x66,
2553 0xfc, 0xc0, 0x58, 0xcc, 0x32, 0xc3, 0xb0, 0x9d,
2554 0x75, 0x62, 0xde, 0xe2, 0x95, 0x09, 0xb5, 0x83,
2555 0x93, 0x92, 0xc9, 0xff, 0x05, 0xf5, 0x1f, 0x31,
2556 0x66, 0xaa, 0xac, 0x4a, 0xc5, 0xf2, 0x38, 0x03,
2557 0x8a, 0x30, 0x45, 0xe6, 0xf7, 0x2e, 0x48, 0xef,
2558 0x0f, 0xe8, 0xbc, 0x67, 0x5e, 0x82, 0xc3, 0x18,
2559 0xa2, 0x68, 0xe4, 0x39, 0x70, 0x27, 0x1b, 0xf1,
2560 0x19, 0xb8, 0x1b, 0xf6, 0xa9, 0x82, 0x74, 0x65,
2561 0x54, 0xf8, 0x4e, 0x72, 0xb9, 0xf0, 0x02, 0x80,
2562 0xa3, 0x20, 0xa0, 0x81, 0x42, 0x92, 0x3c, 0x23,
2563 0xc8, 0x83, 0x42, 0x3f, 0xf9, 0x49, 0x82, 0x7f,
2564 0x29, 0xbb, 0xac, 0xdc, 0x1c, 0xcd, 0xb0, 0x49,
2565 0x38, 0xce, 0x60, 0x98, 0xc9, 0x5b, 0xa6, 0xb3,
2566 0x25, 0x28, 0xf4, 0xef, 0x78, 0xee, 0xd7, 0x78,
2567 0xb2, 0xe1, 0x22, 0xdd, 0xfd, 0x1c, 0xbd, 0xd1,
2568 0x1d, 0x1c, 0x0a, 0x67, 0x83, 0xe0, 0x11, 0xfc,
2569 0x53, 0x6d, 0x63, 0xd0, 0x53, 0x26, 0x06, 0x37,
2570 };
2571
2572 static const uint8_t aes_xts_256_vec8_ctxt[SECSIZE] = {
2573 0x72, 0xef, 0xc1, 0xeb, 0xfe, 0x1e, 0xe2, 0x59,
2574 0x75, 0xa6, 0xeb, 0x3a, 0xa8, 0x58, 0x9d, 0xda,
2575 0x2b, 0x26, 0x1f, 0x1c, 0x85, 0xbd, 0xab, 0x44,
2576 0x2a, 0x9e, 0x5b, 0x2d, 0xd1, 0xd7, 0xc3, 0x95,
2577 0x7a, 0x16, 0xfc, 0x08, 0xe5, 0x26, 0xd4, 0xb1,
2578 0x22, 0x3f, 0x1b, 0x12, 0x32, 0xa1, 0x1a, 0xf2,
2579 0x74, 0xc3, 0xd7, 0x0d, 0xac, 0x57, 0xf8, 0x3e,
2580 0x09, 0x83, 0xc4, 0x98, 0xf1, 0xa6, 0xf1, 0xae,
2581 0xcb, 0x02, 0x1c, 0x3e, 0x70, 0x08, 0x5a, 0x1e,
2582 0x52, 0x7f, 0x1c, 0xe4, 0x1e, 0xe5, 0x91, 0x1a,
2583 0x82, 0x02, 0x01, 0x61, 0x52, 0x9c, 0xd8, 0x27,
2584 0x73, 0x76, 0x2d, 0xaf, 0x54, 0x59, 0xde, 0x94,
2585 0xa0, 0xa8, 0x2a, 0xda, 0xe7, 0xe1, 0x70, 0x3c,
2586 0x80, 0x85, 0x43, 0xc2, 0x9e, 0xd6, 0xfb, 0x32,
2587 0xd9, 0xe0, 0x04, 0x32, 0x7c, 0x13, 0x55, 0x18,
2588 0x0c, 0x99, 0x5a, 0x07, 0x74, 0x14, 0x93, 0xa0,
2589 0x9c, 0x21, 0xba, 0x01, 0xa3, 0x87, 0x88, 0x2d,
2590 0xa4, 0xf6, 0x25, 0x34, 0xb8, 0x7b, 0xb1, 0x5d,
2591 0x60, 0xd1, 0x97, 0x20, 0x1c, 0x0f, 0xd3, 0xbf,
2592 0x30, 0xc1, 0x50, 0x0a, 0x3e, 0xcf, 0xec, 0xdd,
2593 0x66, 0xd8, 0x72, 0x1f, 0x90, 0xbc, 0xc4, 0xc1,
2594 0x7e, 0xe9, 0x25, 0xc6, 0x1b, 0x0a, 0x03, 0x72,
2595 0x7a, 0x9c, 0x0d, 0x5f, 0x5c, 0xa4, 0x62, 0xfb,
2596 0xfa, 0x0a, 0xf1, 0xc2, 0x51, 0x3a, 0x9d, 0x9d,
2597 0x4b, 0x53, 0x45, 0xbd, 0x27, 0xa5, 0xf6, 0xe6,
2598 0x53, 0xf7, 0x51, 0x69, 0x3e, 0x6b, 0x6a, 0x2b,
2599 0x8e, 0xad, 0x57, 0xd5, 0x11, 0xe0, 0x0e, 0x58,
2600 0xc4, 0x5b, 0x7b, 0x8d, 0x00, 0x5a, 0xf7, 0x92,
2601 0x88, 0xf5, 0xc7, 0xc2, 0x2f, 0xd4, 0xf1, 0xbf,
2602 0x7a, 0x89, 0x8b, 0x03, 0xa5, 0x63, 0x4c, 0x6a,
2603 0x1a, 0xe3, 0xf9, 0xfa, 0xe5, 0xde, 0x4f, 0x29,
2604 0x6a, 0x28, 0x96, 0xb2, 0x3e, 0x7e, 0xd4, 0x3e,
2605 0xd1, 0x4f, 0xa5, 0xa2, 0x80, 0x3f, 0x4d, 0x28,
2606 0xf0, 0xd3, 0xff, 0xcf, 0x24, 0x75, 0x76, 0x77,
2607 0xae, 0xbd, 0xb4, 0x7b, 0xb3, 0x88, 0x37, 0x87,
2608 0x08, 0x94, 0x8a, 0x8d, 0x41, 0x26, 0xed, 0x18,
2609 0x39, 0xe0, 0xda, 0x29, 0xa5, 0x37, 0xa8, 0xc1,
2610 0x98, 0xb3, 0xc6, 0x6a, 0xb0, 0x07, 0x12, 0xdd,
2611 0x26, 0x16, 0x74, 0xbf, 0x45, 0xa7, 0x3d, 0x67,
2612 0xf7, 0x69, 0x14, 0xf8, 0x30, 0xca, 0x01, 0x4b,
2613 0x65, 0x59, 0x6f, 0x27, 0xe4, 0xcf, 0x62, 0xde,
2614 0x66, 0x12, 0x5a, 0x55, 0x66, 0xdf, 0x99, 0x75,
2615 0x15, 0x56, 0x28, 0xb4, 0x00, 0xfb, 0xfb, 0x3a,
2616 0x29, 0x04, 0x0e, 0xd5, 0x0f, 0xaf, 0xfd, 0xbb,
2617 0x18, 0xae, 0xce, 0x7c, 0x5c, 0x44, 0x69, 0x32,
2618 0x60, 0xaa, 0xb3, 0x86, 0xc0, 0xa3, 0x7b, 0x11,
2619 0xb1, 0x14, 0xf1, 0xc4, 0x15, 0xae, 0xbb, 0x65,
2620 0x3b, 0xe4, 0x68, 0x17, 0x94, 0x28, 0xd4, 0x3a,
2621 0x4d, 0x8b, 0xc3, 0xec, 0x38, 0x81, 0x3e, 0xca,
2622 0x30, 0xa1, 0x3c, 0xf1, 0xbb, 0x18, 0xd5, 0x24,
2623 0xf1, 0x99, 0x2d, 0x44, 0xd8, 0xb1, 0xa4, 0x2e,
2624 0xa3, 0x0b, 0x22, 0xe6, 0xc9, 0x5b, 0x19, 0x9d,
2625 0x8d, 0x18, 0x2f, 0x88, 0x40, 0xb0, 0x9d, 0x05,
2626 0x95, 0x85, 0xc3, 0x1a, 0xd6, 0x91, 0xfa, 0x06,
2627 0x19, 0xff, 0x03, 0x8a, 0xca, 0x2c, 0x39, 0xa9,
2628 0x43, 0x42, 0x11, 0x57, 0x36, 0x17, 0x17, 0xc4,
2629 0x9d, 0x32, 0x20, 0x28, 0xa7, 0x46, 0x48, 0x11,
2630 0x3b, 0xd8, 0xc9, 0xd7, 0xec, 0x77, 0xcf, 0x3c,
2631 0x89, 0xc1, 0xec, 0x87, 0x18, 0xce, 0xff, 0x85,
2632 0x16, 0xd9, 0x6b, 0x34, 0xc3, 0xc6, 0x14, 0xf1,
2633 0x06, 0x99, 0xc9, 0xab, 0xc4, 0xed, 0x04, 0x11,
2634 0x50, 0x62, 0x23, 0xbe, 0xa1, 0x6a, 0xf3, 0x5c,
2635 0x88, 0x3a, 0xcc, 0xdb, 0xe1, 0x10, 0x4e, 0xef,
2636 0x0c, 0xfd, 0xb5, 0x4e, 0x12, 0xfb, 0x23, 0x0a,
2637 };
2638
2639 /*
2640 * Vector 9 from IEEE 1619/D16, blkno 0xff.
2641 */
2642 static const uint8_t aes_xts_256_vec9_ptxt[SECSIZE] = {
2643 0x72, 0xef, 0xc1, 0xeb, 0xfe, 0x1e, 0xe2, 0x59,
2644 0x75, 0xa6, 0xeb, 0x3a, 0xa8, 0x58, 0x9d, 0xda,
2645 0x2b, 0x26, 0x1f, 0x1c, 0x85, 0xbd, 0xab, 0x44,
2646 0x2a, 0x9e, 0x5b, 0x2d, 0xd1, 0xd7, 0xc3, 0x95,
2647 0x7a, 0x16, 0xfc, 0x08, 0xe5, 0x26, 0xd4, 0xb1,
2648 0x22, 0x3f, 0x1b, 0x12, 0x32, 0xa1, 0x1a, 0xf2,
2649 0x74, 0xc3, 0xd7, 0x0d, 0xac, 0x57, 0xf8, 0x3e,
2650 0x09, 0x83, 0xc4, 0x98, 0xf1, 0xa6, 0xf1, 0xae,
2651 0xcb, 0x02, 0x1c, 0x3e, 0x70, 0x08, 0x5a, 0x1e,
2652 0x52, 0x7f, 0x1c, 0xe4, 0x1e, 0xe5, 0x91, 0x1a,
2653 0x82, 0x02, 0x01, 0x61, 0x52, 0x9c, 0xd8, 0x27,
2654 0x73, 0x76, 0x2d, 0xaf, 0x54, 0x59, 0xde, 0x94,
2655 0xa0, 0xa8, 0x2a, 0xda, 0xe7, 0xe1, 0x70, 0x3c,
2656 0x80, 0x85, 0x43, 0xc2, 0x9e, 0xd6, 0xfb, 0x32,
2657 0xd9, 0xe0, 0x04, 0x32, 0x7c, 0x13, 0x55, 0x18,
2658 0x0c, 0x99, 0x5a, 0x07, 0x74, 0x14, 0x93, 0xa0,
2659 0x9c, 0x21, 0xba, 0x01, 0xa3, 0x87, 0x88, 0x2d,
2660 0xa4, 0xf6, 0x25, 0x34, 0xb8, 0x7b, 0xb1, 0x5d,
2661 0x60, 0xd1, 0x97, 0x20, 0x1c, 0x0f, 0xd3, 0xbf,
2662 0x30, 0xc1, 0x50, 0x0a, 0x3e, 0xcf, 0xec, 0xdd,
2663 0x66, 0xd8, 0x72, 0x1f, 0x90, 0xbc, 0xc4, 0xc1,
2664 0x7e, 0xe9, 0x25, 0xc6, 0x1b, 0x0a, 0x03, 0x72,
2665 0x7a, 0x9c, 0x0d, 0x5f, 0x5c, 0xa4, 0x62, 0xfb,
2666 0xfa, 0x0a, 0xf1, 0xc2, 0x51, 0x3a, 0x9d, 0x9d,
2667 0x4b, 0x53, 0x45, 0xbd, 0x27, 0xa5, 0xf6, 0xe6,
2668 0x53, 0xf7, 0x51, 0x69, 0x3e, 0x6b, 0x6a, 0x2b,
2669 0x8e, 0xad, 0x57, 0xd5, 0x11, 0xe0, 0x0e, 0x58,
2670 0xc4, 0x5b, 0x7b, 0x8d, 0x00, 0x5a, 0xf7, 0x92,
2671 0x88, 0xf5, 0xc7, 0xc2, 0x2f, 0xd4, 0xf1, 0xbf,
2672 0x7a, 0x89, 0x8b, 0x03, 0xa5, 0x63, 0x4c, 0x6a,
2673 0x1a, 0xe3, 0xf9, 0xfa, 0xe5, 0xde, 0x4f, 0x29,
2674 0x6a, 0x28, 0x96, 0xb2, 0x3e, 0x7e, 0xd4, 0x3e,
2675 0xd1, 0x4f, 0xa5, 0xa2, 0x80, 0x3f, 0x4d, 0x28,
2676 0xf0, 0xd3, 0xff, 0xcf, 0x24, 0x75, 0x76, 0x77,
2677 0xae, 0xbd, 0xb4, 0x7b, 0xb3, 0x88, 0x37, 0x87,
2678 0x08, 0x94, 0x8a, 0x8d, 0x41, 0x26, 0xed, 0x18,
2679 0x39, 0xe0, 0xda, 0x29, 0xa5, 0x37, 0xa8, 0xc1,
2680 0x98, 0xb3, 0xc6, 0x6a, 0xb0, 0x07, 0x12, 0xdd,
2681 0x26, 0x16, 0x74, 0xbf, 0x45, 0xa7, 0x3d, 0x67,
2682 0xf7, 0x69, 0x14, 0xf8, 0x30, 0xca, 0x01, 0x4b,
2683 0x65, 0x59, 0x6f, 0x27, 0xe4, 0xcf, 0x62, 0xde,
2684 0x66, 0x12, 0x5a, 0x55, 0x66, 0xdf, 0x99, 0x75,
2685 0x15, 0x56, 0x28, 0xb4, 0x00, 0xfb, 0xfb, 0x3a,
2686 0x29, 0x04, 0x0e, 0xd5, 0x0f, 0xaf, 0xfd, 0xbb,
2687 0x18, 0xae, 0xce, 0x7c, 0x5c, 0x44, 0x69, 0x32,
2688 0x60, 0xaa, 0xb3, 0x86, 0xc0, 0xa3, 0x7b, 0x11,
2689 0xb1, 0x14, 0xf1, 0xc4, 0x15, 0xae, 0xbb, 0x65,
2690 0x3b, 0xe4, 0x68, 0x17, 0x94, 0x28, 0xd4, 0x3a,
2691 0x4d, 0x8b, 0xc3, 0xec, 0x38, 0x81, 0x3e, 0xca,
2692 0x30, 0xa1, 0x3c, 0xf1, 0xbb, 0x18, 0xd5, 0x24,
2693 0xf1, 0x99, 0x2d, 0x44, 0xd8, 0xb1, 0xa4, 0x2e,
2694 0xa3, 0x0b, 0x22, 0xe6, 0xc9, 0x5b, 0x19, 0x9d,
2695 0x8d, 0x18, 0x2f, 0x88, 0x40, 0xb0, 0x9d, 0x05,
2696 0x95, 0x85, 0xc3, 0x1a, 0xd6, 0x91, 0xfa, 0x06,
2697 0x19, 0xff, 0x03, 0x8a, 0xca, 0x2c, 0x39, 0xa9,
2698 0x43, 0x42, 0x11, 0x57, 0x36, 0x17, 0x17, 0xc4,
2699 0x9d, 0x32, 0x20, 0x28, 0xa7, 0x46, 0x48, 0x11,
2700 0x3b, 0xd8, 0xc9, 0xd7, 0xec, 0x77, 0xcf, 0x3c,
2701 0x89, 0xc1, 0xec, 0x87, 0x18, 0xce, 0xff, 0x85,
2702 0x16, 0xd9, 0x6b, 0x34, 0xc3, 0xc6, 0x14, 0xf1,
2703 0x06, 0x99, 0xc9, 0xab, 0xc4, 0xed, 0x04, 0x11,
2704 0x50, 0x62, 0x23, 0xbe, 0xa1, 0x6a, 0xf3, 0x5c,
2705 0x88, 0x3a, 0xcc, 0xdb, 0xe1, 0x10, 0x4e, 0xef,
2706 0x0c, 0xfd, 0xb5, 0x4e, 0x12, 0xfb, 0x23, 0x0a,
2707 };
2708
2709 static const uint8_t aes_xts_256_vec9_ctxt[SECSIZE] = {
2710 0x32, 0x60, 0xae, 0x8d, 0xad, 0x1f, 0x4a, 0x32,
2711 0xc5, 0xca, 0xfe, 0x3a, 0xb0, 0xeb, 0x95, 0x54,
2712 0x9d, 0x46, 0x1a, 0x67, 0xce, 0xb9, 0xe5, 0xaa,
2713 0x2d, 0x3a, 0xfb, 0x62, 0xde, 0xce, 0x05, 0x53,
2714 0x19, 0x3b, 0xa5, 0x0c, 0x75, 0xbe, 0x25, 0x1e,
2715 0x08, 0xd1, 0xd0, 0x8f, 0x10, 0x88, 0x57, 0x6c,
2716 0x7e, 0xfd, 0xfa, 0xaf, 0x3f, 0x45, 0x95, 0x59,
2717 0x57, 0x1e, 0x12, 0x51, 0x17, 0x53, 0xb0, 0x7a,
2718 0xf0, 0x73, 0xf3, 0x5d, 0xa0, 0x6a, 0xf0, 0xce,
2719 0x0b, 0xbf, 0x6b, 0x8f, 0x5c, 0xcc, 0x5c, 0xea,
2720 0x50, 0x0e, 0xc1, 0xb2, 0x11, 0xbd, 0x51, 0xf6,
2721 0x3b, 0x60, 0x6b, 0xf6, 0x52, 0x87, 0x96, 0xca,
2722 0x12, 0x17, 0x3b, 0xa3, 0x9b, 0x89, 0x35, 0xee,
2723 0x44, 0xcc, 0xce, 0x64, 0x6f, 0x90, 0xa4, 0x5b,
2724 0xf9, 0xcc, 0xc5, 0x67, 0xf0, 0xac, 0xe1, 0x3d,
2725 0xc2, 0xd5, 0x3e, 0xbe, 0xed, 0xc8, 0x1f, 0x58,
2726 0xb2, 0xe4, 0x11, 0x79, 0xdd, 0xdf, 0x0d, 0x5a,
2727 0x5c, 0x42, 0xf5, 0xd8, 0x50, 0x6c, 0x1a, 0x5d,
2728 0x2f, 0x8f, 0x59, 0xf3, 0xea, 0x87, 0x3c, 0xbc,
2729 0xd0, 0xee, 0xc1, 0x9a, 0xcb, 0xf3, 0x25, 0x42,
2730 0x3b, 0xd3, 0xdc, 0xb8, 0xc2, 0xb1, 0xbf, 0x1d,
2731 0x1e, 0xae, 0xd0, 0xeb, 0xa7, 0xf0, 0x69, 0x8e,
2732 0x43, 0x14, 0xfb, 0xeb, 0x2f, 0x15, 0x66, 0xd1,
2733 0xb9, 0x25, 0x30, 0x08, 0xcb, 0xcc, 0xf4, 0x5a,
2734 0x2b, 0x0d, 0x9c, 0x5c, 0x9c, 0x21, 0x47, 0x4f,
2735 0x40, 0x76, 0xe0, 0x2b, 0xe2, 0x60, 0x50, 0xb9,
2736 0x9d, 0xee, 0x4f, 0xd6, 0x8a, 0x4c, 0xf8, 0x90,
2737 0xe4, 0x96, 0xe4, 0xfc, 0xae, 0x7b, 0x70, 0xf9,
2738 0x4e, 0xa5, 0xa9, 0x06, 0x2d, 0xa0, 0xda, 0xeb,
2739 0xa1, 0x99, 0x3d, 0x2c, 0xcd, 0x1d, 0xd3, 0xc2,
2740 0x44, 0xb8, 0x42, 0x88, 0x01, 0x49, 0x5a, 0x58,
2741 0xb2, 0x16, 0x54, 0x7e, 0x7e, 0x84, 0x7c, 0x46,
2742 0xd1, 0xd7, 0x56, 0x37, 0x7b, 0x62, 0x42, 0xd2,
2743 0xe5, 0xfb, 0x83, 0xbf, 0x75, 0x2b, 0x54, 0xe0,
2744 0xdf, 0x71, 0xe8, 0x89, 0xf3, 0xa2, 0xbb, 0x0f,
2745 0x4c, 0x10, 0x80, 0x5b, 0xf3, 0xc5, 0x90, 0x37,
2746 0x6e, 0x3c, 0x24, 0xe2, 0x2f, 0xf5, 0x7f, 0x7f,
2747 0xa9, 0x65, 0x57, 0x73, 0x75, 0x32, 0x5c, 0xea,
2748 0x5d, 0x92, 0x0d, 0xb9, 0x4b, 0x9c, 0x33, 0x6b,
2749 0x45, 0x5f, 0x6e, 0x89, 0x4c, 0x01, 0x86, 0x6f,
2750 0xe9, 0xfb, 0xb8, 0xc8, 0xd3, 0xf7, 0x0a, 0x29,
2751 0x57, 0x28, 0x5f, 0x6d, 0xfb, 0x5d, 0xcd, 0x8c,
2752 0xbf, 0x54, 0x78, 0x2f, 0x8f, 0xe7, 0x76, 0x6d,
2753 0x47, 0x23, 0x81, 0x99, 0x13, 0xac, 0x77, 0x34,
2754 0x21, 0xe3, 0xa3, 0x10, 0x95, 0x86, 0x6b, 0xad,
2755 0x22, 0xc8, 0x6a, 0x60, 0x36, 0xb2, 0x51, 0x8b,
2756 0x20, 0x59, 0xb4, 0x22, 0x9d, 0x18, 0xc8, 0xc2,
2757 0xcc, 0xbd, 0xf9, 0x06, 0xc6, 0xcc, 0x6e, 0x82,
2758 0x46, 0x4e, 0xe5, 0x7b, 0xdd, 0xb0, 0xbe, 0xbc,
2759 0xb1, 0xdc, 0x64, 0x53, 0x25, 0xbf, 0xb3, 0xe6,
2760 0x65, 0xef, 0x72, 0x51, 0x08, 0x2c, 0x88, 0xeb,
2761 0xb1, 0xcf, 0x20, 0x3b, 0xd7, 0x79, 0xfd, 0xd3,
2762 0x86, 0x75, 0x71, 0x3c, 0x8d, 0xaa, 0xdd, 0x17,
2763 0xe1, 0xca, 0xbe, 0xe4, 0x32, 0xb0, 0x97, 0x87,
2764 0xb6, 0xdd, 0xf3, 0x30, 0x4e, 0x38, 0xb7, 0x31,
2765 0xb4, 0x5d, 0xf5, 0xdf, 0x51, 0xb7, 0x8f, 0xcf,
2766 0xb3, 0xd3, 0x24, 0x66, 0x02, 0x8d, 0x0b, 0xa3,
2767 0x65, 0x55, 0xe7, 0xe1, 0x1a, 0xb0, 0xee, 0x06,
2768 0x66, 0x06, 0x1d, 0x16, 0x45, 0xd9, 0x62, 0x44,
2769 0x4b, 0xc4, 0x7a, 0x38, 0x18, 0x89, 0x30, 0xa8,
2770 0x4b, 0x4d, 0x56, 0x13, 0x95, 0xc7, 0x3c, 0x08,
2771 0x70, 0x21, 0x92, 0x7c, 0xa6, 0x38, 0xb7, 0xaf,
2772 0xc8, 0xa8, 0x67, 0x9c, 0xcb, 0x84, 0xc2, 0x65,
2773 0x55, 0x44, 0x0e, 0xc7, 0xf1, 0x04, 0x45, 0xcd,
2774 };
2775
2776 const struct testvec aes_xts_256_vectors[] = {
2777 {
2778 .blkno = 0,
2779 .ptxt = aes_xts_256_vec4_ptxt,
2780 .ctxt = aes_xts_256_vec4_ctxt,
2781 },
2782 {
2783 .blkno = 1,
2784 .ptxt = aes_xts_256_vec5_ptxt,
2785 .ctxt = aes_xts_256_vec5_ctxt,
2786 },
2787 {
2788 .blkno = 2,
2789 .ptxt = aes_xts_256_vec6_ptxt,
2790 .ctxt = aes_xts_256_vec6_ctxt,
2791 },
2792 {
2793 .blkno = 0xfd,
2794 .ptxt = aes_xts_256_vec7_ptxt,
2795 .ctxt = aes_xts_256_vec7_ctxt,
2796 },
2797 {
2798 .blkno = 0xfe,
2799 .ptxt = aes_xts_256_vec8_ptxt,
2800 .ctxt = aes_xts_256_vec8_ctxt,
2801 },
2802 {
2803 .blkno = 0xff,
2804 .ptxt = aes_xts_256_vec9_ptxt,
2805 .ctxt = aes_xts_256_vec9_ctxt,
2806 },
2807 };
2808
2809 /*
2810 * Vector 10 from IEEE 1619/D16, blkno 0xff.
2811 */
2812 static const uint8_t aes_xts_512_vec10_ptxt[SECSIZE] = {
2813 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2814 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
2815 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
2816 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
2817 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
2818 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
2819 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2820 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
2821 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
2822 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
2823 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
2824 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
2825 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
2826 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
2827 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
2828 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
2829 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
2830 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
2831 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
2832 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
2833 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
2834 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
2835 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
2836 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
2837 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
2838 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
2839 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
2840 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
2841 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
2842 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
2843 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
2844 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
2845 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2846 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
2847 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
2848 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
2849 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
2850 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
2851 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2852 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
2853 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
2854 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
2855 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
2856 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
2857 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
2858 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
2859 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
2860 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
2861 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
2862 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
2863 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
2864 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
2865 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
2866 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
2867 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
2868 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
2869 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
2870 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
2871 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
2872 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
2873 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
2874 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
2875 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
2876 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
2877 };
2878
2879 static const uint8_t aes_xts_512_vec10_ctxt[SECSIZE] = {
2880 0x1c, 0x3b, 0x3a, 0x10, 0x2f, 0x77, 0x03, 0x86,
2881 0xe4, 0x83, 0x6c, 0x99, 0xe3, 0x70, 0xcf, 0x9b,
2882 0xea, 0x00, 0x80, 0x3f, 0x5e, 0x48, 0x23, 0x57,
2883 0xa4, 0xae, 0x12, 0xd4, 0x14, 0xa3, 0xe6, 0x3b,
2884 0x5d, 0x31, 0xe2, 0x76, 0xf8, 0xfe, 0x4a, 0x8d,
2885 0x66, 0xb3, 0x17, 0xf9, 0xac, 0x68, 0x3f, 0x44,
2886 0x68, 0x0a, 0x86, 0xac, 0x35, 0xad, 0xfc, 0x33,
2887 0x45, 0xbe, 0xfe, 0xcb, 0x4b, 0xb1, 0x88, 0xfd,
2888 0x57, 0x76, 0x92, 0x6c, 0x49, 0xa3, 0x09, 0x5e,
2889 0xb1, 0x08, 0xfd, 0x10, 0x98, 0xba, 0xec, 0x70,
2890 0xaa, 0xa6, 0x69, 0x99, 0xa7, 0x2a, 0x82, 0xf2,
2891 0x7d, 0x84, 0x8b, 0x21, 0xd4, 0xa7, 0x41, 0xb0,
2892 0xc5, 0xcd, 0x4d, 0x5f, 0xff, 0x9d, 0xac, 0x89,
2893 0xae, 0xba, 0x12, 0x29, 0x61, 0xd0, 0x3a, 0x75,
2894 0x71, 0x23, 0xe9, 0x87, 0x0f, 0x8a, 0xcf, 0x10,
2895 0x00, 0x02, 0x08, 0x87, 0x89, 0x14, 0x29, 0xca,
2896 0x2a, 0x3e, 0x7a, 0x7d, 0x7d, 0xf7, 0xb1, 0x03,
2897 0x55, 0x16, 0x5c, 0x8b, 0x9a, 0x6d, 0x0a, 0x7d,
2898 0xe8, 0xb0, 0x62, 0xc4, 0x50, 0x0d, 0xc4, 0xcd,
2899 0x12, 0x0c, 0x0f, 0x74, 0x18, 0xda, 0xe3, 0xd0,
2900 0xb5, 0x78, 0x1c, 0x34, 0x80, 0x3f, 0xa7, 0x54,
2901 0x21, 0xc7, 0x90, 0xdf, 0xe1, 0xde, 0x18, 0x34,
2902 0xf2, 0x80, 0xd7, 0x66, 0x7b, 0x32, 0x7f, 0x6c,
2903 0x8c, 0xd7, 0x55, 0x7e, 0x12, 0xac, 0x3a, 0x0f,
2904 0x93, 0xec, 0x05, 0xc5, 0x2e, 0x04, 0x93, 0xef,
2905 0x31, 0xa1, 0x2d, 0x3d, 0x92, 0x60, 0xf7, 0x9a,
2906 0x28, 0x9d, 0x6a, 0x37, 0x9b, 0xc7, 0x0c, 0x50,
2907 0x84, 0x14, 0x73, 0xd1, 0xa8, 0xcc, 0x81, 0xec,
2908 0x58, 0x3e, 0x96, 0x45, 0xe0, 0x7b, 0x8d, 0x96,
2909 0x70, 0x65, 0x5b, 0xa5, 0xbb, 0xcf, 0xec, 0xc6,
2910 0xdc, 0x39, 0x66, 0x38, 0x0a, 0xd8, 0xfe, 0xcb,
2911 0x17, 0xb6, 0xba, 0x02, 0x46, 0x9a, 0x02, 0x0a,
2912 0x84, 0xe1, 0x8e, 0x8f, 0x84, 0x25, 0x20, 0x70,
2913 0xc1, 0x3e, 0x9f, 0x1f, 0x28, 0x9b, 0xe5, 0x4f,
2914 0xbc, 0x48, 0x14, 0x57, 0x77, 0x8f, 0x61, 0x60,
2915 0x15, 0xe1, 0x32, 0x7a, 0x02, 0xb1, 0x40, 0xf1,
2916 0x50, 0x5e, 0xb3, 0x09, 0x32, 0x6d, 0x68, 0x37,
2917 0x8f, 0x83, 0x74, 0x59, 0x5c, 0x84, 0x9d, 0x84,
2918 0xf4, 0xc3, 0x33, 0xec, 0x44, 0x23, 0x88, 0x51,
2919 0x43, 0xcb, 0x47, 0xbd, 0x71, 0xc5, 0xed, 0xae,
2920 0x9b, 0xe6, 0x9a, 0x2f, 0xfe, 0xce, 0xb1, 0xbe,
2921 0xc9, 0xde, 0x24, 0x4f, 0xbe, 0x15, 0x99, 0x2b,
2922 0x11, 0xb7, 0x7c, 0x04, 0x0f, 0x12, 0xbd, 0x8f,
2923 0x6a, 0x97, 0x5a, 0x44, 0xa0, 0xf9, 0x0c, 0x29,
2924 0xa9, 0xab, 0xc3, 0xd4, 0xd8, 0x93, 0x92, 0x72,
2925 0x84, 0xc5, 0x87, 0x54, 0xcc, 0xe2, 0x94, 0x52,
2926 0x9f, 0x86, 0x14, 0xdc, 0xd2, 0xab, 0xa9, 0x91,
2927 0x92, 0x5f, 0xed, 0xc4, 0xae, 0x74, 0xff, 0xac,
2928 0x6e, 0x33, 0x3b, 0x93, 0xeb, 0x4a, 0xff, 0x04,
2929 0x79, 0xda, 0x9a, 0x41, 0x0e, 0x44, 0x50, 0xe0,
2930 0xdd, 0x7a, 0xe4, 0xc6, 0xe2, 0x91, 0x09, 0x00,
2931 0x57, 0x5d, 0xa4, 0x01, 0xfc, 0x07, 0x05, 0x9f,
2932 0x64, 0x5e, 0x8b, 0x7e, 0x9b, 0xfd, 0xef, 0x33,
2933 0x94, 0x30, 0x54, 0xff, 0x84, 0x01, 0x14, 0x93,
2934 0xc2, 0x7b, 0x34, 0x29, 0xea, 0xed, 0xb4, 0xed,
2935 0x53, 0x76, 0x44, 0x1a, 0x77, 0xed, 0x43, 0x85,
2936 0x1a, 0xd7, 0x7f, 0x16, 0xf5, 0x41, 0xdf, 0xd2,
2937 0x69, 0xd5, 0x0d, 0x6a, 0x5f, 0x14, 0xfb, 0x0a,
2938 0xab, 0x1c, 0xbb, 0x4c, 0x15, 0x50, 0xbe, 0x97,
2939 0xf7, 0xab, 0x40, 0x66, 0x19, 0x3c, 0x4c, 0xaa,
2940 0x77, 0x3d, 0xad, 0x38, 0x01, 0x4b, 0xd2, 0x09,
2941 0x2f, 0xa7, 0x55, 0xc8, 0x24, 0xbb, 0x5e, 0x54,
2942 0xc4, 0xf3, 0x6f, 0xfd, 0xa9, 0xfc, 0xea, 0x70,
2943 0xb9, 0xc6, 0xe6, 0x93, 0xe1, 0x48, 0xc1, 0x51,
2944 };
2945
2946 /*
2947 * Vector 11 from IEEE 1619/D16, blkno 0xffff.
2948 */
2949 static const uint8_t aes_xts_512_vec11_ptxt[SECSIZE] = {
2950 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2951 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
2952 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
2953 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
2954 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
2955 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
2956 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2957 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
2958 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
2959 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
2960 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
2961 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
2962 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
2963 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
2964 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
2965 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
2966 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
2967 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
2968 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
2969 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
2970 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
2971 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
2972 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
2973 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
2974 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
2975 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
2976 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
2977 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
2978 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
2979 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
2980 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
2981 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
2982 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
2983 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
2984 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
2985 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
2986 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
2987 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
2988 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
2989 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
2990 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
2991 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
2992 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
2993 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
2994 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
2995 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
2996 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
2997 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
2998 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
2999 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
3000 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
3001 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
3002 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
3003 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
3004 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
3005 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
3006 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
3007 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
3008 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
3009 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
3010 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
3011 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
3012 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
3013 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
3014 };
3015
3016 static const uint8_t aes_xts_512_vec11_ctxt[SECSIZE] = {
3017 0x77, 0xa3, 0x12, 0x51, 0x61, 0x8a, 0x15, 0xe6,
3018 0xb9, 0x2d, 0x1d, 0x66, 0xdf, 0xfe, 0x7b, 0x50,
3019 0xb5, 0x0b, 0xad, 0x55, 0x23, 0x05, 0xba, 0x02,
3020 0x17, 0xa6, 0x10, 0x68, 0x8e, 0xff, 0x7e, 0x11,
3021 0xe1, 0xd0, 0x22, 0x54, 0x38, 0xe0, 0x93, 0x24,
3022 0x2d, 0x6d, 0xb2, 0x74, 0xfd, 0xe8, 0x01, 0xd4,
3023 0xca, 0xe0, 0x6f, 0x20, 0x92, 0xc7, 0x28, 0xb2,
3024 0x47, 0x85, 0x59, 0xdf, 0x58, 0xe8, 0x37, 0xc2,
3025 0x46, 0x9e, 0xe4, 0xa4, 0xfa, 0x79, 0x4e, 0x4b,
3026 0xbc, 0x7f, 0x39, 0xbc, 0x02, 0x6e, 0x3c, 0xb7,
3027 0x2c, 0x33, 0xb0, 0x88, 0x8f, 0x25, 0xb4, 0xac,
3028 0xf5, 0x6a, 0x2a, 0x98, 0x04, 0xf1, 0xce, 0x6d,
3029 0x3d, 0x6e, 0x1d, 0xc6, 0xca, 0x18, 0x1d, 0x4b,
3030 0x54, 0x61, 0x79, 0xd5, 0x55, 0x44, 0xaa, 0x77,
3031 0x60, 0xc4, 0x0d, 0x06, 0x74, 0x15, 0x39, 0xc7,
3032 0xe3, 0xcd, 0x9d, 0x2f, 0x66, 0x50, 0xb2, 0x01,
3033 0x3f, 0xd0, 0xee, 0xb8, 0xc2, 0xb8, 0xe3, 0xd8,
3034 0xd2, 0x40, 0xcc, 0xae, 0x2d, 0x4c, 0x98, 0x32,
3035 0x0a, 0x74, 0x42, 0xe1, 0xc8, 0xd7, 0x5a, 0x42,
3036 0xd6, 0xe6, 0xcf, 0xa4, 0xc2, 0xec, 0xa1, 0x79,
3037 0x8d, 0x15, 0x8c, 0x7a, 0xec, 0xdf, 0x82, 0x49,
3038 0x0f, 0x24, 0xbb, 0x9b, 0x38, 0xe1, 0x08, 0xbc,
3039 0xda, 0x12, 0xc3, 0xfa, 0xf9, 0xa2, 0x11, 0x41,
3040 0xc3, 0x61, 0x3b, 0x58, 0x36, 0x7f, 0x92, 0x2a,
3041 0xaa, 0x26, 0xcd, 0x22, 0xf2, 0x3d, 0x70, 0x8d,
3042 0xae, 0x69, 0x9a, 0xd7, 0xcb, 0x40, 0xa8, 0xad,
3043 0x0b, 0x6e, 0x27, 0x84, 0x97, 0x3d, 0xcb, 0x60,
3044 0x56, 0x84, 0xc0, 0x8b, 0x8d, 0x69, 0x98, 0xc6,
3045 0x9a, 0xac, 0x04, 0x99, 0x21, 0x87, 0x1e, 0xbb,
3046 0x65, 0x30, 0x1a, 0x46, 0x19, 0xca, 0x80, 0xec,
3047 0xb4, 0x85, 0xa3, 0x1d, 0x74, 0x42, 0x23, 0xce,
3048 0x8d, 0xdc, 0x23, 0x94, 0x82, 0x8d, 0x6a, 0x80,
3049 0x47, 0x0c, 0x09, 0x2f, 0x5b, 0xa4, 0x13, 0xc3,
3050 0x37, 0x8f, 0xa6, 0x05, 0x42, 0x55, 0xc6, 0xf9,
3051 0xdf, 0x44, 0x95, 0x86, 0x2b, 0xbb, 0x32, 0x87,
3052 0x68, 0x1f, 0x93, 0x1b, 0x68, 0x7c, 0x88, 0x8a,
3053 0xbf, 0x84, 0x4d, 0xfc, 0x8f, 0xc2, 0x83, 0x31,
3054 0xe5, 0x79, 0x92, 0x8c, 0xd1, 0x2b, 0xd2, 0x39,
3055 0x0a, 0xe1, 0x23, 0xcf, 0x03, 0x81, 0x8d, 0x14,
3056 0xde, 0xdd, 0xe5, 0xc0, 0xc2, 0x4c, 0x8a, 0xb0,
3057 0x18, 0xbf, 0xca, 0x75, 0xca, 0x09, 0x6f, 0x2d,
3058 0x53, 0x1f, 0x3d, 0x16, 0x19, 0xe7, 0x85, 0xf1,
3059 0xad, 0xa4, 0x37, 0xca, 0xb9, 0x2e, 0x98, 0x05,
3060 0x58, 0xb3, 0xdc, 0xe1, 0x47, 0x4a, 0xfb, 0x75,
3061 0xbf, 0xed, 0xbf, 0x8f, 0xf5, 0x4c, 0xb2, 0x61,
3062 0x8e, 0x02, 0x44, 0xc9, 0xac, 0x0d, 0x3c, 0x66,
3063 0xfb, 0x51, 0x59, 0x8c, 0xd2, 0xdb, 0x11, 0xf9,
3064 0xbe, 0x39, 0x79, 0x1a, 0xbe, 0x44, 0x7c, 0x63,
3065 0x09, 0x4f, 0x7c, 0x45, 0x3b, 0x7f, 0xf8, 0x7c,
3066 0xb5, 0xbb, 0x36, 0xb7, 0xc7, 0x9e, 0xfb, 0x08,
3067 0x72, 0xd1, 0x70, 0x58, 0xb8, 0x3b, 0x15, 0xab,
3068 0x08, 0x66, 0xad, 0x8a, 0x58, 0x65, 0x6c, 0x5a,
3069 0x7e, 0x20, 0xdb, 0xdf, 0x30, 0x8b, 0x24, 0x61,
3070 0xd9, 0x7c, 0x0e, 0xc0, 0x02, 0x4a, 0x27, 0x15,
3071 0x05, 0x52, 0x49, 0xcf, 0x3b, 0x47, 0x8d, 0xdd,
3072 0x47, 0x40, 0xde, 0x65, 0x4f, 0x75, 0xca, 0x68,
3073 0x6e, 0x0d, 0x73, 0x45, 0xc6, 0x9e, 0xd5, 0x0c,
3074 0xdc, 0x2a, 0x8b, 0x33, 0x2b, 0x1f, 0x88, 0x24,
3075 0x10, 0x8a, 0xc9, 0x37, 0xeb, 0x05, 0x05, 0x85,
3076 0x60, 0x8e, 0xe7, 0x34, 0x09, 0x7f, 0xc0, 0x90,
3077 0x54, 0xfb, 0xff, 0x89, 0xee, 0xae, 0xea, 0x79,
3078 0x1f, 0x4a, 0x7a, 0xb1, 0xf9, 0x86, 0x82, 0x94,
3079 0xa4, 0xf9, 0xe2, 0x7b, 0x42, 0xaf, 0x81, 0x00,
3080 0xcb, 0x9d, 0x59, 0xce, 0xf9, 0x64, 0x58, 0x03,
3081 };
3082
3083 const struct testvec aes_xts_512_vectors[] = {
3084 {
3085 .blkno = 0xff,
3086 .ptxt = aes_xts_512_vec10_ptxt,
3087 .ctxt = aes_xts_512_vec10_ctxt,
3088 },
3089 {
3090 .blkno = 0xffff,
3091 .ptxt = aes_xts_512_vec11_ptxt,
3092 .ctxt = aes_xts_512_vec11_ctxt,
3093 },
3094 };
3095
3096 static int
open_disk(const char * devpath,const char * imgpath,size_t size)3097 open_disk(const char *devpath, const char *imgpath, size_t size)
3098 {
3099 int fd;
3100
3101 fd = open(imgpath, O_CREAT | O_RDWR | O_TRUNC, 0600);
3102 if (fd < 0)
3103 return -1;
3104
3105 if (ftruncate(fd, size) < 0)
3106 goto fail;
3107
3108 if (rump_pub_etfs_register_withsize(devpath,
3109 imgpath, RUMP_ETFS_BLK, 0, size) < 0) {
3110 goto fail;
3111 }
3112
3113 unlink(imgpath);
3114 return fd;
3115 fail:
3116 close(fd);
3117 unlink(imgpath);
3118 return -1;
3119 }
3120
3121 static int
open_cgd(int devno)3122 open_cgd(int devno)
3123 {
3124 char devpath[32];
3125
3126 sprintf(devpath, "/dev/rcgd%d%c", devno, getrawpartition() + 'a');
3127
3128 return rump_sys_open(devpath, O_RDWR, 0);
3129 }
3130
3131 static int
configure_cgd(int fd,const char * dkpath,const char * alg,const char * ivmethod,const char * key,size_t keylen)3132 configure_cgd(int fd, const char *dkpath, const char *alg,
3133 const char *ivmethod, const char *key, size_t keylen)
3134 {
3135 struct cgd_ioctl ci;
3136
3137 memset(&ci, 0, sizeof(ci));
3138 ci.ci_disk = dkpath;
3139 ci.ci_alg = alg;
3140 ci.ci_ivmethod = ivmethod;
3141 ci.ci_keylen = 8 * keylen - 8; /* Exclude the NUL terminator. */
3142 ci.ci_key = key;
3143 ci.ci_blocksize = 128;
3144
3145 return rump_sys_ioctl(fd, CGDIOCSET, &ci);
3146 }
3147
3148 static int
unconfigure_cgd(int fd)3149 unconfigure_cgd(int fd)
3150 {
3151 struct cgd_ioctl ci;
3152
3153 return rump_sys_ioctl(fd, CGDIOCCLR, &ci);
3154 }
3155
3156 static int
write_testvec(int cgdfd,const struct testvec * tv)3157 write_testvec(int cgdfd, const struct testvec *tv)
3158 {
3159 ssize_t written;
3160
3161 if (rump_sys_lseek(cgdfd, tv->blkno * SECSIZE, SEEK_SET) < 0)
3162 return -1;
3163
3164 written = rump_sys_write(cgdfd, tv->ptxt, SECSIZE);
3165 if (written < 0)
3166 return -1;
3167 if (written != SECSIZE) {
3168 errno = EDOM; /* Something distinct. */
3169 return -1;
3170 }
3171
3172 return 0;
3173 }
3174
3175 static int
read_testvec(int cgdfd,const struct testvec * tv)3176 read_testvec(int cgdfd, const struct testvec *tv)
3177 {
3178 char *buf;
3179 int res = -1;
3180
3181 buf = malloc(SECSIZE);
3182 if (buf == NULL)
3183 return -1;
3184
3185 if (rump_sys_lseek(cgdfd, tv->blkno * SECSIZE, SEEK_SET) < 0)
3186 goto fail;
3187
3188 if (rump_sys_read(cgdfd, buf, SECSIZE) != SECSIZE)
3189 goto fail;
3190
3191 res = memcmp(buf, tv->ptxt, SECSIZE);
3192 fail:
3193 free(buf);
3194 return res;
3195 }
3196
3197 static int
check_testvec(int dkfd,const struct testvec * tv)3198 check_testvec(int dkfd, const struct testvec *tv)
3199 {
3200 char *buf;
3201 int res = -1;
3202
3203 buf = malloc(SECSIZE);
3204 if (buf == NULL)
3205 return -1;
3206
3207 if (lseek(dkfd, tv->blkno * SECSIZE, SEEK_SET) < 0)
3208 goto fail;
3209
3210 if (read(dkfd, buf, SECSIZE) != SECSIZE)
3211 goto fail;
3212
3213 res = memcmp(buf, tv->ctxt, SECSIZE);
3214 fail:
3215 free(buf);
3216 return res;
3217 }
3218
3219 ATF_TC(cgd_aes_cbc_128_encblkno1);
ATF_TC_HEAD(cgd_aes_cbc_128_encblkno1,tc)3220 ATF_TC_HEAD(cgd_aes_cbc_128_encblkno1, tc)
3221 {
3222 atf_tc_set_md_var(tc, "descr",
3223 "Test aes-cbc with 128 bits key, ivmethod encblkno1");
3224 }
3225
ATF_TC_BODY(cgd_aes_cbc_128_encblkno1,tc)3226 ATF_TC_BODY(cgd_aes_cbc_128_encblkno1, tc)
3227 {
3228 const char imgpath[] = "aes-cbc-128-encblkno1.img";
3229 const char *dkpath = "/dev/dk";
3230 const size_t dksize = 4 * SECSIZE; /* Last blkno is 3. */
3231 int dkfd, cgdfd;
3232
3233 rump_init();
3234
3235 RL(dkfd = open_disk(dkpath, imgpath, dksize));
3236
3237 RL(cgdfd = open_cgd(0));
3238 RL(configure_cgd(cgdfd, dkpath, "aes-cbc", "encblkno1",
3239 aes_cbc_128_key, sizeof(aes_cbc_128_key)));
3240
3241 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_128_1_vectors[0]), -1);
3242 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_128_1_vectors[1]), -1);
3243 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_128_1_vectors[2]), -1);
3244 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_128_1_vectors[3]), -1);
3245
3246 RL(unconfigure_cgd(cgdfd));
3247 RL(configure_cgd(cgdfd, dkpath, "aes-cbc", "encblkno1",
3248 aes_cbc_128_key, sizeof(aes_cbc_128_key)));
3249
3250 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_128_1_vectors[0]), 0);
3251 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_128_1_vectors[1]), 0);
3252 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_128_1_vectors[2]), 0);
3253 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_128_1_vectors[3]), 0);
3254
3255 RL(unconfigure_cgd(cgdfd));
3256 RL(rump_sys_close(cgdfd));
3257
3258 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_128_1_vectors[0]), 0);
3259 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_128_1_vectors[1]), 0);
3260 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_128_1_vectors[2]), 0);
3261 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_128_1_vectors[3]), 0);
3262
3263 RL(close(dkfd));
3264 }
3265
3266 ATF_TC(cgd_aes_cbc_128_encblkno8);
ATF_TC_HEAD(cgd_aes_cbc_128_encblkno8,tc)3267 ATF_TC_HEAD(cgd_aes_cbc_128_encblkno8, tc)
3268 {
3269 atf_tc_set_md_var(tc, "descr",
3270 "Test aes-cbc with 128 bits key, ivmethod encblkno8");
3271 }
3272
ATF_TC_BODY(cgd_aes_cbc_128_encblkno8,tc)3273 ATF_TC_BODY(cgd_aes_cbc_128_encblkno8, tc)
3274 {
3275 const char imgpath[] = "aes-cbc-128-encblkno8.img";
3276 const char *dkpath = "/dev/dk";
3277 const size_t dksize = 4 * SECSIZE; /* Last blkno is 3. */
3278 int dkfd, cgdfd;
3279
3280 rump_init();
3281
3282 RL(dkfd = open_disk(dkpath, imgpath, dksize));
3283
3284 RL(cgdfd = open_cgd(0));
3285 RL(configure_cgd(cgdfd, dkpath, "aes-cbc", "encblkno8",
3286 aes_cbc_128_key, sizeof(aes_cbc_128_key)));
3287
3288 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_128_8_vectors[0]), -1);
3289 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_128_8_vectors[1]), -1);
3290 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_128_8_vectors[2]), -1);
3291 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_128_8_vectors[3]), -1);
3292
3293 RL(unconfigure_cgd(cgdfd));
3294 RL(configure_cgd(cgdfd, dkpath, "aes-cbc", "encblkno8",
3295 aes_cbc_128_key, sizeof(aes_cbc_128_key)));
3296
3297 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_128_8_vectors[0]), 0);
3298 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_128_8_vectors[1]), 0);
3299 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_128_8_vectors[2]), 0);
3300 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_128_8_vectors[3]), 0);
3301
3302 RL(unconfigure_cgd(cgdfd));
3303 RL(rump_sys_close(cgdfd));
3304
3305 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_128_8_vectors[0]), 0);
3306 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_128_8_vectors[1]), 0);
3307 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_128_8_vectors[2]), 0);
3308 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_128_8_vectors[3]), 0);
3309
3310 RL(close(dkfd));
3311 }
3312
3313 ATF_TC(cgd_aes_cbc_192_encblkno1);
ATF_TC_HEAD(cgd_aes_cbc_192_encblkno1,tc)3314 ATF_TC_HEAD(cgd_aes_cbc_192_encblkno1, tc)
3315 {
3316 atf_tc_set_md_var(tc, "descr",
3317 "Test aes-cbc with 192 bits key, ivmethod encblkno1");
3318 }
3319
ATF_TC_BODY(cgd_aes_cbc_192_encblkno1,tc)3320 ATF_TC_BODY(cgd_aes_cbc_192_encblkno1, tc)
3321 {
3322 const char imgpath[] = "aes-cbc-192-encblkno1.img";
3323 const char *dkpath = "/dev/dk";
3324 const size_t dksize = 4 * SECSIZE; /* Last blkno is 3. */
3325 int dkfd, cgdfd;
3326
3327 rump_init();
3328
3329 RL(dkfd = open_disk(dkpath, imgpath, dksize));
3330
3331 RL(cgdfd = open_cgd(0));
3332 RL(configure_cgd(cgdfd, dkpath, "aes-cbc", "encblkno1",
3333 aes_cbc_192_key, sizeof(aes_cbc_192_key)));
3334
3335 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_192_1_vectors[0]), -1);
3336 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_192_1_vectors[1]), -1);
3337 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_192_1_vectors[2]), -1);
3338 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_192_1_vectors[3]), -1);
3339
3340 RL(unconfigure_cgd(cgdfd));
3341 RL(configure_cgd(cgdfd, dkpath, "aes-cbc", "encblkno1",
3342 aes_cbc_192_key, sizeof(aes_cbc_192_key)));
3343
3344 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_192_1_vectors[0]), 0);
3345 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_192_1_vectors[1]), 0);
3346 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_192_1_vectors[2]), 0);
3347 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_192_1_vectors[3]), 0);
3348
3349 RL(unconfigure_cgd(cgdfd));
3350 RL(rump_sys_close(cgdfd));
3351
3352 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_192_1_vectors[0]), 0);
3353 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_192_1_vectors[1]), 0);
3354 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_192_1_vectors[2]), 0);
3355 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_192_1_vectors[3]), 0);
3356
3357 RL(close(dkfd));
3358 }
3359
3360 ATF_TC(cgd_aes_cbc_192_encblkno8);
ATF_TC_HEAD(cgd_aes_cbc_192_encblkno8,tc)3361 ATF_TC_HEAD(cgd_aes_cbc_192_encblkno8, tc)
3362 {
3363 atf_tc_set_md_var(tc, "descr",
3364 "Test aes-cbc with 192 bits key, ivmethod encblkno8");
3365 }
3366
ATF_TC_BODY(cgd_aes_cbc_192_encblkno8,tc)3367 ATF_TC_BODY(cgd_aes_cbc_192_encblkno8, tc)
3368 {
3369 const char imgpath[] = "aes-cbc-192-encblkno8.img";
3370 const char *dkpath = "/dev/dk";
3371 const size_t dksize = 4 * SECSIZE; /* Last blkno is 3. */
3372 int dkfd, cgdfd;
3373
3374 rump_init();
3375
3376 RL(dkfd = open_disk(dkpath, imgpath, dksize));
3377
3378 RL(cgdfd = open_cgd(0));
3379 RL(configure_cgd(cgdfd, dkpath, "aes-cbc", "encblkno8",
3380 aes_cbc_192_key, sizeof(aes_cbc_192_key)));
3381
3382 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_192_8_vectors[0]), -1);
3383 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_192_8_vectors[1]), -1);
3384 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_192_8_vectors[2]), -1);
3385 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_192_8_vectors[3]), -1);
3386
3387 RL(unconfigure_cgd(cgdfd));
3388 RL(configure_cgd(cgdfd, dkpath, "aes-cbc", "encblkno8",
3389 aes_cbc_192_key, sizeof(aes_cbc_192_key)));
3390
3391 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_192_8_vectors[0]), 0);
3392 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_192_8_vectors[1]), 0);
3393 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_192_8_vectors[2]), 0);
3394 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_192_8_vectors[3]), 0);
3395
3396 RL(unconfigure_cgd(cgdfd));
3397 RL(rump_sys_close(cgdfd));
3398
3399 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_192_8_vectors[0]), 0);
3400 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_192_8_vectors[1]), 0);
3401 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_192_8_vectors[2]), 0);
3402 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_192_8_vectors[3]), 0);
3403
3404 RL(close(dkfd));
3405 }
3406
3407 ATF_TC(cgd_aes_cbc_256_encblkno1);
ATF_TC_HEAD(cgd_aes_cbc_256_encblkno1,tc)3408 ATF_TC_HEAD(cgd_aes_cbc_256_encblkno1, tc)
3409 {
3410 atf_tc_set_md_var(tc, "descr",
3411 "Test aes-cbc with 256 bits key, ivmethod encblkno1");
3412 }
3413
ATF_TC_BODY(cgd_aes_cbc_256_encblkno1,tc)3414 ATF_TC_BODY(cgd_aes_cbc_256_encblkno1, tc)
3415 {
3416 const char imgpath[] = "aes-cbc-256-encblkno1.img";
3417 const char *dkpath = "/dev/dk";
3418 const size_t dksize = 4 * SECSIZE; /* Last blkno is 3. */
3419 int dkfd, cgdfd;
3420
3421 rump_init();
3422
3423 RL(dkfd = open_disk(dkpath, imgpath, dksize));
3424
3425 RL(cgdfd = open_cgd(0));
3426 RL(configure_cgd(cgdfd, dkpath, "aes-cbc", "encblkno1",
3427 aes_cbc_256_key, sizeof(aes_cbc_256_key)));
3428
3429 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_256_1_vectors[0]), -1);
3430 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_256_1_vectors[1]), -1);
3431 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_256_1_vectors[2]), -1);
3432 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_256_1_vectors[3]), -1);
3433
3434 RL(unconfigure_cgd(cgdfd));
3435 RL(configure_cgd(cgdfd, dkpath, "aes-cbc", "encblkno1",
3436 aes_cbc_256_key, sizeof(aes_cbc_256_key)));
3437
3438 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_256_1_vectors[0]), 0);
3439 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_256_1_vectors[1]), 0);
3440 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_256_1_vectors[2]), 0);
3441 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_256_1_vectors[3]), 0);
3442
3443 RL(unconfigure_cgd(cgdfd));
3444 RL(rump_sys_close(cgdfd));
3445
3446 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_256_1_vectors[0]), 0);
3447 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_256_1_vectors[1]), 0);
3448 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_256_1_vectors[2]), 0);
3449 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_256_1_vectors[3]), 0);
3450
3451 RL(close(dkfd));
3452 }
3453
3454 ATF_TC(cgd_aes_cbc_256_encblkno8);
ATF_TC_HEAD(cgd_aes_cbc_256_encblkno8,tc)3455 ATF_TC_HEAD(cgd_aes_cbc_256_encblkno8, tc)
3456 {
3457 atf_tc_set_md_var(tc, "descr",
3458 "Test aes-cbc with 256 bits key, ivmethod encblkno8");
3459 }
3460
ATF_TC_BODY(cgd_aes_cbc_256_encblkno8,tc)3461 ATF_TC_BODY(cgd_aes_cbc_256_encblkno8, tc)
3462 {
3463 const char imgpath[] = "aes-cbc-256-encblkno8.img";
3464 const char *dkpath = "/dev/dk";
3465 const size_t dksize = 4 * SECSIZE; /* Last blkno is 3. */
3466 int dkfd, cgdfd;
3467
3468 rump_init();
3469
3470 RL(dkfd = open_disk(dkpath, imgpath, dksize));
3471
3472 RL(cgdfd = open_cgd(0));
3473 RL(configure_cgd(cgdfd, dkpath, "aes-cbc", "encblkno8",
3474 aes_cbc_256_key, sizeof(aes_cbc_256_key)));
3475
3476 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_256_8_vectors[0]), -1);
3477 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_256_8_vectors[1]), -1);
3478 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_256_8_vectors[2]), -1);
3479 CHECK_LIBC(write_testvec(cgdfd, &aes_cbc_256_8_vectors[3]), -1);
3480
3481 RL(unconfigure_cgd(cgdfd));
3482 RL(configure_cgd(cgdfd, dkpath, "aes-cbc", "encblkno8",
3483 aes_cbc_256_key, sizeof(aes_cbc_256_key)));
3484
3485 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_256_8_vectors[0]), 0);
3486 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_256_8_vectors[1]), 0);
3487 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_256_8_vectors[2]), 0);
3488 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_cbc_256_8_vectors[3]), 0);
3489
3490 RL(unconfigure_cgd(cgdfd));
3491 RL(rump_sys_close(cgdfd));
3492
3493 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_256_8_vectors[0]), 0);
3494 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_256_8_vectors[1]), 0);
3495 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_256_8_vectors[2]), 0);
3496 ATF_CHECK_EQ(check_testvec(dkfd, &aes_cbc_256_8_vectors[3]), 0);
3497
3498 RL(close(dkfd));
3499 }
3500
3501 ATF_TC(cgd_aes_xts_256);
ATF_TC_HEAD(cgd_aes_xts_256,tc)3502 ATF_TC_HEAD(cgd_aes_xts_256, tc)
3503 {
3504 atf_tc_set_md_var(tc, "descr", "Test aes-xts with 256 bits key");
3505 }
3506
ATF_TC_BODY(cgd_aes_xts_256,tc)3507 ATF_TC_BODY(cgd_aes_xts_256, tc)
3508 {
3509 const char imgpath[] = "aes-xts-256.img";
3510 const char *dkpath = "/dev/dk";
3511 const size_t dksize = 256 * SECSIZE; /* Last blkno is 0xff. */
3512 int dkfd, cgdfd;
3513
3514 rump_init();
3515
3516 RL(dkfd = open_disk(dkpath, imgpath, dksize));
3517
3518 RL(cgdfd = open_cgd(0));
3519 RL(configure_cgd(cgdfd, dkpath, "aes-xts", "encblkno1",
3520 aes_xts_256_key, sizeof(aes_xts_256_key)));
3521
3522 CHECK_LIBC(write_testvec(cgdfd, &aes_xts_256_vectors[0]), -1);
3523 CHECK_LIBC(write_testvec(cgdfd, &aes_xts_256_vectors[1]), -1);
3524 CHECK_LIBC(write_testvec(cgdfd, &aes_xts_256_vectors[2]), -1);
3525 CHECK_LIBC(write_testvec(cgdfd, &aes_xts_256_vectors[3]), -1);
3526 CHECK_LIBC(write_testvec(cgdfd, &aes_xts_256_vectors[4]), -1);
3527 CHECK_LIBC(write_testvec(cgdfd, &aes_xts_256_vectors[5]), -1);
3528
3529 RL(unconfigure_cgd(cgdfd));
3530 RL(configure_cgd(cgdfd, dkpath, "aes-xts", "encblkno1",
3531 aes_xts_256_key, sizeof(aes_xts_256_key)));
3532
3533 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_xts_256_vectors[0]), 0);
3534 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_xts_256_vectors[1]), 0);
3535 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_xts_256_vectors[2]), 0);
3536 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_xts_256_vectors[3]), 0);
3537 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_xts_256_vectors[4]), 0);
3538 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_xts_256_vectors[5]), 0);
3539
3540 RL(unconfigure_cgd(cgdfd));
3541 RL(rump_sys_close(cgdfd));
3542
3543 ATF_CHECK_EQ(check_testvec(dkfd, &aes_xts_256_vectors[0]), 0);
3544 ATF_CHECK_EQ(check_testvec(dkfd, &aes_xts_256_vectors[1]), 0);
3545 ATF_CHECK_EQ(check_testvec(dkfd, &aes_xts_256_vectors[2]), 0);
3546 ATF_CHECK_EQ(check_testvec(dkfd, &aes_xts_256_vectors[3]), 0);
3547 ATF_CHECK_EQ(check_testvec(dkfd, &aes_xts_256_vectors[4]), 0);
3548 ATF_CHECK_EQ(check_testvec(dkfd, &aes_xts_256_vectors[5]), 0);
3549
3550 RL(close(dkfd));
3551 }
3552
3553 ATF_TC(cgd_aes_xts_512);
ATF_TC_HEAD(cgd_aes_xts_512,tc)3554 ATF_TC_HEAD(cgd_aes_xts_512, tc)
3555 {
3556 atf_tc_set_md_var(tc, "descr", "Test aes-xts with 512 bits key");
3557 }
3558
ATF_TC_BODY(cgd_aes_xts_512,tc)3559 ATF_TC_BODY(cgd_aes_xts_512, tc)
3560 {
3561 const char imgpath[] = "aes-xts-512.img";
3562 const char *dkpath = "/dev/dk";
3563 const size_t dksize = 65536 * SECSIZE; /* Last blkno is 0xffff. */
3564 int dkfd, cgdfd;
3565
3566 rump_init();
3567
3568 RL(dkfd = open_disk(dkpath, imgpath, dksize));
3569
3570 RL(cgdfd = open_cgd(0));
3571 RL(configure_cgd(cgdfd, dkpath, "aes-xts", "encblkno1",
3572 aes_xts_512_key, sizeof(aes_xts_512_key)));
3573
3574 CHECK_LIBC(write_testvec(cgdfd, &aes_xts_512_vectors[0]), -1);
3575 CHECK_LIBC(write_testvec(cgdfd, &aes_xts_512_vectors[1]), -1);
3576
3577 RL(unconfigure_cgd(cgdfd));
3578 RL(configure_cgd(cgdfd, dkpath, "aes-xts", "encblkno1",
3579 aes_xts_512_key, sizeof(aes_xts_512_key)));
3580
3581 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_xts_512_vectors[0]), 0);
3582 ATF_CHECK_EQ(read_testvec(cgdfd, &aes_xts_512_vectors[1]), 0);
3583
3584 RL(unconfigure_cgd(cgdfd));
3585 RL(rump_sys_close(cgdfd));
3586
3587 ATF_CHECK_EQ(check_testvec(dkfd, &aes_xts_512_vectors[0]), 0);
3588 ATF_CHECK_EQ(check_testvec(dkfd, &aes_xts_512_vectors[1]), 0);
3589
3590 RL(close(dkfd));
3591 }
3592
ATF_TP_ADD_TCS(tp)3593 ATF_TP_ADD_TCS(tp)
3594 {
3595
3596 ATF_TP_ADD_TC(tp, cgd_aes_cbc_128_encblkno1);
3597 ATF_TP_ADD_TC(tp, cgd_aes_cbc_128_encblkno8);
3598 ATF_TP_ADD_TC(tp, cgd_aes_cbc_192_encblkno1);
3599 ATF_TP_ADD_TC(tp, cgd_aes_cbc_192_encblkno8);
3600 ATF_TP_ADD_TC(tp, cgd_aes_cbc_256_encblkno1);
3601 ATF_TP_ADD_TC(tp, cgd_aes_cbc_256_encblkno8);
3602 ATF_TP_ADD_TC(tp, cgd_aes_xts_256);
3603 ATF_TP_ADD_TC(tp, cgd_aes_xts_512);
3604
3605 return atf_no_error();
3606 }
3607