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