4 * Copyright(c) 2015 Intel Corporation. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
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
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.
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.
33 #ifndef TEST_CRYPTODEV_GCM_TEST_VECTORS_H_
34 #define TEST_CRYPTODEV_GCM_TEST_VECTORS_H_
36 struct gcm_test_data {
43 uint8_t data[64] __rte_aligned(16);
69 struct gmac_test_data {
76 uint8_t data[64] __rte_aligned(16);
97 /** AES-128 Test Vectors */
98 static const struct gcm_test_data gcm_test_case_1 = {
101 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
102 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
107 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
108 0x00, 0x00, 0x00, 0x00 },
128 0x58, 0xe2, 0xfc, 0xce, 0xfa, 0x7e, 0x30, 0x61,
129 0x36, 0x7f, 0x1d, 0x57, 0xa4, 0xe7, 0x45, 0x5a },
134 /** AES-128 Test Vectors */
135 static const struct gcm_test_data gcm_test_case_2 = {
138 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
139 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
144 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
145 0x00, 0x00, 0x00, 0x00 },
154 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
155 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
160 0x03, 0x88, 0xda, 0xce, 0x60, 0xb6, 0xa3, 0x92,
161 0xf3, 0x28, 0xc2, 0xb9, 0x71, 0xb2, 0xfe, 0x78 },
166 0xab, 0x6e, 0x47, 0xd4, 0x2c, 0xec, 0x13, 0xbd,
167 0xf5, 0x3a, 0x67, 0xb2, 0x12, 0x57, 0xbd, 0xdf },
172 /** AES-128 Test Vectors */
173 static const struct gcm_test_data gcm_test_case_3 = {
176 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
177 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 },
182 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
183 0xde, 0xca, 0xf8, 0x88 },
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 },
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
217 0x4d, 0x5c, 0x2a, 0xf3, 0x27, 0xcd, 0x64, 0xa6,
218 0x2c, 0xf3, 0x5a, 0xbd, 0x2b, 0xa6, 0xfa, 0xb4 },
223 /** AES-128 Test Vectors */
224 static const struct gcm_test_data gcm_test_case_4 = {
227 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
228 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08
234 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
235 0xde, 0xca, 0xf8, 0x88 },
240 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
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
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
271 0xA2, 0xA4, 0x35, 0x75, 0xDC, 0xB0, 0x57, 0x74,
272 0x07, 0x02, 0x30, 0xC2, 0xE7, 0x52, 0x02, 0x00
279 /** AES-128 Test Vectors */
280 static const struct gcm_test_data gcm_test_case_5 = {
283 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
284 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08
290 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
291 0xde, 0xca, 0xf8, 0x88 },
296 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef },
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
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
327 0xC5, 0x2D, 0xFB, 0x54, 0xAF, 0xBB, 0x07, 0xA1,
328 0x9A, 0xFF, 0xBE, 0xE0, 0x61, 0x4C, 0xE7, 0xA5
335 /** AES-128 Test Vectors */
336 static const struct gcm_test_data gcm_test_case_6 = {
339 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
340 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08
346 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
347 0xde, 0xca, 0xf8, 0x88
353 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
354 0x00, 0x00, 0x00, 0x00
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
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
386 0x74, 0xFC, 0xFA, 0x29, 0x3E, 0x60, 0xCC, 0x66,
387 0x09, 0xD6, 0xFD, 0x00, 0xC8, 0x86, 0xD5, 0x42
393 /** AES-128 Test Vectors */
394 static const struct gcm_test_data gcm_test_case_7 = {
397 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
398 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08
404 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
405 0xde, 0xca, 0xf8, 0x88
411 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
412 0xfe, 0xed, 0xfa, 0xce
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
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
444 0xE9, 0xE4, 0xAB, 0x76, 0xB7, 0xFF, 0xEA, 0xDC,
445 0x69, 0x79, 0x38, 0xA2, 0x0D, 0xCA, 0xF5, 0x92
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
475 static const struct gmac_test_data gmac_test_case_1 = {
478 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
479 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08
485 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
486 0xde, 0xca, 0xf8, 0x88 },
490 .data = gmac_plaintext,
499 0x4C, 0x0C, 0x4F, 0x47, 0x2D, 0x78, 0xF6, 0xD8,
500 0x03, 0x53, 0x20, 0x2F, 0x1A, 0xDF, 0x90, 0xD0
506 static const struct gmac_test_data gmac_test_case_2 = {
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,
517 0xab, 0x22, 0x65, 0xb4, 0xc1, 0x68, 0x95,
518 0x55, 0x61, 0xf0, 0x43, 0x15, },
522 .data = gmac_plaintext,
531 0xCF, 0x82, 0x80, 0x64, 0x02, 0x46, 0xF4, 0xFB,
532 0x33, 0xAE, 0x1D, 0x90, 0xEA, 0x48, 0x83, 0xDB
538 static const struct gmac_test_data gmac_test_case_3 = {
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,
550 0x2e, 0xed, 0xe1, 0xdc, 0x64, 0x47, 0xc7,
551 0xaf, 0xc4, 0x41, 0x53, 0x58,
556 .data = gmac_plaintext,
565 0x77, 0x46, 0x0D, 0x6F, 0xB1, 0x87, 0xDB, 0xA9,
566 0x46, 0xAD, 0xCD, 0xFB, 0xB7, 0xF9, 0x13, 0xA1
572 #endif /* TEST_CRYPTODEV_GCM_TEST_VECTORS_H_ */