test/crypto: fix null check for ZUC authentication
[dpdk.git] / app / test / test_cryptodev_security_docsis_test_vectors.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2020 Intel Corporation
3  */
4
5 #ifndef TEST_CRYPTODEV_SECURITY_DOCSIS_TEST_VECTORS_H_
6 #define TEST_CRYPTODEV_SECURITY_DOCSIS_TEST_VECTORS_H_
7
8 /*
9  * DOCSIS test data and cases
10  * - encrypt direction: CRC-Crypto
11  * - decrypt direction: Crypto-CRC
12  */
13
14 struct docsis_test_data {
15         const char test_descr_uplink[128];
16         const char test_descr_downlink[128];
17
18         struct {
19                 uint8_t data[32];
20                 unsigned int len;
21         } key;
22
23         struct {
24                 uint8_t data[16] __rte_aligned(16);
25                 unsigned int len;
26         } iv;
27
28         struct {
29                 uint8_t data[1024];
30                 unsigned int len;
31                 unsigned int cipher_offset;
32                 unsigned int crc_offset;
33                 bool no_cipher;
34                 bool no_crc;
35         } plaintext;
36
37         struct {
38                 uint8_t data[1024];
39                 unsigned int len;
40                 unsigned int cipher_offset;
41                 unsigned int crc_offset;
42                 bool no_cipher;
43                 bool no_crc;
44         } ciphertext;
45 };
46
47 const struct docsis_test_data docsis_test_case_1 = {
48         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-128 and CRC Verify (24-byte "
49                         "frame, Small offset and runt block decryption)"},
50         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-128 "
51                         "(24-byte frame, Small offset and runt block encryption)"},
52         .key = {
53                 .data = {
54                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
55                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
56                 },
57                 .len = 16
58         },
59         .iv = {
60                 .data = {
61                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
62                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
63                 },
64                 .len = 16
65         },
66         .plaintext = {
67                 .data = {
68                         /* DOCSIS header */
69                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
70                         /* Ethernet frame */
71                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
72                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00,
73                         /* CRC */
74                         0xFF, 0xFF, 0xFF, 0xFF
75                 },
76                 .len = 24,
77                 .cipher_offset = 18,
78                 .crc_offset = 6,
79                 .no_cipher = false,
80                 .no_crc = false
81         },
82         .ciphertext = {
83                 .data = {
84                         /* DOCSIS header */
85                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
86                         /* Ethernet frame */
87                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
88                         0x04, 0x03, 0x02, 0x01, 0x7A, 0xF0,
89                         /* CRC */
90                         0x61, 0xF8, 0x63, 0x42
91                 },
92                 .len = 24,
93                 .cipher_offset = 18,
94                 .crc_offset = 6,
95                 .no_cipher = false,
96                 .no_crc = false
97         }
98 };
99
100 const struct docsis_test_data docsis_test_case_2 = {
101         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-128 and CRC Verify (25-byte "
102                         "frame, Small offset and runt block decryption)"},
103         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-128 "
104                         "(25-byte frame, Small offset and runt block encryption)"},
105         .key = {
106                 .data = {
107                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
108                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
109                 },
110                 .len = 16
111         },
112         .iv = {
113                 .data = {
114                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
115                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
116                 },
117                 .len = 16
118         },
119         .plaintext = {
120                 .data = {
121                         /* DOCSIS header */
122                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
123                         /* Ethernet frame */
124                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
125                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA,
126                         /* CRC */
127                         0xFF, 0xFF, 0xFF, 0xFF
128                 },
129                 .len = 25,
130                 .cipher_offset = 18,
131                 .crc_offset = 6,
132                 .no_cipher = false,
133                 .no_crc = false
134         },
135         .ciphertext = {
136                 .data = {
137                         /* DOCSIS header */
138                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
139                         /* Ethernet frame */
140                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
141                         0x04, 0x03, 0x02, 0x01, 0x7A, 0xF0, 0xDF,
142                         /* CRC */
143                         0xFE, 0x12, 0x99, 0xE5
144                 },
145                 .len = 25,
146                 .cipher_offset = 18,
147                 .crc_offset = 6,
148                 .no_cipher = false,
149                 .no_crc = false
150         }
151 };
152
153 const struct docsis_test_data docsis_test_case_3 = {
154         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-128 and CRC Verify (34-byte "
155                         "frame, Small offset and full block decryption)"},
156         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-128 "
157                         "(34-byte frame, Small offset and full block encryption)"},
158         .key = {
159                 .data = {
160                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
161                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
162                 },
163                 .len = 16
164         },
165         .iv = {
166                 .data = {
167                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
168                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
169                 },
170                 .len = 16
171         },
172         .plaintext = {
173                 .data = {
174                         /* DOCSIS header */
175                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
176                         /* Ethernet frame */
177                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
178                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
179                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
180                         /* CRC */
181                         0xFF, 0xFF, 0xFF, 0xFF
182                 },
183                 .len = 34,
184                 .cipher_offset = 18,
185                 .crc_offset = 6,
186                 .no_cipher = false,
187                 .no_crc = false
188         },
189         .ciphertext = {
190                 .data = {
191                         /* DOCSIS header */
192                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
193                         /* Ethernet frame */
194                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
195                         0x04, 0x03, 0x02, 0x01, 0xD6, 0xE2, 0x70, 0x5C,
196                         0xE6, 0x4D, 0xCC, 0x8C, 0x47, 0xB7, 0x09, 0xD6,
197                         /* CRC */
198                         0x54, 0x85, 0xF8, 0x32
199                 },
200                 .len = 34,
201                 .cipher_offset = 18,
202                 .crc_offset = 6,
203                 .no_cipher = false,
204                 .no_crc = false
205         }
206 };
207
208 const struct docsis_test_data docsis_test_case_4 = {
209         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-128 and CRC Verify (35-byte "
210                         "frame, Small offset and uneven decryption)"},
211         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-128 "
212                         "(35-byte frame, Small offset and uneven encryption)"},
213         .key = {
214                 .data = {
215                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
216                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
217                 },
218                 .len = 16
219         },
220         .iv = {
221                 .data = {
222                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
223                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
224                 },
225                 .len = 16
226         },
227         .plaintext = {
228                 .data = {
229                         /* DOCSIS header */
230                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
231                         /* Ethernet frame */
232                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
233                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
234                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
235                         0xAA,
236                         /* CRC */
237                         0xFF, 0xFF, 0xFF, 0xFF
238                 },
239                 .len = 35,
240                 .cipher_offset = 18,
241                 .crc_offset = 6,
242                 .no_cipher = false,
243                 .no_crc = false
244         },
245         .ciphertext = {
246                 .data = {
247                         /* DOCSIS header */
248                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
249                         /* Ethernet frame */
250                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
251                         0x04, 0x03, 0x02, 0x01, 0x92, 0x6A, 0xC2, 0xDC,
252                         0xEE, 0x3B, 0x31, 0xEC, 0x03, 0xDE, 0x95, 0x33,
253                         0x5E,
254                         /* CRC */
255                         0xFE, 0x47, 0x3E, 0x22
256                 },
257                 .len = 35,
258                 .cipher_offset = 18,
259                 .crc_offset = 6,
260                 .no_cipher = false,
261                 .no_crc = false
262         }
263 };
264
265 const struct docsis_test_data docsis_test_case_5 = {
266         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-128 and CRC Verify (82-byte "
267                         "frame, Small offset and full block decryption)"},
268         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-128 "
269                         "(82-byte frame, Small offset and full block encryption)"},
270         .key = {
271                 .data = {
272                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
273                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
274                 },
275                 .len = 16
276         },
277         .iv = {
278                 .data = {
279                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
280                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
281                 },
282                 .len = 16
283         },
284         .plaintext = {
285                 .data = {
286                         /* DOCSIS header */
287                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
288                         /* Ethernet frame */
289                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
290                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
291                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
292                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
293                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
294                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
295                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
296                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
297                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
298                         /* CRC */
299                         0xFF, 0xFF, 0xFF, 0xFF
300                 },
301                 .len = 82,
302                 .cipher_offset = 18,
303                 .crc_offset = 6,
304                 .no_cipher = false,
305                 .no_crc = false
306         },
307         .ciphertext = {
308                 .data = {
309                         /* DOCSIS header */
310                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
311                         /* Ethernet frame */
312                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
313                         0x04, 0x03, 0x02, 0x01, 0x77, 0x74, 0x56, 0x05,
314                         0xD1, 0x14, 0xA2, 0x8D, 0x2C, 0x9A, 0x11, 0xFC,
315                         0x7D, 0xB0, 0xE7, 0x18, 0xCE, 0x75, 0x7C, 0x89,
316                         0x14, 0x56, 0xE2, 0xF2, 0xB7, 0x47, 0x08, 0x27,
317                         0xF7, 0x08, 0x7A, 0x13, 0x90, 0x81, 0x75, 0xB0,
318                         0xC7, 0x91, 0x04, 0x83, 0xAD, 0x11, 0x46, 0x46,
319                         0xF8, 0x54, 0x87, 0xA0, 0x42, 0xF3, 0x71, 0xA9,
320                         0x8A, 0xCD, 0x59, 0x77, 0x67, 0x11, 0x1A, 0x87,
321                         /* CRC */
322                         0xAB, 0xED, 0x2C, 0x26
323                 },
324                 .len = 82,
325                 .cipher_offset = 18,
326                 .crc_offset = 6,
327                 .no_cipher = false,
328                 .no_crc = false
329         }
330 };
331
332 const struct docsis_test_data docsis_test_case_6 = {
333         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-128 and CRC Verify (83-byte "
334                         "frame, Small offset and uneven decryption)"},
335         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-128 "
336                         "(83-byte frame, Small offset and uneven encryption)"},
337         .key = {
338                 .data = {
339                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
340                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
341                 },
342                 .len = 16
343         },
344         .iv = {
345                 .data = {
346                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
347                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
348                 },
349                 .len = 16
350         },
351         .plaintext = {
352                 .data = {
353                         /* DOCSIS header */
354                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
355                         /* Ethernet frame */
356                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
357                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
358                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
359                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
360                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
361                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
362                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
363                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
364                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
365                         0xAA,
366                         /* CRC */
367                         0xFF, 0xFF, 0xFF, 0xFF
368                 },
369                 .len = 83,
370                 .cipher_offset = 18,
371                 .crc_offset = 6,
372                 .no_cipher = false,
373                 .no_crc = false
374         },
375         .ciphertext = {
376                 .data = {
377                         /* DOCSIS header */
378                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
379                         /* Ethernet frame */
380                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
381                         0x04, 0x03, 0x02, 0x01, 0x77, 0x74, 0x56, 0x05,
382                         0xD1, 0x14, 0xA2, 0x8D, 0x2C, 0x9A, 0x11, 0xFC,
383                         0x7D, 0xB0, 0xE7, 0x18, 0xCE, 0x75, 0x7C, 0x89,
384                         0x14, 0x56, 0xE2, 0xF2, 0xB7, 0x47, 0x08, 0x27,
385                         0xF7, 0x08, 0x7A, 0x13, 0x90, 0x81, 0x75, 0xB0,
386                         0xC7, 0x91, 0x04, 0x83, 0xAD, 0x11, 0x46, 0x46,
387                         0xF8, 0x54, 0x87, 0xA0, 0xA4, 0x0C, 0xC2, 0xF0,
388                         0x81, 0x49, 0xA8, 0xA6, 0x6C, 0x48, 0xEB, 0x1F,
389                         0x4B,
390                         /* CRC */
391                         0x2F, 0xD4, 0x48, 0x18
392                 },
393                 .len = 83,
394                 .cipher_offset = 18,
395                 .crc_offset = 6,
396                 .no_cipher = false,
397                 .no_crc = false
398         }
399 };
400
401 const struct docsis_test_data docsis_test_case_7 = {
402         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-128 and CRC Verify (83-byte "
403                         "frame, Big offset and uneven decryption)"},
404         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-128 "
405                         "(83-byte frame, Big offset and uneven encryption)"},
406         .key = {
407                 .data = {
408                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
409                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
410                 },
411                 .len = 16
412         },
413         .iv = {
414                 .data = {
415                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
416                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
417                 },
418                 .len = 16
419         },
420         .plaintext = {
421                 .data = {
422                         /* DOCSIS header */
423                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
424                         /* Ethernet frame */
425                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
426                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
427                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
428                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
429                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
430                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
431                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
432                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
433                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
434                         0xAA,
435                         /* CRC */
436                         0xFF, 0xFF, 0xFF, 0xFF
437                 },
438                 .len = 83,
439                 .cipher_offset = 40,
440                 .crc_offset = 6,
441                 .no_cipher = false,
442                 .no_crc = false
443         },
444         .ciphertext = {
445                 .data = {
446                         /* DOCSIS header */
447                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
448                         /* Ethernet frame */
449                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
450                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
451                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
452                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
453                         0xAA, 0xAA, 0x3B, 0x9F, 0x72, 0x4C, 0xB5, 0x72,
454                         0x3E, 0x56, 0x54, 0x49, 0x13, 0x53, 0xC4, 0xAA,
455                         0xCD, 0xEA, 0x6A, 0x88, 0x99, 0x07, 0x86, 0xF4,
456                         0xCF, 0x03, 0x4E, 0xDF, 0x65, 0x61, 0x47, 0x5B,
457                         0x2F, 0x81, 0x09, 0x12, 0x9A, 0xC2, 0x24, 0x8C,
458                         0x09,
459                         /* CRC */
460                         0x11, 0xB4, 0x06, 0x33
461                 },
462                 .len = 83,
463                 .cipher_offset = 40,
464                 .crc_offset = 6,
465                 .no_cipher = false,
466                 .no_crc = false
467         }
468 };
469
470 const struct docsis_test_data docsis_test_case_8 = {
471         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-128 and CRC Verify (24-byte "
472                         "frame, No CRC, Small offset and runt block decryption)"},
473         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-128 "
474                         "(24-byte frame, No CRC, Small offset and runt block encryption)"},
475         .key = {
476                 .data = {
477                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
478                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
479                 },
480                 .len = 16
481         },
482         .iv = {
483                 .data = {
484                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
485                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
486                 },
487                 .len = 16
488         },
489         .plaintext = {
490                 .data = {
491                         /* DOCSIS header */
492                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
493                         /* Ethernet frame */
494                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
495                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00,
496                         /* CRC */
497                         0xFF, 0xFF, 0xFF, 0xFF
498                 },
499                 .len = 24,
500                 .cipher_offset = 18,
501                 .crc_offset = 6,
502                 .no_cipher = false,
503                 .no_crc = true
504         },
505         .ciphertext = {
506                 .data = {
507                         /* DOCSIS header */
508                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
509                         /* Ethernet frame */
510                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
511                         0x04, 0x03, 0x02, 0x01, 0x7A, 0xF0,
512                         /* CRC */
513                         0x8A, 0x0F, 0x74, 0xE8
514                 },
515                 .len = 24,
516                 .cipher_offset = 18,
517                 .crc_offset = 6,
518                 .no_cipher = false,
519                 .no_crc = true
520         }
521 };
522
523 const struct docsis_test_data docsis_test_case_9 = {
524         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-128 and CRC Verify (83-byte "
525                         "frame, No CRC, Big offset and uneven decryption)"},
526         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-128 "
527                         "(83-byte frame, No CRC, Big offset and uneven encryption)"},
528         .key = {
529                 .data = {
530                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
531                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
532                 },
533                 .len = 16
534         },
535         .iv = {
536                 .data = {
537                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
538                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
539                 },
540                 .len = 16
541         },
542         .plaintext = {
543                 .data = {
544                         /* DOCSIS header */
545                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
546                         /* Ethernet frame */
547                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
548                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
549                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
550                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
551                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
552                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
553                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
554                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
555                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
556                         0xAA,
557                         /* CRC */
558                         0xFF, 0xFF, 0xFF, 0xFF
559                 },
560                 .len = 83,
561                 .cipher_offset = 40,
562                 .crc_offset = 6,
563                 .no_cipher = false,
564                 .no_crc = true
565         },
566         .ciphertext = {
567                 .data = {
568                         /* DOCSIS header */
569                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
570                         /* Ethernet frame */
571                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
572                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
573                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
574                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
575                         0xAA, 0xAA, 0x3B, 0x9F, 0x72, 0x4C, 0xB5, 0x72,
576                         0x3E, 0x56, 0x54, 0x49, 0x13, 0x53, 0xC4, 0xAA,
577                         0xCD, 0xEA, 0x6A, 0x88, 0x99, 0x07, 0x86, 0xF4,
578                         0xCF, 0x03, 0x4E, 0xDF, 0x65, 0x61, 0x47, 0x5B,
579                         0x2F, 0x81, 0x09, 0x12, 0x9A, 0xC2, 0x24, 0x8C,
580                         0x09,
581                         /* CRC */
582                         0x5D, 0x2B, 0x12, 0xF4
583                 },
584                 .len = 83,
585                 .cipher_offset = 40,
586                 .crc_offset = 6,
587                 .no_cipher = false,
588                 .no_crc = true
589         }
590 };
591
592 const struct docsis_test_data docsis_test_case_10 = {
593         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-128 and CRC Verify (24-byte "
594                         "frame, No decryption)"},
595         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-128 "
596                         "(24-byte frame, No encryption)"},
597         .key = {
598                 .data = {
599                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
600                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
601                 },
602                 .len = 16
603         },
604         .iv = {
605                 .data = {
606                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
607                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
608                 },
609                 .len = 16
610         },
611         .plaintext = {
612                 .data = {
613                         /* DOCSIS header */
614                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
615                         /* Ethernet frame */
616                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
617                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00,
618                         /* CRC */
619                         0xFF, 0xFF, 0xFF, 0xFF
620                 },
621                 .len = 24,
622                 .cipher_offset = 18,
623                 .crc_offset = 6,
624                 .no_cipher = true,
625                 .no_crc = false
626         },
627         .ciphertext = {
628                 .data = {
629                         /* DOCSIS header */
630                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
631                         /* Ethernet frame */
632                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
633                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00,
634                         /* CRC */
635                         0x14, 0x08, 0xE8, 0x55
636                 },
637                 .len = 24,
638                 .cipher_offset = 18,
639                 .crc_offset = 6,
640                 .no_cipher = true,
641                 .no_crc = false
642         }
643 };
644
645 const struct docsis_test_data docsis_test_case_11 = {
646         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-128 and CRC Verify (83-byte "
647                         "frame, No decryption)"},
648         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-128 "
649                         "(83-byte frame, No encryption)"},
650         .key = {
651                 .data = {
652                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
653                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
654                 },
655                 .len = 16
656         },
657         .iv = {
658                 .data = {
659                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
660                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
661                 },
662                 .len = 16
663         },
664         .plaintext = {
665                 .data = {
666                         /* DOCSIS header */
667                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
668                         /* Ethernet frame */
669                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
670                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
671                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
672                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
673                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
674                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
675                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
676                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
677                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
678                         0xAA,
679                         /* CRC */
680                         0xFF, 0xFF, 0xFF, 0xFF
681                 },
682                 .len = 83,
683                 .cipher_offset = 40,
684                 .crc_offset = 6,
685                 .no_cipher = true,
686                 .no_crc = false
687         },
688         .ciphertext = {
689                 .data = {
690                         /* DOCSIS header */
691                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
692                         /* Ethernet frame */
693                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
694                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
695                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
696                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
697                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
698                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
699                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
700                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
701                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
702                         0xAA,
703                         /* CRC */
704                         0xB3, 0x60, 0xEB, 0x38
705                 },
706                 .len = 83,
707                 .cipher_offset = 40,
708                 .crc_offset = 6,
709                 .no_cipher = true,
710                 .no_crc = false
711         }
712 };
713
714 const struct docsis_test_data docsis_test_case_12 = {
715         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-128 and CRC Verify (24-byte "
716                         "frame, No CRC, No decryption)"},
717         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-128 "
718                 "(24-byte frame, No CRC, No encryption)"},
719         .key = {
720                 .data = {
721                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
722                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
723                 },
724                 .len = 16
725         },
726         .iv = {
727                 .data = {
728                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
729                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
730                 },
731                 .len = 16
732         },
733         .plaintext = {
734                 .data = {
735                         /* DOCSIS header */
736                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
737                         /* Ethernet frame */
738                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
739                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00,
740                         /* CRC */
741                         0xFF, 0xFF, 0xFF, 0xFF
742                 },
743                 .len = 24,
744                 .cipher_offset = 18,
745                 .crc_offset = 6,
746                 .no_cipher = true,
747                 .no_crc = true
748         },
749         .ciphertext = {
750                 .data = {
751                         /* DOCSIS header */
752                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
753                         /* Ethernet frame */
754                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
755                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00,
756                         /* CRC */
757                         0xFF, 0xFF, 0xFF, 0xFF
758                 },
759                 .len = 24,
760                 .cipher_offset = 18,
761                 .crc_offset = 6,
762                 .no_cipher = true,
763                 .no_crc = true
764         }
765 };
766
767 const struct docsis_test_data docsis_test_case_13 = {
768         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-128 and CRC Verify (83-byte "
769                         "frame, No CRC, No decryption)"},
770         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-128 "
771                         "(83-byte frame, No CRC, No encryption)"},
772         .key = {
773                 .data = {
774                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
775                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
776                 },
777                 .len = 16
778         },
779         .iv = {
780                 .data = {
781                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
782                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
783                 },
784                 .len = 16
785         },
786         .plaintext = {
787                 .data = {
788                         /* DOCSIS header */
789                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
790                         /* Ethernet frame */
791                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
792                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
793                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
794                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
795                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
796                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
797                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
798                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
799                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
800                         0xAA,
801                         /* CRC */
802                         0xFF, 0xFF, 0xFF, 0xFF
803                 },
804                 .len = 83,
805                 .cipher_offset = 40,
806                 .crc_offset = 6,
807                 .no_cipher = true,
808                 .no_crc = true
809         },
810         .ciphertext = {
811                 .data = {
812                         /* DOCSIS header */
813                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
814                         /* Ethernet frame */
815                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
816                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
817                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
818                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
819                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
820                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
821                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
822                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
823                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
824                         0xAA,
825                         /* CRC */
826                         0xFF, 0xFF, 0xFF, 0xFF
827                 },
828                 .len = 83,
829                 .cipher_offset = 40,
830                 .crc_offset = 6,
831                 .no_cipher = true,
832                 .no_crc = true
833         }
834 };
835
836 const struct docsis_test_data docsis_test_case_14 = {
837         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-256 and CRC Verify (24-byte "
838                         "frame, Small offset and runt block decryption)"},
839         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-256 "
840                         "(24-byte frame, Small offset and runt block encryption)"},
841         .key = {
842                 .data = {
843                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
844                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
845                         0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD,
846                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
847                 },
848                 .len = 32
849         },
850         .iv = {
851                 .data = {
852                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
853                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
854                 },
855                 .len = 16
856         },
857         .plaintext = {
858                 .data = {
859                         /* DOCSIS header */
860                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
861                         /* Ethernet frame */
862                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
863                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00,
864                         /* CRC */
865                         0xFF, 0xFF, 0xFF, 0xFF
866                 },
867                 .len = 24,
868                 .cipher_offset = 18,
869                 .crc_offset = 6,
870                 .no_cipher = false,
871                 .no_crc = false
872         },
873         .ciphertext = {
874                 .data = {
875                         /* DOCSIS header */
876                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
877                         /* Ethernet frame */
878                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
879                         0x04, 0x03, 0x02, 0x01, 0x6A, 0x86,
880                         /* CRC */
881                         0x9B, 0xB3, 0x1A, 0x26
882                 },
883                 .len = 24,
884                 .cipher_offset = 18,
885                 .crc_offset = 6,
886                 .no_cipher = false,
887                 .no_crc = false
888         }
889 };
890
891 const struct docsis_test_data docsis_test_case_15 = {
892         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-256 and CRC Verify (25-byte "
893                         "frame, Small offset and runt block decryption)"},
894         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-256 "
895                         "(25-byte frame, Small offset and runt block encryption)"},
896         .key = {
897                 .data = {
898                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
899                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
900                         0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD,
901                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
902                 },
903                 .len = 32
904         },
905         .iv = {
906                 .data = {
907                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
908                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
909                 },
910                 .len = 16
911         },
912         .plaintext = {
913                 .data = {
914                         /* DOCSIS header */
915                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
916                         /* Ethernet frame */
917                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
918                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA,
919                         /* CRC */
920                         0xFF, 0xFF, 0xFF, 0xFF
921                 },
922                 .len = 25,
923                 .cipher_offset = 18,
924                 .crc_offset = 6,
925                 .no_cipher = false,
926                 .no_crc = false
927         },
928         .ciphertext = {
929                 .data = {
930                         /* DOCSIS header */
931                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
932                         /* Ethernet frame */
933                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
934                         0x04, 0x03, 0x02, 0x01, 0x6A, 0x86, 0x25,
935                         /* CRC */
936                         0xB5, 0x6B, 0xFD, 0xCB
937                 },
938                 .len = 25,
939                 .cipher_offset = 18,
940                 .crc_offset = 6,
941                 .no_cipher = false,
942                 .no_crc = false
943         }
944 };
945
946 const struct docsis_test_data docsis_test_case_16 = {
947         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-256 and CRC Verify (34-byte "
948                         "frame, Small offset and full block decryption)"},
949         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-256 "
950                         "(34-byte frame, Small offset and full block encryption)"},
951         .key = {
952                 .data = {
953                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
954                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
955                         0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD,
956                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
957                 },
958                 .len = 32
959         },
960         .iv = {
961                 .data = {
962                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
963                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
964                 },
965                 .len = 16
966         },
967         .plaintext = {
968                 .data = {
969                         /* DOCSIS header */
970                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
971                         /* Ethernet frame */
972                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
973                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
974                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
975                         /* CRC */
976                         0xFF, 0xFF, 0xFF, 0xFF
977                 },
978                 .len = 34,
979                 .cipher_offset = 18,
980                 .crc_offset = 6,
981                 .no_cipher = false,
982                 .no_crc = false
983         },
984         .ciphertext = {
985                 .data = {
986                         /* DOCSIS header */
987                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
988                         /* Ethernet frame */
989                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
990                         0x04, 0x03, 0x02, 0x01, 0xF6, 0xA1, 0x2E, 0x0A,
991                         0xBB, 0x27, 0x82, 0x4F, 0x99, 0x0A, 0xE2, 0x3F,
992                         /* CRC */
993                         0xEB, 0xB7, 0x89, 0xB0
994                 },
995                 .len = 34,
996                 .cipher_offset = 18,
997                 .crc_offset = 6,
998                 .no_cipher = false,
999                 .no_crc = false
1000         }
1001 };
1002
1003 const struct docsis_test_data docsis_test_case_17 = {
1004         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-256 and CRC Verify (35-byte "
1005                         "frame, Small offset and uneven decryption)"},
1006         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-256 "
1007                         "(35-byte frame, Small offset and uneven encryption)"},
1008         .key = {
1009                 .data = {
1010                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
1011                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
1012                         0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD,
1013                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
1014                 },
1015                 .len = 32
1016         },
1017         .iv = {
1018                 .data = {
1019                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
1020                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
1021                 },
1022                 .len = 16
1023         },
1024         .plaintext = {
1025                 .data = {
1026                         /* DOCSIS header */
1027                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1028                         /* Ethernet frame */
1029                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
1030                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
1031                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1032                         0xAA,
1033                         /* CRC */
1034                         0xFF, 0xFF, 0xFF, 0xFF
1035                 },
1036                 .len = 35,
1037                 .cipher_offset = 18,
1038                 .crc_offset = 6,
1039                 .no_cipher = false,
1040                 .no_crc = false
1041         },
1042         .ciphertext = {
1043                 .data = {
1044                         /* DOCSIS header */
1045                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1046                         /* Ethernet frame */
1047                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
1048                         0x04, 0x03, 0x02, 0x01, 0xE1, 0x30, 0x38, 0xC8,
1049                         0xC4, 0x59, 0x8D, 0x43, 0x9A, 0xBE, 0xBE, 0x73,
1050                         0xC3,
1051                         /*CRC */
1052                         0x8C, 0xE1, 0x89, 0x8B
1053                 },
1054                 .len = 35,
1055                 .cipher_offset = 18,
1056                 .crc_offset = 6,
1057                 .no_cipher = false,
1058                 .no_crc = false
1059         }
1060 };
1061
1062 const struct docsis_test_data docsis_test_case_18 = {
1063         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-256 and CRC Verify (82-byte "
1064                         "frame, Small offset and full block decryption)"},
1065         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-256 "
1066                         "(82-byte frame, Small offset and full block encryption)"},
1067         .key = {
1068                 .data = {
1069                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
1070                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
1071                         0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD,
1072                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
1073                 },
1074                 .len = 32
1075         },
1076         .iv = {
1077                 .data = {
1078                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
1079                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
1080                 },
1081                 .len = 16
1082         },
1083         .plaintext = {
1084                 .data = {
1085                         /* DOCSIS header */
1086                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1087                         /* Ethernet frame */
1088                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
1089                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
1090                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1091                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1092                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1093                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1094                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1095                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1096                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1097                         /* CRC */
1098                         0xFF, 0xFF, 0xFF, 0xFF
1099                 },
1100                 .len = 82,
1101                 .cipher_offset = 18,
1102                 .crc_offset = 6,
1103                 .no_cipher = false,
1104                 .no_crc = false
1105         },
1106         .ciphertext = {
1107                 .data = {
1108                         /* DOCSIS header */
1109                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1110                         /* Ethernet frame */
1111                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
1112                         0x04, 0x03, 0x02, 0x01, 0xE9, 0x12, 0x3B, 0x12,
1113                         0x36, 0x56, 0x95, 0xA6, 0x97, 0xF1, 0x74, 0x68,
1114                         0xBA, 0x58, 0x77, 0xEA, 0x43, 0x11, 0x85, 0xD4,
1115                         0x7A, 0xF8, 0x1C, 0x11, 0x50, 0xD1, 0xF1, 0xBD,
1116                         0x15, 0x4D, 0x99, 0xB5, 0x39, 0x74, 0x84, 0xDF,
1117                         0xD4, 0x8B, 0xDC, 0xB7, 0x58, 0x1B, 0x22, 0xAB,
1118                         0xF3, 0x29, 0xC6, 0xCB, 0x26, 0x07, 0x36, 0x6B,
1119                         0x8C, 0xAC, 0x6E, 0x99, 0x37, 0x94, 0xDF, 0x31,
1120                         /* CRC */
1121                         0xA1, 0x7D, 0x70, 0xBB
1122                 },
1123                 .len = 82,
1124                 .cipher_offset = 18,
1125                 .crc_offset = 6,
1126                 .no_cipher = false,
1127                 .no_crc = false
1128         }
1129 };
1130
1131 const struct docsis_test_data docsis_test_case_19 = {
1132         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-256 and CRC Verify (83-byte "
1133                         "frame, Small offset and uneven decryption)"},
1134         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-256 "
1135                         "(83-byte frame, Small offset and uneven encryption)"},
1136         .key = {
1137                 .data = {
1138                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
1139                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
1140                         0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD,
1141                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
1142                 },
1143                 .len = 32
1144         },
1145         .iv = {
1146                 .data = {
1147                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
1148                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
1149                 },
1150                 .len = 16
1151         },
1152         .plaintext = {
1153                 .data = {
1154                         /* DOCSIS header */
1155                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1156                         /* Ethernet frame */
1157                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
1158                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
1159                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1160                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1161                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1162                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1163                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1164                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1165                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1166                         0xAA,
1167                         /* CRC */
1168                         0xFF, 0xFF, 0xFF, 0xFF
1169                 },
1170                 .len = 83,
1171                 .cipher_offset = 18,
1172                 .crc_offset = 6,
1173                 .no_cipher = false,
1174                 .no_crc = false
1175         },
1176         .ciphertext = {
1177                 .data = {
1178                         /* DOCSIS header */
1179                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1180                         /* Ethernet frame */
1181                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
1182                         0x04, 0x03, 0x02, 0x01, 0xE9, 0x12, 0x3B, 0x12,
1183                         0x36, 0x56, 0x95, 0xA6, 0x97, 0xF1, 0x74, 0x68,
1184                         0xBA, 0x58, 0x77, 0xEA, 0x43, 0x11, 0x85, 0xD4,
1185                         0x7A, 0xF8, 0x1C, 0x11, 0x50, 0xD1, 0xF1, 0xBD,
1186                         0x15, 0x4D, 0x99, 0xB5, 0x39, 0x74, 0x84, 0xDF,
1187                         0xD4, 0x8B, 0xDC, 0xB7, 0x58, 0x1B, 0x22, 0xAB,
1188                         0xF3, 0x29, 0xC6, 0xCB, 0x13, 0xED, 0x08, 0xF5,
1189                         0x1B, 0x4B, 0xD8, 0x79, 0x93, 0x26, 0x69, 0x03,
1190                         0x23,
1191                         /* CRC */
1192                         0xC8, 0x8E, 0x02, 0x3A
1193                 },
1194                 .len = 83,
1195                 .cipher_offset = 18,
1196                 .crc_offset = 6,
1197                 .no_cipher = false,
1198                 .no_crc = false
1199         }
1200 };
1201
1202 const struct docsis_test_data docsis_test_case_20 = {
1203         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-256 and CRC Verify (83-byte "
1204                         "frame, Big offset and uneven decryption)"},
1205         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-256 "
1206                         "(83-byte frame, Big offset and uneven encryption)"},
1207         .key = {
1208                 .data = {
1209                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
1210                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
1211                         0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD,
1212                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
1213                 },
1214                 .len = 32
1215         },
1216         .iv = {
1217                 .data = {
1218                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
1219                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
1220                 },
1221                 .len = 16
1222         },
1223         .plaintext = {
1224                 .data = {
1225                         /* DOCSIS header */
1226                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1227                         /* Ethernet frame */
1228                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
1229                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
1230                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1231                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1232                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1233                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1234                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1235                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1236                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1237                         0xAA,
1238                         /* CRC */
1239                         0xFF, 0xFF, 0xFF, 0xFF
1240                 },
1241                 .len = 83,
1242                 .cipher_offset = 40,
1243                 .crc_offset = 6,
1244                 .no_cipher = false,
1245                 .no_crc = false
1246         },
1247         .ciphertext = {
1248                 .data = {
1249                         /* DOCSIS header */
1250                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1251                         /* Ethernet frame */
1252                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
1253                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
1254                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1255                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1256                         0xAA, 0xAA, 0x54, 0xB4, 0x55, 0x68, 0x06, 0xBF,
1257                         0x00, 0x8B, 0x5F, 0x2C, 0x10, 0x4A, 0xBF, 0x5A,
1258                         0xF2, 0x20, 0xD9, 0x77, 0x7F, 0x2D, 0x2B, 0x11,
1259                         0xAC, 0xAF, 0x21, 0x36, 0xD2, 0xD4, 0x80, 0xF2,
1260                         0x4F, 0x14, 0xA0, 0x3A, 0x66, 0xE5, 0xC5, 0xE2,
1261                         0x15,
1262                         /* CRC */
1263                         0x0C, 0x89, 0x76, 0x26
1264                 },
1265                 .len = 83,
1266                 .cipher_offset = 40,
1267                 .crc_offset = 6,
1268                 .no_cipher = false,
1269                 .no_crc = false
1270         }
1271 };
1272
1273 const struct docsis_test_data docsis_test_case_21 = {
1274         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-256 and CRC Verify (24-byte "
1275                         "frame, No CRC, Small offset and runt block decryption)"},
1276         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-256 "
1277                         "(24-byte frame, No CRC, Small offset and runt block encryption)"},
1278         .key = {
1279                 .data = {
1280                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
1281                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
1282                         0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD,
1283                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
1284                 },
1285                 .len = 32
1286         },
1287         .iv = {
1288                 .data = {
1289                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
1290                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
1291                 },
1292                 .len = 16
1293         },
1294         .plaintext = {
1295                 .data = {
1296                         /* DOCSIS header */
1297                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1298                         /* Ethernet frame */
1299                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
1300                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00,
1301                         /* CRC */
1302                         0xFF, 0xFF, 0xFF, 0xFF
1303                 },
1304                 .len = 24,
1305                 .cipher_offset = 18,
1306                 .crc_offset = 6,
1307                 .no_cipher = false,
1308                 .no_crc = true
1309         },
1310         .ciphertext = {
1311                 .data = {
1312                         /* DOCSIS header */
1313                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1314                         /* Ethernet frame */
1315                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
1316                         0x04, 0x03, 0x02, 0x01, 0x6A, 0x86,
1317                         /* CRC */
1318                         0x70, 0x44, 0x0D, 0x8C
1319                 },
1320                 .len = 24,
1321                 .cipher_offset = 18,
1322                 .crc_offset = 6,
1323                 .no_cipher = false,
1324                 .no_crc = true
1325         }
1326 };
1327
1328 const struct docsis_test_data docsis_test_case_22 = {
1329         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-256 and CRC Verify (83-byte "
1330                         "frame, No CRC, Big offset and uneven decryption)"},
1331         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-256 "
1332                         "(83-byte frame, No CRC, Big offset and uneven encryption)"},
1333         .key = {
1334                 .data = {
1335                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
1336                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
1337                         0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD,
1338                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
1339                 },
1340                 .len = 32
1341         },
1342         .iv = {
1343                 .data = {
1344                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
1345                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
1346                 },
1347                 .len = 16
1348         },
1349         .plaintext = {
1350                 .data = {
1351                         /* DOCSIS header */
1352                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1353                         /* Ethernet frame */
1354                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
1355                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
1356                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1357                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1358                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1359                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1360                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1361                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1362                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1363                         0xAA,
1364                         /* CRC */
1365                         0xFF, 0xFF, 0xFF, 0xFF
1366                 },
1367                 .len = 83,
1368                 .cipher_offset = 40,
1369                 .crc_offset = 6,
1370                 .no_cipher = false,
1371                 .no_crc = true
1372         },
1373         .ciphertext = {
1374                 .data = {
1375                         /* DOCSIS header */
1376                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1377                         /* Ethernet frame */
1378                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
1379                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
1380                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1381                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1382                         0xAA, 0xAA, 0x54, 0xB4, 0x55, 0x68, 0x06, 0xBF,
1383                         0x00, 0x8B, 0x5F, 0x2C, 0x10, 0x4A, 0xBF, 0x5A,
1384                         0xF2, 0x20, 0xD9, 0x77, 0x7F, 0x2D, 0x2B, 0x11,
1385                         0xAC, 0xAF, 0x21, 0x36, 0xD2, 0xD4, 0x80, 0xF2,
1386                         0x4F, 0x14, 0xA0, 0x3A, 0x66, 0xE5, 0xC5, 0xE2,
1387                         0x15,
1388                         /* CRC */
1389                         0x40, 0x16, 0x62, 0xE1
1390                 },
1391                 .len = 83,
1392                 .cipher_offset = 40,
1393                 .crc_offset = 6,
1394                 .no_cipher = false,
1395                 .no_crc = true
1396         }
1397 };
1398
1399 const struct docsis_test_data docsis_test_case_23 = {
1400         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-256 and CRC Verify (24-byte "
1401                         "frame, No decryption)"},
1402         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-256 "
1403                         "(24-byte frame, No encryption)"},
1404         .key = {
1405                 .data = {
1406                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
1407                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
1408                         0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD,
1409                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
1410                 },
1411                 .len = 32
1412         },
1413         .iv = {
1414                 .data = {
1415                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
1416                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
1417                 },
1418                 .len = 16
1419         },
1420         .plaintext = {
1421                 .data = {
1422                         /* DOCSIS header */
1423                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1424                         /* Ethernet frame */
1425                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
1426                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00,
1427                         /* CRC */
1428                         0xFF, 0xFF, 0xFF, 0xFF
1429                 },
1430                 .len = 24,
1431                 .cipher_offset = 18,
1432                 .crc_offset = 6,
1433                 .no_cipher = true,
1434                 .no_crc = false
1435         },
1436         .ciphertext = {
1437                 .data = {
1438                         /* DOCSIS header */
1439                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1440                         /* Ethernet frame */
1441                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
1442                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00,
1443                         /* CRC */
1444                         0x14, 0x08, 0xE8, 0x55
1445                 },
1446                 .len = 24,
1447                 .cipher_offset = 18,
1448                 .crc_offset = 6,
1449                 .no_cipher = true,
1450                 .no_crc = false
1451         }
1452 };
1453
1454 const struct docsis_test_data docsis_test_case_24 = {
1455         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-256 and CRC Verify (83-byte "
1456                         "frame, No decryption)"},
1457         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-256 "
1458                         "(83-byte frame, No encryption)"},
1459         .key = {
1460                 .data = {
1461                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
1462                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
1463                         0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD,
1464                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
1465                 },
1466                 .len = 32
1467         },
1468         .iv = {
1469                 .data = {
1470                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
1471                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
1472                 },
1473                 .len = 16
1474         },
1475         .plaintext = {
1476                 .data = {
1477                         /* DOCSIS header */
1478                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1479                         /* Ethernet frame */
1480                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
1481                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
1482                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1483                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1484                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1485                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1486                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1487                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1488                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1489                         0xAA,
1490                         /* CRC */
1491                         0xFF, 0xFF, 0xFF, 0xFF
1492                 },
1493                 .len = 83,
1494                 .cipher_offset = 40,
1495                 .crc_offset = 6,
1496                 .no_cipher = true,
1497                 .no_crc = false
1498         },
1499         .ciphertext = {
1500                 .data = {
1501                         /* DOCSIS header */
1502                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1503                         /* Ethernet frame */
1504                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
1505                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
1506                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1507                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1508                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1509                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1510                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1511                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1512                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1513                         0xAA,
1514                         /* CRC */
1515                         0xB3, 0x60, 0xEB, 0x38
1516                 },
1517                 .len = 83,
1518                 .cipher_offset = 40,
1519                 .crc_offset = 6,
1520                 .no_cipher = true,
1521                 .no_crc = false
1522         }
1523 };
1524
1525 const struct docsis_test_data docsis_test_case_25 = {
1526         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-256 and CRC Verify (24-byte "
1527                         "frame, No CRC, No decryption)"},
1528         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-256 "
1529                         "(24-byte frame, No CRC, No encryption)"},
1530         .key = {
1531                 .data = {
1532                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
1533                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
1534                         0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD,
1535                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
1536                 },
1537                 .len = 32
1538         },
1539         .iv = {
1540                 .data = {
1541                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
1542                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
1543                 },
1544                 .len = 16
1545         },
1546         .plaintext = {
1547                 .data = {
1548                         /* DOCSIS header */
1549                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1550                         /* Ethernet frame */
1551                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
1552                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00,
1553                         /* CRC */
1554                         0xFF, 0xFF, 0xFF, 0xFF
1555                 },
1556                 .len = 24,
1557                 .cipher_offset = 18,
1558                 .crc_offset = 6,
1559                 .no_cipher = true,
1560                 .no_crc = true
1561         },
1562         .ciphertext = {
1563                 .data = {
1564                         /* DOCSIS header */
1565                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1566                         /* Ethernet frame */
1567                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
1568                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00,
1569                         /* CRC */
1570                         0xFF, 0xFF, 0xFF, 0xFF
1571                 },
1572                 .len = 24,
1573                 .cipher_offset = 18,
1574                 .crc_offset = 6,
1575                 .no_cipher = true,
1576                 .no_crc = true
1577         }
1578 };
1579
1580 const struct docsis_test_data docsis_test_case_26 = {
1581         .test_descr_uplink = {"Uplink AES-DOCSIS-BPI-256 and CRC Verify (83-byte "
1582                         "frame, No CRC, No decryption)"},
1583         .test_descr_downlink = {"Downlink CRC Generate and AES-DOCSIS-BPI-256 "
1584                         "(83-byte frame, No CRC, No encryption)"},
1585         .key = {
1586                 .data = {
1587                         0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
1588                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
1589                         0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD,
1590                         0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55
1591                 },
1592                 .len = 32
1593         },
1594         .iv = {
1595                 .data = {
1596                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
1597                         0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
1598                 },
1599                 .len = 16
1600         },
1601         .plaintext = {
1602                 .data = {
1603                         /* DOCSIS header */
1604                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1605                         /* Ethernet frame */
1606                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
1607                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
1608                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1609                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1610                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1611                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1612                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1613                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1614                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1615                         0xAA,
1616                         /* CRC */
1617                         0xFF, 0xFF, 0xFF, 0xFF
1618                 },
1619                 .len = 83,
1620                 .cipher_offset = 40,
1621                 .crc_offset = 6,
1622                 .no_cipher = true,
1623                 .no_crc = true
1624         },
1625         .ciphertext = {
1626                 .data = {
1627                         /* DOCSIS header */
1628                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1629                         /* Ethernet frame */
1630                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x05,
1631                         0x04, 0x03, 0x02, 0x01, 0x08, 0x00, 0xAA, 0xAA,
1632                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1633                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1634                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1635                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1636                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1637                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1638                         0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
1639                         0xAA,
1640                         /* CRC */
1641                         0xFF, 0xFF, 0xFF, 0xFF
1642                 },
1643                 .len = 83,
1644                 .cipher_offset = 40,
1645                 .crc_offset = 6,
1646                 .no_cipher = true,
1647                 .no_crc = true
1648         }
1649 };
1650
1651 #endif /* TEST_CRYPTODEV_SECURITY_DOCSIS_TEST_VECTORS_H_ */