13d9b7210SChristian Ehrhardt/*-
23d9b7210SChristian Ehrhardt *   BSD LICENSE
33d9b7210SChristian Ehrhardt *
43d9b7210SChristian Ehrhardt *   Copyright(c) 2016 Intel Corporation. All rights reserved.
53d9b7210SChristian Ehrhardt *
63d9b7210SChristian Ehrhardt *   Redistribution and use in source and binary forms, with or without
73d9b7210SChristian Ehrhardt *   modification, are permitted provided that the following conditions
83d9b7210SChristian Ehrhardt *   are met:
93d9b7210SChristian Ehrhardt *
103d9b7210SChristian Ehrhardt *	 * Redistributions of source code must retain the above copyright
113d9b7210SChristian Ehrhardt *	   notice, this list of conditions and the following disclaimer.
123d9b7210SChristian Ehrhardt *	 * Redistributions in binary form must reproduce the above copyright
133d9b7210SChristian Ehrhardt *	   notice, this list of conditions and the following disclaimer in
143d9b7210SChristian Ehrhardt *	   the documentation and/or other materials provided with the
153d9b7210SChristian Ehrhardt *	   distribution.
163d9b7210SChristian Ehrhardt *	 * Neither the name of Intel Corporation nor the names of its
173d9b7210SChristian Ehrhardt *	   contributors may be used to endorse or promote products derived
183d9b7210SChristian Ehrhardt *	   from this software without specific prior written permission.
193d9b7210SChristian Ehrhardt *
203d9b7210SChristian Ehrhardt *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
213d9b7210SChristian Ehrhardt *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
223d9b7210SChristian Ehrhardt *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
233d9b7210SChristian Ehrhardt *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
243d9b7210SChristian Ehrhardt *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
253d9b7210SChristian Ehrhardt *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
263d9b7210SChristian Ehrhardt *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
273d9b7210SChristian Ehrhardt *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
283d9b7210SChristian Ehrhardt *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
293d9b7210SChristian Ehrhardt *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
303d9b7210SChristian Ehrhardt *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
313d9b7210SChristian Ehrhardt */
323d9b7210SChristian Ehrhardt
333d9b7210SChristian Ehrhardt#ifndef APP_TEST_TEST_CRYPTODEV_HMAC_TEST_VECTORS_H_
343d9b7210SChristian Ehrhardt#define APP_TEST_TEST_CRYPTODEV_HMAC_TEST_VECTORS_H_
353d9b7210SChristian Ehrhardt
363d9b7210SChristian Ehrhardt/* *** MD5 test vectors *** */
373d9b7210SChristian Ehrhardt
383d9b7210SChristian Ehrhardt#define MD5_DIGEST_LEN	16
393d9b7210SChristian Ehrhardt
403d9b7210SChristian Ehrhardtstruct HMAC_MD5_vector {
413d9b7210SChristian Ehrhardt	struct {
423d9b7210SChristian Ehrhardt		uint8_t data[64];
433d9b7210SChristian Ehrhardt		uint16_t len;
443d9b7210SChristian Ehrhardt	} key;
453d9b7210SChristian Ehrhardt
463d9b7210SChristian Ehrhardt	struct {
473d9b7210SChristian Ehrhardt			uint8_t data[1024];
483d9b7210SChristian Ehrhardt			uint16_t len;
493d9b7210SChristian Ehrhardt	} plaintext;
503d9b7210SChristian Ehrhardt
513d9b7210SChristian Ehrhardt	struct {
523d9b7210SChristian Ehrhardt			uint8_t data[16];
533d9b7210SChristian Ehrhardt			uint16_t len;
543d9b7210SChristian Ehrhardt	} auth_tag;
553d9b7210SChristian Ehrhardt};
563d9b7210SChristian Ehrhardt
573d9b7210SChristian Ehrhardtstatic const struct
583d9b7210SChristian EhrhardtHMAC_MD5_vector HMAC_MD5_test_case_1 = {
593d9b7210SChristian Ehrhardt	.key = {
603d9b7210SChristian Ehrhardt		.data = {
613d9b7210SChristian Ehrhardt			0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA,
623d9b7210SChristian Ehrhardt			0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD
633d9b7210SChristian Ehrhardt		},
643d9b7210SChristian Ehrhardt		.len = 16
653d9b7210SChristian Ehrhardt	},
663d9b7210SChristian Ehrhardt	.plaintext = {
673d9b7210SChristian Ehrhardt		.data = {
683d9b7210SChristian Ehrhardt			0x87, 0x4D, 0x61, 0x91, 0xB6, 0x20, 0xE3, 0x26,
693d9b7210SChristian Ehrhardt			0x1B, 0xEF, 0x68, 0x64, 0x99, 0x0D, 0xB6, 0xCE,
703d9b7210SChristian Ehrhardt			0x98, 0x06, 0xF6, 0x6B, 0x79, 0x70, 0xFD, 0xFF,
713d9b7210SChristian Ehrhardt			0x86, 0x17, 0x18, 0x7B, 0xB9, 0xFF, 0xFD, 0xFF,
723d9b7210SChristian Ehrhardt			0x5A, 0xE4, 0xDF, 0x3E, 0xDB, 0xD5, 0xD3, 0x5E,
733d9b7210SChristian Ehrhardt			0x5B, 0x4F, 0x09, 0x02, 0x0D, 0xB0, 0x3E, 0xAB,
743d9b7210SChristian Ehrhardt			0x1E, 0x03, 0x1D, 0xDA, 0x2F, 0xBE, 0x03, 0xD1,
753d9b7210SChristian Ehrhardt			0x79, 0x21, 0x70, 0xA0, 0xF3, 0x00, 0x9C, 0xEE
763d9b7210SChristian Ehrhardt		},
773d9b7210SChristian Ehrhardt		.len = 64
783d9b7210SChristian Ehrhardt	},
793d9b7210SChristian Ehrhardt	.auth_tag = {
803d9b7210SChristian Ehrhardt		.data = {
813d9b7210SChristian Ehrhardt			0x67, 0x83, 0xE1, 0x0F, 0xB0, 0xBF, 0x33, 0x49,
823d9b7210SChristian Ehrhardt			0x22, 0x04, 0x89, 0xDF, 0x86, 0xD0, 0x5F, 0x0C
833d9b7210SChristian Ehrhardt		},
843d9b7210SChristian Ehrhardt		.len = MD5_DIGEST_LEN
853d9b7210SChristian Ehrhardt	}
863d9b7210SChristian Ehrhardt};
873d9b7210SChristian Ehrhardt
883d9b7210SChristian Ehrhardtstatic const struct
893d9b7210SChristian EhrhardtHMAC_MD5_vector HMAC_MD5_test_case_2 = {
903d9b7210SChristian Ehrhardt	.key = {
913d9b7210SChristian Ehrhardt		.data = {
923d9b7210SChristian Ehrhardt			0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA,
933d9b7210SChristian Ehrhardt			0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD,
943d9b7210SChristian Ehrhardt			0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA,
953d9b7210SChristian Ehrhardt			0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD
963d9b7210SChristian Ehrhardt		},
973d9b7210SChristian Ehrhardt		.len = 32
983d9b7210SChristian Ehrhardt	},
993d9b7210SChristian Ehrhardt	.plaintext = {
1003d9b7210SChristian Ehrhardt		.data = {
1013d9b7210SChristian Ehrhardt			0x87, 0x4D, 0x61, 0x91, 0xB6, 0x20, 0xE3, 0x26,
1023d9b7210SChristian Ehrhardt			0x1B, 0xEF, 0x68, 0x64, 0x99, 0x0D, 0xB6, 0xCE,
1033d9b7210SChristian Ehrhardt			0x98, 0x06, 0xF6, 0x6B, 0x79, 0x70, 0xFD, 0xFF,
1043d9b7210SChristian Ehrhardt			0x86, 0x17, 0x18, 0x7B, 0xB9, 0xFF, 0xFD, 0xFF,
1053d9b7210SChristian Ehrhardt			0x5A, 0xE4, 0xDF, 0x3E, 0xDB, 0xD5, 0xD3, 0x5E,
1063d9b7210SChristian Ehrhardt			0x5B, 0x4F, 0x09, 0x02, 0x0D, 0xB0, 0x3E, 0xAB,
1073d9b7210SChristian Ehrhardt			0x1E, 0x03, 0x1D, 0xDA, 0x2F, 0xBE, 0x03, 0xD1,
1083d9b7210SChristian Ehrhardt			0x79, 0x21, 0x70, 0xA0, 0xF3, 0x00, 0x9C, 0xEE
1093d9b7210SChristian Ehrhardt		},
1103d9b7210SChristian Ehrhardt		.len = 64
1113d9b7210SChristian Ehrhardt	},
1123d9b7210SChristian Ehrhardt	.auth_tag = {
1133d9b7210SChristian Ehrhardt		.data = {
1143d9b7210SChristian Ehrhardt			0x39, 0x24, 0x70, 0x7A, 0x30, 0x38, 0x1E, 0x2B,
1153d9b7210SChristian Ehrhardt			0x9F, 0x6B, 0xD9, 0x3C, 0xAD, 0xC2, 0x73, 0x52
1163d9b7210SChristian Ehrhardt		},
1173d9b7210SChristian Ehrhardt		.len = MD5_DIGEST_LEN
1183d9b7210SChristian Ehrhardt	}
1193d9b7210SChristian Ehrhardt};
1203d9b7210SChristian Ehrhardt
1213d9b7210SChristian Ehrhardt#endif /* APP_TEST_TEST_CRYPTODEV_HMAC_TEST_VECTORS_H_ */
122