nl80211: Fix a typo
[hostap-gosc2009.git] / tests / test-milenage.c
blobb41e1a75cbfe1b7907e126209483de8731464a47
1 #include "includes.h"
3 #include "common.h"
4 #include "crypto/aes_wrap.h"
5 #include "crypto/milenage.h"
8 extern int wpa_debug_level;
11 /**
12 * milenage_opc - Determine OPc from OP and K
13 * @op: OP = 128-bit operator variant algorithm configuration field
14 * @k: K = 128-bit subscriber key
15 * @opc: Buffer for OPc = 128-bit value derived from OP and K
17 static int milenage_opc(const u8 *op, const u8 *k, u8 *opc)
19 int i;
20 /* OP_C = OP XOR E_K(OP) */
21 if (aes_128_encrypt_block(k, op, opc) < 0)
22 return -1;
23 for (i = 0; i < 16; i++)
24 opc[i] ^= op[i];
25 return 0;
29 struct gsm_milenage_test_set {
30 u8 ki[16];
31 u8 rand[16];
32 u8 opc[16];
33 u8 sres1[4];
34 u8 sres2[4];
35 u8 kc[8];
38 static const struct gsm_milenage_test_set gsm_test_sets[] =
41 /* 3GPP TS 55.205 v6.0.0 - Test Set 1 */
42 { 0x46, 0x5b, 0x5c, 0xe8, 0xb1, 0x99, 0xb4, 0x9f,
43 0xaa, 0x5f, 0x0a, 0x2e, 0xe2, 0x38, 0xa6, 0xbc },
44 { 0x23, 0x55, 0x3c, 0xbe, 0x96, 0x37, 0xa8, 0x9d,
45 0x21, 0x8a, 0xe6, 0x4d, 0xae, 0x47, 0xbf, 0x35 },
46 { 0xcd, 0x63, 0xcb, 0x71, 0x95, 0x4a, 0x9f, 0x4e,
47 0x48, 0xa5, 0x99, 0x4e, 0x37, 0xa0, 0x2b, 0xaf },
48 { 0x46, 0xf8, 0x41, 0x6a },
49 { 0xa5, 0x42, 0x11, 0xd5 },
50 { 0xea, 0xe4, 0xbe, 0x82, 0x3a, 0xf9, 0xa0, 0x8b }
51 }, {
52 /* 3GPP TS 55.205 v6.0.0 - Test Set 2 */
53 { 0xfe, 0xc8, 0x6b, 0xa6, 0xeb, 0x70, 0x7e, 0xd0,
54 0x89, 0x05, 0x75, 0x7b, 0x1b, 0xb4, 0x4b, 0x8f },
55 { 0x9f, 0x7c, 0x8d, 0x02, 0x1a, 0xcc, 0xf4, 0xdb,
56 0x21, 0x3c, 0xcf, 0xf0, 0xc7, 0xf7, 0x1a, 0x6a },
57 { 0x10, 0x06, 0x02, 0x0f, 0x0a, 0x47, 0x8b, 0xf6,
58 0xb6, 0x99, 0xf1, 0x5c, 0x06, 0x2e, 0x42, 0xb3 },
59 { 0x8c, 0x30, 0x8a, 0x5e },
60 { 0x80, 0x11, 0xc4, 0x8c },
61 { 0xaa, 0x01, 0x73, 0x9b, 0x8c, 0xaa, 0x97, 0x6d }
62 }, {
63 /* 3GPP TS 55.205 v6.0.0 - Test Set 3 */
64 { 0x9e, 0x59, 0x44, 0xae, 0xa9, 0x4b, 0x81, 0x16,
65 0x5c, 0x82, 0xfb, 0xf9, 0xf3, 0x2d, 0xb7, 0x51 },
66 { 0xce, 0x83, 0xdb, 0xc5, 0x4a, 0xc0, 0x27, 0x4a,
67 0x15, 0x7c, 0x17, 0xf8, 0x0d, 0x01, 0x7b, 0xd6 },
68 { 0xa6, 0x4a, 0x50, 0x7a, 0xe1, 0xa2, 0xa9, 0x8b,
69 0xb8, 0x8e, 0xb4, 0x21, 0x01, 0x35, 0xdc, 0x87 },
70 { 0xcf, 0xbc, 0xe3, 0xfe },
71 { 0xf3, 0x65, 0xcd, 0x68 },
72 { 0x9a, 0x8e, 0xc9, 0x5f, 0x40, 0x8c, 0xc5, 0x07 }
73 }, {
74 /* 3GPP TS 55.205 v6.0.0 - Test Set 4 */
75 { 0x4a, 0xb1, 0xde, 0xb0, 0x5c, 0xa6, 0xce, 0xb0,
76 0x51, 0xfc, 0x98, 0xe7, 0x7d, 0x02, 0x6a, 0x84 },
77 { 0x74, 0xb0, 0xcd, 0x60, 0x31, 0xa1, 0xc8, 0x33,
78 0x9b, 0x2b, 0x6c, 0xe2, 0xb8, 0xc4, 0xa1, 0x86 },
79 { 0xdc, 0xf0, 0x7c, 0xbd, 0x51, 0x85, 0x52, 0x90,
80 0xb9, 0x2a, 0x07, 0xa9, 0x89, 0x1e, 0x52, 0x3e },
81 { 0x96, 0x55, 0xe2, 0x65 },
82 { 0x58, 0x60, 0xfc, 0x1b },
83 { 0xcd, 0xc1, 0xdc, 0x08, 0x41, 0xb8, 0x1a, 0x22 }
84 }, {
85 /* 3GPP TS 55.205 v6.0.0 - Test Set 5 */
86 { 0x6c, 0x38, 0xa1, 0x16, 0xac, 0x28, 0x0c, 0x45,
87 0x4f, 0x59, 0x33, 0x2e, 0xe3, 0x5c, 0x8c, 0x4f },
88 { 0xee, 0x64, 0x66, 0xbc, 0x96, 0x20, 0x2c, 0x5a,
89 0x55, 0x7a, 0xbb, 0xef, 0xf8, 0xba, 0xbf, 0x63 },
90 { 0x38, 0x03, 0xef, 0x53, 0x63, 0xb9, 0x47, 0xc6,
91 0xaa, 0xa2, 0x25, 0xe5, 0x8f, 0xae, 0x39, 0x34 },
92 { 0x13, 0x68, 0x8f, 0x17 },
93 { 0x16, 0xc8, 0x23, 0x3f },
94 { 0xdf, 0x75, 0xbc, 0x5e, 0xa8, 0x99, 0x87, 0x9f }
95 }, {
96 /* 3GPP TS 55.205 v6.0.0 - Test Set 6 */
97 { 0x2d, 0x60, 0x9d, 0x4d, 0xb0, 0xac, 0x5b, 0xf0,
98 0xd2, 0xc0, 0xde, 0x26, 0x70, 0x14, 0xde, 0x0d },
99 { 0x19, 0x4a, 0xa7, 0x56, 0x01, 0x38, 0x96, 0xb7,
100 0x4b, 0x4a, 0x2a, 0x3b, 0x0a, 0xf4, 0x53, 0x9e },
101 { 0xc3, 0x5a, 0x0a, 0xb0, 0xbc, 0xbf, 0xc9, 0x25,
102 0x2c, 0xaf, 0xf1, 0x5f, 0x24, 0xef, 0xbd, 0xe0 },
103 { 0x55, 0x3d, 0x00, 0xb3 },
104 { 0x8c, 0x25, 0xa1, 0x6c },
105 { 0x84, 0xb4, 0x17, 0xae, 0x3a, 0xea, 0xb4, 0xf3 }
106 }, {
107 /* 3GPP TS 55.205 v6.0.0 - Test Set 7 */
108 { 0xa5, 0x30, 0xa7, 0xfe, 0x42, 0x8f, 0xad, 0x10,
109 0x82, 0xc4, 0x5e, 0xdd, 0xfc, 0xe1, 0x38, 0x84 },
110 { 0x3a, 0x4c, 0x2b, 0x32, 0x45, 0xc5, 0x0e, 0xb5,
111 0xc7, 0x1d, 0x08, 0x63, 0x93, 0x95, 0x76, 0x4d },
112 { 0x27, 0x95, 0x3e, 0x49, 0xbc, 0x8a, 0xf6, 0xdc,
113 0xc6, 0xe7, 0x30, 0xeb, 0x80, 0x28, 0x6b, 0xe3 },
114 { 0x59, 0xf1, 0xa4, 0x4a },
115 { 0xa6, 0x32, 0x41, 0xe1 },
116 { 0x3b, 0x4e, 0x24, 0x4c, 0xdc, 0x60, 0xce, 0x03 }
117 }, {
118 /* 3GPP TS 55.205 v6.0.0 - Test Set 8 */
119 { 0xd9, 0x15, 0x1c, 0xf0, 0x48, 0x96, 0xe2, 0x58,
120 0x30, 0xbf, 0x2e, 0x08, 0x26, 0x7b, 0x83, 0x60 },
121 { 0xf7, 0x61, 0xe5, 0xe9, 0x3d, 0x60, 0x3f, 0xeb,
122 0x73, 0x0e, 0x27, 0x55, 0x6c, 0xb8, 0xa2, 0xca },
123 { 0xc4, 0xc9, 0x3e, 0xff, 0xe8, 0xa0, 0x81, 0x38,
124 0xc2, 0x03, 0xd4, 0xc2, 0x7c, 0xe4, 0xe3, 0xd9 },
125 { 0x50, 0x58, 0x88, 0x61 },
126 { 0x4a, 0x90, 0xb2, 0x17 },
127 { 0x8d, 0x4e, 0xc0, 0x1d, 0xe5, 0x97, 0xac, 0xfe }
128 }, {
129 /* 3GPP TS 55.205 v6.0.0 - Test Set 9 */
130 { 0xa0, 0xe2, 0x97, 0x1b, 0x68, 0x22, 0xe8, 0xd3,
131 0x54, 0xa1, 0x8c, 0xc2, 0x35, 0x62, 0x4e, 0xcb },
132 { 0x08, 0xef, 0xf8, 0x28, 0xb1, 0x3f, 0xdb, 0x56,
133 0x27, 0x22, 0xc6, 0x5c, 0x7f, 0x30, 0xa9, 0xb2 },
134 { 0x82, 0xa2, 0x6f, 0x22, 0xbb, 0xa9, 0xe9, 0x48,
135 0x8f, 0x94, 0x9a, 0x10, 0xd9, 0x8e, 0x9c, 0xc4 },
136 { 0xcd, 0xe6, 0xb0, 0x27 },
137 { 0x4b, 0xc2, 0x21, 0x2d },
138 { 0xd8, 0xde, 0xbc, 0x4f, 0xfb, 0xcd, 0x60, 0xaa }
139 }, {
140 /* 3GPP TS 55.205 v6.0.0 - Test Set 10 */
141 { 0x0d, 0xa6, 0xf7, 0xba, 0x86, 0xd5, 0xea, 0xc8,
142 0xa1, 0x9c, 0xf5, 0x63, 0xac, 0x58, 0x64, 0x2d },
143 { 0x67, 0x9a, 0xc4, 0xdb, 0xac, 0xd7, 0xd2, 0x33,
144 0xff, 0x9d, 0x68, 0x06, 0xf4, 0x14, 0x9c, 0xe3 },
145 { 0x0d, 0xb1, 0x07, 0x1f, 0x87, 0x67, 0x56, 0x2c,
146 0xa4, 0x3a, 0x0a, 0x64, 0xc4, 0x1e, 0x8d, 0x08 },
147 { 0x02, 0xd1, 0x3a, 0xcd },
148 { 0x6f, 0xc3, 0x0f, 0xee },
149 { 0xf0, 0xea, 0xa5, 0x0a, 0x1e, 0xdc, 0xeb, 0xb7 }
150 }, {
151 /* 3GPP TS 55.205 v6.0.0 - Test Set 11 */
152 { 0x77, 0xb4, 0x58, 0x43, 0xc8, 0x8e, 0x58, 0xc1,
153 0x0d, 0x20, 0x26, 0x84, 0x51, 0x5e, 0xd4, 0x30 },
154 { 0x4c, 0x47, 0xeb, 0x30, 0x76, 0xdc, 0x55, 0xfe,
155 0x51, 0x06, 0xcb, 0x20, 0x34, 0xb8, 0xcd, 0x78 },
156 { 0xd4, 0x83, 0xaf, 0xae, 0x56, 0x24, 0x09, 0xa3,
157 0x26, 0xb5, 0xbb, 0x0b, 0x20, 0xc4, 0xd7, 0x62 },
158 { 0x44, 0x38, 0x9d, 0x01 },
159 { 0xae, 0xfa, 0x35, 0x7b },
160 { 0x82, 0xdb, 0xab, 0x7f, 0x83, 0xf0, 0x63, 0xda }
161 }, {
162 /* 3GPP TS 55.205 v6.0.0 - Test Set 12 */
163 { 0x72, 0x9b, 0x17, 0x72, 0x92, 0x70, 0xdd, 0x87,
164 0xcc, 0xdf, 0x1b, 0xfe, 0x29, 0xb4, 0xe9, 0xbb },
165 { 0x31, 0x1c, 0x4c, 0x92, 0x97, 0x44, 0xd6, 0x75,
166 0xb7, 0x20, 0xf3, 0xb7, 0xe9, 0xb1, 0xcb, 0xd0 },
167 { 0x22, 0x8c, 0x2f, 0x2f, 0x06, 0xac, 0x32, 0x68,
168 0xa9, 0xe6, 0x16, 0xee, 0x16, 0xdb, 0x4b, 0xa1 },
169 { 0x03, 0xe0, 0xfd, 0x84 },
170 { 0x98, 0xdb, 0xbd, 0x09 },
171 { 0x3c, 0x66, 0xcb, 0x98, 0xca, 0xb2, 0xd3, 0x3d }
172 }, {
173 /* 3GPP TS 55.205 v6.0.0 - Test Set 13 */
174 { 0xd3, 0x2d, 0xd2, 0x3e, 0x89, 0xdc, 0x66, 0x23,
175 0x54, 0xca, 0x12, 0xeb, 0x79, 0xdd, 0x32, 0xfa },
176 { 0xcf, 0x7d, 0x0a, 0xb1, 0xd9, 0x43, 0x06, 0x95,
177 0x0b, 0xf1, 0x20, 0x18, 0xfb, 0xd4, 0x68, 0x87 },
178 { 0xd2, 0x2a, 0x4b, 0x41, 0x80, 0xa5, 0x32, 0x57,
179 0x08, 0xa5, 0xff, 0x70, 0xd9, 0xf6, 0x7e, 0xc7 },
180 { 0xbe, 0x73, 0xb3, 0xdc },
181 { 0xaf, 0x4a, 0x41, 0x1e },
182 { 0x96, 0x12, 0xb5, 0xd8, 0x8a, 0x41, 0x30, 0xbb }
183 }, {
184 /* 3GPP TS 55.205 v6.0.0 - Test Set 14 */
185 { 0xaf, 0x7c, 0x65, 0xe1, 0x92, 0x72, 0x21, 0xde,
186 0x59, 0x11, 0x87, 0xa2, 0xc5, 0x98, 0x7a, 0x53 },
187 { 0x1f, 0x0f, 0x85, 0x78, 0x46, 0x4f, 0xd5, 0x9b,
188 0x64, 0xbe, 0xd2, 0xd0, 0x94, 0x36, 0xb5, 0x7a },
189 { 0xa4, 0xcf, 0x5c, 0x81, 0x55, 0xc0, 0x8a, 0x7e,
190 0xff, 0x41, 0x8e, 0x54, 0x43, 0xb9, 0x8e, 0x55 },
191 { 0x8f, 0xe0, 0x19, 0xc7 },
192 { 0x7b, 0xff, 0xa5, 0xc2 },
193 { 0x75, 0xa1, 0x50, 0xdf, 0x3c, 0x6a, 0xed, 0x08 }
194 }, {
195 /* 3GPP TS 55.205 v6.0.0 - Test Set 15 */
196 { 0x5b, 0xd7, 0xec, 0xd3, 0xd3, 0x12, 0x7a, 0x41,
197 0xd1, 0x25, 0x39, 0xbe, 0xd4, 0xe7, 0xcf, 0x71 },
198 { 0x59, 0xb7, 0x5f, 0x14, 0x25, 0x1c, 0x75, 0x03,
199 0x1d, 0x0b, 0xcb, 0xac, 0x1c, 0x2c, 0x04, 0xc7 },
200 { 0x76, 0x08, 0x9d, 0x3c, 0x0f, 0xf3, 0xef, 0xdc,
201 0x6e, 0x36, 0x72, 0x1d, 0x4f, 0xce, 0xb7, 0x47 },
202 { 0x27, 0x20, 0x2b, 0x82 },
203 { 0x7e, 0x3f, 0x44, 0xc7 },
204 { 0xb7, 0xf9, 0x2e, 0x42, 0x6a, 0x36, 0xfe, 0xc5 }
205 }, {
206 /* 3GPP TS 55.205 v6.0.0 - Test Set 16 */
207 { 0x6c, 0xd1, 0xc6, 0xce, 0xb1, 0xe0, 0x1e, 0x14,
208 0xf1, 0xb8, 0x23, 0x16, 0xa9, 0x0b, 0x7f, 0x3d },
209 { 0xf6, 0x9b, 0x78, 0xf3, 0x00, 0xa0, 0x56, 0x8b,
210 0xce, 0x9f, 0x0c, 0xb9, 0x3c, 0x4b, 0xe4, 0xc9 },
211 { 0xa2, 0x19, 0xdc, 0x37, 0xf1, 0xdc, 0x7d, 0x66,
212 0x73, 0x8b, 0x58, 0x43, 0xc7, 0x99, 0xf2, 0x06 },
213 { 0xdd, 0xd7, 0xef, 0xe6 },
214 { 0x70, 0xf6, 0xbd, 0xb9 },
215 { 0x88, 0xd9, 0xde, 0x10, 0xa2, 0x20, 0x04, 0xc5 }
216 }, {
217 /* 3GPP TS 55.205 v6.0.0 - Test Set 17 */
218 { 0xb7, 0x3a, 0x90, 0xcb, 0xcf, 0x3a, 0xfb, 0x62,
219 0x2d, 0xba, 0x83, 0xc5, 0x8a, 0x84, 0x15, 0xdf },
220 { 0xb1, 0x20, 0xf1, 0xc1, 0xa0, 0x10, 0x2a, 0x2f,
221 0x50, 0x7d, 0xd5, 0x43, 0xde, 0x68, 0x28, 0x1f },
222 { 0xdf, 0x0c, 0x67, 0x86, 0x8f, 0xa2, 0x5f, 0x74,
223 0x8b, 0x70, 0x44, 0xc6, 0xe7, 0xc2, 0x45, 0xb8 },
224 { 0x67, 0xe4, 0xff, 0x3f },
225 { 0x47, 0x9d, 0xd2, 0x5c },
226 { 0xa8, 0x19, 0xe5, 0x77, 0xa8, 0xd6, 0x17, 0x5b }
227 }, {
228 /* 3GPP TS 55.205 v6.0.0 - Test Set 18 */
229 { 0x51, 0x22, 0x25, 0x02, 0x14, 0xc3, 0x3e, 0x72,
230 0x3a, 0x5d, 0xd5, 0x23, 0xfc, 0x14, 0x5f, 0xc0 },
231 { 0x81, 0xe9, 0x2b, 0x6c, 0x0e, 0xe0, 0xe1, 0x2e,
232 0xbc, 0xeb, 0xa8, 0xd9, 0x2a, 0x99, 0xdf, 0xa5 },
233 { 0x98, 0x1d, 0x46, 0x4c, 0x7c, 0x52, 0xeb, 0x6e,
234 0x50, 0x36, 0x23, 0x49, 0x84, 0xad, 0x0b, 0xcf },
235 { 0x8a, 0x3b, 0x8d, 0x17 },
236 { 0x28, 0xd7, 0xb0, 0xf2 },
237 { 0x9a, 0x8d, 0x0e, 0x88, 0x3f, 0xf0, 0x88, 0x7a }
238 }, {
239 /* 3GPP TS 55.205 v6.0.0 - Test Set 19 */
240 { 0x90, 0xdc, 0xa4, 0xed, 0xa4, 0x5b, 0x53, 0xcf,
241 0x0f, 0x12, 0xd7, 0xc9, 0xc3, 0xbc, 0x6a, 0x89 },
242 { 0x9f, 0xdd, 0xc7, 0x20, 0x92, 0xc6, 0xad, 0x03,
243 0x6b, 0x6e, 0x46, 0x47, 0x89, 0x31, 0x5b, 0x78 },
244 { 0xcb, 0x9c, 0xcc, 0xc4, 0xb9, 0x25, 0x8e, 0x6d,
245 0xca, 0x47, 0x60, 0x37, 0x9f, 0xb8, 0x25, 0x81 },
246 { 0xdf, 0x58, 0x52, 0x2f },
247 { 0xa9, 0x51, 0x00, 0xe2 },
248 { 0xed, 0x29, 0xb2, 0xf1, 0xc2, 0x7f, 0x9f, 0x34 }
252 #define NUM_GSM_TESTS (sizeof(gsm_test_sets) / sizeof(gsm_test_sets[0]))
255 struct milenage_test_set {
256 u8 k[16];
257 u8 rand[16];
258 u8 sqn[6];
259 u8 amf[2];
260 u8 op[16];
261 u8 opc[16];
262 u8 f1[8];
263 u8 f1star[8];
264 u8 f2[8];
265 u8 f3[16];
266 u8 f4[16];
267 u8 f5[6];
268 u8 f5star[6];
271 static const struct milenage_test_set test_sets[] =
274 /* 3GPP TS 35.208 v6.0.0 - 4.3.1 Test Set 1 */
275 { 0x46, 0x5b, 0x5c, 0xe8, 0xb1, 0x99, 0xb4, 0x9f,
276 0xaa, 0x5f, 0x0a, 0x2e, 0xe2, 0x38, 0xa6, 0xbc },
277 { 0x23, 0x55, 0x3c, 0xbe, 0x96, 0x37, 0xa8, 0x9d,
278 0x21, 0x8a, 0xe6, 0x4d, 0xae, 0x47, 0xbf, 0x35 },
279 { 0xff, 0x9b, 0xb4, 0xd0, 0xb6, 0x07 },
280 { 0xb9, 0xb9 },
281 { 0xcd, 0xc2, 0x02, 0xd5, 0x12, 0x3e, 0x20, 0xf6,
282 0x2b, 0x6d, 0x67, 0x6a, 0xc7, 0x2c, 0xb3, 0x18 },
283 { 0xcd, 0x63, 0xcb, 0x71, 0x95, 0x4a, 0x9f, 0x4e,
284 0x48, 0xa5, 0x99, 0x4e, 0x37, 0xa0, 0x2b, 0xaf },
285 { 0x4a, 0x9f, 0xfa, 0xc3, 0x54, 0xdf, 0xaf, 0xb3 },
286 { 0x01, 0xcf, 0xaf, 0x9e, 0xc4, 0xe8, 0x71, 0xe9 },
287 { 0xa5, 0x42, 0x11, 0xd5, 0xe3, 0xba, 0x50, 0xbf },
288 { 0xb4, 0x0b, 0xa9, 0xa3, 0xc5, 0x8b, 0x2a, 0x05,
289 0xbb, 0xf0, 0xd9, 0x87, 0xb2, 0x1b, 0xf8, 0xcb },
290 { 0xf7, 0x69, 0xbc, 0xd7, 0x51, 0x04, 0x46, 0x04,
291 0x12, 0x76, 0x72, 0x71, 0x1c, 0x6d, 0x34, 0x41 },
292 { 0xaa, 0x68, 0x9c, 0x64, 0x83, 0x70 },
293 { 0x45, 0x1e, 0x8b, 0xec, 0xa4, 0x3b }
294 }, {
295 /* 3GPP TS 35.208 v6.0.0 - 4.3.2 Test Set 2 */
296 { 0x46, 0x5b, 0x5c, 0xe8, 0xb1, 0x99, 0xb4, 0x9f,
297 0xaa, 0x5f, 0x0a, 0x2e, 0xe2, 0x38, 0xa6, 0xbc },
298 { 0x23, 0x55, 0x3c, 0xbe, 0x96, 0x37, 0xa8, 0x9d,
299 0x21, 0x8a, 0xe6, 0x4d, 0xae, 0x47, 0xbf, 0x35 },
300 { 0xff, 0x9b, 0xb4, 0xd0, 0xb6, 0x07 },
301 { 0xb9, 0xb9 },
302 { 0xcd, 0xc2, 0x02, 0xd5, 0x12, 0x3e, 0x20, 0xf6,
303 0x2b, 0x6d, 0x67, 0x6a, 0xc7, 0x2c, 0xb3, 0x18 },
304 { 0xcd, 0x63, 0xcb, 0x71, 0x95, 0x4a, 0x9f, 0x4e,
305 0x48, 0xa5, 0x99, 0x4e, 0x37, 0xa0, 0x2b, 0xaf },
306 { 0x4a, 0x9f, 0xfa, 0xc3, 0x54, 0xdf, 0xaf, 0xb3 },
307 { 0x01, 0xcf, 0xaf, 0x9e, 0xc4, 0xe8, 0x71, 0xe9 },
308 { 0xa5, 0x42, 0x11, 0xd5, 0xe3, 0xba, 0x50, 0xbf },
309 { 0xb4, 0x0b, 0xa9, 0xa3, 0xc5, 0x8b, 0x2a, 0x05,
310 0xbb, 0xf0, 0xd9, 0x87, 0xb2, 0x1b, 0xf8, 0xcb },
311 { 0xf7, 0x69, 0xbc, 0xd7, 0x51, 0x04, 0x46, 0x04,
312 0x12, 0x76, 0x72, 0x71, 0x1c, 0x6d, 0x34, 0x41 },
313 { 0xaa, 0x68, 0x9c, 0x64, 0x83, 0x70 },
314 { 0x45, 0x1e, 0x8b, 0xec, 0xa4, 0x3b }
315 }, {
316 /* 3GPP TS 35.208 v6.0.0 - 4.3.3 Test Set 3 */
317 { 0xfe, 0xc8, 0x6b, 0xa6, 0xeb, 0x70, 0x7e, 0xd0,
318 0x89, 0x05, 0x75, 0x7b, 0x1b, 0xb4, 0x4b, 0x8f },
319 { 0x9f, 0x7c, 0x8d, 0x02, 0x1a, 0xcc, 0xf4, 0xdb,
320 0x21, 0x3c, 0xcf, 0xf0, 0xc7, 0xf7, 0x1a, 0x6a },
321 { 0x9d, 0x02, 0x77, 0x59, 0x5f, 0xfc },
322 { 0x72, 0x5c },
323 { 0xdb, 0xc5, 0x9a, 0xdc, 0xb6, 0xf9, 0xa0, 0xef,
324 0x73, 0x54, 0x77, 0xb7, 0xfa, 0xdf, 0x83, 0x74 },
325 { 0x10, 0x06, 0x02, 0x0f, 0x0a, 0x47, 0x8b, 0xf6,
326 0xb6, 0x99, 0xf1, 0x5c, 0x06, 0x2e, 0x42, 0xb3 },
327 { 0x9c, 0xab, 0xc3, 0xe9, 0x9b, 0xaf, 0x72, 0x81 },
328 { 0x95, 0x81, 0x4b, 0xa2, 0xb3, 0x04, 0x43, 0x24 },
329 { 0x80, 0x11, 0xc4, 0x8c, 0x0c, 0x21, 0x4e, 0xd2 },
330 { 0x5d, 0xbd, 0xbb, 0x29, 0x54, 0xe8, 0xf3, 0xcd,
331 0xe6, 0x65, 0xb0, 0x46, 0x17, 0x9a, 0x50, 0x98 },
332 { 0x59, 0xa9, 0x2d, 0x3b, 0x47, 0x6a, 0x04, 0x43,
333 0x48, 0x70, 0x55, 0xcf, 0x88, 0xb2, 0x30, 0x7b },
334 { 0x33, 0x48, 0x4d, 0xc2, 0x13, 0x6b },
335 { 0xde, 0xac, 0xdd, 0x84, 0x8c, 0xc6 }
336 }, {
337 /* 3GPP TS 35.208 v6.0.0 - 4.3.4 Test Set 4 */
338 { 0x9e, 0x59, 0x44, 0xae, 0xa9, 0x4b, 0x81, 0x16,
339 0x5c, 0x82, 0xfb, 0xf9, 0xf3, 0x2d, 0xb7, 0x51 },
340 { 0xce, 0x83, 0xdb, 0xc5, 0x4a, 0xc0, 0x27, 0x4a,
341 0x15, 0x7c, 0x17, 0xf8, 0x0d, 0x01, 0x7b, 0xd6 },
342 { 0x0b, 0x60, 0x4a, 0x81, 0xec, 0xa8 },
343 { 0x9e, 0x09 },
344 { 0x22, 0x30, 0x14, 0xc5, 0x80, 0x66, 0x94, 0xc0,
345 0x07, 0xca, 0x1e, 0xee, 0xf5, 0x7f, 0x00, 0x4f },
346 { 0xa6, 0x4a, 0x50, 0x7a, 0xe1, 0xa2, 0xa9, 0x8b,
347 0xb8, 0x8e, 0xb4, 0x21, 0x01, 0x35, 0xdc, 0x87 },
348 { 0x74, 0xa5, 0x82, 0x20, 0xcb, 0xa8, 0x4c, 0x49 },
349 { 0xac, 0x2c, 0xc7, 0x4a, 0x96, 0x87, 0x18, 0x37 },
350 { 0xf3, 0x65, 0xcd, 0x68, 0x3c, 0xd9, 0x2e, 0x96 },
351 { 0xe2, 0x03, 0xed, 0xb3, 0x97, 0x15, 0x74, 0xf5,
352 0xa9, 0x4b, 0x0d, 0x61, 0xb8, 0x16, 0x34, 0x5d },
353 { 0x0c, 0x45, 0x24, 0xad, 0xea, 0xc0, 0x41, 0xc4,
354 0xdd, 0x83, 0x0d, 0x20, 0x85, 0x4f, 0xc4, 0x6b },
355 { 0xf0, 0xb9, 0xc0, 0x8a, 0xd0, 0x2e },
356 { 0x60, 0x85, 0xa8, 0x6c, 0x6f, 0x63 }
357 }, {
358 /* 3GPP TS 35.208 v6.0.0 - 4.3.5 Test Set 5 */
359 { 0x4a, 0xb1, 0xde, 0xb0, 0x5c, 0xa6, 0xce, 0xb0,
360 0x51, 0xfc, 0x98, 0xe7, 0x7d, 0x02, 0x6a, 0x84 },
361 { 0x74, 0xb0, 0xcd, 0x60, 0x31, 0xa1, 0xc8, 0x33,
362 0x9b, 0x2b, 0x6c, 0xe2, 0xb8, 0xc4, 0xa1, 0x86 },
363 { 0xe8, 0x80, 0xa1, 0xb5, 0x80, 0xb6 },
364 { 0x9f, 0x07 },
365 { 0x2d, 0x16, 0xc5, 0xcd, 0x1f, 0xdf, 0x6b, 0x22,
366 0x38, 0x35, 0x84, 0xe3, 0xbe, 0xf2, 0xa8, 0xd8 },
367 { 0xdc, 0xf0, 0x7c, 0xbd, 0x51, 0x85, 0x52, 0x90,
368 0xb9, 0x2a, 0x07, 0xa9, 0x89, 0x1e, 0x52, 0x3e },
369 { 0x49, 0xe7, 0x85, 0xdd, 0x12, 0x62, 0x6e, 0xf2 },
370 { 0x9e, 0x85, 0x79, 0x03, 0x36, 0xbb, 0x3f, 0xa2 },
371 { 0x58, 0x60, 0xfc, 0x1b, 0xce, 0x35, 0x1e, 0x7e },
372 { 0x76, 0x57, 0x76, 0x6b, 0x37, 0x3d, 0x1c, 0x21,
373 0x38, 0xf3, 0x07, 0xe3, 0xde, 0x92, 0x42, 0xf9 },
374 { 0x1c, 0x42, 0xe9, 0x60, 0xd8, 0x9b, 0x8f, 0xa9,
375 0x9f, 0x27, 0x44, 0xe0, 0x70, 0x8c, 0xcb, 0x53 },
376 { 0x31, 0xe1, 0x1a, 0x60, 0x91, 0x18 },
377 { 0xfe, 0x25, 0x55, 0xe5, 0x4a, 0xa9 }
378 }, {
379 /* 3GPP TS 35.208 v6.0.0 - 4.3.6 Test Set 6 */
380 { 0x6c, 0x38, 0xa1, 0x16, 0xac, 0x28, 0x0c, 0x45,
381 0x4f, 0x59, 0x33, 0x2e, 0xe3, 0x5c, 0x8c, 0x4f },
382 { 0xee, 0x64, 0x66, 0xbc, 0x96, 0x20, 0x2c, 0x5a,
383 0x55, 0x7a, 0xbb, 0xef, 0xf8, 0xba, 0xbf, 0x63 },
384 { 0x41, 0x4b, 0x98, 0x22, 0x21, 0x81 },
385 { 0x44, 0x64 },
386 { 0x1b, 0xa0, 0x0a, 0x1a, 0x7c, 0x67, 0x00, 0xac,
387 0x8c, 0x3f, 0xf3, 0xe9, 0x6a, 0xd0, 0x87, 0x25 },
388 { 0x38, 0x03, 0xef, 0x53, 0x63, 0xb9, 0x47, 0xc6,
389 0xaa, 0xa2, 0x25, 0xe5, 0x8f, 0xae, 0x39, 0x34 },
390 { 0x07, 0x8a, 0xdf, 0xb4, 0x88, 0x24, 0x1a, 0x57 },
391 { 0x80, 0x24, 0x6b, 0x8d, 0x01, 0x86, 0xbc, 0xf1 },
392 { 0x16, 0xc8, 0x23, 0x3f, 0x05, 0xa0, 0xac, 0x28 },
393 { 0x3f, 0x8c, 0x75, 0x87, 0xfe, 0x8e, 0x4b, 0x23,
394 0x3a, 0xf6, 0x76, 0xae, 0xde, 0x30, 0xba, 0x3b },
395 { 0xa7, 0x46, 0x6c, 0xc1, 0xe6, 0xb2, 0xa1, 0x33,
396 0x7d, 0x49, 0xd3, 0xb6, 0x6e, 0x95, 0xd7, 0xb4 },
397 { 0x45, 0xb0, 0xf6, 0x9a, 0xb0, 0x6c },
398 { 0x1f, 0x53, 0xcd, 0x2b, 0x11, 0x13 }
399 }, {
400 /* 3GPP TS 35.208 v6.0.0 - 4.3.7 Test Set 7 */
401 { 0x2d, 0x60, 0x9d, 0x4d, 0xb0, 0xac, 0x5b, 0xf0,
402 0xd2, 0xc0, 0xde, 0x26, 0x70, 0x14, 0xde, 0x0d },
403 { 0x19, 0x4a, 0xa7, 0x56, 0x01, 0x38, 0x96, 0xb7,
404 0x4b, 0x4a, 0x2a, 0x3b, 0x0a, 0xf4, 0x53, 0x9e },
405 { 0x6b, 0xf6, 0x94, 0x38, 0xc2, 0xe4 },
406 { 0x5f, 0x67 },
407 { 0x46, 0x0a, 0x48, 0x38, 0x54, 0x27, 0xaa, 0x39,
408 0x26, 0x4a, 0xac, 0x8e, 0xfc, 0x9e, 0x73, 0xe8 },
409 { 0xc3, 0x5a, 0x0a, 0xb0, 0xbc, 0xbf, 0xc9, 0x25,
410 0x2c, 0xaf, 0xf1, 0x5f, 0x24, 0xef, 0xbd, 0xe0 },
411 { 0xbd, 0x07, 0xd3, 0x00, 0x3b, 0x9e, 0x5c, 0xc3 },
412 { 0xbc, 0xb6, 0xc2, 0xfc, 0xad, 0x15, 0x22, 0x50 },
413 { 0x8c, 0x25, 0xa1, 0x6c, 0xd9, 0x18, 0xa1, 0xdf },
414 { 0x4c, 0xd0, 0x84, 0x60, 0x20, 0xf8, 0xfa, 0x07,
415 0x31, 0xdd, 0x47, 0xcb, 0xdc, 0x6b, 0xe4, 0x11 },
416 { 0x88, 0xab, 0x80, 0xa4, 0x15, 0xf1, 0x5c, 0x73,
417 0x71, 0x12, 0x54, 0xa1, 0xd3, 0x88, 0xf6, 0x96 },
418 { 0x7e, 0x64, 0x55, 0xf3, 0x4c, 0xf3 },
419 { 0xdc, 0x6d, 0xd0, 0x1e, 0x8f, 0x15 }
420 }, {
421 /* 3GPP TS 35.208 v6.0.0 - 4.3.8 Test Set 8 */
422 { 0xa5, 0x30, 0xa7, 0xfe, 0x42, 0x8f, 0xad, 0x10,
423 0x82, 0xc4, 0x5e, 0xdd, 0xfc, 0xe1, 0x38, 0x84 },
424 { 0x3a, 0x4c, 0x2b, 0x32, 0x45, 0xc5, 0x0e, 0xb5,
425 0xc7, 0x1d, 0x08, 0x63, 0x93, 0x95, 0x76, 0x4d },
426 { 0xf6, 0x3f, 0x5d, 0x76, 0x87, 0x84 },
427 { 0xb9, 0x0e },
428 { 0x51, 0x1c, 0x6c, 0x4e, 0x83, 0xe3, 0x8c, 0x89,
429 0xb1, 0xc5, 0xd8, 0xdd, 0xe6, 0x24, 0x26, 0xfa },
430 { 0x27, 0x95, 0x3e, 0x49, 0xbc, 0x8a, 0xf6, 0xdc,
431 0xc6, 0xe7, 0x30, 0xeb, 0x80, 0x28, 0x6b, 0xe3 },
432 { 0x53, 0x76, 0x1f, 0xbd, 0x67, 0x9b, 0x0b, 0xad },
433 { 0x21, 0xad, 0xfd, 0x33, 0x4a, 0x10, 0xe7, 0xce },
434 { 0xa6, 0x32, 0x41, 0xe1, 0xff, 0xc3, 0xe5, 0xab },
435 { 0x10, 0xf0, 0x5b, 0xab, 0x75, 0xa9, 0x9a, 0x5f,
436 0xbb, 0x98, 0xa9, 0xc2, 0x87, 0x67, 0x9c, 0x3b },
437 { 0xf9, 0xec, 0x08, 0x65, 0xeb, 0x32, 0xf2, 0x23,
438 0x69, 0xca, 0xde, 0x40, 0xc5, 0x9c, 0x3a, 0x44 },
439 { 0x88, 0x19, 0x6c, 0x47, 0x98, 0x6f },
440 { 0xc9, 0x87, 0xa3, 0xd2, 0x31, 0x15 }
441 }, {
442 /* 3GPP TS 35.208 v6.0.0 - 4.3.9 Test Set 9 */
443 { 0xd9, 0x15, 0x1c, 0xf0, 0x48, 0x96, 0xe2, 0x58,
444 0x30, 0xbf, 0x2e, 0x08, 0x26, 0x7b, 0x83, 0x60 },
445 { 0xf7, 0x61, 0xe5, 0xe9, 0x3d, 0x60, 0x3f, 0xeb,
446 0x73, 0x0e, 0x27, 0x55, 0x6c, 0xb8, 0xa2, 0xca },
447 { 0x47, 0xee, 0x01, 0x99, 0x82, 0x0a },
448 { 0x91, 0x13 },
449 { 0x75, 0xfc, 0x22, 0x33, 0xa4, 0x42, 0x94, 0xee,
450 0x8e, 0x6d, 0xe2, 0x5c, 0x43, 0x53, 0xd2, 0x6b },
451 { 0xc4, 0xc9, 0x3e, 0xff, 0xe8, 0xa0, 0x81, 0x38,
452 0xc2, 0x03, 0xd4, 0xc2, 0x7c, 0xe4, 0xe3, 0xd9 },
453 { 0x66, 0xcc, 0x4b, 0xe4, 0x48, 0x62, 0xaf, 0x1f },
454 { 0x7a, 0x4b, 0x8d, 0x7a, 0x87, 0x53, 0xf2, 0x46 },
455 { 0x4a, 0x90, 0xb2, 0x17, 0x1a, 0xc8, 0x3a, 0x76 },
456 { 0x71, 0x23, 0x6b, 0x71, 0x29, 0xf9, 0xb2, 0x2a,
457 0xb7, 0x7e, 0xa7, 0xa5, 0x4c, 0x96, 0xda, 0x22 },
458 { 0x90, 0x52, 0x7e, 0xba, 0xa5, 0x58, 0x89, 0x68,
459 0xdb, 0x41, 0x72, 0x73, 0x25, 0xa0, 0x4d, 0x9e },
460 { 0x82, 0xa0, 0xf5, 0x28, 0x7a, 0x71 },
461 { 0x52, 0x7d, 0xbf, 0x41, 0xf3, 0x5f }
462 }, {
463 /* 3GPP TS 35.208 v6.0.0 - 4.3.10 Test Set 10 */
464 { 0xa0, 0xe2, 0x97, 0x1b, 0x68, 0x22, 0xe8, 0xd3,
465 0x54, 0xa1, 0x8c, 0xc2, 0x35, 0x62, 0x4e, 0xcb },
466 { 0x08, 0xef, 0xf8, 0x28, 0xb1, 0x3f, 0xdb, 0x56,
467 0x27, 0x22, 0xc6, 0x5c, 0x7f, 0x30, 0xa9, 0xb2 },
468 { 0xdb, 0x5c, 0x06, 0x64, 0x81, 0xe0 },
469 { 0x71, 0x6b },
470 { 0x32, 0x37, 0x92, 0xfa, 0xca, 0x21, 0xfb, 0x4d,
471 0x5d, 0x6f, 0x13, 0xc1, 0x45, 0xa9, 0xd2, 0xc1 },
472 { 0x82, 0xa2, 0x6f, 0x22, 0xbb, 0xa9, 0xe9, 0x48,
473 0x8f, 0x94, 0x9a, 0x10, 0xd9, 0x8e, 0x9c, 0xc4 },
474 { 0x94, 0x85, 0xfe, 0x24, 0x62, 0x1c, 0xb9, 0xf6 },
475 { 0xbc, 0xe3, 0x25, 0xce, 0x03, 0xe2, 0xe9, 0xb9 },
476 { 0x4b, 0xc2, 0x21, 0x2d, 0x86, 0x24, 0x91, 0x0a },
477 { 0x08, 0xce, 0xf6, 0xd0, 0x04, 0xec, 0x61, 0x47,
478 0x1a, 0x3c, 0x3c, 0xda, 0x04, 0x81, 0x37, 0xfa },
479 { 0xed, 0x03, 0x18, 0xca, 0x5d, 0xeb, 0x92, 0x06,
480 0x27, 0x2f, 0x6e, 0x8f, 0xa6, 0x4b, 0xa4, 0x11 },
481 { 0xa2, 0xf8, 0x58, 0xaa, 0x9e, 0x5d },
482 { 0x74, 0xe7, 0x6f, 0xbb, 0xec, 0x38 }
483 }, {
484 /* 3GPP TS 35.208 v6.0.0 - 4.3.11 Test Set 11 */
485 { 0x0d, 0xa6, 0xf7, 0xba, 0x86, 0xd5, 0xea, 0xc8,
486 0xa1, 0x9c, 0xf5, 0x63, 0xac, 0x58, 0x64, 0x2d },
487 { 0x67, 0x9a, 0xc4, 0xdb, 0xac, 0xd7, 0xd2, 0x33,
488 0xff, 0x9d, 0x68, 0x06, 0xf4, 0x14, 0x9c, 0xe3 },
489 { 0x6e, 0x23, 0x31, 0xd6, 0x92, 0xad },
490 { 0x22, 0x4a },
491 { 0x4b, 0x9a, 0x26, 0xfa, 0x45, 0x9e, 0x3a, 0xcb,
492 0xff, 0x36, 0xf4, 0x01, 0x5d, 0xe3, 0xbd, 0xc1 },
493 { 0x0d, 0xb1, 0x07, 0x1f, 0x87, 0x67, 0x56, 0x2c,
494 0xa4, 0x3a, 0x0a, 0x64, 0xc4, 0x1e, 0x8d, 0x08 },
495 { 0x28, 0x31, 0xd7, 0xae, 0x90, 0x88, 0xe4, 0x92 },
496 { 0x9b, 0x2e, 0x16, 0x95, 0x11, 0x35, 0xd5, 0x23 },
497 { 0x6f, 0xc3, 0x0f, 0xee, 0x6d, 0x12, 0x35, 0x23 },
498 { 0x69, 0xb1, 0xca, 0xe7, 0xc7, 0x42, 0x9d, 0x97,
499 0x5e, 0x24, 0x5c, 0xac, 0xb0, 0x5a, 0x51, 0x7c },
500 { 0x74, 0xf2, 0x4e, 0x8c, 0x26, 0xdf, 0x58, 0xe1,
501 0xb3, 0x8d, 0x7d, 0xcd, 0x4f, 0x1b, 0x7f, 0xbd },
502 { 0x4c, 0x53, 0x9a, 0x26, 0xe1, 0xfa },
503 { 0x07, 0x86, 0x1e, 0x12, 0x69, 0x28 }
504 }, {
505 /* 3GPP TS 35.208 v6.0.0 - 4.3.12 Test Set 12 */
506 { 0x77, 0xb4, 0x58, 0x43, 0xc8, 0x8e, 0x58, 0xc1,
507 0x0d, 0x20, 0x26, 0x84, 0x51, 0x5e, 0xd4, 0x30 },
508 { 0x4c, 0x47, 0xeb, 0x30, 0x76, 0xdc, 0x55, 0xfe,
509 0x51, 0x06, 0xcb, 0x20, 0x34, 0xb8, 0xcd, 0x78 },
510 { 0xfe, 0x1a, 0x87, 0x31, 0x00, 0x5d },
511 { 0xad, 0x25 },
512 { 0xbf, 0x32, 0x86, 0xc7, 0xa5, 0x14, 0x09, 0xce,
513 0x95, 0x72, 0x4d, 0x50, 0x3b, 0xfe, 0x6e, 0x70 },
514 { 0xd4, 0x83, 0xaf, 0xae, 0x56, 0x24, 0x09, 0xa3,
515 0x26, 0xb5, 0xbb, 0x0b, 0x20, 0xc4, 0xd7, 0x62 },
516 { 0x08, 0x33, 0x2d, 0x7e, 0x9f, 0x48, 0x45, 0x70 },
517 { 0xed, 0x41, 0xb7, 0x34, 0x48, 0x9d, 0x52, 0x07 },
518 { 0xae, 0xfa, 0x35, 0x7b, 0xea, 0xc2, 0xa8, 0x7a },
519 { 0x90, 0x8c, 0x43, 0xf0, 0x56, 0x9c, 0xb8, 0xf7,
520 0x4b, 0xc9, 0x71, 0xe7, 0x06, 0xc3, 0x6c, 0x5f },
521 { 0xc2, 0x51, 0xdf, 0x0d, 0x88, 0x8d, 0xd9, 0x32,
522 0x9b, 0xcf, 0x46, 0x65, 0x5b, 0x22, 0x6e, 0x40 },
523 { 0x30, 0xff, 0x25, 0xcd, 0xad, 0xf6 },
524 { 0xe8, 0x4e, 0xd0, 0xd4, 0x67, 0x7e }
525 }, {
526 /* 3GPP TS 35.208 v6.0.0 - 4.3.13 Test Set 13 */
527 { 0x72, 0x9b, 0x17, 0x72, 0x92, 0x70, 0xdd, 0x87,
528 0xcc, 0xdf, 0x1b, 0xfe, 0x29, 0xb4, 0xe9, 0xbb },
529 { 0x31, 0x1c, 0x4c, 0x92, 0x97, 0x44, 0xd6, 0x75,
530 0xb7, 0x20, 0xf3, 0xb7, 0xe9, 0xb1, 0xcb, 0xd0 },
531 { 0xc8, 0x5c, 0x4c, 0xf6, 0x59, 0x16 },
532 { 0x5b, 0xb2 },
533 { 0xd0, 0x4c, 0x9c, 0x35, 0xbd, 0x22, 0x62, 0xfa,
534 0x81, 0x0d, 0x29, 0x24, 0xd0, 0x36, 0xfd, 0x13 },
535 { 0x22, 0x8c, 0x2f, 0x2f, 0x06, 0xac, 0x32, 0x68,
536 0xa9, 0xe6, 0x16, 0xee, 0x16, 0xdb, 0x4b, 0xa1 },
537 { 0xff, 0x79, 0x4f, 0xe2, 0xf8, 0x27, 0xeb, 0xf8 },
538 { 0x24, 0xfe, 0x4d, 0xc6, 0x1e, 0x87, 0x4b, 0x52 },
539 { 0x98, 0xdb, 0xbd, 0x09, 0x9b, 0x3b, 0x40, 0x8d },
540 { 0x44, 0xc0, 0xf2, 0x3c, 0x54, 0x93, 0xcf, 0xd2,
541 0x41, 0xe4, 0x8f, 0x19, 0x7e, 0x1d, 0x10, 0x12 },
542 { 0x0c, 0x9f, 0xb8, 0x16, 0x13, 0x88, 0x4c, 0x25,
543 0x35, 0xdd, 0x0e, 0xab, 0xf3, 0xb4, 0x40, 0xd8 },
544 { 0x53, 0x80, 0xd1, 0x58, 0xcf, 0xe3 },
545 { 0x87, 0xac, 0x3b, 0x55, 0x9f, 0xb6 }
546 }, {
547 /* 3GPP TS 35.208 v6.0.0 - 4.3.14 Test Set 14 */
548 { 0xd3, 0x2d, 0xd2, 0x3e, 0x89, 0xdc, 0x66, 0x23,
549 0x54, 0xca, 0x12, 0xeb, 0x79, 0xdd, 0x32, 0xfa },
550 { 0xcf, 0x7d, 0x0a, 0xb1, 0xd9, 0x43, 0x06, 0x95,
551 0x0b, 0xf1, 0x20, 0x18, 0xfb, 0xd4, 0x68, 0x87 },
552 { 0x48, 0x41, 0x07, 0xe5, 0x6a, 0x43 },
553 { 0xb5, 0xe6 },
554 { 0xfe, 0x75, 0x90, 0x5b, 0x9d, 0xa4, 0x7d, 0x35,
555 0x62, 0x36, 0xd0, 0x31, 0x4e, 0x09, 0xc3, 0x2e },
556 { 0xd2, 0x2a, 0x4b, 0x41, 0x80, 0xa5, 0x32, 0x57,
557 0x08, 0xa5, 0xff, 0x70, 0xd9, 0xf6, 0x7e, 0xc7 },
558 { 0xcf, 0x19, 0xd6, 0x2b, 0x6a, 0x80, 0x98, 0x66 },
559 { 0x5d, 0x26, 0x95, 0x37, 0xe4, 0x5e, 0x2c, 0xe6 },
560 { 0xaf, 0x4a, 0x41, 0x1e, 0x11, 0x39, 0xf2, 0xc2 },
561 { 0x5a, 0xf8, 0x6b, 0x80, 0xed, 0xb7, 0x0d, 0xf5,
562 0x29, 0x2c, 0xc1, 0x12, 0x1c, 0xba, 0xd5, 0x0c },
563 { 0x7f, 0x4d, 0x6a, 0xe7, 0x44, 0x0e, 0x18, 0x78,
564 0x9a, 0x8b, 0x75, 0xad, 0x3f, 0x42, 0xf0, 0x3a },
565 { 0x21, 0x7a, 0xf4, 0x92, 0x72, 0xad },
566 { 0x90, 0x0e, 0x10, 0x1c, 0x67, 0x7e }
567 }, {
568 /* 3GPP TS 35.208 v6.0.0 - 4.3.15 Test Set 15 */
569 { 0xaf, 0x7c, 0x65, 0xe1, 0x92, 0x72, 0x21, 0xde,
570 0x59, 0x11, 0x87, 0xa2, 0xc5, 0x98, 0x7a, 0x53 },
571 { 0x1f, 0x0f, 0x85, 0x78, 0x46, 0x4f, 0xd5, 0x9b,
572 0x64, 0xbe, 0xd2, 0xd0, 0x94, 0x36, 0xb5, 0x7a },
573 { 0x3d, 0x62, 0x7b, 0x01, 0x41, 0x8d },
574 { 0x84, 0xf6 },
575 { 0x0c, 0x7a, 0xcb, 0x8d, 0x95, 0xb7, 0xd4, 0xa3,
576 0x1c, 0x5a, 0xca, 0x6d, 0x26, 0x34, 0x5a, 0x88 },
577 { 0xa4, 0xcf, 0x5c, 0x81, 0x55, 0xc0, 0x8a, 0x7e,
578 0xff, 0x41, 0x8e, 0x54, 0x43, 0xb9, 0x8e, 0x55 },
579 { 0xc3, 0x7c, 0xae, 0x78, 0x05, 0x64, 0x20, 0x32 },
580 { 0x68, 0xcd, 0x09, 0xa4, 0x52, 0xd8, 0xdb, 0x7c },
581 { 0x7b, 0xff, 0xa5, 0xc2, 0xf4, 0x1f, 0xbc, 0x05 },
582 { 0x3f, 0x8c, 0x3f, 0x3c, 0xcf, 0x76, 0x25, 0xbf,
583 0x77, 0xfc, 0x94, 0xbc, 0xfd, 0x22, 0xfd, 0x26 },
584 { 0xab, 0xcb, 0xae, 0x8f, 0xd4, 0x61, 0x15, 0xe9,
585 0x96, 0x1a, 0x55, 0xd0, 0xda, 0x5f, 0x20, 0x78 },
586 { 0x83, 0x7f, 0xd7, 0xb7, 0x44, 0x19 },
587 { 0x56, 0xe9, 0x7a, 0x60, 0x90, 0xb1 }
588 }, {
589 /* 3GPP TS 35.208 v6.0.0 - 4.3.16 Test Set 16 */
590 { 0x5b, 0xd7, 0xec, 0xd3, 0xd3, 0x12, 0x7a, 0x41,
591 0xd1, 0x25, 0x39, 0xbe, 0xd4, 0xe7, 0xcf, 0x71 },
592 { 0x59, 0xb7, 0x5f, 0x14, 0x25, 0x1c, 0x75, 0x03,
593 0x1d, 0x0b, 0xcb, 0xac, 0x1c, 0x2c, 0x04, 0xc7 },
594 { 0xa2, 0x98, 0xae, 0x89, 0x29, 0xdc },
595 { 0xd0, 0x56 },
596 { 0xf9, 0x67, 0xf7, 0x60, 0x38, 0xb9, 0x20, 0xa9,
597 0xcd, 0x25, 0xe1, 0x0c, 0x08, 0xb4, 0x99, 0x24 },
598 { 0x76, 0x08, 0x9d, 0x3c, 0x0f, 0xf3, 0xef, 0xdc,
599 0x6e, 0x36, 0x72, 0x1d, 0x4f, 0xce, 0xb7, 0x47 },
600 { 0xc3, 0xf2, 0x5c, 0xd9, 0x43, 0x09, 0x10, 0x7e },
601 { 0xb0, 0xc8, 0xba, 0x34, 0x36, 0x65, 0xaf, 0xcc },
602 { 0x7e, 0x3f, 0x44, 0xc7, 0x59, 0x1f, 0x6f, 0x45 },
603 { 0xd4, 0x2b, 0x2d, 0x61, 0x5e, 0x49, 0xa0, 0x3a,
604 0xc2, 0x75, 0xa5, 0xae, 0xf9, 0x7a, 0xf8, 0x92 },
605 { 0x0b, 0x3f, 0x8d, 0x02, 0x4f, 0xe6, 0xbf, 0xaf,
606 0xaa, 0x98, 0x2b, 0x8f, 0x82, 0xe3, 0x19, 0xc2 },
607 { 0x5b, 0xe1, 0x14, 0x95, 0x52, 0x5d },
608 { 0x4d, 0x6a, 0x34, 0xa1, 0xe4, 0xeb }
609 }, {
610 /* 3GPP TS 35.208 v6.0.0 - 4.3.17 Test Set 17 */
611 { 0x6c, 0xd1, 0xc6, 0xce, 0xb1, 0xe0, 0x1e, 0x14,
612 0xf1, 0xb8, 0x23, 0x16, 0xa9, 0x0b, 0x7f, 0x3d },
613 { 0xf6, 0x9b, 0x78, 0xf3, 0x00, 0xa0, 0x56, 0x8b,
614 0xce, 0x9f, 0x0c, 0xb9, 0x3c, 0x4b, 0xe4, 0xc9 },
615 { 0xb4, 0xfc, 0xe5, 0xfe, 0xb0, 0x59 },
616 { 0xe4, 0xbb },
617 { 0x07, 0x8b, 0xfc, 0xa9, 0x56, 0x46, 0x59, 0xec,
618 0xd8, 0x85, 0x1e, 0x84, 0xe6, 0xc5, 0x9b, 0x48 },
619 { 0xa2, 0x19, 0xdc, 0x37, 0xf1, 0xdc, 0x7d, 0x66,
620 0x73, 0x8b, 0x58, 0x43, 0xc7, 0x99, 0xf2, 0x06 },
621 { 0x69, 0xa9, 0x08, 0x69, 0xc2, 0x68, 0xcb, 0x7b },
622 { 0x2e, 0x0f, 0xdc, 0xf9, 0xfd, 0x1c, 0xfa, 0x6a },
623 { 0x70, 0xf6, 0xbd, 0xb9, 0xad, 0x21, 0x52, 0x5f },
624 { 0x6e, 0xda, 0xf9, 0x9e, 0x5b, 0xd9, 0xf8, 0x5d,
625 0x5f, 0x36, 0xd9, 0x1c, 0x12, 0x72, 0xfb, 0x4b },
626 { 0xd6, 0x1c, 0x85, 0x3c, 0x28, 0x0d, 0xd9, 0xc4,
627 0x6f, 0x29, 0x7b, 0xae, 0xc3, 0x86, 0xde, 0x17 },
628 { 0x1c, 0x40, 0x8a, 0x85, 0x8b, 0x3e },
629 { 0xaa, 0x4a, 0xe5, 0x2d, 0xaa, 0x30 }
630 }, {
631 /* 3GPP TS 35.208 v6.0.0 - 4.3.18 Test Set 18 */
632 { 0xb7, 0x3a, 0x90, 0xcb, 0xcf, 0x3a, 0xfb, 0x62,
633 0x2d, 0xba, 0x83, 0xc5, 0x8a, 0x84, 0x15, 0xdf },
634 { 0xb1, 0x20, 0xf1, 0xc1, 0xa0, 0x10, 0x2a, 0x2f,
635 0x50, 0x7d, 0xd5, 0x43, 0xde, 0x68, 0x28, 0x1f },
636 { 0xf1, 0xe8, 0xa5, 0x23, 0xa3, 0x6d },
637 { 0x47, 0x1b },
638 { 0xb6, 0x72, 0x04, 0x7e, 0x00, 0x3b, 0xb9, 0x52,
639 0xdc, 0xa6, 0xcb, 0x8a, 0xf0, 0xe5, 0xb7, 0x79 },
640 { 0xdf, 0x0c, 0x67, 0x86, 0x8f, 0xa2, 0x5f, 0x74,
641 0x8b, 0x70, 0x44, 0xc6, 0xe7, 0xc2, 0x45, 0xb8 },
642 { 0xeb, 0xd7, 0x03, 0x41, 0xbc, 0xd4, 0x15, 0xb0 },
643 { 0x12, 0x35, 0x9f, 0x5d, 0x82, 0x22, 0x0c, 0x14 },
644 { 0x47, 0x9d, 0xd2, 0x5c, 0x20, 0x79, 0x2d, 0x63 },
645 { 0x66, 0x19, 0x5d, 0xbe, 0xd0, 0x31, 0x32, 0x74,
646 0xc5, 0xca, 0x77, 0x66, 0x61, 0x5f, 0xa2, 0x5e },
647 { 0x66, 0xbe, 0xc7, 0x07, 0xeb, 0x2a, 0xfc, 0x47,
648 0x6d, 0x74, 0x08, 0xa8, 0xf2, 0x92, 0x7b, 0x36 },
649 { 0xae, 0xfd, 0xaa, 0x5d, 0xdd, 0x99 },
650 { 0x12, 0xec, 0x2b, 0x87, 0xfb, 0xb1 }
651 }, {
652 /* 3GPP TS 35.208 v6.0.0 - 4.3.19 Test Set 19 */
653 { 0x51, 0x22, 0x25, 0x02, 0x14, 0xc3, 0x3e, 0x72,
654 0x3a, 0x5d, 0xd5, 0x23, 0xfc, 0x14, 0x5f, 0xc0 },
655 { 0x81, 0xe9, 0x2b, 0x6c, 0x0e, 0xe0, 0xe1, 0x2e,
656 0xbc, 0xeb, 0xa8, 0xd9, 0x2a, 0x99, 0xdf, 0xa5 },
657 { 0x16, 0xf3, 0xb3, 0xf7, 0x0f, 0xc2 },
658 { 0xc3, 0xab },
659 { 0xc9, 0xe8, 0x76, 0x32, 0x86, 0xb5, 0xb9, 0xff,
660 0xbd, 0xf5, 0x6e, 0x12, 0x97, 0xd0, 0x88, 0x7b },
661 { 0x98, 0x1d, 0x46, 0x4c, 0x7c, 0x52, 0xeb, 0x6e,
662 0x50, 0x36, 0x23, 0x49, 0x84, 0xad, 0x0b, 0xcf },
663 { 0x2a, 0x5c, 0x23, 0xd1, 0x5e, 0xe3, 0x51, 0xd5 },
664 { 0x62, 0xda, 0xe3, 0x85, 0x3f, 0x3a, 0xf9, 0xd2 },
665 { 0x28, 0xd7, 0xb0, 0xf2, 0xa2, 0xec, 0x3d, 0xe5 },
666 { 0x53, 0x49, 0xfb, 0xe0, 0x98, 0x64, 0x9f, 0x94,
667 0x8f, 0x5d, 0x2e, 0x97, 0x3a, 0x81, 0xc0, 0x0f },
668 { 0x97, 0x44, 0x87, 0x1a, 0xd3, 0x2b, 0xf9, 0xbb,
669 0xd1, 0xdd, 0x5c, 0xe5, 0x4e, 0x3e, 0x2e, 0x5a },
670 { 0xad, 0xa1, 0x5a, 0xeb, 0x7b, 0xb8 },
671 { 0xd4, 0x61, 0xbc, 0x15, 0x47, 0x5d }
672 }, {
673 /* 3GPP TS 35.208 v6.0.0 - 4.3.20 Test Set 20 */
674 { 0x90, 0xdc, 0xa4, 0xed, 0xa4, 0x5b, 0x53, 0xcf,
675 0x0f, 0x12, 0xd7, 0xc9, 0xc3, 0xbc, 0x6a, 0x89 },
676 { 0x9f, 0xdd, 0xc7, 0x20, 0x92, 0xc6, 0xad, 0x03,
677 0x6b, 0x6e, 0x46, 0x47, 0x89, 0x31, 0x5b, 0x78 },
678 { 0x20, 0xf8, 0x13, 0xbd, 0x41, 0x41 },
679 { 0x61, 0xdf },
680 { 0x3f, 0xfc, 0xfe, 0x5b, 0x7b, 0x11, 0x11, 0x58,
681 0x99, 0x20, 0xd3, 0x52, 0x8e, 0x84, 0xe6, 0x55 },
682 { 0xcb, 0x9c, 0xcc, 0xc4, 0xb9, 0x25, 0x8e, 0x6d,
683 0xca, 0x47, 0x60, 0x37, 0x9f, 0xb8, 0x25, 0x81 },
684 { 0x09, 0xdb, 0x94, 0xea, 0xb4, 0xf8, 0x14, 0x9e },
685 { 0xa2, 0x94, 0x68, 0xaa, 0x97, 0x75, 0xb5, 0x27 },
686 { 0xa9, 0x51, 0x00, 0xe2, 0x76, 0x09, 0x52, 0xcd },
687 { 0xb5, 0xf2, 0xda, 0x03, 0x88, 0x3b, 0x69, 0xf9,
688 0x6b, 0xf5, 0x2e, 0x02, 0x9e, 0xd9, 0xac, 0x45 },
689 { 0xb4, 0x72, 0x13, 0x68, 0xbc, 0x16, 0xea, 0x67,
690 0x87, 0x5c, 0x55, 0x98, 0x68, 0x8b, 0xb0, 0xef },
691 { 0x83, 0xcf, 0xd5, 0x4d, 0xb9, 0x13 },
692 { 0x4f, 0x20, 0x39, 0x39, 0x2d, 0xdc }
696 #define NUM_TESTS (sizeof(test_sets) / sizeof(test_sets[0]))
699 int main(int argc, char *argv[])
701 u8 buf[16], buf2[16], buf3[16], buf4[16], buf5[16], opc[16];
702 u8 auts[14], sqn[6], _rand[16];
703 int ret = 0, res, i;
704 const struct milenage_test_set *t;
705 size_t res_len;
707 wpa_debug_level = 0;
709 printf("Milenage test sets\n");
710 for (i = 0; i < NUM_TESTS; i++) {
711 t = &test_sets[i];
712 printf("Test Set %d\n", i + 1);
714 milenage_opc(t->op, t->k, opc);
715 if (memcmp(opc, t->opc, 16) != 0) {
716 printf("- milenage_opc failed\n");
717 ret++;
720 if (milenage_f1(opc, t->k, t->rand, t->sqn, t->amf, buf, buf2)
721 || memcmp(buf, t->f1, 8) != 0) {
722 printf("- milenage_f1 failed\n");
723 ret++;
725 if (memcmp(buf2, t->f1star, 8) != 0) {
726 printf("- milenage_f1* failed\n");
727 ret++;
730 if (milenage_f2345(opc, t->k, t->rand, buf, buf2, buf3, buf4,
731 buf5) ||
732 memcmp(buf, t->f2, 8) != 0) {
733 printf("- milenage_f2 failed\n");
734 ret++;
736 if (memcmp(buf2, t->f3, 16) != 0) {
737 printf("- milenage_f3 failed\n");
738 ret++;
740 if (memcmp(buf3, t->f4, 16) != 0) {
741 printf("- milenage_f4 failed\n");
742 ret++;
744 if (memcmp(buf4, t->f5, 6) != 0) {
745 printf("- milenage_f5 failed\n");
746 ret++;
748 if (memcmp(buf5, t->f5star, 6) != 0) {
749 printf("- milenage_f5* failed\n");
750 ret++;
754 printf("milenage_auts test:\n");
755 os_memcpy(auts, "\x4f\x20\x39\x39\x2d\xdd", 6);
756 os_memcpy(auts + 6, "\x4b\xb4\x31\x6e\xd4\xa1\x46\x88", 8);
757 res = milenage_auts(t->opc, t->k, t->rand, auts, buf);
758 printf("AUTS for test set %d: %d / SQN=%02x%02x%02x%02x%02x%02x\n",
759 i, res, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
760 if (res)
761 ret++;
763 os_memset(_rand, 0xaa, sizeof(_rand));
764 os_memcpy(auts,
765 "\x43\x68\x1a\xd3\xda\xf0\x06\xbc\xde\x40\x5a\x20\x72\x67",
766 14);
767 res = milenage_auts(t->opc, t->k, _rand, auts, buf);
768 printf("AUTS from a test USIM: %d / SQN=%02x%02x%02x%02x%02x%02x\n",
769 res, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
770 if (res)
771 ret++;
773 printf("milenage_generate test:\n");
774 os_memcpy(sqn, "\x00\x00\x00\x00\x40\x44", 6);
775 os_memcpy(_rand, "\x12\x69\xb8\x23\x41\x39\x35\x66\xfb\x99\x41\xe9\x84"
776 "\x4f\xe6\x2f", 16);
777 res_len = 8;
778 milenage_generate(t->opc, t->amf, t->k, sqn, _rand, buf, buf2, buf3,
779 buf4, &res_len);
780 wpa_hexdump(MSG_DEBUG, "SQN", sqn, 6);
781 wpa_hexdump(MSG_DEBUG, "RAND", _rand, 16);
782 wpa_hexdump(MSG_DEBUG, "AUTN", buf, 16);
783 wpa_hexdump(MSG_DEBUG, "IK", buf2, 16);
784 wpa_hexdump(MSG_DEBUG, "CK", buf3, 16);
785 wpa_hexdump(MSG_DEBUG, "RES", buf4, res_len);
787 printf("GSM-Milenage test sets\n");
788 for (i = 0; i < NUM_GSM_TESTS; i++) {
789 const struct gsm_milenage_test_set *g;
790 u8 sres[4], kc[8];
791 g = &gsm_test_sets[i];
792 printf("Test Set %d\n", i + 1);
793 gsm_milenage(g->opc, g->ki, g->rand, sres, kc);
794 if (memcmp(g->kc, kc, 8) != 0) {
795 printf("- gsm_milenage Kc failed\n");
796 ret++;
798 #ifdef GSM_MILENAGE_ALT_SRES
799 if (memcmp(g->sres2, sres, 4) != 0) {
800 printf("- gsm_milenage SRES#2 failed\n");
801 ret++;
803 #else /* GSM_MILENAGE_ALT_SRES */
804 if (memcmp(g->sres1, sres, 4) != 0) {
805 printf("- gsm_milenage SRES#1 failed\n");
806 ret++;
808 #endif /* GSM_MILENAGE_ALT_SRES */
811 if (ret)
812 printf("Something failed\n");
813 else
814 printf("OK\n");
816 return ret;