16 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
17 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
21UINT8 mHkdfSha256Salt[13] = {
22 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
26UINT8 mHkdfSha256Info[10] = {
27 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9,
30UINT8 mHkdfSha256Prk[32] = {
31 0x07, 0x77, 0x09, 0x36, 0x2c, 0x2e, 0x32, 0xdf, 0x0d, 0xdc,
32 0x3f, 0x0d, 0xc4, 0x7b, 0xba, 0x63, 0x90, 0xb6, 0xc7, 0x3b,
33 0xb5, 0x0f, 0x9c, 0x31, 0x22, 0xec, 0x84, 0x4a, 0xd7, 0xc2,
37UINT8 mHkdfSha256Okm[42] = {
38 0x3c, 0xb2, 0x5f, 0x25, 0xfa, 0xac, 0xd5, 0x7a, 0x90, 0x43,
39 0x4f, 0x64, 0xd0, 0x36, 0x2f, 0x2a, 0x2d, 0x2d, 0x0a, 0x90,
40 0xcf, 0x1a, 0x5a, 0x4c, 0x5d, 0xb0, 0x2d, 0x56, 0xec, 0xc4,
41 0xc5, 0xbf, 0x34, 0x00, 0x72, 0x08, 0xd5, 0xb8, 0x87, 0x18,
51 0x86, 0x77, 0xdc, 0x79, 0x23, 0x3e, 0xf3, 0x48, 0x07, 0x77,
52 0xc4, 0xc6, 0x01, 0xef, 0x4f, 0x0b,
55UINT8 mHkdfSha384Salt[16] = {
56 0xad, 0x88, 0xdb, 0x71, 0x82, 0x44, 0xe2, 0xcb, 0x60, 0xe3,
57 0x5f, 0x87, 0x4d, 0x7a, 0xd8, 0x1f,
60UINT8 mHkdfSha384Info[20] = {
61 0xa3, 0x8f, 0x63, 0x4d, 0x94, 0x78, 0x19, 0xa9, 0xbf, 0xa7,
62 0x92, 0x17, 0x4b, 0x42, 0xba, 0xa2, 0x0c, 0x9f, 0xce, 0x15,
65UINT8 mHkdfSha384Prk[48] = {
66 0x60, 0xae, 0xa0, 0xde, 0xca, 0x97, 0x62, 0xaa, 0x43, 0xaf,
67 0x0e, 0x77, 0xa8, 0x0f, 0xb7, 0x76, 0xd0, 0x08, 0x19, 0x62,
68 0xf8, 0x30, 0xb5, 0x0d, 0x92, 0x08, 0x92, 0x7a, 0x8a, 0xd5,
69 0x6a, 0x3d, 0xc4, 0x4a, 0x5d, 0xfe, 0xb6, 0xb4, 0x79, 0x2f,
70 0x97, 0x92, 0x71, 0xe6, 0xcb, 0x08, 0x86, 0x52,
73UINT8 mHkdfSha384Okm[64] = {
74 0x75, 0x85, 0x46, 0x36, 0x2a, 0x07, 0x0c, 0x0f, 0x13, 0xcb,
75 0xfb, 0xf1, 0x75, 0x6e, 0x8f, 0x29, 0xb7, 0x81, 0x9f, 0xb9,
76 0x03, 0xc7, 0xed, 0x4f, 0x97, 0xa5, 0x6b, 0xe3, 0xc8, 0xf8,
77 0x1e, 0x8c, 0x37, 0xae, 0xf5, 0xc0, 0xf8, 0xe5, 0xd2, 0xb1,
78 0x7e, 0xb1, 0xaa, 0x02, 0xec, 0x04, 0xc3, 0x3f, 0x54, 0x6c,
79 0xb2, 0xf3, 0xd1, 0x93, 0xe9, 0x30, 0xa9, 0xf8, 0x9e, 0xc9,
80 0xce, 0x3a, 0x82, 0xb5
95 ZeroMem (PrkOut,
sizeof (PrkOut));
100 sizeof (mHkdfSha256Salt),
111 sizeof (mHkdfSha256Prk),
113 sizeof (mHkdfSha256Info),
126 sizeof (mHkdfSha256Salt),
128 sizeof (mHkdfSha256Info),
136 return UNIT_TEST_PASSED;
141TestVerifyHkdfSha384 (
150 ZeroMem (PrkOut,
sizeof (PrkOut));
155 sizeof (mHkdfSha384Salt),
166 sizeof (mHkdfSha384Prk),
168 sizeof (mHkdfSha384Info),
181 sizeof (mHkdfSha384Salt),
183 sizeof (mHkdfSha384Info),
191 return UNIT_TEST_PASSED;
198 {
"TestVerifyHkdfSha256()",
"CryptoPkg.BaseCryptLib.Hkdf", TestVerifyHkdfSha256,
NULL,
NULL,
NULL },
199 {
"TestVerifyHkdfSha384()",
"CryptoPkg.BaseCryptLib.Hkdf", TestVerifyHkdfSha384,
NULL,
NULL,
NULL },
BOOLEAN EFIAPI HkdfSha256Extract(IN CONST UINT8 *Key, IN UINTN KeySize, IN CONST UINT8 *Salt, IN UINTN SaltSize, OUT UINT8 *PrkOut, UINTN PrkOutSize)
BOOLEAN EFIAPI HkdfSha384ExtractAndExpand(IN CONST UINT8 *Key, IN UINTN KeySize, IN CONST UINT8 *Salt, IN UINTN SaltSize, IN CONST UINT8 *Info, IN UINTN InfoSize, OUT UINT8 *Out, IN UINTN OutSize)
BOOLEAN EFIAPI HkdfSha384Extract(IN CONST UINT8 *Key, IN UINTN KeySize, IN CONST UINT8 *Salt, IN UINTN SaltSize, OUT UINT8 *PrkOut, UINTN PrkOutSize)
BOOLEAN EFIAPI HkdfSha256Expand(IN CONST UINT8 *Prk, IN UINTN PrkSize, IN CONST UINT8 *Info, IN UINTN InfoSize, OUT UINT8 *Out, IN UINTN OutSize)
BOOLEAN EFIAPI HkdfSha256ExtractAndExpand(IN CONST UINT8 *Key, IN UINTN KeySize, IN CONST UINT8 *Salt, IN UINTN SaltSize, IN CONST UINT8 *Info, IN UINTN InfoSize, OUT UINT8 *Out, IN UINTN OutSize)
BOOLEAN EFIAPI HkdfSha384Expand(IN CONST UINT8 *Prk, IN UINTN PrkSize, IN CONST UINT8 *Info, IN UINTN InfoSize, OUT UINT8 *Out, IN UINTN OutSize)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
#define ARRAY_SIZE(Array)
#define UT_ASSERT_MEM_EQUAL(BufferA, BufferB, Length)
#define UT_ASSERT_TRUE(Expression)