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);
68 /** AES-128 Test Vectors */
69 static const struct gcm_test_data gcm_test_case_1 = {
72 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
73 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
78 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
79 0x00, 0x00, 0x00, 0x00 },
99 0x58, 0xe2, 0xfc, 0xce, 0xfa, 0x7e, 0x30, 0x61,
100 0x36, 0x7f, 0x1d, 0x57, 0xa4, 0xe7, 0x45, 0x5a },
105 /** AES-128 Test Vectors */
106 static const struct gcm_test_data gcm_test_case_2 = {
109 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
110 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
115 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
116 0x00, 0x00, 0x00, 0x00 },
125 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
126 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
131 0x03, 0x88, 0xda, 0xce, 0x60, 0xb6, 0xa3, 0x92,
132 0xf3, 0x28, 0xc2, 0xb9, 0x71, 0xb2, 0xfe, 0x78 },
137 0xab, 0x6e, 0x47, 0xd4, 0x2c, 0xec, 0x13, 0xbd,
138 0xf5, 0x3a, 0x67, 0xb2, 0x12, 0x57, 0xbd, 0xdf },
143 /** AES-128 Test Vectors */
144 static const struct gcm_test_data gcm_test_case_3 = {
147 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
148 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 },
153 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
154 0xde, 0xca, 0xf8, 0x88 },
163 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
164 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
165 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
166 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
167 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
168 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
169 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
170 0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55 },
175 0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24,
176 0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c,
177 0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0,
178 0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e,
179 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c,
180 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05,
181 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97,
182 0x3d, 0x58, 0xe0, 0x91, 0x47, 0x3f, 0x59, 0x85
188 0x4d, 0x5c, 0x2a, 0xf3, 0x27, 0xcd, 0x64, 0xa6,
189 0x2c, 0xf3, 0x5a, 0xbd, 0x2b, 0xa6, 0xfa, 0xb4 },
194 /** AES-128 Test Vectors */
195 static const struct gcm_test_data gcm_test_case_4 = {
198 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
199 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08
205 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
206 0xde, 0xca, 0xf8, 0x88 },
211 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
216 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
217 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
218 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
219 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
220 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
221 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
222 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
223 0xba, 0x63, 0x7b, 0x39
229 0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24,
230 0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c,
231 0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0,
232 0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e,
233 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c,
234 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05,
235 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97,
236 0x3d, 0x58, 0xe0, 0x91
242 0xA2, 0xA4, 0x35, 0x75, 0xDC, 0xB0, 0x57, 0x74,
243 0x07, 0x02, 0x30, 0xC2, 0xE7, 0x52, 0x02, 0x00
250 /** AES-128 Test Vectors */
251 static const struct gcm_test_data gcm_test_case_5 = {
254 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
255 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08
261 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
262 0xde, 0xca, 0xf8, 0x88 },
267 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef },
272 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
273 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
274 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
275 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
276 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
277 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
278 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
279 0xba, 0x63, 0x7b, 0x39
285 0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24,
286 0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c,
287 0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0,
288 0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e,
289 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c,
290 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05,
291 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97,
292 0x3d, 0x58, 0xe0, 0x91
298 0xC5, 0x2D, 0xFB, 0x54, 0xAF, 0xBB, 0x07, 0xA1,
299 0x9A, 0xFF, 0xBE, 0xE0, 0x61, 0x4C, 0xE7, 0xA5
306 /** AES-128 Test Vectors */
307 static const struct gcm_test_data gcm_test_case_6 = {
310 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
311 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08
317 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
318 0xde, 0xca, 0xf8, 0x88
324 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
325 0x00, 0x00, 0x00, 0x00
331 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
332 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
333 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
334 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
335 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
336 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
337 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
338 0xba, 0x63, 0x7b, 0x39
344 0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24,
345 0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c,
346 0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0,
347 0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e,
348 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c,
349 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05,
350 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97,
351 0x3d, 0x58, 0xe0, 0x91
357 0x74, 0xFC, 0xFA, 0x29, 0x3E, 0x60, 0xCC, 0x66,
358 0x09, 0xD6, 0xFD, 0x00, 0xC8, 0x86, 0xD5, 0x42
364 /** AES-128 Test Vectors */
365 static const struct gcm_test_data gcm_test_case_7 = {
368 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
369 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08
375 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad,
376 0xde, 0xca, 0xf8, 0x88
382 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef,
383 0xfe, 0xed, 0xfa, 0xce
389 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5,
390 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a,
391 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda,
392 0x2e, 0x4c, 0x30, 0x3d, 0x8a, 0x31, 0x8a, 0x72,
393 0x1c, 0x3c, 0x0c, 0x95, 0x95, 0x68, 0x09, 0x53,
394 0x2f, 0xcf, 0x0e, 0x24, 0x49, 0xa6, 0xb5, 0x25,
395 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57,
396 0xba, 0x63, 0x7b, 0x39
402 0x42, 0x83, 0x1e, 0xc2, 0x21, 0x77, 0x74, 0x24,
403 0x4b, 0x72, 0x21, 0xb7, 0x84, 0xd0, 0xd4, 0x9c,
404 0xe3, 0xaa, 0x21, 0x2f, 0x2c, 0x02, 0xa4, 0xe0,
405 0x35, 0xc1, 0x7e, 0x23, 0x29, 0xac, 0xa1, 0x2e,
406 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c,
407 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05,
408 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97,
409 0x3d, 0x58, 0xe0, 0x91
415 0xE9, 0xE4, 0xAB, 0x76, 0xB7, 0xFF, 0xEA, 0xDC,
416 0x69, 0x79, 0x38, 0xA2, 0x0D, 0xCA, 0xF5, 0x92
423 #endif /* TEST_CRYPTODEV_GCM_TEST_VECTORS_H_ */