16b3e017eSChristian Ehrhardt/*
26b3e017eSChristian Ehrhardt *   BSD LICENSE
36b3e017eSChristian Ehrhardt *
46b3e017eSChristian Ehrhardt *   Copyright(c) 2016 Intel Corporation. All rights reserved.
56b3e017eSChristian Ehrhardt *
66b3e017eSChristian Ehrhardt *   Redistribution and use in source and binary forms, with or without
76b3e017eSChristian Ehrhardt *   modification, are permitted provided that the following conditions
86b3e017eSChristian Ehrhardt *   are met:
96b3e017eSChristian Ehrhardt *
106b3e017eSChristian Ehrhardt *	 * Redistributions of source code must retain the above copyright
116b3e017eSChristian Ehrhardt *	   notice, this list of conditions and the following disclaimer.
126b3e017eSChristian Ehrhardt *	 * Redistributions in binary form must reproduce the above copyright
136b3e017eSChristian Ehrhardt *	   notice, this list of conditions and the following disclaimer in
146b3e017eSChristian Ehrhardt *	   the documentation and/or other materials provided with the
156b3e017eSChristian Ehrhardt *	   distribution.
166b3e017eSChristian Ehrhardt *	 * Neither the name of Intel Corporation nor the names of its
176b3e017eSChristian Ehrhardt *	   contributors may be used to endorse or promote products derived
186b3e017eSChristian Ehrhardt *	   from this software without specific prior written permission.
196b3e017eSChristian Ehrhardt *
206b3e017eSChristian Ehrhardt *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
216b3e017eSChristian Ehrhardt *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
226b3e017eSChristian Ehrhardt *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
236b3e017eSChristian Ehrhardt *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
246b3e017eSChristian Ehrhardt *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
256b3e017eSChristian Ehrhardt *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
266b3e017eSChristian Ehrhardt *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
276b3e017eSChristian Ehrhardt *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
286b3e017eSChristian Ehrhardt *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
296b3e017eSChristian Ehrhardt *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
306b3e017eSChristian Ehrhardt *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
316b3e017eSChristian Ehrhardt */
326b3e017eSChristian Ehrhardt
336b3e017eSChristian Ehrhardt#ifndef TEST_CRYPTODEV_HASH_TEST_VECTORS_H_
346b3e017eSChristian Ehrhardt#define TEST_CRYPTODEV_HASH_TEST_VECTORS_H_
356b3e017eSChristian Ehrhardt
366b3e017eSChristian Ehrhardtstatic const uint8_t plaintext_hash[] = {
376b3e017eSChristian Ehrhardt	"What a lousy earth! He wondered how many people "
386b3e017eSChristian Ehrhardt	"were destitute that same night even in his own "
396b3e017eSChristian Ehrhardt	"prosperous country, how many homes were "
406b3e017eSChristian Ehrhardt	"shanties, how many husbands were drunk and "
416b3e017eSChristian Ehrhardt	"wives socked, and how many children were "
426b3e017eSChristian Ehrhardt	"bullied, abused, or abandoned. How many "
436b3e017eSChristian Ehrhardt	"families hungered for food they could not "
446b3e017eSChristian Ehrhardt	"afford to buy? How many hearts were broken? How "
456b3e017eSChristian Ehrhardt	"many suicides would take place that same night, "
466b3e017eSChristian Ehrhardt	"how many people would go insane? How many "
476b3e017eSChristian Ehrhardt	"cockroaches and landlords would triumph? How "
486b3e017eSChristian Ehrhardt	"many winners were losers, successes failures, "
496b3e017eSChristian Ehrhardt	"and rich men poor men? How many wise guys were "
506b3e017eSChristian Ehrhardt	"stupid? How many happy endings were unhappy "
516b3e017eSChristian Ehrhardt	"endings? How many honest men were liars, brave "
526b3e017eSChristian Ehrhardt	"men cowards, loyal men traitors, how many "
536b3e017eSChristian Ehrhardt	"sainted men were corrupt, how many people in "
546b3e017eSChristian Ehrhardt	"positions of trust had sold their souls to "
556b3e017eSChristian Ehrhardt	"bodyguards, how many had never had souls? How "
566b3e017eSChristian Ehrhardt	"many straight-and-narrow paths were crooked "
576b3e017eSChristian Ehrhardt	"paths? How many best families were worst "
586b3e017eSChristian Ehrhardt	"families and how many good people were bad "
596b3e017eSChristian Ehrhardt	"people? When you added them all up and then "
606b3e017eSChristian Ehrhardt	"subtracted, you might be left with only the "
616b3e017eSChristian Ehrhardt	"children, and perhaps with Albert Einstein and "
626b3e017eSChristian Ehrhardt	"an old violinist or sculptor somewhere."
636b3e017eSChristian Ehrhardt};
646b3e017eSChristian Ehrhardt
656b3e017eSChristian Ehrhardtstatic const struct blockcipher_test_data
666b3e017eSChristian Ehrhardtmd5_test_vector = {
676b3e017eSChristian Ehrhardt	.auth_algo = RTE_CRYPTO_AUTH_MD5,
686b3e017eSChristian Ehrhardt	.ciphertext = {
696b3e017eSChristian Ehrhardt		.data = plaintext_hash,
706b3e017eSChristian Ehrhardt		.len = 512
716b3e017eSChristian Ehrhardt	},
726b3e017eSChristian Ehrhardt	.digest = {
736b3e017eSChristian Ehrhardt		.data = {
746b3e017eSChristian Ehrhardt			0xB3, 0xE6, 0xBB, 0x50, 0x41, 0x35, 0x3C, 0x6B,
756b3e017eSChristian Ehrhardt			0x7A, 0xFF, 0xD2, 0x64, 0xAF, 0xD5, 0x1C, 0xB2
766b3e017eSChristian Ehrhardt		},
776b3e017eSChristian Ehrhardt		.len = 16
786b3e017eSChristian Ehrhardt	}
796b3e017eSChristian Ehrhardt};
806b3e017eSChristian Ehrhardt
816b3e017eSChristian Ehrhardtstatic const struct blockcipher_test_data
826b3e017eSChristian Ehrhardthmac_md5_test_vector = {
836b3e017eSChristian Ehrhardt	.auth_algo = RTE_CRYPTO_AUTH_MD5_HMAC,
846b3e017eSChristian Ehrhardt	.ciphertext = {
856b3e017eSChristian Ehrhardt		.data = plaintext_hash,
866b3e017eSChristian Ehrhardt		.len = 512
876b3e017eSChristian Ehrhardt	},
886b3e017eSChristian Ehrhardt	.auth_key = {
896b3e017eSChristian Ehrhardt		.data = {
906b3e017eSChristian Ehrhardt			0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA,
916b3e017eSChristian Ehrhardt			0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD
926b3e017eSChristian Ehrhardt		},
936b3e017eSChristian Ehrhardt		.len = 16
946b3e017eSChristian Ehrhardt	},
956b3e017eSChristian Ehrhardt	.digest = {
966b3e017eSChristian Ehrhardt		.data = {
976b3e017eSChristian Ehrhardt			0x50, 0xE8, 0xDE, 0xC5, 0xC1, 0x76, 0xAC, 0xAE,
986b3e017eSChristian Ehrhardt			0x15, 0x4A, 0xF1, 0x7F, 0x7E, 0x04, 0x42, 0x9B
996b3e017eSChristian Ehrhardt		},
1006b3e017eSChristian Ehrhardt		.len = 16
1016b3e017eSChristian Ehrhardt	}
1026b3e017eSChristian Ehrhardt};
1036b3e017eSChristian Ehrhardt
1046b3e017eSChristian Ehrhardtstatic const struct blockcipher_test_data
1056b3e017eSChristian Ehrhardtsha1_test_vector = {
1066b3e017eSChristian Ehrhardt	.auth_algo = RTE_CRYPTO_AUTH_SHA1,
1076b3e017eSChristian Ehrhardt	.ciphertext = {
1086b3e017eSChristian Ehrhardt		.data = plaintext_hash,
1096b3e017eSChristian Ehrhardt		.len = 512
1106b3e017eSChristian Ehrhardt	},
1116b3e017eSChristian Ehrhardt	.digest = {
1126b3e017eSChristian Ehrhardt		.data = {
1136b3e017eSChristian Ehrhardt			0xA2, 0x8D, 0x40, 0x78, 0xDD, 0x9F, 0xBB, 0xD5,
1146b3e017eSChristian Ehrhardt			0x35, 0x62, 0xFB, 0xFA, 0x93, 0xFD, 0x7D, 0x70,
1156b3e017eSChristian Ehrhardt			0xA6, 0x7D, 0x45, 0xCA
1166b3e017eSChristian Ehrhardt		},
1176b3e017eSChristian Ehrhardt		.len = 20
1186b3e017eSChristian Ehrhardt	}
1196b3e017eSChristian Ehrhardt};
1206b3e017eSChristian Ehrhardt
1216b3e017eSChristian Ehrhardtstatic const struct blockcipher_test_data
1226b3e017eSChristian Ehrhardthmac_sha1_test_vector = {
1236b3e017eSChristian Ehrhardt	.auth_algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
1246b3e017eSChristian Ehrhardt	.ciphertext = {
1256b3e017eSChristian Ehrhardt		.data = plaintext_hash,
1266b3e017eSChristian Ehrhardt		.len = 512
1276b3e017eSChristian Ehrhardt	},
1286b3e017eSChristian Ehrhardt	.auth_key = {
1296b3e017eSChristian Ehrhardt		.data = {
1306b3e017eSChristian Ehrhardt			0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA,
1316b3e017eSChristian Ehrhardt			0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD,
1326b3e017eSChristian Ehrhardt			0xDE, 0xF4, 0xDE, 0xAD
1336b3e017eSChristian Ehrhardt		},
1346b3e017eSChristian Ehrhardt		.len = 20
1356b3e017eSChristian Ehrhardt	},
1366b3e017eSChristian Ehrhardt	.digest = {
1376b3e017eSChristian Ehrhardt		.data = {
1386b3e017eSChristian Ehrhardt			0xC4, 0xB7, 0x0E, 0x6B, 0xDE, 0xD1, 0xE7, 0x77,
1396b3e017eSChristian Ehrhardt			0x7E, 0x2E, 0x8F, 0xFC, 0x48, 0x39, 0x46, 0x17,
1406b3e017eSChristian Ehrhardt			0x3F, 0x91, 0x64, 0x59
1416b3e017eSChristian Ehrhardt		},
1426b3e017eSChristian Ehrhardt		.len = 20
1436b3e017eSChristian Ehrhardt	}
1446b3e017eSChristian Ehrhardt};
1456b3e017eSChristian Ehrhardt
1466b3e017eSChristian Ehrhardtstatic const struct blockcipher_test_data
1476b3e017eSChristian Ehrhardtsha224_test_vector = {
1486b3e017eSChristian Ehrhardt	.auth_algo = RTE_CRYPTO_AUTH_SHA224,
1496b3e017eSChristian Ehrhardt	.ciphertext = {
1506b3e017eSChristian Ehrhardt		.data = plaintext_hash,
1516b3e017eSChristian Ehrhardt		.len = 512
1526b3e017eSChristian Ehrhardt	},
1536b3e017eSChristian Ehrhardt	.digest = {
1546b3e017eSChristian Ehrhardt		.data = {
1556b3e017eSChristian Ehrhardt			0x91, 0xE7, 0xCD, 0x75, 0x14, 0x9C, 0xA9, 0xE9,
1566b3e017eSChristian Ehrhardt			0x2E, 0x46, 0x12, 0x20, 0x22, 0xF9, 0x68, 0x28,
1576b3e017eSChristian Ehrhardt			0x39, 0x26, 0xDF, 0xB5, 0x78, 0x62, 0xB2, 0x6E,
1586b3e017eSChristian Ehrhardt			0x5E, 0x8F, 0x25, 0x84
1596b3e017eSChristian Ehrhardt		},
1606b3e017eSChristian Ehrhardt		.len = 28
1616b3e017eSChristian Ehrhardt	}
1626b3e017eSChristian Ehrhardt};
1636b3e017eSChristian Ehrhardt
1646b3e017eSChristian Ehrhardtstatic const struct blockcipher_test_data
1656b3e017eSChristian Ehrhardthmac_sha224_test_vector = {
1666b3e017eSChristian Ehrhardt	.auth_algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
1676b3e017eSChristian Ehrhardt	.ciphertext = {
1686b3e017eSChristian Ehrhardt		.data = plaintext_hash,
1696b3e017eSChristian Ehrhardt		.len = 512
1706b3e017eSChristian Ehrhardt	},
1716b3e017eSChristian Ehrhardt	.auth_key = {
1726b3e017eSChristian Ehrhardt		.data = {
1736b3e017eSChristian Ehrhardt			0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA,
1746b3e017eSChristian Ehrhardt			0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD,
1756b3e017eSChristian Ehrhardt			0xDE, 0xF4, 0xDE, 0xAD, 0x26, 0xEB, 0xAB, 0x92,
1766b3e017eSChristian Ehrhardt			0xFB, 0xBF, 0xB0, 0x8C
1776b3e017eSChristian Ehrhardt		},
1786b3e017eSChristian Ehrhardt		.len = 28
1796b3e017eSChristian Ehrhardt	},
1806b3e017eSChristian Ehrhardt	.digest = {
1816b3e017eSChristian Ehrhardt		.data = {
1826b3e017eSChristian Ehrhardt			0x70, 0x0F, 0x04, 0x4D, 0x22, 0x02, 0x7D, 0x31,
1836b3e017eSChristian Ehrhardt			0x36, 0xDA, 0x77, 0x19, 0xB9, 0x66, 0x37, 0x7B,
1846b3e017eSChristian Ehrhardt			0xF1, 0x8A, 0x63, 0xBB, 0x5D, 0x1D, 0xE3, 0x9F,
1856b3e017eSChristian Ehrhardt			0x92, 0xF6, 0xAA, 0x19
1866b3e017eSChristian Ehrhardt		},
1876b3e017eSChristian Ehrhardt		.len = 28
1886b3e017eSChristian Ehrhardt	}
1896b3e017eSChristian Ehrhardt};
1906b3e017eSChristian Ehrhardt
1916b3e017eSChristian Ehrhardtstatic const struct blockcipher_test_data
1926b3e017eSChristian Ehrhardtsha256_test_vector = {
1936b3e017eSChristian Ehrhardt	.auth_algo = RTE_CRYPTO_AUTH_SHA256,
1946b3e017eSChristian Ehrhardt	.ciphertext = {
1956b3e017eSChristian Ehrhardt		.data = plaintext_hash,
1966b3e017eSChristian Ehrhardt		.len = 512
1976b3e017eSChristian Ehrhardt	},
1986b3e017eSChristian Ehrhardt	.digest = {
1996b3e017eSChristian Ehrhardt		.data = {
2006b3e017eSChristian Ehrhardt			0x7F, 0xF1, 0x0C, 0xF5, 0x90, 0x97, 0x19, 0x0F,
2016b3e017eSChristian Ehrhardt			0x00, 0xE4, 0x83, 0x01, 0xCA, 0x59, 0x00, 0x2E,
2026b3e017eSChristian Ehrhardt			0x1F, 0xC7, 0x84, 0xEE, 0x76, 0xA6, 0x39, 0x15,
2036b3e017eSChristian Ehrhardt			0x76, 0x2F, 0x87, 0xF9, 0x01, 0x06, 0xF3, 0xB7
2046b3e017eSChristian Ehrhardt		},
2056b3e017eSChristian Ehrhardt		.len = 32
2066b3e017eSChristian Ehrhardt	}
2076b3e017eSChristian Ehrhardt};
2086b3e017eSChristian Ehrhardt
2096b3e017eSChristian Ehrhardtstatic const struct blockcipher_test_data
2106b3e017eSChristian Ehrhardthmac_sha256_test_vector = {
2116b3e017eSChristian Ehrhardt	.auth_algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
2126b3e017eSChristian Ehrhardt	.ciphertext = {
2136b3e017eSChristian Ehrhardt		.data = plaintext_hash,
2146b3e017eSChristian Ehrhardt		.len = 512
2156b3e017eSChristian Ehrhardt	},
2166b3e017eSChristian Ehrhardt	.auth_key = {
2176b3e017eSChristian Ehrhardt		.data = {
2186b3e017eSChristian Ehrhardt			0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA,
2196b3e017eSChristian Ehrhardt			0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD,
2206b3e017eSChristian Ehrhardt			0xDE, 0xF4, 0xDE, 0xAD, 0x26, 0xEB, 0xAB, 0x92,
2216b3e017eSChristian Ehrhardt			0xFB, 0xBF, 0xB0, 0x8C, 0x29, 0x87, 0x90, 0xAC
2226b3e017eSChristian Ehrhardt		},
2236b3e017eSChristian Ehrhardt		.len = 32
2246b3e017eSChristian Ehrhardt	},
2256b3e017eSChristian Ehrhardt	.digest = {
2266b3e017eSChristian Ehrhardt		.data = {
2276b3e017eSChristian Ehrhardt			0xAF, 0x8F, 0x70, 0x1B, 0x4B, 0xAF, 0x34, 0xCB,
2286b3e017eSChristian Ehrhardt			0x02, 0x24, 0x48, 0x45, 0x83, 0x52, 0x8F, 0x22,
2296b3e017eSChristian Ehrhardt			0x06, 0x4D, 0x64, 0x09, 0x0A, 0xCC, 0x02, 0x77,
2306b3e017eSChristian Ehrhardt			0x71, 0x83, 0x48, 0x71, 0x07, 0x02, 0x25, 0x17
2316b3e017eSChristian Ehrhardt		},
2326b3e017eSChristian Ehrhardt		.len = 32
2336b3e017eSChristian Ehrhardt	}
2346b3e017eSChristian Ehrhardt};
2356b3e017eSChristian Ehrhardt
2366b3e017eSChristian Ehrhardtstatic const struct blockcipher_test_data
2376b3e017eSChristian Ehrhardtsha384_test_vector = {
2386b3e017eSChristian Ehrhardt	.auth_algo = RTE_CRYPTO_AUTH_SHA384,
2396b3e017eSChristian Ehrhardt	.ciphertext = {
2406b3e017eSChristian Ehrhardt		.data = plaintext_hash,
2416b3e017eSChristian Ehrhardt		.len = 512
2426b3e017eSChristian Ehrhardt	},
2436b3e017eSChristian Ehrhardt	.digest = {
2446b3e017eSChristian Ehrhardt		.data = {
2456b3e017eSChristian Ehrhardt			0x1D, 0xE7, 0x3F, 0x55, 0x86, 0xFE, 0x48, 0x9F,
2466b3e017eSChristian Ehrhardt			0xAC, 0xC6, 0x85, 0x32, 0xFA, 0x8E, 0xA6, 0x77,
2476b3e017eSChristian Ehrhardt			0x25, 0x84, 0xA5, 0x98, 0x8D, 0x0B, 0x80, 0xF4,
2486b3e017eSChristian Ehrhardt			0xEB, 0x2C, 0xFB, 0x6C, 0xEA, 0x7B, 0xFD, 0xD5,
2496b3e017eSChristian Ehrhardt			0xAD, 0x41, 0xAB, 0x15, 0xB0, 0x03, 0x15, 0xEC,
2506b3e017eSChristian Ehrhardt			0x9E, 0x3D, 0xED, 0xCB, 0x80, 0x7B, 0xF4, 0xB6
2516b3e017eSChristian Ehrhardt		},
2526b3e017eSChristian Ehrhardt		.len = 48
2536b3e017eSChristian Ehrhardt	}
2546b3e017eSChristian Ehrhardt};
2556b3e017eSChristian Ehrhardt
2566b3e017eSChristian Ehrhardtstatic const struct blockcipher_test_data
2576b3e017eSChristian Ehrhardthmac_sha384_test_vector = {
2586b3e017eSChristian Ehrhardt	.auth_algo = RTE_CRYPTO_AUTH_SHA384_HMAC,
2596b3e017eSChristian Ehrhardt	.ciphertext = {
2606b3e017eSChristian Ehrhardt		.data = plaintext_hash,
2616b3e017eSChristian Ehrhardt		.len = 512
2626b3e017eSChristian Ehrhardt	},
2636b3e017eSChristian Ehrhardt	.auth_key = {
2646b3e017eSChristian Ehrhardt		.data = {
2656b3e017eSChristian Ehrhardt			0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA,
2666b3e017eSChristian Ehrhardt			0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD,
2676b3e017eSChristian Ehrhardt			0xDE, 0xF4, 0xDE, 0xAD, 0x26, 0xEB, 0xAB, 0x92,
2686b3e017eSChristian Ehrhardt			0xFB, 0xBF, 0xB0, 0x8C, 0x29, 0x87, 0x90, 0xAC,
2696b3e017eSChristian Ehrhardt			0x39, 0x8B, 0x5C, 0x49, 0x68, 0x1E, 0x3A, 0x05,
2706b3e017eSChristian Ehrhardt			0xCC, 0x68, 0x5C, 0x76, 0xCB, 0x3C, 0x71, 0x89
2716b3e017eSChristian Ehrhardt		},
2726b3e017eSChristian Ehrhardt		.len = 48
2736b3e017eSChristian Ehrhardt	},
2746b3e017eSChristian Ehrhardt	.digest = {
2756b3e017eSChristian Ehrhardt		.data = {
2766b3e017eSChristian Ehrhardt			0xE2, 0x83, 0x18, 0x55, 0xB5, 0x8D, 0x94, 0x9B,
2776b3e017eSChristian Ehrhardt			0x01, 0xB6, 0xE2, 0x57, 0x7A, 0x62, 0xF5, 0xF4,
2786b3e017eSChristian Ehrhardt			0xAB, 0x39, 0xF3, 0x3C, 0x28, 0xA0, 0x0F, 0xCC,
2796b3e017eSChristian Ehrhardt			0xEE, 0x1C, 0xF1, 0xF8, 0x69, 0xF1, 0x24, 0x3B,
2806b3e017eSChristian Ehrhardt			0x10, 0x90, 0x0A, 0xE3, 0xF0, 0x59, 0xDD, 0xC0,
2816b3e017eSChristian Ehrhardt			0x6F, 0xE6, 0x8C, 0x84, 0xD5, 0x03, 0xF8, 0x9E
2826b3e017eSChristian Ehrhardt		},
2836b3e017eSChristian Ehrhardt		.len = 48
2846b3e017eSChristian Ehrhardt	}
2856b3e017eSChristian Ehrhardt};
2866b3e017eSChristian Ehrhardt
2876b3e017eSChristian Ehrhardtstatic const struct blockcipher_test_data
2886b3e017eSChristian Ehrhardtsha512_test_vector = {
2896b3e017eSChristian Ehrhardt	.auth_algo = RTE_CRYPTO_AUTH_SHA512,
2906b3e017eSChristian Ehrhardt	.ciphertext = {
2916b3e017eSChristian Ehrhardt		.data = plaintext_hash,
2926b3e017eSChristian Ehrhardt		.len = 512
2936b3e017eSChristian Ehrhardt	},
2946b3e017eSChristian Ehrhardt	.digest = {
2956b3e017eSChristian Ehrhardt		.data = {
2966b3e017eSChristian Ehrhardt			0xB9, 0xBA, 0x28, 0x48, 0x3C, 0xC2, 0xD3, 0x65,
2976b3e017eSChristian Ehrhardt			0x4A, 0xD6, 0x00, 0x1D, 0xCE, 0x61, 0x64, 0x54,
2986b3e017eSChristian Ehrhardt			0x45, 0x8C, 0x64, 0x0E, 0xED, 0x0E, 0xD8, 0x1C,
2996b3e017eSChristian Ehrhardt			0x72, 0xCE, 0xD2, 0x44, 0x91, 0xC8, 0xEB, 0xC7,
3006b3e017eSChristian Ehrhardt			0x99, 0xC5, 0xCA, 0x89, 0x72, 0x64, 0x96, 0x41,
3016b3e017eSChristian Ehrhardt			0xC8, 0xEA, 0xB2, 0x4E, 0xD1, 0x21, 0x13, 0x49,
3026b3e017eSChristian Ehrhardt			0x64, 0x4E, 0x15, 0x68, 0x12, 0x67, 0x26, 0x0F,
3036b3e017eSChristian Ehrhardt			0x2C, 0x3C, 0x83, 0x25, 0x27, 0x86, 0xF0, 0xDB
3046b3e017eSChristian Ehrhardt		},
3056b3e017eSChristian Ehrhardt		.len = 64
3066b3e017eSChristian Ehrhardt	}
3076b3e017eSChristian Ehrhardt};
3086b3e017eSChristian Ehrhardt
3096b3e017eSChristian Ehrhardtstatic const struct blockcipher_test_data
3106b3e017eSChristian Ehrhardthmac_sha512_test_vector = {
3116b3e017eSChristian Ehrhardt	.auth_algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
3126b3e017eSChristian Ehrhardt	.ciphertext = {
3136b3e017eSChristian Ehrhardt		.data = plaintext_hash,
3146b3e017eSChristian Ehrhardt		.len = 512
3156b3e017eSChristian Ehrhardt	},
3166b3e017eSChristian Ehrhardt	.auth_key = {
3176b3e017eSChristian Ehrhardt		.data = {
3186b3e017eSChristian Ehrhardt			0xF8, 0x2A, 0xC7, 0x54, 0xDB, 0x96, 0x18, 0xAA,
3196b3e017eSChristian Ehrhardt			0xC3, 0xA1, 0x53, 0xF6, 0x1F, 0x17, 0x60, 0xBD,
3206b3e017eSChristian Ehrhardt			0xDE, 0xF4, 0xDE, 0xAD, 0x26, 0xEB, 0xAB, 0x92,
3216b3e017eSChristian Ehrhardt			0xFB, 0xBF, 0xB0, 0x8C, 0x29, 0x87, 0x90, 0xAC,
3226b3e017eSChristian Ehrhardt			0x39, 0x8B, 0x5C, 0x49, 0x68, 0x1E, 0x3A, 0x05,
3236b3e017eSChristian Ehrhardt			0xCC, 0x68, 0x5C, 0x76, 0xCB, 0x3C, 0x71, 0x89,
3246b3e017eSChristian Ehrhardt			0xDE, 0xAA, 0x36, 0x44, 0x98, 0x93, 0x97, 0x1E,
3256b3e017eSChristian Ehrhardt			0x6D, 0x53, 0x83, 0x87, 0xB3, 0xB7, 0x56, 0x41
3266b3e017eSChristian Ehrhardt		},
3276b3e017eSChristian Ehrhardt		.len = 64
3286b3e017eSChristian Ehrhardt	},
3296b3e017eSChristian Ehrhardt	.digest = {
3306b3e017eSChristian Ehrhardt		.data = {
3316b3e017eSChristian Ehrhardt			0xB8, 0x0B, 0x35, 0x97, 0x3F, 0x24, 0x3F, 0x05,
3326b3e017eSChristian Ehrhardt			0x2A, 0x7F, 0x2F, 0xD8, 0xD7, 0x56, 0x58, 0xAD,
3336b3e017eSChristian Ehrhardt			0x6F, 0x8D, 0x1F, 0x4C, 0x30, 0xF9, 0xA8, 0x29,
3346b3e017eSChristian Ehrhardt			0x7A, 0xE0, 0x8D, 0x88, 0xF5, 0x2E, 0x94, 0xF5,
3356b3e017eSChristian Ehrhardt			0x06, 0xF7, 0x5D, 0x57, 0x32, 0xA8, 0x49, 0x29,
3366b3e017eSChristian Ehrhardt			0xEA, 0x6B, 0x6D, 0x95, 0xBD, 0x76, 0xF5, 0x79,
3376b3e017eSChristian Ehrhardt			0x97, 0x37, 0x0F, 0xBE, 0xC2, 0x45, 0xA0, 0x87,
3386b3e017eSChristian Ehrhardt			0xAF, 0x24, 0x27, 0x0C, 0x78, 0xBA, 0xBE, 0x20
3396b3e017eSChristian Ehrhardt		},
3406b3e017eSChristian Ehrhardt		.len = 64
3416b3e017eSChristian Ehrhardt	}
3426b3e017eSChristian Ehrhardt};
3436b3e017eSChristian Ehrhardt
3446b3e017eSChristian Ehrhardtstatic const struct blockcipher_test_case hash_test_cases[] = {
3456b3e017eSChristian Ehrhardt	{
3466b3e017eSChristian Ehrhardt		.test_descr = "MD5 Digest",
3476b3e017eSChristian Ehrhardt		.test_data = &md5_test_vector,
3486b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
3496b3e017eSChristian Ehrhardt		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
3506b3e017eSChristian Ehrhardt	},
3516b3e017eSChristian Ehrhardt	{
3526b3e017eSChristian Ehrhardt		.test_descr = "MD5 Digest Verify",
3536b3e017eSChristian Ehrhardt		.test_data = &md5_test_vector,
3546b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
3556b3e017eSChristian Ehrhardt		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
3566b3e017eSChristian Ehrhardt	},
3576b3e017eSChristian Ehrhardt	{
3586b3e017eSChristian Ehrhardt		.test_descr = "HMAC-MD5 Digest",
3596b3e017eSChristian Ehrhardt		.test_data = &hmac_md5_test_vector,
3606b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
361fdd2322bSLuca Boccassi		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
362fdd2322bSLuca Boccassi			BLOCKCIPHER_TEST_TARGET_PMD_QAT
3636b3e017eSChristian Ehrhardt	},
3646b3e017eSChristian Ehrhardt	{
3656b3e017eSChristian Ehrhardt		.test_descr = "HMAC-MD5 Digest Verify",
3666b3e017eSChristian Ehrhardt		.test_data = &hmac_md5_test_vector,
3676b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
368fdd2322bSLuca Boccassi		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
369fdd2322bSLuca Boccassi			BLOCKCIPHER_TEST_TARGET_PMD_QAT
3706b3e017eSChristian Ehrhardt	},
3716b3e017eSChristian Ehrhardt	{
3726b3e017eSChristian Ehrhardt		.test_descr = "SHA1 Digest",
3736b3e017eSChristian Ehrhardt		.test_data = &sha1_test_vector,
3746b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
3756b3e017eSChristian Ehrhardt		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
3766b3e017eSChristian Ehrhardt	},
3776b3e017eSChristian Ehrhardt	{
3786b3e017eSChristian Ehrhardt		.test_descr = "SHA1 Digest Verify",
3796b3e017eSChristian Ehrhardt		.test_data = &sha1_test_vector,
3806b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
3816b3e017eSChristian Ehrhardt		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
3826b3e017eSChristian Ehrhardt	},
3836b3e017eSChristian Ehrhardt	{
3846b3e017eSChristian Ehrhardt		.test_descr = "HMAC-SHA1 Digest",
3856b3e017eSChristian Ehrhardt		.test_data = &hmac_sha1_test_vector,
3866b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
387fdd2322bSLuca Boccassi		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
388fdd2322bSLuca Boccassi			BLOCKCIPHER_TEST_TARGET_PMD_QAT
3896b3e017eSChristian Ehrhardt	},
3906b3e017eSChristian Ehrhardt	{
3916b3e017eSChristian Ehrhardt		.test_descr = "HMAC-SHA1 Digest Verify",
3926b3e017eSChristian Ehrhardt		.test_data = &hmac_sha1_test_vector,
3936b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
394fdd2322bSLuca Boccassi		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
395fdd2322bSLuca Boccassi			BLOCKCIPHER_TEST_TARGET_PMD_QAT
3966b3e017eSChristian Ehrhardt	},
3976b3e017eSChristian Ehrhardt	{
3986b3e017eSChristian Ehrhardt		.test_descr = "SHA224 Digest",
3996b3e017eSChristian Ehrhardt		.test_data = &sha224_test_vector,
4006b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
4016b3e017eSChristian Ehrhardt		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
4026b3e017eSChristian Ehrhardt	},
4036b3e017eSChristian Ehrhardt	{
4046b3e017eSChristian Ehrhardt		.test_descr = "SHA224 Digest Verify",
4056b3e017eSChristian Ehrhardt		.test_data = &sha224_test_vector,
4066b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
4076b3e017eSChristian Ehrhardt		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
4086b3e017eSChristian Ehrhardt	},
4096b3e017eSChristian Ehrhardt	{
4106b3e017eSChristian Ehrhardt		.test_descr = "HMAC-SHA224 Digest",
4116b3e017eSChristian Ehrhardt		.test_data = &hmac_sha224_test_vector,
4126b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
413fdd2322bSLuca Boccassi		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
414fdd2322bSLuca Boccassi			BLOCKCIPHER_TEST_TARGET_PMD_QAT
4156b3e017eSChristian Ehrhardt	},
4166b3e017eSChristian Ehrhardt	{
4176b3e017eSChristian Ehrhardt		.test_descr = "HMAC-SHA224 Digest Verify",
4186b3e017eSChristian Ehrhardt		.test_data = &hmac_sha224_test_vector,
4196b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
420fdd2322bSLuca Boccassi		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
421fdd2322bSLuca Boccassi			BLOCKCIPHER_TEST_TARGET_PMD_QAT
4226b3e017eSChristian Ehrhardt	},
4236b3e017eSChristian Ehrhardt	{
4246b3e017eSChristian Ehrhardt		.test_descr = "SHA256 Digest",
4256b3e017eSChristian Ehrhardt		.test_data = &sha256_test_vector,
4266b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
4276b3e017eSChristian Ehrhardt		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
4286b3e017eSChristian Ehrhardt	},
4296b3e017eSChristian Ehrhardt	{
4306b3e017eSChristian Ehrhardt		.test_descr = "SHA256 Digest Verify",
4316b3e017eSChristian Ehrhardt		.test_data = &sha256_test_vector,
4326b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
4336b3e017eSChristian Ehrhardt		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
4346b3e017eSChristian Ehrhardt	},
4356b3e017eSChristian Ehrhardt	{
4366b3e017eSChristian Ehrhardt		.test_descr = "HMAC-SHA256 Digest",
4376b3e017eSChristian Ehrhardt		.test_data = &hmac_sha256_test_vector,
4386b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
439fdd2322bSLuca Boccassi		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
440fdd2322bSLuca Boccassi			BLOCKCIPHER_TEST_TARGET_PMD_QAT
4416b3e017eSChristian Ehrhardt	},
4426b3e017eSChristian Ehrhardt	{
4436b3e017eSChristian Ehrhardt		.test_descr = "HMAC-SHA256 Digest Verify",
4446b3e017eSChristian Ehrhardt		.test_data = &hmac_sha256_test_vector,
4456b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
446fdd2322bSLuca Boccassi		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
447fdd2322bSLuca Boccassi			BLOCKCIPHER_TEST_TARGET_PMD_QAT
4486b3e017eSChristian Ehrhardt	},
4496b3e017eSChristian Ehrhardt	{
4506b3e017eSChristian Ehrhardt		.test_descr = "SHA384 Digest",
4516b3e017eSChristian Ehrhardt		.test_data = &sha384_test_vector,
4526b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
4536b3e017eSChristian Ehrhardt		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
4546b3e017eSChristian Ehrhardt	},
4556b3e017eSChristian Ehrhardt	{
4566b3e017eSChristian Ehrhardt		.test_descr = "SHA384 Digest Verify",
4576b3e017eSChristian Ehrhardt		.test_data = &sha384_test_vector,
4586b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
4596b3e017eSChristian Ehrhardt		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
4606b3e017eSChristian Ehrhardt	},
4616b3e017eSChristian Ehrhardt	{
4626b3e017eSChristian Ehrhardt		.test_descr = "HMAC-SHA384 Digest",
4636b3e017eSChristian Ehrhardt		.test_data = &hmac_sha384_test_vector,
4646b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
465fdd2322bSLuca Boccassi		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
466fdd2322bSLuca Boccassi			BLOCKCIPHER_TEST_TARGET_PMD_QAT
4676b3e017eSChristian Ehrhardt	},
4686b3e017eSChristian Ehrhardt	{
4696b3e017eSChristian Ehrhardt		.test_descr = "HMAC-SHA384 Digest Verify",
4706b3e017eSChristian Ehrhardt		.test_data = &hmac_sha384_test_vector,
4716b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
472fdd2322bSLuca Boccassi		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
473fdd2322bSLuca Boccassi			BLOCKCIPHER_TEST_TARGET_PMD_QAT
4746b3e017eSChristian Ehrhardt	},
4756b3e017eSChristian Ehrhardt	{
4766b3e017eSChristian Ehrhardt		.test_descr = "SHA512 Digest",
4776b3e017eSChristian Ehrhardt		.test_data = &sha512_test_vector,
4786b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
4796b3e017eSChristian Ehrhardt		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
4806b3e017eSChristian Ehrhardt	},
4816b3e017eSChristian Ehrhardt	{
4826b3e017eSChristian Ehrhardt		.test_descr = "SHA512 Digest Verify",
4836b3e017eSChristian Ehrhardt		.test_data = &sha512_test_vector,
4846b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
4856b3e017eSChristian Ehrhardt		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL
4866b3e017eSChristian Ehrhardt	},
4876b3e017eSChristian Ehrhardt	{
4886b3e017eSChristian Ehrhardt		.test_descr = "HMAC-SHA512 Digest",
4896b3e017eSChristian Ehrhardt		.test_data = &hmac_sha512_test_vector,
4906b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN,
491fdd2322bSLuca Boccassi		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
492fdd2322bSLuca Boccassi			BLOCKCIPHER_TEST_TARGET_PMD_QAT
4936b3e017eSChristian Ehrhardt	},
4946b3e017eSChristian Ehrhardt	{
4956b3e017eSChristian Ehrhardt		.test_descr = "HMAC-SHA512 Digest Verify",
4966b3e017eSChristian Ehrhardt		.test_data = &hmac_sha512_test_vector,
4976b3e017eSChristian Ehrhardt		.op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY,
498fdd2322bSLuca Boccassi		.pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
499fdd2322bSLuca Boccassi			BLOCKCIPHER_TEST_TARGET_PMD_QAT
5006b3e017eSChristian Ehrhardt	},
5016b3e017eSChristian Ehrhardt};
5026b3e017eSChristian Ehrhardt
5036b3e017eSChristian Ehrhardt#endif /* TEST_CRYPTODEV_HASH_TEST_VECTORS_H_ */
504