app/test: add GMAC for qat
[dpdk.git] / app / test / test_cryptodev_gcm_test_vectors.h
1 /*-
2  *   BSD LICENSE
3  *
4  *   Copyright(c) 2015 Intel Corporation. All rights reserved.
5  *
6  *   Redistribution and use in source and binary forms, with or without
7  *   modification, are permitted provided that the following conditions
8  *   are met:
9  *
10  *       * Redistributions of source code must retain the above copyright
11  *         notice, this list of conditions and the following disclaimer.
12  *       * Redistributions in binary form must reproduce the above copyright
13  *         notice, this list of conditions and the following disclaimer in
14  *         the documentation and/or other materials provided with the
15  *         distribution.
16  *       * Neither the name of Intel Corporation nor the names of its
17  *         contributors may be used to endorse or promote products derived
18  *         from this software without specific prior written permission.
19  *
20  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32
33 #ifndef TEST_CRYPTODEV_GCM_TEST_VECTORS_H_
34 #define TEST_CRYPTODEV_GCM_TEST_VECTORS_H_
35
36 struct gcm_test_data {
37         struct {
38                 uint8_t data[64];
39                 unsigned len;
40         } key;
41
42         struct {
43                 uint8_t data[64] __rte_aligned(16);
44                 unsigned len;
45         } iv;
46
47         struct {
48                 uint8_t data[64];
49                 unsigned len;
50         } aad;
51
52         struct {
53                 uint8_t data[1024];
54                 unsigned len;
55         } plaintext;
56
57         struct {
58                 uint8_t data[1024];
59                 unsigned len;
60         } ciphertext;
61
62         struct {
63                 uint8_t data[16];
64                 unsigned len;
65         } auth_tag;
66
67 };
68
69 struct gmac_test_data {
70         struct {
71                 uint8_t data[64];
72                 unsigned len;
73         } key;
74
75         struct {
76                 uint8_t data[64] __rte_aligned(16);
77                 unsigned len;
78         } iv;
79
80         struct {
81                 uint8_t *data;
82                 unsigned len;
83         } aad;
84
85         struct {
86                 uint8_t *data;
87                 unsigned len;
88         } plaintext;
89
90         struct {
91                 uint8_t data[16];
92                 unsigned len;
93         } gmac_tag;
94
95 };
96
97 /** AES-128 Test Vectors */
98 static const struct gcm_test_data gcm_test_case_1 = {
99         .key = {
100                 .data = {
101                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
102                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
103                 .len = 16
104         },
105         .iv = {
106                 .data = {
107                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
108                         0x00, 0x00, 0x00, 0x00 },
109                 .len = 12
110         },
111         .aad = {
112                 .data = { 0 },
113                 .len = 0
114         },
115         .plaintext = {
116                 .data = {
117                         0x00 },
118                 .len = 0
119         },
120         .ciphertext = {
121                 .data = {
122                         0x00
123                 },
124                 .len = 0
125         },
126         .auth_tag = {
127                 .data = {
128                         0x58, 0xe2, 0xfc, 0xce, 0xfa, 0x7e, 0x30, 0x61,
129                         0x36, 0x7f, 0x1d, 0x57, 0xa4, 0xe7, 0x45, 0x5a },
130                 .len = 16
131         }
132 };
133
134 /** AES-128 Test Vectors */
135 static const struct gcm_test_data gcm_test_case_2 = {
136         .key = {
137                 .data = {
138                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
139                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
140                 .len = 16
141         },
142         .iv = {
143                 .data = {
144                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
145                         0x00, 0x00, 0x00, 0x00 },
146                 .len = 12
147         },
148         .aad = {
149                 .data = { 0 },
150                 .len = 0
151         },
152         .plaintext = {
153                 .data = {
154                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
155                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
156                 .len = 16
157         },
158         .ciphertext = {
159                 .data = {
160                         0x03, 0x88, 0xda, 0xce, 0x60, 0xb6, 0xa3, 0x92,
161                         0xf3, 0x28, 0xc2, 0xb9, 0x71, 0xb2, 0xfe, 0x78 },
162                 .len = 16
163         },
164         .auth_tag = {
165                 .data = {
166                         0xab, 0x6e, 0x47, 0xd4, 0x2c, 0xec, 0x13, 0xbd,
167                         0xf5, 0x3a, 0x67, 0xb2, 0x12, 0x57, 0xbd, 0xdf },
168                 .len = 16
169         }
170 };
171
172 /** AES-128 Test Vectors */
173 static const struct gcm_test_data gcm_test_case_3 = {
174         .key = {
175                 .data = {
176                         0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
177                         0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 },
178                 .len = 16
179         },
180         .iv = {
181                 .data = {
182                         0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
183                         0xde, 0xca, 0xf8, 0x88 },
184                 .len = 12
185         },
186         .aad = {
187                 .data = { 0 },
188                 .len = 0
189         },
190         .plaintext = {
191                 .data = {
192                         0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
193                         0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
194                         0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
195                         0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
196                         0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
197                         0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
198                         0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
199                         0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55 },
200                 .len = 64
201         },
202         .ciphertext = {
203                 .data = {
204                         0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24,
205                         0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c,
206                         0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0,
207                         0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e,
208                         0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c,
209                         0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05,
210                         0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97,
211                         0x3d, 0x58, 0xe0, 0x91, 0x47, 0x3f, 0x59, 0x85
212                 },
213                 .len = 64
214         },
215         .auth_tag = {
216                 .data = {
217                         0x4d, 0x5c, 0x2a, 0xf3, 0x27, 0xcd, 0x64, 0xa6,
218                         0x2c, 0xf3, 0x5a, 0xbd, 0x2b, 0xa6, 0xfa, 0xb4 },
219                 .len = 16
220         }
221 };
222
223 /** AES-128 Test Vectors */
224 static const struct gcm_test_data gcm_test_case_4 = {
225         .key = {
226                 .data = {
227                         0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
228                         0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08
229                 },
230                 .len = 16
231         },
232         .iv = {
233                 .data = {
234                         0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
235                         0xde, 0xca, 0xf8, 0x88 },
236                 .len = 12
237         },
238         .aad = {
239                 .data = {
240                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
241                 .len = 8
242         },
243         .plaintext = {
244                 .data = {
245                         0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
246                         0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
247                         0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
248                         0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
249                         0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
250                         0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
251                         0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
252                         0xba, 0x63, 0x7b, 0x39
253                 },
254                 .len = 60
255         },
256         .ciphertext = {
257                 .data = {
258                         0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24,
259                         0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c,
260                         0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0,
261                         0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e,
262                         0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c,
263                         0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05,
264                         0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97,
265                         0x3d, 0x58, 0xe0, 0x91
266                 },
267                 .len = 60
268         },
269         .auth_tag = {
270                 .data = {
271                         0xA2, 0xA4, 0x35, 0x75, 0xDC, 0xB0, 0x57, 0x74,
272                         0x07, 0x02, 0x30, 0xC2, 0xE7, 0x52, 0x02, 0x00
273                 },
274                 .len = 16
275         }
276
277 };
278
279 /** AES-128 Test Vectors */
280 static const struct gcm_test_data gcm_test_case_5 = {
281         .key = {
282                 .data = {
283                         0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
284                         0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08
285                 },
286                 .len = 16
287         },
288         .iv = {
289                 .data = {
290                         0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
291                         0xde, 0xca, 0xf8, 0x88 },
292                 .len = 12
293         },
294         .aad = {
295                 .data = {
296                         0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef },
297                 .len = 8
298         },
299         .plaintext = {
300                 .data = {
301                         0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
302                         0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
303                         0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
304                         0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
305                         0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
306                         0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
307                         0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
308                         0xba, 0x63, 0x7b, 0x39
309                 },
310                 .len = 60
311         },
312         .ciphertext = {
313                 .data = {
314                         0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24,
315                         0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c,
316                         0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0,
317                         0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e,
318                         0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c,
319                         0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05,
320                         0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97,
321                         0x3d, 0x58, 0xe0, 0x91
322                 },
323                 .len = 60
324         },
325         .auth_tag = {
326                 .data = {
327                         0xC5, 0x2D, 0xFB, 0x54, 0xAF, 0xBB, 0x07, 0xA1,
328                         0x9A, 0xFF, 0xBE, 0xE0, 0x61, 0x4C, 0xE7, 0xA5
329                 },
330                 .len = 16
331         }
332
333 };
334
335 /** AES-128 Test Vectors */
336 static const struct gcm_test_data gcm_test_case_6 = {
337         .key = {
338                 .data = {
339                         0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
340                         0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08
341                 },
342                 .len = 16
343         },
344         .iv = {
345                 .data = {
346                         0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
347                         0xde, 0xca, 0xf8, 0x88
348                 },
349                 .len = 12
350         },
351         .aad = {
352                 .data = {
353                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
354                         0x00, 0x00, 0x00, 0x00
355                 },
356                 .len = 12
357         },
358         .plaintext = {
359                 .data = {
360                         0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
361                         0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
362                         0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
363                         0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
364                         0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
365                         0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
366                         0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
367                         0xba, 0x63, 0x7b, 0x39
368                 },
369                 .len = 60
370         },
371         .ciphertext = {
372                 .data = {
373                         0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24,
374                         0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c,
375                         0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0,
376                         0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e,
377                         0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c,
378                         0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05,
379                         0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97,
380                         0x3d, 0x58, 0xe0, 0x91
381                 },
382                 .len = 60
383         },
384         .auth_tag = {
385                 .data = {
386                         0x74, 0xFC, 0xFA, 0x29, 0x3E, 0x60, 0xCC, 0x66,
387                         0x09, 0xD6, 0xFD, 0x00, 0xC8, 0x86, 0xD5, 0x42
388                 },
389                 .len = 16
390         }
391 };
392
393 /** AES-128 Test Vectors */
394 static const struct gcm_test_data gcm_test_case_7 = {
395         .key = {
396                 .data = {
397                         0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
398                         0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08
399                 },
400                 .len = 16
401         },
402         .iv = {
403                 .data = {
404                         0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
405                         0xde, 0xca, 0xf8, 0x88
406                 },
407                 .len = 12
408         },
409         .aad = {
410                 .data = {
411                         0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
412                         0xfe, 0xed, 0xfa, 0xce
413                 },
414                 .len = 12
415         },
416         .plaintext = {
417                 .data = {
418                         0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
419                         0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
420                         0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
421                         0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
422                         0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
423                         0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
424                         0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
425                         0xba, 0x63, 0x7b, 0x39
426                 },
427                 .len = 60
428         },
429         .ciphertext = {
430                 .data = {
431                         0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24,
432                         0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c,
433                         0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0,
434                         0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e,
435                         0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c,
436                         0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05,
437                         0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97,
438                         0x3d, 0x58, 0xe0, 0x91
439                 },
440                 .len = 60
441         },
442         .auth_tag = {
443                 .data = {
444                         0xE9, 0xE4, 0xAB, 0x76, 0xB7, 0xFF, 0xEA, 0xDC,
445                         0x69, 0x79, 0x38, 0xA2, 0x0D, 0xCA, 0xF5, 0x92
446                 },
447                 .len = 16
448         }
449 };
450
451 /** GMAC Test Vectors */
452 static uint8_t gmac_plaintext[] = {
453                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
454                         0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
455                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
456                         0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
457                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
458                         0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
459                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
460                         0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
461                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
462                         0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
463                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
464                         0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
465                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
466                         0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
467                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
468                         0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
469                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
470                         0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
471                         0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
472                         0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10
473 };
474
475 static const struct gmac_test_data gmac_test_case_1 = {
476         .key = {
477                 .data = {
478                         0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
479                         0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08
480                 },
481                 .len = 16
482         },
483         .iv = {
484                 .data = {
485                         0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
486                         0xde, 0xca, 0xf8, 0x88 },
487                 .len = 12
488         },
489         .aad = {
490                 .data = gmac_plaintext,
491                 .len = 160
492         },
493         .plaintext = {
494                 .data = NULL,
495                 .len = 0
496         },
497         .gmac_tag = {
498                 .data = {
499                         0x4C, 0x0C, 0x4F, 0x47, 0x2D, 0x78, 0xF6, 0xD8,
500                         0x03, 0x53, 0x20, 0x2F, 0x1A, 0xDF, 0x90, 0xD0
501                 },
502                 .len = 16
503         },
504 };
505
506 static const struct gmac_test_data gmac_test_case_2 = {
507         .key = {
508                 .data = {
509                     0xaa, 0x74, 0x0a, 0xbf, 0xad, 0xcd, 0xa7, 0x79,
510                     0x22, 0x0d, 0x3b, 0x40, 0x6c, 0x5d, 0x7e, 0xc0,
511                     0x9a, 0x77, 0xfe, 0x9d, 0x94, 0x10, 0x45, 0x39,
512                 },
513                 .len = 24
514         },
515         .iv = {
516                 .data = {
517                     0xab, 0x22, 0x65, 0xb4, 0xc1, 0x68, 0x95,
518                     0x55, 0x61, 0xf0, 0x43, 0x15, },
519                 .len = 12
520         },
521         .aad = {
522                 .data = gmac_plaintext,
523                 .len = 80
524         },
525         .plaintext = {
526                 .data = NULL,
527                 .len = 0
528         },
529         .gmac_tag = {
530                 .data = {
531                     0xCF, 0x82, 0x80, 0x64, 0x02, 0x46, 0xF4, 0xFB,
532                     0x33, 0xAE, 0x1D, 0x90, 0xEA, 0x48, 0x83, 0xDB
533                 },
534                 .len = 16
535         },
536 };
537
538 static const struct gmac_test_data gmac_test_case_3 = {
539         .key = {
540                 .data = {
541                     0xb5, 0x48, 0xe4, 0x93, 0x4f, 0x5c, 0x64, 0xd3,
542                     0xc0, 0xf0, 0xb7, 0x8f, 0x7b, 0x4d, 0x88, 0x24,
543                     0xaa, 0xc4, 0x6b, 0x3c, 0x8d, 0x2c, 0xc3, 0x5e,
544                     0xe4, 0xbf, 0xb2, 0x54, 0xe4, 0xfc, 0xba, 0xf7,
545                 },
546                 .len = 32
547         },
548         .iv = {
549                 .data = {
550                     0x2e, 0xed, 0xe1, 0xdc, 0x64, 0x47, 0xc7,
551                     0xaf, 0xc4, 0x41, 0x53, 0x58,
552                 },
553                 .len = 12
554         },
555         .aad = {
556                 .data = gmac_plaintext,
557                 .len = 65
558         },
559         .plaintext = {
560                 .data = NULL,
561                 .len = 0
562         },
563         .gmac_tag = {
564                 .data = {
565                         0x77, 0x46, 0x0D, 0x6F, 0xB1, 0x87, 0xDB, 0xA9,
566                         0x46, 0xAD, 0xCD, 0xFB, 0xB7, 0xF9, 0x13, 0xA1
567                 },
568                 .len = 16
569         },
570 };
571
572 #endif /* TEST_CRYPTODEV_GCM_TEST_VECTORS_H_ */