t_cgd_3des.c revision 1.1.2.2 1 1.1.2.2 pgoyette /* $NetBSD: t_cgd_3des.c,v 1.1.2.2 2017/01/07 08:56:54 pgoyette Exp $ */
2 1.1.2.2 pgoyette /*-
3 1.1.2.2 pgoyette * Copyright (c) 2016 The NetBSD Foundation, Inc.
4 1.1.2.2 pgoyette * All rights reserved.
5 1.1.2.2 pgoyette *
6 1.1.2.2 pgoyette * This code is derived from software contributed to The NetBSD Foundation
7 1.1.2.2 pgoyette * by Alexander Nasonov.
8 1.1.2.2 pgoyette *
9 1.1.2.2 pgoyette * Redistribution and use in source and binary forms, with or without
10 1.1.2.2 pgoyette * modification, are permitted provided that the following conditions
11 1.1.2.2 pgoyette * are met:
12 1.1.2.2 pgoyette *
13 1.1.2.2 pgoyette * 1. Redistributions of source code must retain the above copyright
14 1.1.2.2 pgoyette * notice, this list of conditions and the following disclaimer.
15 1.1.2.2 pgoyette * 2. Redistributions in binary form must reproduce the above copyright
16 1.1.2.2 pgoyette * notice, this list of conditions and the following disclaimer in
17 1.1.2.2 pgoyette * the documentation and/or other materials provided with the
18 1.1.2.2 pgoyette * distribution.
19 1.1.2.2 pgoyette *
20 1.1.2.2 pgoyette * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 1.1.2.2 pgoyette * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 1.1.2.2 pgoyette * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 1.1.2.2 pgoyette * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24 1.1.2.2 pgoyette * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25 1.1.2.2 pgoyette * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
26 1.1.2.2 pgoyette * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 1.1.2.2 pgoyette * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28 1.1.2.2 pgoyette * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 1.1.2.2 pgoyette * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30 1.1.2.2 pgoyette * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 1.1.2.2 pgoyette * SUCH DAMAGE.
32 1.1.2.2 pgoyette */
33 1.1.2.2 pgoyette
34 1.1.2.2 pgoyette #include <sys/types.h>
35 1.1.2.2 pgoyette #include <sys/ioctl.h>
36 1.1.2.2 pgoyette #include <sys/sysctl.h>
37 1.1.2.2 pgoyette
38 1.1.2.2 pgoyette #include <atf-c.h>
39 1.1.2.2 pgoyette #include <fcntl.h>
40 1.1.2.2 pgoyette #include <stdio.h>
41 1.1.2.2 pgoyette #include <stdlib.h>
42 1.1.2.2 pgoyette #include <string.h>
43 1.1.2.2 pgoyette #include <unistd.h>
44 1.1.2.2 pgoyette #include <util.h>
45 1.1.2.2 pgoyette
46 1.1.2.2 pgoyette #include <dev/cgdvar.h>
47 1.1.2.2 pgoyette
48 1.1.2.2 pgoyette #include <rump/rump.h>
49 1.1.2.2 pgoyette #include <rump/rump_syscalls.h>
50 1.1.2.2 pgoyette
51 1.1.2.2 pgoyette #include "../../h_macros.h"
52 1.1.2.2 pgoyette
53 1.1.2.2 pgoyette #define SECSIZE 512
54 1.1.2.2 pgoyette
55 1.1.2.2 pgoyette struct testvec {
56 1.1.2.2 pgoyette unsigned int blkno;
57 1.1.2.2 pgoyette const uint8_t *ptxt; /* PlainText */
58 1.1.2.2 pgoyette const uint8_t *ctxt; /* CipherText */
59 1.1.2.2 pgoyette };
60 1.1.2.2 pgoyette
61 1.1.2.2 pgoyette /*
62 1.1.2.2 pgoyette * 192 bits CBC key, NUL terminated.
63 1.1.2.2 pgoyette */
64 1.1.2.2 pgoyette static const char c3des_cbc_192_key[25] = {
65 1.1.2.2 pgoyette 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, /* ABCDEFGH */
66 1.1.2.2 pgoyette 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, /* IJKLMNOP */
67 1.1.2.2 pgoyette 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, /* QRSTUVWX */
68 1.1.2.2 pgoyette 0
69 1.1.2.2 pgoyette };
70 1.1.2.2 pgoyette
71 1.1.2.2 pgoyette static const uint8_t c3des_cbc_ptxt[SECSIZE] =
72 1.1.2.2 pgoyette " abcdefghijklmnop"
73 1.1.2.2 pgoyette " abcdefghijklmnop"
74 1.1.2.2 pgoyette " abcdefghijklmnop"
75 1.1.2.2 pgoyette " abcdefghijklmnop"
76 1.1.2.2 pgoyette " abcdefghijklmnop"
77 1.1.2.2 pgoyette " abcdefghijklmnop"
78 1.1.2.2 pgoyette " abcdefghijklmnop"
79 1.1.2.2 pgoyette " abcdefghijklmnop"
80 1.1.2.2 pgoyette " abcdefghijklmnop"
81 1.1.2.2 pgoyette " abcdefghijklmnop"
82 1.1.2.2 pgoyette " abcdefghijklmnop"
83 1.1.2.2 pgoyette " abcdefghijklmnop"
84 1.1.2.2 pgoyette " abcdefghijklmnop"
85 1.1.2.2 pgoyette " abcdefghijklmnop"
86 1.1.2.2 pgoyette " abcdefghijklmnop"
87 1.1.2.2 pgoyette " abcdefghijklmnop";
88 1.1.2.2 pgoyette
89 1.1.2.2 pgoyette /*
90 1.1.2.2 pgoyette * IV method encblkno1, blkno 0.
91 1.1.2.2 pgoyette */
92 1.1.2.2 pgoyette static const uint8_t c3des_cbc_192_encblkno1_vec0_ctxt[SECSIZE] = {
93 1.1.2.2 pgoyette 0x19, 0x92, 0xc8, 0xce, 0xdf, 0xa3, 0x14, 0xef,
94 1.1.2.2 pgoyette 0xff, 0x88, 0x9f, 0x01, 0xfa, 0x6f, 0xfa, 0xa6,
95 1.1.2.2 pgoyette 0xdd, 0x2b, 0x43, 0x67, 0xfa, 0xce, 0x37, 0x95,
96 1.1.2.2 pgoyette 0x73, 0x4d, 0x18, 0x33, 0x0c, 0x29, 0xb6, 0xbb,
97 1.1.2.2 pgoyette 0x37, 0x77, 0x31, 0x74, 0xf6, 0x62, 0x03, 0xd2,
98 1.1.2.2 pgoyette 0x78, 0x13, 0x55, 0xf6, 0x58, 0x49, 0xaf, 0x2a,
99 1.1.2.2 pgoyette 0x15, 0x4c, 0xc2, 0x4a, 0x55, 0x99, 0x82, 0xb9,
100 1.1.2.2 pgoyette 0xfb, 0x8b, 0x4f, 0x92, 0xe3, 0xbc, 0x9b, 0x09,
101 1.1.2.2 pgoyette 0x42, 0x7b, 0x5f, 0x54, 0xed, 0xf0, 0xcb, 0x5d,
102 1.1.2.2 pgoyette 0x93, 0xba, 0x09, 0x4b, 0x20, 0xf3, 0xe6, 0x44,
103 1.1.2.2 pgoyette 0x30, 0x5e, 0x9e, 0xfc, 0x7a, 0x3c, 0x7d, 0x11,
104 1.1.2.2 pgoyette 0x63, 0xea, 0x40, 0x94, 0xaa, 0xd0, 0xa9, 0xf6,
105 1.1.2.2 pgoyette 0xc7, 0x1e, 0x8f, 0xc8, 0xa6, 0x2c, 0xf7, 0xeb,
106 1.1.2.2 pgoyette 0x51, 0x26, 0xdc, 0xf8, 0x73, 0xf9, 0xb4, 0xa8,
107 1.1.2.2 pgoyette 0x80, 0x4a, 0xe5, 0x6f, 0xb6, 0x33, 0x13, 0x6b,
108 1.1.2.2 pgoyette 0x1b, 0x7d, 0x00, 0xde, 0x44, 0x7e, 0x26, 0xa2,
109 1.1.2.2 pgoyette 0x82, 0xa7, 0x80, 0x16, 0x34, 0xde, 0xb9, 0x82,
110 1.1.2.2 pgoyette 0x4c, 0x42, 0x8e, 0x0d, 0x48, 0x7e, 0x38, 0xbd,
111 1.1.2.2 pgoyette 0x1d, 0x7d, 0x98, 0xbb, 0x11, 0x8a, 0x72, 0x14,
112 1.1.2.2 pgoyette 0x4e, 0xaa, 0xd0, 0xef, 0x4d, 0x7f, 0xa3, 0xa6,
113 1.1.2.2 pgoyette 0xfc, 0x85, 0x9d, 0x74, 0x63, 0x9d, 0xe4, 0x5c,
114 1.1.2.2 pgoyette 0xf7, 0xa8, 0xd0, 0xd7, 0x95, 0xb4, 0x28, 0x64,
115 1.1.2.2 pgoyette 0x41, 0x2d, 0x5d, 0xd9, 0xba, 0x79, 0xa7, 0xb3,
116 1.1.2.2 pgoyette 0x9c, 0x16, 0xfa, 0xb8, 0x10, 0x5d, 0x1d, 0xd4,
117 1.1.2.2 pgoyette 0xce, 0xad, 0x67, 0x27, 0x91, 0x8a, 0xb3, 0xbc,
118 1.1.2.2 pgoyette 0x37, 0x20, 0x95, 0xac, 0xf7, 0x0d, 0xe0, 0x1e,
119 1.1.2.2 pgoyette 0x59, 0xa7, 0xe5, 0x81, 0x82, 0x6a, 0x71, 0x07,
120 1.1.2.2 pgoyette 0x85, 0x43, 0x43, 0xdb, 0xbf, 0x56, 0xb0, 0x0a,
121 1.1.2.2 pgoyette 0x4c, 0xf1, 0xcd, 0xcd, 0xa3, 0x9a, 0x10, 0x8e,
122 1.1.2.2 pgoyette 0x0c, 0xe2, 0x6d, 0xf2, 0x16, 0xd0, 0x4c, 0xac,
123 1.1.2.2 pgoyette 0xf9, 0xfc, 0xc9, 0x56, 0x1f, 0x31, 0x89, 0x1c,
124 1.1.2.2 pgoyette 0xfa, 0xb7, 0x49, 0xea, 0x69, 0x91, 0xfe, 0x45,
125 1.1.2.2 pgoyette 0x96, 0x5e, 0x45, 0xc3, 0x2c, 0xb1, 0x40, 0xd9,
126 1.1.2.2 pgoyette 0x1f, 0x82, 0x3f, 0xc1, 0x45, 0x7c, 0x39, 0x72,
127 1.1.2.2 pgoyette 0x6f, 0x52, 0xe4, 0xaf, 0x15, 0xa4, 0xe2, 0xd4,
128 1.1.2.2 pgoyette 0xa1, 0xa4, 0xb2, 0xb5, 0x4a, 0x0b, 0xad, 0xe4,
129 1.1.2.2 pgoyette 0x1e, 0x5c, 0x26, 0x62, 0x81, 0x78, 0x3e, 0xd3,
130 1.1.2.2 pgoyette 0x6a, 0x98, 0x94, 0x2a, 0x00, 0xa7, 0xe4, 0x04,
131 1.1.2.2 pgoyette 0x9d, 0x9a, 0xfc, 0xcf, 0xad, 0x2b, 0xba, 0x9b,
132 1.1.2.2 pgoyette 0x40, 0x1e, 0x71, 0x3a, 0xb6, 0x92, 0xc4, 0xc5,
133 1.1.2.2 pgoyette 0x56, 0x58, 0x92, 0x2a, 0x69, 0xbe, 0x0f, 0xb0,
134 1.1.2.2 pgoyette 0x91, 0xae, 0xaa, 0x3f, 0x07, 0xe8, 0xf9, 0x71,
135 1.1.2.2 pgoyette 0x20, 0x06, 0xed, 0xe0, 0x80, 0xec, 0xc9, 0xe7,
136 1.1.2.2 pgoyette 0x54, 0xaa, 0xaa, 0xf4, 0x4c, 0xb2, 0x34, 0xf7,
137 1.1.2.2 pgoyette 0x8a, 0x76, 0xc2, 0x4a, 0xae, 0x71, 0x7a, 0x07,
138 1.1.2.2 pgoyette 0xd7, 0xec, 0x75, 0x2f, 0x8a, 0x99, 0x59, 0x13,
139 1.1.2.2 pgoyette 0xd0, 0x8d, 0x18, 0x69, 0x0d, 0xd9, 0x39, 0x73,
140 1.1.2.2 pgoyette 0x2b, 0xd0, 0xa3, 0xbc, 0x9e, 0x29, 0x4d, 0x88,
141 1.1.2.2 pgoyette 0xff, 0x98, 0x02, 0xb4, 0xcf, 0xa1, 0xf9, 0x2a,
142 1.1.2.2 pgoyette 0xa6, 0xef, 0x7c, 0x72, 0x26, 0x4e, 0xd7, 0xdf,
143 1.1.2.2 pgoyette 0xec, 0x3a, 0xbc, 0x8e, 0xe6, 0xb3, 0x2b, 0x43,
144 1.1.2.2 pgoyette 0xcd, 0x67, 0x8b, 0x72, 0x00, 0x6f, 0xe5, 0x85,
145 1.1.2.2 pgoyette 0xe2, 0x2a, 0x4c, 0x8d, 0x02, 0x44, 0x6b, 0x7a,
146 1.1.2.2 pgoyette 0x89, 0x7a, 0x18, 0x3b, 0xc8, 0x9c, 0x8d, 0x60,
147 1.1.2.2 pgoyette 0xec, 0x79, 0x58, 0x15, 0x98, 0x71, 0x4b, 0x1a,
148 1.1.2.2 pgoyette 0x34, 0x69, 0x96, 0xd0, 0x0f, 0x01, 0x27, 0x2e,
149 1.1.2.2 pgoyette 0x19, 0x02, 0xf0, 0x17, 0x8c, 0x89, 0xbf, 0x05,
150 1.1.2.2 pgoyette 0xf0, 0xfe, 0xc3, 0xe6, 0x90, 0x9d, 0xa2, 0xb1,
151 1.1.2.2 pgoyette 0x40, 0x06, 0x7e, 0xcd, 0x20, 0x7e, 0x5f, 0x54,
152 1.1.2.2 pgoyette 0x31, 0xfb, 0x79, 0x84, 0x47, 0x38, 0x71, 0x69,
153 1.1.2.2 pgoyette 0xe1, 0xd5, 0x4e, 0x84, 0xa3, 0x2b, 0x4a, 0x86,
154 1.1.2.2 pgoyette 0xc2, 0x21, 0x5b, 0x15, 0xc3, 0x63, 0xbb, 0xc5,
155 1.1.2.2 pgoyette 0x5c, 0xc1, 0xfb, 0x31, 0x3a, 0x4d, 0xb1, 0x9e,
156 1.1.2.2 pgoyette 0xe1, 0xd8, 0x67, 0x4b, 0x08, 0x42, 0xc4, 0xe8,
157 1.1.2.2 pgoyette };
158 1.1.2.2 pgoyette
159 1.1.2.2 pgoyette /*
160 1.1.2.2 pgoyette * IV method encblkno1, blkno 1.
161 1.1.2.2 pgoyette */
162 1.1.2.2 pgoyette static const uint8_t c3des_cbc_192_encblkno1_vec1_ctxt[SECSIZE] = {
163 1.1.2.2 pgoyette 0x1d, 0x65, 0xdf, 0x01, 0x9b, 0x24, 0xa5, 0x10,
164 1.1.2.2 pgoyette 0x94, 0x9a, 0x5b, 0x81, 0x96, 0x4e, 0xa3, 0x42,
165 1.1.2.2 pgoyette 0x42, 0xd5, 0x05, 0x52, 0xab, 0x3c, 0x67, 0x40,
166 1.1.2.2 pgoyette 0x79, 0xf9, 0x4b, 0x58, 0x39, 0xf6, 0xd0, 0x97,
167 1.1.2.2 pgoyette 0x48, 0xf4, 0x77, 0xb8, 0xac, 0xe2, 0x10, 0x66,
168 1.1.2.2 pgoyette 0xa8, 0x04, 0x0a, 0x1e, 0xa6, 0xbb, 0x4c, 0xd9,
169 1.1.2.2 pgoyette 0x5d, 0x0c, 0x11, 0xb5, 0xe0, 0x26, 0x84, 0x50,
170 1.1.2.2 pgoyette 0x10, 0x80, 0xbf, 0xd6, 0xdc, 0x82, 0x53, 0x0a,
171 1.1.2.2 pgoyette 0xcf, 0xf6, 0xd3, 0x07, 0x45, 0xb0, 0x8e, 0x36,
172 1.1.2.2 pgoyette 0x2e, 0x60, 0x0f, 0xd0, 0xc1, 0xb9, 0xd8, 0x29,
173 1.1.2.2 pgoyette 0x6e, 0x13, 0x8e, 0xc1, 0xa8, 0x63, 0x20, 0xe0,
174 1.1.2.2 pgoyette 0x8d, 0x47, 0x8b, 0xf9, 0xa0, 0x60, 0x55, 0x53,
175 1.1.2.2 pgoyette 0x1d, 0xaf, 0x43, 0x46, 0xe5, 0x10, 0xd5, 0xcd,
176 1.1.2.2 pgoyette 0x91, 0x9e, 0x11, 0x4a, 0x6f, 0x6a, 0x13, 0xdf,
177 1.1.2.2 pgoyette 0xee, 0x7a, 0x88, 0xbe, 0x59, 0x96, 0xdb, 0x65,
178 1.1.2.2 pgoyette 0x25, 0x57, 0x9e, 0x82, 0xad, 0xc2, 0xd6, 0x28,
179 1.1.2.2 pgoyette 0x96, 0xb3, 0x7f, 0x57, 0x5d, 0xb2, 0xfa, 0x60,
180 1.1.2.2 pgoyette 0x43, 0x22, 0xa5, 0x33, 0x14, 0x99, 0x8f, 0x68,
181 1.1.2.2 pgoyette 0x5a, 0x7f, 0xaf, 0x9e, 0xe9, 0x23, 0x57, 0x9b,
182 1.1.2.2 pgoyette 0x52, 0xe9, 0x20, 0x59, 0x26, 0x89, 0x9b, 0x59,
183 1.1.2.2 pgoyette 0xb0, 0xee, 0xe8, 0x6d, 0x06, 0x8c, 0x01, 0xc2,
184 1.1.2.2 pgoyette 0xea, 0xbc, 0x7d, 0x93, 0x3f, 0x79, 0x7f, 0xeb,
185 1.1.2.2 pgoyette 0x57, 0xc9, 0x0a, 0xca, 0x37, 0x81, 0xa7, 0x82,
186 1.1.2.2 pgoyette 0xde, 0x37, 0x7d, 0x69, 0x01, 0xaa, 0x19, 0x98,
187 1.1.2.2 pgoyette 0x26, 0xfe, 0x06, 0x83, 0xeb, 0x9d, 0x26, 0xdc,
188 1.1.2.2 pgoyette 0x04, 0x5d, 0xc9, 0x05, 0xee, 0x1a, 0xd3, 0xeb,
189 1.1.2.2 pgoyette 0x20, 0x8c, 0xb7, 0x99, 0x75, 0xe0, 0x19, 0x98,
190 1.1.2.2 pgoyette 0xca, 0x83, 0xae, 0x94, 0x28, 0xbf, 0x47, 0x42,
191 1.1.2.2 pgoyette 0x92, 0x05, 0x8c, 0xaa, 0xeb, 0x99, 0x0f, 0xcc,
192 1.1.2.2 pgoyette 0x33, 0x79, 0x24, 0x62, 0xa0, 0x7a, 0x65, 0xcb,
193 1.1.2.2 pgoyette 0x53, 0xb7, 0x86, 0x0d, 0xcb, 0x44, 0x2d, 0xbf,
194 1.1.2.2 pgoyette 0xe8, 0x5d, 0x62, 0xeb, 0x21, 0x4d, 0x35, 0x86,
195 1.1.2.2 pgoyette 0x56, 0x6c, 0x51, 0xff, 0xa3, 0x45, 0xcc, 0x88,
196 1.1.2.2 pgoyette 0x09, 0x43, 0x08, 0x97, 0x13, 0x7d, 0x00, 0xd8,
197 1.1.2.2 pgoyette 0x82, 0x2d, 0xbe, 0xbe, 0x44, 0x0c, 0x2c, 0xa4,
198 1.1.2.2 pgoyette 0x4f, 0x84, 0x07, 0x20, 0x9c, 0x3f, 0xf6, 0x5b,
199 1.1.2.2 pgoyette 0x9e, 0xe8, 0x68, 0x40, 0xd3, 0x64, 0x8f, 0xb4,
200 1.1.2.2 pgoyette 0x9e, 0xac, 0xc6, 0x41, 0x11, 0xda, 0xf2, 0x60,
201 1.1.2.2 pgoyette 0xfa, 0x29, 0x9d, 0x26, 0x68, 0x5b, 0x79, 0x3a,
202 1.1.2.2 pgoyette 0xd1, 0x66, 0x78, 0xca, 0x80, 0x87, 0xae, 0xab,
203 1.1.2.2 pgoyette 0x7b, 0x29, 0x3c, 0xb0, 0xe6, 0xa2, 0x6b, 0x24,
204 1.1.2.2 pgoyette 0x81, 0xeb, 0x51, 0xf9, 0xcb, 0x4a, 0x08, 0x37,
205 1.1.2.2 pgoyette 0x2a, 0x75, 0xb5, 0xd3, 0xb3, 0x8f, 0x3d, 0x13,
206 1.1.2.2 pgoyette 0x11, 0x0c, 0xa9, 0xf7, 0xf6, 0x57, 0x7e, 0xb7,
207 1.1.2.2 pgoyette 0xa6, 0x22, 0xe8, 0x13, 0xfd, 0xf1, 0x6a, 0xe9,
208 1.1.2.2 pgoyette 0xc1, 0x94, 0xa6, 0xf5, 0xa5, 0xec, 0xfa, 0x31,
209 1.1.2.2 pgoyette 0xd2, 0x66, 0x8f, 0xe3, 0x6e, 0x9a, 0xaa, 0xb0,
210 1.1.2.2 pgoyette 0xe3, 0x04, 0x09, 0x00, 0x1e, 0x67, 0x3c, 0xbe,
211 1.1.2.2 pgoyette 0x2a, 0x8c, 0xd5, 0x1f, 0x4f, 0x55, 0x2c, 0x1d,
212 1.1.2.2 pgoyette 0x26, 0x7f, 0xc9, 0x27, 0x00, 0x88, 0x7d, 0x45,
213 1.1.2.2 pgoyette 0x4e, 0xe1, 0x36, 0xf6, 0xf5, 0xa8, 0xd4, 0xef,
214 1.1.2.2 pgoyette 0x8b, 0x26, 0x76, 0x41, 0x28, 0x87, 0xf4, 0x51,
215 1.1.2.2 pgoyette 0x14, 0x36, 0xad, 0x60, 0x8d, 0xe9, 0xe2, 0x9d,
216 1.1.2.2 pgoyette 0x3c, 0xea, 0x09, 0x51, 0x3c, 0x81, 0xdf, 0x1a,
217 1.1.2.2 pgoyette 0xc2, 0xc2, 0xf6, 0x45, 0xe1, 0x73, 0xac, 0xae,
218 1.1.2.2 pgoyette 0x85, 0x74, 0x83, 0x8f, 0x56, 0x3c, 0x36, 0x1c,
219 1.1.2.2 pgoyette 0xe0, 0x07, 0xc6, 0x6a, 0x48, 0xe4, 0x34, 0xe9,
220 1.1.2.2 pgoyette 0x81, 0x53, 0xb7, 0x53, 0x95, 0xa7, 0x94, 0x21,
221 1.1.2.2 pgoyette 0x7e, 0x32, 0x53, 0xda, 0x83, 0xd8, 0x57, 0x92,
222 1.1.2.2 pgoyette 0xd1, 0x15, 0x45, 0x86, 0x40, 0xac, 0xf1, 0x6f,
223 1.1.2.2 pgoyette 0x3c, 0x29, 0xef, 0x8d, 0x12, 0xe1, 0x9d, 0x04,
224 1.1.2.2 pgoyette 0x17, 0x3a, 0xcc, 0xa6, 0xc5, 0xe4, 0x27, 0x41,
225 1.1.2.2 pgoyette 0xcb, 0xfb, 0x5e, 0x77, 0x73, 0x5a, 0x2c, 0x03,
226 1.1.2.2 pgoyette 0xe9, 0x2b, 0x76, 0x4e, 0x69, 0xea, 0xcb, 0xb3,
227 1.1.2.2 pgoyette };
228 1.1.2.2 pgoyette
229 1.1.2.2 pgoyette /*
230 1.1.2.2 pgoyette * IV method encblkno1, blkno 2.
231 1.1.2.2 pgoyette */
232 1.1.2.2 pgoyette static const uint8_t c3des_cbc_192_encblkno1_vec2_ctxt[SECSIZE] = {
233 1.1.2.2 pgoyette 0x87, 0xb1, 0x3c, 0xd6, 0x60, 0xa0, 0x5a, 0x35,
234 1.1.2.2 pgoyette 0xf7, 0xe1, 0x6b, 0x87, 0xa0, 0x90, 0x2f, 0xc7,
235 1.1.2.2 pgoyette 0x8c, 0xed, 0x53, 0xda, 0x93, 0x32, 0x78, 0x5d,
236 1.1.2.2 pgoyette 0x24, 0x23, 0x42, 0xdd, 0x93, 0x5b, 0x2e, 0x40,
237 1.1.2.2 pgoyette 0xa1, 0xb1, 0x3b, 0xbb, 0xf0, 0x50, 0xb4, 0x61,
238 1.1.2.2 pgoyette 0xea, 0x15, 0x37, 0xf3, 0x49, 0xe1, 0xa0, 0x32,
239 1.1.2.2 pgoyette 0x88, 0x85, 0x81, 0xfd, 0xb7, 0x96, 0xd7, 0x9d,
240 1.1.2.2 pgoyette 0xd7, 0x29, 0x4b, 0x14, 0xf9, 0x18, 0x6a, 0xf6,
241 1.1.2.2 pgoyette 0x46, 0xae, 0x69, 0xdf, 0x63, 0x9a, 0xe0, 0x0b,
242 1.1.2.2 pgoyette 0x2c, 0x53, 0xd7, 0x82, 0x6f, 0xe5, 0xa0, 0x95,
243 1.1.2.2 pgoyette 0x2f, 0x61, 0x7f, 0x15, 0xff, 0xc7, 0xe8, 0x83,
244 1.1.2.2 pgoyette 0xfc, 0xfc, 0x16, 0x1c, 0x37, 0x0f, 0x9b, 0xbb,
245 1.1.2.2 pgoyette 0x14, 0xb2, 0xe2, 0xb7, 0x1f, 0x85, 0xb7, 0x07,
246 1.1.2.2 pgoyette 0x8a, 0x18, 0xed, 0xf7, 0x5f, 0x27, 0xff, 0x2f,
247 1.1.2.2 pgoyette 0x07, 0xf9, 0x9d, 0xe3, 0x79, 0x45, 0x1f, 0x51,
248 1.1.2.2 pgoyette 0x08, 0x54, 0x0f, 0x56, 0x84, 0xee, 0x87, 0x9a,
249 1.1.2.2 pgoyette 0xa9, 0x46, 0xb8, 0x77, 0x85, 0x40, 0x46, 0x50,
250 1.1.2.2 pgoyette 0xc1, 0x58, 0x07, 0xfd, 0xfa, 0x2b, 0x20, 0xd6,
251 1.1.2.2 pgoyette 0x4e, 0xba, 0x08, 0x02, 0x59, 0x3d, 0x23, 0x3b,
252 1.1.2.2 pgoyette 0x5d, 0xf9, 0x5e, 0x2f, 0xac, 0x9e, 0xa0, 0xd7,
253 1.1.2.2 pgoyette 0x3f, 0x9a, 0xdf, 0x50, 0x66, 0xcc, 0x28, 0xce,
254 1.1.2.2 pgoyette 0x93, 0xc8, 0x11, 0x5c, 0x74, 0xe2, 0x4f, 0xfd,
255 1.1.2.2 pgoyette 0xaf, 0x33, 0xbb, 0xce, 0x96, 0x1f, 0xb3, 0x46,
256 1.1.2.2 pgoyette 0x6e, 0xcd, 0xe4, 0xef, 0xfa, 0x2f, 0x93, 0xb1,
257 1.1.2.2 pgoyette 0xe5, 0x7c, 0x54, 0xbc, 0x17, 0x1f, 0xd5, 0x31,
258 1.1.2.2 pgoyette 0x0e, 0x88, 0xe7, 0xcd, 0xb0, 0xb5, 0x2e, 0x1e,
259 1.1.2.2 pgoyette 0x9e, 0x40, 0x36, 0xa5, 0xbb, 0xa7, 0x4e, 0xc8,
260 1.1.2.2 pgoyette 0x11, 0x6c, 0xae, 0x1c, 0x2d, 0xdb, 0x55, 0xd8,
261 1.1.2.2 pgoyette 0x14, 0x40, 0x02, 0xad, 0xaf, 0x19, 0x28, 0x59,
262 1.1.2.2 pgoyette 0xd7, 0x4f, 0x81, 0xd0, 0xc1, 0x54, 0x63, 0x73,
263 1.1.2.2 pgoyette 0x0e, 0xfb, 0x26, 0xf2, 0xa6, 0x80, 0xca, 0x2e,
264 1.1.2.2 pgoyette 0xf3, 0xca, 0x1e, 0xa4, 0x62, 0x07, 0x22, 0x10,
265 1.1.2.2 pgoyette 0x11, 0x6a, 0x57, 0x28, 0x45, 0x80, 0xdf, 0x34,
266 1.1.2.2 pgoyette 0x88, 0xe5, 0xf1, 0x23, 0xe0, 0xb6, 0x44, 0x51,
267 1.1.2.2 pgoyette 0x54, 0xd8, 0xb3, 0x66, 0xac, 0x46, 0x4d, 0xdf,
268 1.1.2.2 pgoyette 0xa2, 0x8e, 0x72, 0x3a, 0x1c, 0x87, 0x2a, 0x43,
269 1.1.2.2 pgoyette 0xfe, 0xdb, 0x00, 0xff, 0xb7, 0x1c, 0x13, 0xc3,
270 1.1.2.2 pgoyette 0x18, 0xfc, 0x71, 0x13, 0xe3, 0xd1, 0x1f, 0xde,
271 1.1.2.2 pgoyette 0x16, 0x63, 0x73, 0xf5, 0x0e, 0xf7, 0x18, 0xe5,
272 1.1.2.2 pgoyette 0x48, 0x8d, 0x30, 0xd9, 0x26, 0x20, 0x6d, 0xa1,
273 1.1.2.2 pgoyette 0xba, 0xde, 0xe8, 0x7d, 0x77, 0x02, 0x33, 0x0d,
274 1.1.2.2 pgoyette 0x73, 0xb2, 0xab, 0x35, 0xfd, 0xa5, 0x6e, 0x4c,
275 1.1.2.2 pgoyette 0x5c, 0x27, 0xc7, 0x7e, 0x4a, 0x28, 0xf8, 0xf5,
276 1.1.2.2 pgoyette 0x00, 0xbe, 0x4c, 0xd7, 0x2c, 0x27, 0x83, 0x16,
277 1.1.2.2 pgoyette 0x37, 0xda, 0x0c, 0xb1, 0xd7, 0x89, 0xd8, 0x8f,
278 1.1.2.2 pgoyette 0x17, 0x69, 0x1b, 0x6b, 0x48, 0x2b, 0xce, 0x9c,
279 1.1.2.2 pgoyette 0xbd, 0xf4, 0x0d, 0xb5, 0x4d, 0x12, 0x11, 0x36,
280 1.1.2.2 pgoyette 0x49, 0xd3, 0x8b, 0x52, 0xce, 0x7e, 0x47, 0xb0,
281 1.1.2.2 pgoyette 0xb5, 0x54, 0x77, 0xef, 0x90, 0xb8, 0x0e, 0xaf,
282 1.1.2.2 pgoyette 0x6f, 0x97, 0x88, 0xde, 0x6b, 0x37, 0x24, 0xdd,
283 1.1.2.2 pgoyette 0x91, 0x84, 0x00, 0x51, 0xab, 0x06, 0x96, 0x3c,
284 1.1.2.2 pgoyette 0x82, 0x73, 0xcf, 0xae, 0x8d, 0x23, 0x86, 0x59,
285 1.1.2.2 pgoyette 0x62, 0x5b, 0xeb, 0x2a, 0xaf, 0x40, 0x17, 0xed,
286 1.1.2.2 pgoyette 0x2b, 0x60, 0x73, 0x7d, 0x99, 0x95, 0x3f, 0xd6,
287 1.1.2.2 pgoyette 0x6c, 0xca, 0x1e, 0xf3, 0xb0, 0xcd, 0xd5, 0x1d,
288 1.1.2.2 pgoyette 0x53, 0xe0, 0xd2, 0x8b, 0x57, 0x7b, 0xac, 0x67,
289 1.1.2.2 pgoyette 0x5a, 0x5a, 0x0a, 0x64, 0x82, 0xab, 0x8f, 0x5a,
290 1.1.2.2 pgoyette 0x36, 0xe2, 0x45, 0x50, 0xec, 0x3e, 0x14, 0x80,
291 1.1.2.2 pgoyette 0x7c, 0xfd, 0x0c, 0xa9, 0x94, 0xfb, 0xfe, 0x72,
292 1.1.2.2 pgoyette 0xec, 0x47, 0x71, 0x2e, 0x90, 0x97, 0xf6, 0x33,
293 1.1.2.2 pgoyette 0xbd, 0x7d, 0x7e, 0x77, 0x8f, 0xad, 0xd4, 0x1d,
294 1.1.2.2 pgoyette 0x1d, 0x53, 0x0f, 0x28, 0x39, 0x77, 0x06, 0x1a,
295 1.1.2.2 pgoyette 0x75, 0xfc, 0x12, 0xe6, 0x45, 0xfc, 0x87, 0xe1,
296 1.1.2.2 pgoyette 0x46, 0xac, 0xb0, 0x73, 0xca, 0x24, 0x7c, 0x71,
297 1.1.2.2 pgoyette };
298 1.1.2.2 pgoyette
299 1.1.2.2 pgoyette /*
300 1.1.2.2 pgoyette * IV method encblkno1, blkno 3.
301 1.1.2.2 pgoyette */
302 1.1.2.2 pgoyette static const uint8_t c3des_cbc_192_encblkno1_vec3_ctxt[SECSIZE] = {
303 1.1.2.2 pgoyette 0xb1, 0xef, 0x7c, 0xd0, 0xa0, 0x6b, 0xe4, 0x88,
304 1.1.2.2 pgoyette 0x5c, 0xd7, 0xf1, 0xbf, 0x5f, 0xce, 0xda, 0x19,
305 1.1.2.2 pgoyette 0x81, 0x32, 0xbb, 0x96, 0x7e, 0xb9, 0x6e, 0xa1,
306 1.1.2.2 pgoyette 0x43, 0xde, 0x53, 0x66, 0x9c, 0x27, 0x94, 0x85,
307 1.1.2.2 pgoyette 0xcb, 0x09, 0x4e, 0x16, 0xd8, 0x60, 0x7a, 0x38,
308 1.1.2.2 pgoyette 0x27, 0x21, 0x4d, 0x08, 0xaa, 0xe2, 0x1e, 0x6e,
309 1.1.2.2 pgoyette 0xa3, 0xcb, 0x9a, 0x7f, 0xd1, 0xbf, 0x18, 0x36,
310 1.1.2.2 pgoyette 0x5a, 0x4d, 0x7a, 0x7f, 0xcf, 0x3f, 0xba, 0xa5,
311 1.1.2.2 pgoyette 0x77, 0x5b, 0xb4, 0x79, 0xdc, 0xbf, 0x2a, 0x28,
312 1.1.2.2 pgoyette 0x16, 0x27, 0x0f, 0x8b, 0xd7, 0x95, 0xc3, 0xcb,
313 1.1.2.2 pgoyette 0xa1, 0x6a, 0x49, 0x53, 0xa8, 0x0c, 0x70, 0xde,
314 1.1.2.2 pgoyette 0x90, 0x2e, 0x36, 0x74, 0x40, 0x5d, 0x81, 0x74,
315 1.1.2.2 pgoyette 0x03, 0x11, 0xbd, 0xba, 0x40, 0x8d, 0x03, 0x86,
316 1.1.2.2 pgoyette 0x2b, 0x17, 0x55, 0x20, 0xd8, 0x81, 0x30, 0xd2,
317 1.1.2.2 pgoyette 0x2a, 0xbd, 0xea, 0xff, 0x5c, 0x69, 0x9b, 0xe6,
318 1.1.2.2 pgoyette 0xe3, 0x21, 0x9a, 0x10, 0x3e, 0xb0, 0xf4, 0x7a,
319 1.1.2.2 pgoyette 0xfc, 0x6e, 0x66, 0xec, 0x44, 0x0b, 0x95, 0x8d,
320 1.1.2.2 pgoyette 0x13, 0xd4, 0xf6, 0x3e, 0xa1, 0xa1, 0xac, 0xb1,
321 1.1.2.2 pgoyette 0xd8, 0x3d, 0x86, 0xaf, 0x5e, 0xef, 0x14, 0x6a,
322 1.1.2.2 pgoyette 0x32, 0xf3, 0x13, 0x75, 0x3b, 0x64, 0x9a, 0xf4,
323 1.1.2.2 pgoyette 0xd0, 0xf5, 0x00, 0x36, 0x9e, 0xdb, 0xfd, 0xcb,
324 1.1.2.2 pgoyette 0xda, 0x1f, 0xed, 0x9d, 0x6d, 0x52, 0xd7, 0xb5,
325 1.1.2.2 pgoyette 0x48, 0xce, 0x53, 0x5e, 0xdc, 0xc8, 0xe4, 0x96,
326 1.1.2.2 pgoyette 0x04, 0x32, 0xa5, 0xcf, 0x0c, 0xba, 0xa0, 0xd0,
327 1.1.2.2 pgoyette 0x44, 0xb3, 0xe8, 0x72, 0xc6, 0xff, 0x8f, 0xd4,
328 1.1.2.2 pgoyette 0x4d, 0x0a, 0x22, 0x89, 0x74, 0x50, 0xaa, 0x65,
329 1.1.2.2 pgoyette 0x15, 0xab, 0x99, 0xc8, 0xf9, 0xa4, 0x10, 0xe6,
330 1.1.2.2 pgoyette 0xa6, 0x4b, 0x0c, 0xc8, 0xb9, 0xa7, 0x60, 0x41,
331 1.1.2.2 pgoyette 0xe7, 0x57, 0x31, 0xfa, 0x86, 0x55, 0xdf, 0x29,
332 1.1.2.2 pgoyette 0x49, 0xac, 0x55, 0x7b, 0x21, 0xf9, 0x3b, 0x1e,
333 1.1.2.2 pgoyette 0x1f, 0xb4, 0x1c, 0x0b, 0x77, 0xcb, 0x88, 0xbf,
334 1.1.2.2 pgoyette 0xa6, 0x79, 0xbf, 0x9a, 0x51, 0xc4, 0x8e, 0x59,
335 1.1.2.2 pgoyette 0x9c, 0xb3, 0x9d, 0x9d, 0x6b, 0xb2, 0x15, 0x41,
336 1.1.2.2 pgoyette 0x0d, 0x6c, 0xf7, 0x5e, 0xe2, 0xf9, 0xb3, 0x80,
337 1.1.2.2 pgoyette 0x8f, 0x03, 0x67, 0x68, 0x6e, 0x4b, 0x4d, 0x52,
338 1.1.2.2 pgoyette 0xbc, 0x9b, 0xa2, 0xd8, 0x29, 0x1e, 0x5c, 0xd7,
339 1.1.2.2 pgoyette 0x59, 0x67, 0x94, 0x40, 0x9e, 0x08, 0x15, 0x0d,
340 1.1.2.2 pgoyette 0x7e, 0xc9, 0x14, 0x53, 0xa8, 0x67, 0xb3, 0xb8,
341 1.1.2.2 pgoyette 0xaa, 0x21, 0x0f, 0x79, 0x69, 0x48, 0x52, 0xea,
342 1.1.2.2 pgoyette 0x56, 0x03, 0x7b, 0x55, 0xb7, 0xf3, 0xfe, 0xb1,
343 1.1.2.2 pgoyette 0x8a, 0x22, 0x7d, 0x75, 0x55, 0x31, 0xad, 0x20,
344 1.1.2.2 pgoyette 0x6a, 0xc2, 0xa4, 0xd1, 0x1e, 0xab, 0xdd, 0x29,
345 1.1.2.2 pgoyette 0xb5, 0xf8, 0xdd, 0x9b, 0x1a, 0xb8, 0xe7, 0xde,
346 1.1.2.2 pgoyette 0xae, 0xa1, 0xab, 0xbb, 0xf6, 0x00, 0x87, 0xc4,
347 1.1.2.2 pgoyette 0x29, 0xee, 0x2b, 0xa1, 0xa9, 0x1a, 0x46, 0x05,
348 1.1.2.2 pgoyette 0x5a, 0x12, 0x3f, 0x32, 0x81, 0x25, 0x20, 0x71,
349 1.1.2.2 pgoyette 0xb6, 0xfa, 0x1f, 0x27, 0x2a, 0x33, 0x49, 0xfc,
350 1.1.2.2 pgoyette 0x95, 0x00, 0x72, 0x6b, 0x03, 0x53, 0x94, 0x57,
351 1.1.2.2 pgoyette 0x2f, 0x47, 0x3d, 0x2d, 0x7c, 0xb4, 0xde, 0xa7,
352 1.1.2.2 pgoyette 0x96, 0x81, 0x12, 0xff, 0x2c, 0xec, 0x5c, 0x03,
353 1.1.2.2 pgoyette 0x2a, 0x8c, 0x76, 0xc4, 0xed, 0x09, 0xe6, 0x00,
354 1.1.2.2 pgoyette 0x28, 0xdb, 0x9b, 0x44, 0xb0, 0xb4, 0x7b, 0x57,
355 1.1.2.2 pgoyette 0x3b, 0xb6, 0x4f, 0x0b, 0xff, 0xf2, 0xf5, 0x02,
356 1.1.2.2 pgoyette 0x56, 0xcf, 0xd5, 0xbf, 0x71, 0xe6, 0x66, 0xf3,
357 1.1.2.2 pgoyette 0x08, 0x8e, 0x8b, 0x15, 0x57, 0x07, 0x41, 0xa3,
358 1.1.2.2 pgoyette 0x91, 0xc1, 0xe4, 0x64, 0x92, 0x89, 0xed, 0x22,
359 1.1.2.2 pgoyette 0x88, 0x8f, 0x17, 0x91, 0xde, 0xea, 0x0c, 0xa6,
360 1.1.2.2 pgoyette 0x86, 0x8e, 0x4c, 0xd9, 0x63, 0xc9, 0xe5, 0xdc,
361 1.1.2.2 pgoyette 0xd6, 0xd3, 0x7b, 0x2b, 0x65, 0xfa, 0x36, 0x47,
362 1.1.2.2 pgoyette 0x20, 0xa4, 0xe7, 0x0b, 0x52, 0xfa, 0xa6, 0xeb,
363 1.1.2.2 pgoyette 0x1d, 0x20, 0xd0, 0x4b, 0xfd, 0x88, 0x8c, 0xbb,
364 1.1.2.2 pgoyette 0x52, 0x9c, 0x2f, 0xb7, 0xba, 0x8b, 0xdd, 0x10,
365 1.1.2.2 pgoyette 0x2d, 0x7d, 0x77, 0x79, 0x40, 0xa7, 0xed, 0xf9,
366 1.1.2.2 pgoyette 0xbd, 0x2a, 0x55, 0x1f, 0x87, 0x1e, 0x3c, 0xfc,
367 1.1.2.2 pgoyette };
368 1.1.2.2 pgoyette
369 1.1.2.2 pgoyette const struct testvec c3des_cbc_192_1_vectors[] = {
370 1.1.2.2 pgoyette {
371 1.1.2.2 pgoyette .blkno = 0,
372 1.1.2.2 pgoyette .ptxt = c3des_cbc_ptxt,
373 1.1.2.2 pgoyette .ctxt = c3des_cbc_192_encblkno1_vec0_ctxt,
374 1.1.2.2 pgoyette },
375 1.1.2.2 pgoyette {
376 1.1.2.2 pgoyette .blkno = 1,
377 1.1.2.2 pgoyette .ptxt = c3des_cbc_ptxt,
378 1.1.2.2 pgoyette .ctxt = c3des_cbc_192_encblkno1_vec1_ctxt,
379 1.1.2.2 pgoyette },
380 1.1.2.2 pgoyette {
381 1.1.2.2 pgoyette .blkno = 2,
382 1.1.2.2 pgoyette .ptxt = c3des_cbc_ptxt,
383 1.1.2.2 pgoyette .ctxt = c3des_cbc_192_encblkno1_vec2_ctxt,
384 1.1.2.2 pgoyette },
385 1.1.2.2 pgoyette {
386 1.1.2.2 pgoyette .blkno = 3,
387 1.1.2.2 pgoyette .ptxt = c3des_cbc_ptxt,
388 1.1.2.2 pgoyette .ctxt = c3des_cbc_192_encblkno1_vec3_ctxt,
389 1.1.2.2 pgoyette },
390 1.1.2.2 pgoyette };
391 1.1.2.2 pgoyette
392 1.1.2.2 pgoyette /*
393 1.1.2.2 pgoyette * IV method encblkno8, blkno 0.
394 1.1.2.2 pgoyette */
395 1.1.2.2 pgoyette static const uint8_t c3des_cbc_192_encblkno8_vec0_ctxt[SECSIZE] = {
396 1.1.2.2 pgoyette 0x9e, 0x5d, 0x35, 0x56, 0xa7, 0xcc, 0xc0, 0x1c,
397 1.1.2.2 pgoyette 0x60, 0x4c, 0x42, 0x90, 0x35, 0xf3, 0xc1, 0x20,
398 1.1.2.2 pgoyette 0xf2, 0x07, 0x6f, 0xf8, 0x7c, 0x33, 0x6a, 0x74,
399 1.1.2.2 pgoyette 0xdc, 0x85, 0xbc, 0x9c, 0xa2, 0x29, 0xc6, 0x69,
400 1.1.2.2 pgoyette 0x0e, 0xef, 0x0f, 0xa9, 0x6e, 0xec, 0xf2, 0x23,
401 1.1.2.2 pgoyette 0x2f, 0x9a, 0xbe, 0x1a, 0x89, 0x22, 0x00, 0xc4,
402 1.1.2.2 pgoyette 0x5a, 0xaf, 0x4a, 0xa0, 0x4f, 0x30, 0x8f, 0x99,
403 1.1.2.2 pgoyette 0xd2, 0x93, 0x6d, 0xfa, 0xcd, 0x2f, 0xad, 0x19,
404 1.1.2.2 pgoyette 0x10, 0x14, 0x90, 0x3a, 0x4b, 0xab, 0x17, 0x2e,
405 1.1.2.2 pgoyette 0x2c, 0xe1, 0x26, 0xe5, 0x76, 0xf1, 0xd1, 0x1d,
406 1.1.2.2 pgoyette 0x4c, 0x77, 0x68, 0xfb, 0x45, 0x9a, 0x3e, 0x19,
407 1.1.2.2 pgoyette 0xe0, 0xfb, 0xdc, 0xd4, 0x0e, 0x29, 0x7c, 0x06,
408 1.1.2.2 pgoyette 0xd3, 0x45, 0xa8, 0xf7, 0x39, 0x91, 0xe6, 0x18,
409 1.1.2.2 pgoyette 0x0f, 0x81, 0xe6, 0x7d, 0x6c, 0x65, 0x2e, 0x16,
410 1.1.2.2 pgoyette 0x24, 0xa4, 0x16, 0x96, 0x0a, 0x7b, 0x5f, 0x3a,
411 1.1.2.2 pgoyette 0x0c, 0xe9, 0x0e, 0x3f, 0x34, 0x38, 0xb0, 0xe1,
412 1.1.2.2 pgoyette 0x39, 0x23, 0x5c, 0x3c, 0x00, 0xb4, 0xa0, 0xf7,
413 1.1.2.2 pgoyette 0x42, 0x18, 0x70, 0x25, 0x82, 0x13, 0x24, 0x49,
414 1.1.2.2 pgoyette 0xbb, 0x3f, 0xfb, 0xef, 0xb6, 0xc6, 0x7f, 0x3d,
415 1.1.2.2 pgoyette 0x8c, 0x17, 0x62, 0x60, 0x6f, 0xd5, 0xda, 0x2c,
416 1.1.2.2 pgoyette 0xf8, 0x85, 0xee, 0xa7, 0xc2, 0x76, 0x5d, 0x34,
417 1.1.2.2 pgoyette 0x4c, 0xe1, 0x0d, 0x36, 0x6e, 0x02, 0xdd, 0x08,
418 1.1.2.2 pgoyette 0x85, 0xe4, 0x90, 0xfe, 0x1f, 0x81, 0x4a, 0x06,
419 1.1.2.2 pgoyette 0xa6, 0x72, 0x81, 0x79, 0x47, 0xd7, 0x6d, 0x92,
420 1.1.2.2 pgoyette 0x8f, 0xb7, 0xb2, 0xfd, 0xd0, 0x60, 0x6c, 0x06,
421 1.1.2.2 pgoyette 0x44, 0xcd, 0x20, 0x28, 0xef, 0x16, 0xc3, 0x01,
422 1.1.2.2 pgoyette 0x19, 0x14, 0x34, 0x39, 0xad, 0x87, 0x9f, 0xde,
423 1.1.2.2 pgoyette 0x76, 0xb9, 0xb9, 0x87, 0x1a, 0xbd, 0x8e, 0x2c,
424 1.1.2.2 pgoyette 0xe6, 0xb3, 0xe7, 0xb6, 0x80, 0xf8, 0xc5, 0x22,
425 1.1.2.2 pgoyette 0x5f, 0x53, 0xed, 0x03, 0xfe, 0x09, 0x2c, 0x9d,
426 1.1.2.2 pgoyette 0xb6, 0x61, 0x4a, 0xbb, 0x07, 0x5d, 0xbd, 0x68,
427 1.1.2.2 pgoyette 0x74, 0xab, 0x02, 0x81, 0x64, 0x7b, 0x97, 0xa3,
428 1.1.2.2 pgoyette 0xad, 0x15, 0x99, 0x7a, 0x04, 0x33, 0xbd, 0x50,
429 1.1.2.2 pgoyette 0x94, 0x11, 0xcc, 0xf7, 0x8b, 0x77, 0x88, 0x78,
430 1.1.2.2 pgoyette 0x80, 0xfe, 0x5f, 0xa1, 0x63, 0xbc, 0xb0, 0x65,
431 1.1.2.2 pgoyette 0xcb, 0x9d, 0x4c, 0xfe, 0x66, 0x4e, 0xff, 0xe3,
432 1.1.2.2 pgoyette 0x43, 0x61, 0x99, 0x88, 0x88, 0x4c, 0xbc, 0x8a,
433 1.1.2.2 pgoyette 0xf1, 0x69, 0x00, 0xc2, 0xe5, 0xb9, 0x65, 0x8b,
434 1.1.2.2 pgoyette 0x10, 0xdf, 0x38, 0x3e, 0x9e, 0x9f, 0x87, 0xed,
435 1.1.2.2 pgoyette 0x84, 0x71, 0xe7, 0xf2, 0xb5, 0xb6, 0x11, 0xed,
436 1.1.2.2 pgoyette 0x1e, 0xd4, 0xc0, 0x6d, 0x77, 0x08, 0x4b, 0xfd,
437 1.1.2.2 pgoyette 0x95, 0xd5, 0xc0, 0xbe, 0xa6, 0xcc, 0x3b, 0xea,
438 1.1.2.2 pgoyette 0x11, 0x38, 0xa5, 0x59, 0x36, 0x2a, 0xf4, 0x98,
439 1.1.2.2 pgoyette 0x52, 0x9d, 0x3b, 0x8c, 0x8a, 0x19, 0xbd, 0xfb,
440 1.1.2.2 pgoyette 0x49, 0xcb, 0xb0, 0x57, 0x91, 0xc7, 0xf8, 0x2a,
441 1.1.2.2 pgoyette 0x89, 0xa8, 0x85, 0x03, 0xdf, 0x6e, 0xad, 0xf4,
442 1.1.2.2 pgoyette 0x8a, 0x88, 0x9a, 0x2b, 0x5d, 0xe8, 0xca, 0xa9,
443 1.1.2.2 pgoyette 0x8f, 0x18, 0xa3, 0x6a, 0x37, 0x84, 0xa9, 0x24,
444 1.1.2.2 pgoyette 0x5b, 0xce, 0xd6, 0xbe, 0x7e, 0x40, 0x86, 0x6a,
445 1.1.2.2 pgoyette 0xc3, 0x47, 0x28, 0x66, 0xf0, 0x8c, 0x2d, 0x69,
446 1.1.2.2 pgoyette 0x22, 0x64, 0x61, 0x36, 0x6a, 0x0c, 0xc4, 0x18,
447 1.1.2.2 pgoyette 0x5f, 0xd7, 0xff, 0xbc, 0xf1, 0x94, 0x16, 0xfb,
448 1.1.2.2 pgoyette 0x26, 0xa7, 0x80, 0xa4, 0x2d, 0x72, 0xc6, 0x9d,
449 1.1.2.2 pgoyette 0xa7, 0xed, 0x04, 0x13, 0x0f, 0xe7, 0xf8, 0x93,
450 1.1.2.2 pgoyette 0x57, 0x6b, 0xd5, 0xa4, 0xad, 0x9a, 0x97, 0xeb,
451 1.1.2.2 pgoyette 0x97, 0xe7, 0x60, 0x01, 0x89, 0x3f, 0x88, 0xf2,
452 1.1.2.2 pgoyette 0xee, 0xf3, 0x79, 0xd6, 0x5a, 0x03, 0x94, 0x07,
453 1.1.2.2 pgoyette 0xd3, 0x33, 0xc8, 0xda, 0x15, 0x17, 0x0a, 0x8f,
454 1.1.2.2 pgoyette 0xbd, 0x58, 0x1b, 0xfe, 0x3d, 0x77, 0x5d, 0x8f,
455 1.1.2.2 pgoyette 0x4e, 0x0e, 0x98, 0x7d, 0x02, 0x63, 0x94, 0x73,
456 1.1.2.2 pgoyette 0x4a, 0x58, 0x47, 0xed, 0x52, 0xfc, 0x85, 0x19,
457 1.1.2.2 pgoyette 0x5d, 0x2f, 0xfa, 0x07, 0x44, 0xbd, 0x8e, 0xcb,
458 1.1.2.2 pgoyette 0x20, 0x63, 0x9d, 0x2b, 0x61, 0x5c, 0x19, 0x71,
459 1.1.2.2 pgoyette 0x80, 0xe5, 0x25, 0x5b, 0x2e, 0xc5, 0xfe, 0x1a,
460 1.1.2.2 pgoyette };
461 1.1.2.2 pgoyette
462 1.1.2.2 pgoyette /*
463 1.1.2.2 pgoyette * IV method encblkno8, blkno 1.
464 1.1.2.2 pgoyette */
465 1.1.2.2 pgoyette static const uint8_t c3des_cbc_192_encblkno8_vec1_ctxt[SECSIZE] = {
466 1.1.2.2 pgoyette 0xf4, 0xb0, 0xb0, 0xcb, 0x79, 0xcc, 0x8c, 0x0a,
467 1.1.2.2 pgoyette 0x3b, 0xc7, 0x43, 0x4e, 0x62, 0x9d, 0xde, 0xb4,
468 1.1.2.2 pgoyette 0xab, 0xa5, 0x62, 0x63, 0x32, 0xa7, 0x18, 0x2b,
469 1.1.2.2 pgoyette 0xe3, 0xee, 0x44, 0xc6, 0x6f, 0xb2, 0xdc, 0x21,
470 1.1.2.2 pgoyette 0xc5, 0xc8, 0x9e, 0x32, 0x71, 0x4c, 0x7a, 0x82,
471 1.1.2.2 pgoyette 0x8d, 0xe0, 0xad, 0x91, 0x88, 0x0c, 0x41, 0x83,
472 1.1.2.2 pgoyette 0x28, 0x0d, 0xed, 0xa7, 0xeb, 0x48, 0xb1, 0x31,
473 1.1.2.2 pgoyette 0xfa, 0x40, 0xd9, 0x44, 0x19, 0xee, 0x8d, 0x2c,
474 1.1.2.2 pgoyette 0x7d, 0xe2, 0x39, 0xa0, 0x39, 0xaa, 0x86, 0xab,
475 1.1.2.2 pgoyette 0xb5, 0x68, 0xe5, 0x83, 0x06, 0x61, 0xec, 0xe6,
476 1.1.2.2 pgoyette 0xc2, 0x85, 0xb2, 0x46, 0xf4, 0x5b, 0x0e, 0x34,
477 1.1.2.2 pgoyette 0x7e, 0x0c, 0xa0, 0xda, 0xef, 0x58, 0x9c, 0x39,
478 1.1.2.2 pgoyette 0x95, 0xa2, 0xca, 0xd3, 0x3b, 0x4d, 0x76, 0xe3,
479 1.1.2.2 pgoyette 0x34, 0x6d, 0x08, 0xa4, 0xba, 0x88, 0x58, 0x39,
480 1.1.2.2 pgoyette 0xb4, 0xe4, 0x6b, 0xb6, 0x32, 0x50, 0x2c, 0xe2,
481 1.1.2.2 pgoyette 0x0a, 0x37, 0xbc, 0x98, 0x38, 0x32, 0x17, 0x1b,
482 1.1.2.2 pgoyette 0x12, 0xef, 0xdc, 0x9d, 0x91, 0x09, 0x8e, 0xd8,
483 1.1.2.2 pgoyette 0xc3, 0xf8, 0x7b, 0x35, 0x41, 0x3b, 0xf8, 0xf5,
484 1.1.2.2 pgoyette 0x37, 0x48, 0x04, 0xf7, 0x94, 0xbf, 0x54, 0x8d,
485 1.1.2.2 pgoyette 0x79, 0x49, 0x8f, 0xf0, 0x3f, 0xb7, 0x90, 0x76,
486 1.1.2.2 pgoyette 0x14, 0x09, 0xc6, 0x8c, 0xba, 0x1a, 0x30, 0x1b,
487 1.1.2.2 pgoyette 0xbb, 0xd9, 0xe2, 0xb5, 0xe8, 0xd9, 0x9b, 0x68,
488 1.1.2.2 pgoyette 0x60, 0x90, 0xd3, 0x4a, 0xe8, 0x65, 0x7b, 0xaa,
489 1.1.2.2 pgoyette 0xb0, 0xda, 0x69, 0x1d, 0x45, 0x78, 0x2c, 0x3b,
490 1.1.2.2 pgoyette 0x59, 0x29, 0x3c, 0x26, 0x9a, 0xd2, 0xa5, 0xfd,
491 1.1.2.2 pgoyette 0xb7, 0x16, 0x59, 0x7c, 0x46, 0xea, 0x99, 0xd0,
492 1.1.2.2 pgoyette 0x06, 0x01, 0x3f, 0xd2, 0x23, 0xcc, 0xde, 0xb8,
493 1.1.2.2 pgoyette 0xaa, 0x88, 0x17, 0x03, 0xe1, 0x48, 0x2c, 0xdd,
494 1.1.2.2 pgoyette 0xce, 0xd1, 0x2c, 0xce, 0x37, 0xee, 0xe6, 0xa6,
495 1.1.2.2 pgoyette 0x47, 0x8c, 0x07, 0xe5, 0xfe, 0x01, 0xc6, 0x27,
496 1.1.2.2 pgoyette 0xfe, 0x3f, 0x9d, 0x30, 0x18, 0x36, 0xe7, 0xa7,
497 1.1.2.2 pgoyette 0x37, 0x1d, 0xcf, 0x6d, 0x4c, 0x82, 0xec, 0x58,
498 1.1.2.2 pgoyette 0xa1, 0x6f, 0x56, 0xc6, 0x08, 0x25, 0x94, 0xda,
499 1.1.2.2 pgoyette 0xae, 0x1a, 0x4f, 0xda, 0xb2, 0xf4, 0xbf, 0x94,
500 1.1.2.2 pgoyette 0xff, 0x66, 0x6a, 0xb1, 0x1f, 0x42, 0xfe, 0x32,
501 1.1.2.2 pgoyette 0xa4, 0x0e, 0x3d, 0x6a, 0x16, 0x44, 0xe0, 0xac,
502 1.1.2.2 pgoyette 0xe8, 0xc1, 0xe2, 0xa8, 0x73, 0xab, 0xac, 0x58,
503 1.1.2.2 pgoyette 0xb1, 0xbc, 0x94, 0xb2, 0x6a, 0xe4, 0x45, 0xf5,
504 1.1.2.2 pgoyette 0x90, 0x6b, 0x82, 0xeb, 0x9e, 0x22, 0x9e, 0xb2,
505 1.1.2.2 pgoyette 0x27, 0x3e, 0xc8, 0x55, 0xf4, 0x8f, 0xda, 0x04,
506 1.1.2.2 pgoyette 0xa3, 0x9c, 0xa4, 0x79, 0xbd, 0x79, 0xd3, 0xbd,
507 1.1.2.2 pgoyette 0xbe, 0x72, 0x7f, 0x90, 0xef, 0xc3, 0x34, 0x17,
508 1.1.2.2 pgoyette 0x72, 0x6f, 0xb4, 0xfe, 0x62, 0x56, 0xc3, 0xd6,
509 1.1.2.2 pgoyette 0x43, 0xc8, 0x4c, 0x76, 0x91, 0x04, 0x97, 0x4c,
510 1.1.2.2 pgoyette 0x84, 0x98, 0x56, 0xb7, 0x7b, 0x4f, 0xd5, 0xcf,
511 1.1.2.2 pgoyette 0x1b, 0x9c, 0x09, 0xe3, 0x1d, 0xdf, 0x0e, 0xfa,
512 1.1.2.2 pgoyette 0x39, 0xc8, 0x48, 0x43, 0x84, 0xec, 0x79, 0xc8,
513 1.1.2.2 pgoyette 0x7f, 0x4f, 0xa8, 0xc0, 0xb4, 0xde, 0x8b, 0x79,
514 1.1.2.2 pgoyette 0xcb, 0x9c, 0x42, 0x81, 0x49, 0xdc, 0x39, 0xb5,
515 1.1.2.2 pgoyette 0x31, 0xa6, 0x22, 0xba, 0x71, 0xb8, 0x2d, 0x1d,
516 1.1.2.2 pgoyette 0xc8, 0x17, 0xd8, 0x9d, 0x26, 0x2b, 0xd5, 0xcf,
517 1.1.2.2 pgoyette 0x57, 0x46, 0x0a, 0x61, 0x7e, 0xb7, 0xc3, 0x9c,
518 1.1.2.2 pgoyette 0xa6, 0x44, 0x60, 0x2d, 0x30, 0xb8, 0x10, 0x47,
519 1.1.2.2 pgoyette 0x7d, 0x7e, 0x87, 0x76, 0xc1, 0x4e, 0x85, 0x77,
520 1.1.2.2 pgoyette 0xbc, 0x30, 0x32, 0x56, 0x0a, 0x5b, 0x1c, 0xd0,
521 1.1.2.2 pgoyette 0xf6, 0x47, 0x48, 0x22, 0xf4, 0x6e, 0x38, 0xc5,
522 1.1.2.2 pgoyette 0xab, 0xe2, 0xd0, 0x4d, 0x40, 0x27, 0xab, 0x8f,
523 1.1.2.2 pgoyette 0x43, 0xb1, 0x60, 0x29, 0x07, 0xd0, 0xf5, 0x25,
524 1.1.2.2 pgoyette 0xe5, 0xfa, 0xe7, 0x46, 0x32, 0x37, 0xb9, 0xae,
525 1.1.2.2 pgoyette 0x2e, 0x02, 0x8c, 0x94, 0x15, 0x69, 0xd6, 0x74,
526 1.1.2.2 pgoyette 0xb4, 0x36, 0xdd, 0x94, 0x70, 0xa7, 0x16, 0x7b,
527 1.1.2.2 pgoyette 0x4c, 0xd3, 0x48, 0x83, 0xc5, 0xb2, 0xb0, 0x6a,
528 1.1.2.2 pgoyette 0xfe, 0x7e, 0xd4, 0xe5, 0x6d, 0xa5, 0x96, 0x20,
529 1.1.2.2 pgoyette 0x08, 0x59, 0xbd, 0x0c, 0x3d, 0x55, 0xa5, 0x03,
530 1.1.2.2 pgoyette };
531 1.1.2.2 pgoyette
532 1.1.2.2 pgoyette /*
533 1.1.2.2 pgoyette * IV method encblkno8, blkno 2.
534 1.1.2.2 pgoyette */
535 1.1.2.2 pgoyette static const uint8_t c3des_cbc_192_encblkno8_vec2_ctxt[SECSIZE] = {
536 1.1.2.2 pgoyette 0xea, 0x7c, 0x8c, 0x8e, 0x3e, 0x61, 0x34, 0x3d,
537 1.1.2.2 pgoyette 0xe0, 0x7f, 0xd3, 0xe1, 0x3a, 0xb9, 0xc8, 0xf2,
538 1.1.2.2 pgoyette 0x98, 0xdc, 0x59, 0x26, 0xd2, 0xd8, 0xa7, 0x7f,
539 1.1.2.2 pgoyette 0x41, 0x98, 0x24, 0xa8, 0x28, 0x0c, 0x88, 0x55,
540 1.1.2.2 pgoyette 0x91, 0xdb, 0x29, 0x17, 0x70, 0xd7, 0x03, 0xff,
541 1.1.2.2 pgoyette 0xbd, 0x0e, 0xbf, 0xf8, 0x73, 0x92, 0x19, 0xe9,
542 1.1.2.2 pgoyette 0x92, 0x67, 0xdb, 0x08, 0x94, 0x77, 0x71, 0x2d,
543 1.1.2.2 pgoyette 0x00, 0xad, 0x26, 0x42, 0x2d, 0xac, 0x8c, 0x67,
544 1.1.2.2 pgoyette 0x6f, 0xb3, 0x8e, 0x36, 0x22, 0xeb, 0x1f, 0x8c,
545 1.1.2.2 pgoyette 0xd4, 0x9b, 0x9f, 0xa6, 0xa9, 0xb1, 0x52, 0x65,
546 1.1.2.2 pgoyette 0x9a, 0xfe, 0xcc, 0x92, 0x48, 0x75, 0xf6, 0xb8,
547 1.1.2.2 pgoyette 0x59, 0xfe, 0x0e, 0x67, 0x93, 0xce, 0x3b, 0x7e,
548 1.1.2.2 pgoyette 0x51, 0x74, 0xe5, 0x24, 0x35, 0x08, 0x68, 0x21,
549 1.1.2.2 pgoyette 0x6a, 0x7f, 0xdd, 0x8c, 0xfd, 0xcd, 0x6d, 0x90,
550 1.1.2.2 pgoyette 0xc5, 0x3b, 0x26, 0x9e, 0x00, 0xf4, 0x1e, 0x70,
551 1.1.2.2 pgoyette 0xd3, 0xe7, 0xe8, 0x2f, 0x52, 0x87, 0x76, 0x84,
552 1.1.2.2 pgoyette 0xbb, 0x5c, 0x76, 0x5a, 0xc8, 0xea, 0x74, 0xe2,
553 1.1.2.2 pgoyette 0x9e, 0x85, 0xf6, 0x53, 0x85, 0x1a, 0x6e, 0x02,
554 1.1.2.2 pgoyette 0x0d, 0x32, 0x11, 0xc4, 0xec, 0xee, 0x79, 0x27,
555 1.1.2.2 pgoyette 0xda, 0xca, 0xc0, 0x0b, 0x8e, 0x2d, 0xb7, 0x7d,
556 1.1.2.2 pgoyette 0x8c, 0x6e, 0xfb, 0xa3, 0xa8, 0x24, 0x24, 0x62,
557 1.1.2.2 pgoyette 0xc8, 0xdd, 0xc7, 0x16, 0x09, 0x33, 0x0f, 0xe5,
558 1.1.2.2 pgoyette 0xc8, 0x60, 0x3d, 0xb6, 0xbf, 0x6c, 0x28, 0xd2,
559 1.1.2.2 pgoyette 0x0b, 0x9c, 0xd9, 0xcb, 0x64, 0x49, 0xe4, 0x80,
560 1.1.2.2 pgoyette 0x72, 0x58, 0xaa, 0xaa, 0x7e, 0x1d, 0x9f, 0xd7,
561 1.1.2.2 pgoyette 0x29, 0x15, 0x65, 0xfc, 0xfd, 0x3f, 0xe1, 0x82,
562 1.1.2.2 pgoyette 0x25, 0x3c, 0xd4, 0xbe, 0x59, 0x79, 0x63, 0xd1,
563 1.1.2.2 pgoyette 0xd6, 0x0e, 0xda, 0x00, 0xf3, 0xaa, 0x13, 0xd3,
564 1.1.2.2 pgoyette 0xed, 0xef, 0xca, 0x8b, 0x97, 0x15, 0x2d, 0x10,
565 1.1.2.2 pgoyette 0x6f, 0xcf, 0xee, 0xc7, 0x21, 0xad, 0xe3, 0xe4,
566 1.1.2.2 pgoyette 0xd8, 0x95, 0x21, 0x1f, 0xc0, 0x06, 0x3a, 0xbc,
567 1.1.2.2 pgoyette 0xbb, 0x2a, 0x92, 0x78, 0x76, 0x9d, 0x1e, 0x7b,
568 1.1.2.2 pgoyette 0xb5, 0x29, 0xaf, 0x96, 0x75, 0x2b, 0x41, 0xbd,
569 1.1.2.2 pgoyette 0xae, 0x79, 0x28, 0x72, 0xe7, 0x54, 0xc4, 0x08,
570 1.1.2.2 pgoyette 0xd3, 0xd2, 0xac, 0x96, 0xd0, 0x0f, 0x9b, 0x68,
571 1.1.2.2 pgoyette 0x7d, 0x3f, 0xc2, 0xdd, 0x3d, 0xfc, 0xca, 0xcd,
572 1.1.2.2 pgoyette 0x11, 0x71, 0xd9, 0x48, 0x53, 0x9f, 0xd3, 0x79,
573 1.1.2.2 pgoyette 0x7d, 0x47, 0x71, 0x2a, 0x6d, 0x9e, 0xa9, 0x47,
574 1.1.2.2 pgoyette 0xa1, 0xf7, 0x97, 0x80, 0x83, 0x70, 0x6b, 0xfe,
575 1.1.2.2 pgoyette 0x10, 0x11, 0x6a, 0x0e, 0xdd, 0xde, 0x22, 0x3c,
576 1.1.2.2 pgoyette 0x19, 0x30, 0x73, 0x73, 0x2e, 0x4b, 0x54, 0x17,
577 1.1.2.2 pgoyette 0xc3, 0x2e, 0xe9, 0xce, 0xe0, 0xe3, 0xa0, 0x1a,
578 1.1.2.2 pgoyette 0x28, 0xd1, 0x50, 0xa8, 0xd2, 0x40, 0xe2, 0x1b,
579 1.1.2.2 pgoyette 0xfa, 0x49, 0x06, 0x49, 0x8b, 0x4b, 0xd9, 0xd5,
580 1.1.2.2 pgoyette 0xf5, 0x50, 0xae, 0x64, 0x19, 0xe1, 0xd9, 0x4e,
581 1.1.2.2 pgoyette 0xbb, 0x29, 0x70, 0x66, 0x46, 0xa8, 0x7e, 0x5b,
582 1.1.2.2 pgoyette 0xdc, 0xe2, 0xd5, 0x9d, 0x56, 0x6d, 0x4c, 0xe6,
583 1.1.2.2 pgoyette 0x0e, 0x6b, 0x71, 0x40, 0x82, 0xf7, 0xb3, 0xad,
584 1.1.2.2 pgoyette 0x23, 0x17, 0xe3, 0x1c, 0x61, 0x1d, 0x3b, 0x71,
585 1.1.2.2 pgoyette 0xfc, 0x06, 0x17, 0xec, 0x6c, 0x77, 0x98, 0x27,
586 1.1.2.2 pgoyette 0xc7, 0x4b, 0x65, 0x17, 0x81, 0xe7, 0xcb, 0xce,
587 1.1.2.2 pgoyette 0x09, 0x76, 0x82, 0x82, 0x4a, 0x53, 0x67, 0xa0,
588 1.1.2.2 pgoyette 0x05, 0x25, 0x4c, 0xc4, 0xa7, 0xad, 0xa7, 0xaf,
589 1.1.2.2 pgoyette 0xa0, 0x11, 0xd7, 0x73, 0x3b, 0x30, 0xbf, 0x53,
590 1.1.2.2 pgoyette 0x50, 0x9b, 0xd8, 0xf3, 0x32, 0x15, 0xdd, 0x36,
591 1.1.2.2 pgoyette 0x88, 0xc2, 0x39, 0x51, 0xb6, 0xb8, 0x0d, 0x5c,
592 1.1.2.2 pgoyette 0x20, 0x4e, 0x24, 0xee, 0x95, 0x32, 0x61, 0x25,
593 1.1.2.2 pgoyette 0xda, 0x73, 0x0d, 0x8a, 0x58, 0xe6, 0xcc, 0xad,
594 1.1.2.2 pgoyette 0x79, 0x3d, 0xef, 0x29, 0x0c, 0x9f, 0xe1, 0xa7,
595 1.1.2.2 pgoyette 0x22, 0x1e, 0xea, 0x7a, 0x4f, 0xfb, 0xc1, 0x1f,
596 1.1.2.2 pgoyette 0x17, 0xca, 0x69, 0xd6, 0xa4, 0xce, 0x6e, 0xc0,
597 1.1.2.2 pgoyette 0x70, 0xa3, 0x08, 0x32, 0x87, 0xb4, 0x6b, 0x80,
598 1.1.2.2 pgoyette 0x5c, 0x7f, 0x88, 0x5c, 0xbf, 0x07, 0xd8, 0xe9,
599 1.1.2.2 pgoyette 0xdd, 0xd2, 0x76, 0xa9, 0xaa, 0xd9, 0x55, 0x48,
600 1.1.2.2 pgoyette };
601 1.1.2.2 pgoyette
602 1.1.2.2 pgoyette /*
603 1.1.2.2 pgoyette * IV method encblkno8, blkno 3.
604 1.1.2.2 pgoyette */
605 1.1.2.2 pgoyette static const uint8_t c3des_cbc_192_encblkno8_vec3_ctxt[SECSIZE] = {
606 1.1.2.2 pgoyette 0xf3, 0x49, 0xda, 0x5c, 0xde, 0x9d, 0x3e, 0x9d,
607 1.1.2.2 pgoyette 0xb9, 0xc2, 0x6e, 0x96, 0xa9, 0x93, 0x10, 0x73,
608 1.1.2.2 pgoyette 0x0e, 0x26, 0x39, 0xd6, 0x9f, 0x04, 0x5f, 0x69,
609 1.1.2.2 pgoyette 0x54, 0xa3, 0x7c, 0x46, 0x7b, 0x18, 0x93, 0xc0,
610 1.1.2.2 pgoyette 0xbb, 0x0c, 0x96, 0x6f, 0xb0, 0xbf, 0xce, 0x67,
611 1.1.2.2 pgoyette 0x33, 0x3e, 0x56, 0xe8, 0x6b, 0x4d, 0x3f, 0xc8,
612 1.1.2.2 pgoyette 0x3c, 0xc6, 0x89, 0x2c, 0x0b, 0x95, 0x3a, 0xaf,
613 1.1.2.2 pgoyette 0xc0, 0xf3, 0x1f, 0x0e, 0x07, 0x01, 0xa6, 0x35,
614 1.1.2.2 pgoyette 0x19, 0x79, 0x91, 0x24, 0xaa, 0x0d, 0xf0, 0x53,
615 1.1.2.2 pgoyette 0x27, 0x7d, 0xbb, 0xa6, 0xb6, 0x44, 0x31, 0x4b,
616 1.1.2.2 pgoyette 0xd4, 0xcf, 0xf6, 0x6d, 0x18, 0xa2, 0x28, 0x8a,
617 1.1.2.2 pgoyette 0xc1, 0x0a, 0xbe, 0x57, 0x0c, 0x61, 0x5f, 0xd9,
618 1.1.2.2 pgoyette 0x12, 0x14, 0xfe, 0xe2, 0xc7, 0x10, 0x72, 0xee,
619 1.1.2.2 pgoyette 0x19, 0xb8, 0x16, 0x0b, 0x88, 0x87, 0xce, 0xf3,
620 1.1.2.2 pgoyette 0xfe, 0x57, 0x37, 0xd1, 0xa2, 0xf7, 0xd0, 0x5e,
621 1.1.2.2 pgoyette 0x73, 0xde, 0x39, 0x35, 0xbc, 0xde, 0xed, 0x61,
622 1.1.2.2 pgoyette 0x4b, 0x31, 0xdc, 0xfe, 0x3c, 0x4d, 0x98, 0xa9,
623 1.1.2.2 pgoyette 0x36, 0xb0, 0x34, 0x5b, 0xb4, 0xb7, 0x79, 0x25,
624 1.1.2.2 pgoyette 0x6e, 0x24, 0x7e, 0x10, 0xfe, 0x20, 0xd5, 0x16,
625 1.1.2.2 pgoyette 0x86, 0xaf, 0xcd, 0x26, 0x34, 0xd3, 0x2e, 0xdc,
626 1.1.2.2 pgoyette 0x7c, 0x69, 0xe3, 0xc5, 0x62, 0x0c, 0xba, 0x29,
627 1.1.2.2 pgoyette 0x9c, 0x4b, 0x2f, 0x39, 0x45, 0xe1, 0xcf, 0xc5,
628 1.1.2.2 pgoyette 0xfe, 0x35, 0xb6, 0x2f, 0xb1, 0x1a, 0x90, 0xe1,
629 1.1.2.2 pgoyette 0xa7, 0x39, 0xe8, 0x1e, 0x5f, 0xac, 0xab, 0x1e,
630 1.1.2.2 pgoyette 0x32, 0xba, 0xc5, 0x92, 0x39, 0x62, 0x37, 0x2c,
631 1.1.2.2 pgoyette 0x49, 0xf1, 0x62, 0x90, 0xf7, 0x1e, 0x10, 0xce,
632 1.1.2.2 pgoyette 0x8e, 0x95, 0xa3, 0xc6, 0xd8, 0xe5, 0xc8, 0xdf,
633 1.1.2.2 pgoyette 0xcc, 0x94, 0x7d, 0x26, 0xab, 0x29, 0xbb, 0x9d,
634 1.1.2.2 pgoyette 0xf3, 0x73, 0xce, 0xac, 0x76, 0xdf, 0x75, 0x2a,
635 1.1.2.2 pgoyette 0x3e, 0x8f, 0x47, 0xff, 0x76, 0xfe, 0xea, 0xd4,
636 1.1.2.2 pgoyette 0x4a, 0xa9, 0x36, 0x9d, 0x12, 0x45, 0xb7, 0x99,
637 1.1.2.2 pgoyette 0x81, 0xb6, 0x77, 0x98, 0x13, 0xfb, 0x5a, 0xe5,
638 1.1.2.2 pgoyette 0x40, 0x87, 0x61, 0x0d, 0x10, 0x76, 0xf6, 0x3e,
639 1.1.2.2 pgoyette 0x48, 0xac, 0xc4, 0x27, 0x87, 0xcd, 0x07, 0xde,
640 1.1.2.2 pgoyette 0x0b, 0x23, 0x97, 0x61, 0x3d, 0x18, 0x64, 0x7f,
641 1.1.2.2 pgoyette 0xbf, 0xd6, 0x87, 0xc1, 0x11, 0xfb, 0xf9, 0xda,
642 1.1.2.2 pgoyette 0x14, 0xa1, 0x01, 0xf8, 0x7e, 0xea, 0x5b, 0x5b,
643 1.1.2.2 pgoyette 0xdd, 0x09, 0xf9, 0x31, 0x80, 0x3c, 0xee, 0x34,
644 1.1.2.2 pgoyette 0x2d, 0xda, 0x71, 0xd9, 0x32, 0x7d, 0x45, 0xb2,
645 1.1.2.2 pgoyette 0x53, 0xea, 0xd5, 0x7c, 0x85, 0x45, 0xce, 0x1d,
646 1.1.2.2 pgoyette 0x2b, 0xe9, 0xd7, 0x95, 0xf8, 0x8c, 0x08, 0xe4,
647 1.1.2.2 pgoyette 0xd0, 0x2f, 0x60, 0x75, 0x02, 0xf3, 0xde, 0xeb,
648 1.1.2.2 pgoyette 0x46, 0x40, 0xa8, 0xd2, 0x37, 0xd6, 0xca, 0x5d,
649 1.1.2.2 pgoyette 0xb9, 0xf4, 0x51, 0x31, 0x8a, 0x1a, 0x82, 0xbd,
650 1.1.2.2 pgoyette 0x6f, 0x6d, 0x88, 0x2b, 0x63, 0x0f, 0xe1, 0xf0,
651 1.1.2.2 pgoyette 0xcf, 0x13, 0x79, 0x1d, 0x78, 0x82, 0x66, 0xa1,
652 1.1.2.2 pgoyette 0xef, 0xdb, 0x34, 0x50, 0xd2, 0x71, 0x47, 0x49,
653 1.1.2.2 pgoyette 0x41, 0x74, 0xd9, 0x0b, 0x14, 0x38, 0x1f, 0xc3,
654 1.1.2.2 pgoyette 0x09, 0x4d, 0xb3, 0xa6, 0x03, 0x3f, 0x56, 0x67,
655 1.1.2.2 pgoyette 0xd7, 0x51, 0x4c, 0x8a, 0x1d, 0x37, 0x99, 0xfb,
656 1.1.2.2 pgoyette 0xe1, 0x84, 0x57, 0x55, 0x9b, 0xf8, 0x73, 0x63,
657 1.1.2.2 pgoyette 0x68, 0x73, 0x89, 0x52, 0x06, 0xe7, 0x34, 0xe7,
658 1.1.2.2 pgoyette 0x1a, 0x15, 0x7e, 0xd9, 0x84, 0xa3, 0x0e, 0x68,
659 1.1.2.2 pgoyette 0x14, 0x1c, 0xe8, 0x23, 0x9e, 0xe3, 0x8f, 0x71,
660 1.1.2.2 pgoyette 0x02, 0x9b, 0x87, 0xd4, 0xd9, 0x1b, 0xd1, 0x9e,
661 1.1.2.2 pgoyette 0x9e, 0xa0, 0x7e, 0x49, 0x8e, 0xaa, 0x89, 0xb5,
662 1.1.2.2 pgoyette 0x16, 0x48, 0x07, 0xb3, 0x3d, 0x9e, 0x4c, 0x35,
663 1.1.2.2 pgoyette 0x3e, 0x94, 0xa9, 0xf8, 0x82, 0x50, 0x6a, 0x41,
664 1.1.2.2 pgoyette 0x28, 0x3e, 0x9f, 0x9a, 0x1a, 0x5d, 0x02, 0x7c,
665 1.1.2.2 pgoyette 0xd0, 0x32, 0x52, 0xa5, 0xee, 0x09, 0x27, 0x2d,
666 1.1.2.2 pgoyette 0x49, 0x17, 0xf7, 0x92, 0xa1, 0x63, 0x9d, 0x2a,
667 1.1.2.2 pgoyette 0xfd, 0x53, 0x26, 0x14, 0x7c, 0x92, 0x72, 0xa6,
668 1.1.2.2 pgoyette 0x38, 0x18, 0x8f, 0xb5, 0x54, 0xb3, 0x69, 0x63,
669 1.1.2.2 pgoyette 0x6a, 0xdc, 0xb1, 0x5a, 0x12, 0x7a, 0x0b, 0xa3,
670 1.1.2.2 pgoyette };
671 1.1.2.2 pgoyette
672 1.1.2.2 pgoyette const struct testvec c3des_cbc_192_8_vectors[] = {
673 1.1.2.2 pgoyette {
674 1.1.2.2 pgoyette .blkno = 0,
675 1.1.2.2 pgoyette .ptxt = c3des_cbc_ptxt,
676 1.1.2.2 pgoyette .ctxt = c3des_cbc_192_encblkno8_vec0_ctxt,
677 1.1.2.2 pgoyette },
678 1.1.2.2 pgoyette {
679 1.1.2.2 pgoyette .blkno = 1,
680 1.1.2.2 pgoyette .ptxt = c3des_cbc_ptxt,
681 1.1.2.2 pgoyette .ctxt = c3des_cbc_192_encblkno8_vec1_ctxt,
682 1.1.2.2 pgoyette },
683 1.1.2.2 pgoyette {
684 1.1.2.2 pgoyette .blkno = 2,
685 1.1.2.2 pgoyette .ptxt = c3des_cbc_ptxt,
686 1.1.2.2 pgoyette .ctxt = c3des_cbc_192_encblkno8_vec2_ctxt,
687 1.1.2.2 pgoyette },
688 1.1.2.2 pgoyette {
689 1.1.2.2 pgoyette .blkno = 3,
690 1.1.2.2 pgoyette .ptxt = c3des_cbc_ptxt,
691 1.1.2.2 pgoyette .ctxt = c3des_cbc_192_encblkno8_vec3_ctxt,
692 1.1.2.2 pgoyette },
693 1.1.2.2 pgoyette };
694 1.1.2.2 pgoyette
695 1.1.2.2 pgoyette static int
696 1.1.2.2 pgoyette open_disk(const char *devpath, const char *imgpath, size_t size)
697 1.1.2.2 pgoyette {
698 1.1.2.2 pgoyette int fd;
699 1.1.2.2 pgoyette
700 1.1.2.2 pgoyette fd = open(imgpath, O_CREAT | O_RDWR | O_TRUNC, 0600);
701 1.1.2.2 pgoyette if (fd < 0)
702 1.1.2.2 pgoyette return -1;
703 1.1.2.2 pgoyette
704 1.1.2.2 pgoyette if (ftruncate(fd, size) < 0)
705 1.1.2.2 pgoyette goto fail;
706 1.1.2.2 pgoyette
707 1.1.2.2 pgoyette if (rump_pub_etfs_register_withsize(devpath,
708 1.1.2.2 pgoyette imgpath, RUMP_ETFS_BLK, 0, size) < 0) {
709 1.1.2.2 pgoyette goto fail;
710 1.1.2.2 pgoyette }
711 1.1.2.2 pgoyette
712 1.1.2.2 pgoyette unlink(imgpath);
713 1.1.2.2 pgoyette return fd;
714 1.1.2.2 pgoyette fail:
715 1.1.2.2 pgoyette close(fd);
716 1.1.2.2 pgoyette unlink(imgpath);
717 1.1.2.2 pgoyette return -1;
718 1.1.2.2 pgoyette }
719 1.1.2.2 pgoyette
720 1.1.2.2 pgoyette static int
721 1.1.2.2 pgoyette open_cgd(int devno)
722 1.1.2.2 pgoyette {
723 1.1.2.2 pgoyette char devpath[32];
724 1.1.2.2 pgoyette
725 1.1.2.2 pgoyette sprintf(devpath, "/dev/rcgd%d%c", devno, getrawpartition() + 'a');
726 1.1.2.2 pgoyette
727 1.1.2.2 pgoyette return rump_sys_open(devpath, O_RDWR, 0);
728 1.1.2.2 pgoyette }
729 1.1.2.2 pgoyette
730 1.1.2.2 pgoyette static int
731 1.1.2.2 pgoyette configure_cgd(int fd, const char *dkpath, const char *alg,
732 1.1.2.2 pgoyette const char *ivmethod, const char *key, size_t keylen)
733 1.1.2.2 pgoyette {
734 1.1.2.2 pgoyette struct cgd_ioctl ci;
735 1.1.2.2 pgoyette
736 1.1.2.2 pgoyette memset(&ci, 0, sizeof(ci));
737 1.1.2.2 pgoyette ci.ci_disk = dkpath;
738 1.1.2.2 pgoyette ci.ci_alg = alg;
739 1.1.2.2 pgoyette ci.ci_ivmethod = ivmethod;
740 1.1.2.2 pgoyette ci.ci_keylen = 8 * keylen - 8; /* Exclude the NUL terminator. */
741 1.1.2.2 pgoyette ci.ci_key = key;
742 1.1.2.2 pgoyette ci.ci_blocksize = 64;
743 1.1.2.2 pgoyette
744 1.1.2.2 pgoyette return rump_sys_ioctl(fd, CGDIOCSET, &ci);
745 1.1.2.2 pgoyette }
746 1.1.2.2 pgoyette
747 1.1.2.2 pgoyette static int
748 1.1.2.2 pgoyette unconfigure_cgd(int fd)
749 1.1.2.2 pgoyette {
750 1.1.2.2 pgoyette struct cgd_ioctl ci;
751 1.1.2.2 pgoyette
752 1.1.2.2 pgoyette return rump_sys_ioctl(fd, CGDIOCCLR, &ci);
753 1.1.2.2 pgoyette }
754 1.1.2.2 pgoyette
755 1.1.2.2 pgoyette static int
756 1.1.2.2 pgoyette write_testvec(int cgdfd, const struct testvec *tv)
757 1.1.2.2 pgoyette {
758 1.1.2.2 pgoyette
759 1.1.2.2 pgoyette if (rump_sys_lseek(cgdfd, tv->blkno * SECSIZE, SEEK_SET) < 0)
760 1.1.2.2 pgoyette return -1;
761 1.1.2.2 pgoyette
762 1.1.2.2 pgoyette if (rump_sys_write(cgdfd, tv->ptxt, SECSIZE) != SECSIZE)
763 1.1.2.2 pgoyette return -1;
764 1.1.2.2 pgoyette
765 1.1.2.2 pgoyette return 0;
766 1.1.2.2 pgoyette }
767 1.1.2.2 pgoyette
768 1.1.2.2 pgoyette static int
769 1.1.2.2 pgoyette read_testvec(int cgdfd, const struct testvec *tv)
770 1.1.2.2 pgoyette {
771 1.1.2.2 pgoyette char *buf;
772 1.1.2.2 pgoyette int res = -1;
773 1.1.2.2 pgoyette
774 1.1.2.2 pgoyette buf = malloc(SECSIZE);
775 1.1.2.2 pgoyette if (buf == NULL)
776 1.1.2.2 pgoyette return -1;
777 1.1.2.2 pgoyette
778 1.1.2.2 pgoyette if (rump_sys_lseek(cgdfd, tv->blkno * SECSIZE, SEEK_SET) < 0)
779 1.1.2.2 pgoyette goto fail;
780 1.1.2.2 pgoyette
781 1.1.2.2 pgoyette if (rump_sys_read(cgdfd, buf, SECSIZE) != SECSIZE)
782 1.1.2.2 pgoyette goto fail;
783 1.1.2.2 pgoyette
784 1.1.2.2 pgoyette res = memcmp(buf, tv->ptxt, SECSIZE);
785 1.1.2.2 pgoyette fail:
786 1.1.2.2 pgoyette free(buf);
787 1.1.2.2 pgoyette return res;
788 1.1.2.2 pgoyette }
789 1.1.2.2 pgoyette
790 1.1.2.2 pgoyette static int
791 1.1.2.2 pgoyette check_testvec(int dkfd, const struct testvec *tv)
792 1.1.2.2 pgoyette {
793 1.1.2.2 pgoyette char *buf;
794 1.1.2.2 pgoyette int res = -1;
795 1.1.2.2 pgoyette
796 1.1.2.2 pgoyette buf = malloc(SECSIZE);
797 1.1.2.2 pgoyette if (buf == NULL)
798 1.1.2.2 pgoyette return -1;
799 1.1.2.2 pgoyette
800 1.1.2.2 pgoyette if (lseek(dkfd, tv->blkno * SECSIZE, SEEK_SET) < 0)
801 1.1.2.2 pgoyette goto fail;
802 1.1.2.2 pgoyette
803 1.1.2.2 pgoyette if (read(dkfd, buf, SECSIZE) != SECSIZE)
804 1.1.2.2 pgoyette goto fail;
805 1.1.2.2 pgoyette
806 1.1.2.2 pgoyette res = memcmp(buf, tv->ctxt, SECSIZE);
807 1.1.2.2 pgoyette fail:
808 1.1.2.2 pgoyette free(buf);
809 1.1.2.2 pgoyette return res;
810 1.1.2.2 pgoyette }
811 1.1.2.2 pgoyette
812 1.1.2.2 pgoyette ATF_TC(cgd_3des_cbc_192_encblkno1);
813 1.1.2.2 pgoyette ATF_TC_HEAD(cgd_3des_cbc_192_encblkno1, tc)
814 1.1.2.2 pgoyette {
815 1.1.2.2 pgoyette atf_tc_set_md_var(tc, "descr",
816 1.1.2.2 pgoyette "Test 3des-cbc with 192 bits key, ivmethod encblkno1");
817 1.1.2.2 pgoyette }
818 1.1.2.2 pgoyette
819 1.1.2.2 pgoyette ATF_TC_BODY(cgd_3des_cbc_192_encblkno1, tc)
820 1.1.2.2 pgoyette {
821 1.1.2.2 pgoyette const char imgpath[] = "3des-cbc-192-encblkno1.img";
822 1.1.2.2 pgoyette const char *dkpath = "/dev/dk";
823 1.1.2.2 pgoyette const size_t dksize = 4 * SECSIZE; /* Last blkno is 3. */
824 1.1.2.2 pgoyette int dkfd, cgdfd;
825 1.1.2.2 pgoyette
826 1.1.2.2 pgoyette rump_init();
827 1.1.2.2 pgoyette
828 1.1.2.2 pgoyette RL(dkfd = open_disk(dkpath, imgpath, dksize));
829 1.1.2.2 pgoyette
830 1.1.2.2 pgoyette RL(cgdfd = open_cgd(0));
831 1.1.2.2 pgoyette RL(configure_cgd(cgdfd, dkpath, "3des-cbc", "encblkno1",
832 1.1.2.2 pgoyette c3des_cbc_192_key, sizeof(c3des_cbc_192_key)));
833 1.1.2.2 pgoyette
834 1.1.2.2 pgoyette ATF_CHECK_EQ(write_testvec(cgdfd, &c3des_cbc_192_1_vectors[0]), 0);
835 1.1.2.2 pgoyette ATF_CHECK_EQ(write_testvec(cgdfd, &c3des_cbc_192_1_vectors[1]), 0);
836 1.1.2.2 pgoyette ATF_CHECK_EQ(write_testvec(cgdfd, &c3des_cbc_192_1_vectors[2]), 0);
837 1.1.2.2 pgoyette ATF_CHECK_EQ(write_testvec(cgdfd, &c3des_cbc_192_1_vectors[3]), 0);
838 1.1.2.2 pgoyette
839 1.1.2.2 pgoyette RL(unconfigure_cgd(cgdfd));
840 1.1.2.2 pgoyette RL(configure_cgd(cgdfd, dkpath, "3des-cbc", "encblkno1",
841 1.1.2.2 pgoyette c3des_cbc_192_key, sizeof(c3des_cbc_192_key)));
842 1.1.2.2 pgoyette
843 1.1.2.2 pgoyette ATF_CHECK_EQ(read_testvec(cgdfd, &c3des_cbc_192_1_vectors[0]), 0);
844 1.1.2.2 pgoyette ATF_CHECK_EQ(read_testvec(cgdfd, &c3des_cbc_192_1_vectors[1]), 0);
845 1.1.2.2 pgoyette ATF_CHECK_EQ(read_testvec(cgdfd, &c3des_cbc_192_1_vectors[2]), 0);
846 1.1.2.2 pgoyette ATF_CHECK_EQ(read_testvec(cgdfd, &c3des_cbc_192_1_vectors[3]), 0);
847 1.1.2.2 pgoyette
848 1.1.2.2 pgoyette RL(unconfigure_cgd(cgdfd));
849 1.1.2.2 pgoyette RL(rump_sys_close(cgdfd));
850 1.1.2.2 pgoyette
851 1.1.2.2 pgoyette ATF_CHECK_EQ(check_testvec(dkfd, &c3des_cbc_192_1_vectors[0]), 0);
852 1.1.2.2 pgoyette ATF_CHECK_EQ(check_testvec(dkfd, &c3des_cbc_192_1_vectors[1]), 0);
853 1.1.2.2 pgoyette ATF_CHECK_EQ(check_testvec(dkfd, &c3des_cbc_192_1_vectors[2]), 0);
854 1.1.2.2 pgoyette ATF_CHECK_EQ(check_testvec(dkfd, &c3des_cbc_192_1_vectors[3]), 0);
855 1.1.2.2 pgoyette
856 1.1.2.2 pgoyette RL(close(dkfd));
857 1.1.2.2 pgoyette }
858 1.1.2.2 pgoyette
859 1.1.2.2 pgoyette ATF_TC(cgd_3des_cbc_192_encblkno8);
860 1.1.2.2 pgoyette ATF_TC_HEAD(cgd_3des_cbc_192_encblkno8, tc)
861 1.1.2.2 pgoyette {
862 1.1.2.2 pgoyette atf_tc_set_md_var(tc, "descr",
863 1.1.2.2 pgoyette "Test 3des-cbc with 192 bits key, ivmethod encblkno8");
864 1.1.2.2 pgoyette }
865 1.1.2.2 pgoyette
866 1.1.2.2 pgoyette ATF_TC_BODY(cgd_3des_cbc_192_encblkno8, tc)
867 1.1.2.2 pgoyette {
868 1.1.2.2 pgoyette const char imgpath[] = "3des-cbc-192-encblkno8.img";
869 1.1.2.2 pgoyette const char *dkpath = "/dev/dk";
870 1.1.2.2 pgoyette const size_t dksize = 4 * SECSIZE; /* Last blkno is 3. */
871 1.1.2.2 pgoyette int dkfd, cgdfd;
872 1.1.2.2 pgoyette
873 1.1.2.2 pgoyette rump_init();
874 1.1.2.2 pgoyette
875 1.1.2.2 pgoyette RL(dkfd = open_disk(dkpath, imgpath, dksize));
876 1.1.2.2 pgoyette
877 1.1.2.2 pgoyette RL(cgdfd = open_cgd(0));
878 1.1.2.2 pgoyette RL(configure_cgd(cgdfd, dkpath, "3des-cbc", "encblkno8",
879 1.1.2.2 pgoyette c3des_cbc_192_key, sizeof(c3des_cbc_192_key)));
880 1.1.2.2 pgoyette
881 1.1.2.2 pgoyette ATF_CHECK_EQ(write_testvec(cgdfd, &c3des_cbc_192_8_vectors[0]), 0);
882 1.1.2.2 pgoyette ATF_CHECK_EQ(write_testvec(cgdfd, &c3des_cbc_192_8_vectors[1]), 0);
883 1.1.2.2 pgoyette ATF_CHECK_EQ(write_testvec(cgdfd, &c3des_cbc_192_8_vectors[2]), 0);
884 1.1.2.2 pgoyette ATF_CHECK_EQ(write_testvec(cgdfd, &c3des_cbc_192_8_vectors[3]), 0);
885 1.1.2.2 pgoyette
886 1.1.2.2 pgoyette RL(unconfigure_cgd(cgdfd));
887 1.1.2.2 pgoyette RL(configure_cgd(cgdfd, dkpath, "3des-cbc", "encblkno8",
888 1.1.2.2 pgoyette c3des_cbc_192_key, sizeof(c3des_cbc_192_key)));
889 1.1.2.2 pgoyette
890 1.1.2.2 pgoyette ATF_CHECK_EQ(read_testvec(cgdfd, &c3des_cbc_192_8_vectors[0]), 0);
891 1.1.2.2 pgoyette ATF_CHECK_EQ(read_testvec(cgdfd, &c3des_cbc_192_8_vectors[1]), 0);
892 1.1.2.2 pgoyette ATF_CHECK_EQ(read_testvec(cgdfd, &c3des_cbc_192_8_vectors[2]), 0);
893 1.1.2.2 pgoyette ATF_CHECK_EQ(read_testvec(cgdfd, &c3des_cbc_192_8_vectors[3]), 0);
894 1.1.2.2 pgoyette
895 1.1.2.2 pgoyette RL(unconfigure_cgd(cgdfd));
896 1.1.2.2 pgoyette RL(rump_sys_close(cgdfd));
897 1.1.2.2 pgoyette
898 1.1.2.2 pgoyette ATF_CHECK_EQ(check_testvec(dkfd, &c3des_cbc_192_8_vectors[0]), 0);
899 1.1.2.2 pgoyette ATF_CHECK_EQ(check_testvec(dkfd, &c3des_cbc_192_8_vectors[1]), 0);
900 1.1.2.2 pgoyette ATF_CHECK_EQ(check_testvec(dkfd, &c3des_cbc_192_8_vectors[2]), 0);
901 1.1.2.2 pgoyette ATF_CHECK_EQ(check_testvec(dkfd, &c3des_cbc_192_8_vectors[3]), 0);
902 1.1.2.2 pgoyette
903 1.1.2.2 pgoyette RL(close(dkfd));
904 1.1.2.2 pgoyette }
905 1.1.2.2 pgoyette
906 1.1.2.2 pgoyette ATF_TP_ADD_TCS(tp)
907 1.1.2.2 pgoyette {
908 1.1.2.2 pgoyette
909 1.1.2.2 pgoyette ATF_TP_ADD_TC(tp, cgd_3des_cbc_192_encblkno1);
910 1.1.2.2 pgoyette ATF_TP_ADD_TC(tp, cgd_3des_cbc_192_encblkno8);
911 1.1.2.2 pgoyette
912 1.1.2.2 pgoyette return atf_no_error();
913 1.1.2.2 pgoyette }
914