TianoCore EDK2 master
Loading...
Searching...
No Matches
HkdfTests.c File Reference
#include "TestBaseCryptLib.h"

Go to the source code of this file.

Functions

UNIT_TEST_STATUS EFIAPI TestVerifyHkdfSha256 (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestVerifyHkdfSha384 (IN UNIT_TEST_CONTEXT Context)
 

Variables

UINT8 mHkdfSha256Ikm [22]
 
UINT8 mHkdfSha256Salt [13]
 
UINT8 mHkdfSha256Info [10]
 
UINT8 mHkdfSha256Prk [32]
 
UINT8 mHkdfSha256Okm [42]
 
UINT8 mHkdfSha384Ikm [16]
 
UINT8 mHkdfSha384Salt [16]
 
UINT8 mHkdfSha384Info [20]
 
UINT8 mHkdfSha384Prk [48]
 
UINT8 mHkdfSha384Okm [64]
 
TEST_DESC mHkdfTest []
 
UINTN mHkdfTestNum = ARRAY_SIZE (mHkdfTest)
 

Detailed Description

Application for Hkdf Primitives Validation.

Copyright (c) 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file HkdfTests.c.

Function Documentation

◆ TestVerifyHkdfSha256()

UNIT_TEST_STATUS EFIAPI TestVerifyHkdfSha256 ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 85 of file HkdfTests.c.

◆ TestVerifyHkdfSha384()

UNIT_TEST_STATUS EFIAPI TestVerifyHkdfSha384 ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 141 of file HkdfTests.c.

Variable Documentation

◆ mHkdfSha256Ikm

UINT8 mHkdfSha256Ikm[22]
Initial value:
= {
0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
0x0b, 0x0b
}

HKDF KAT from RFC 5869 Appendix A. Test Vectors https://www.rfc-editor.org/rfc/rfc5869.html

Definition at line 15 of file HkdfTests.c.

◆ mHkdfSha256Info

UINT8 mHkdfSha256Info[10]
Initial value:
= {
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9,
}

Definition at line 26 of file HkdfTests.c.

◆ mHkdfSha256Okm

UINT8 mHkdfSha256Okm[42]
Initial value:
= {
0x3c, 0xb2, 0x5f, 0x25, 0xfa, 0xac, 0xd5, 0x7a, 0x90, 0x43,
0x4f, 0x64, 0xd0, 0x36, 0x2f, 0x2a, 0x2d, 0x2d, 0x0a, 0x90,
0xcf, 0x1a, 0x5a, 0x4c, 0x5d, 0xb0, 0x2d, 0x56, 0xec, 0xc4,
0xc5, 0xbf, 0x34, 0x00, 0x72, 0x08, 0xd5, 0xb8, 0x87, 0x18,
0x58, 0x65,
}

Definition at line 37 of file HkdfTests.c.

◆ mHkdfSha256Prk

UINT8 mHkdfSha256Prk[32]
Initial value:
= {
0x07, 0x77, 0x09, 0x36, 0x2c, 0x2e, 0x32, 0xdf, 0x0d, 0xdc,
0x3f, 0x0d, 0xc4, 0x7b, 0xba, 0x63, 0x90, 0xb6, 0xc7, 0x3b,
0xb5, 0x0f, 0x9c, 0x31, 0x22, 0xec, 0x84, 0x4a, 0xd7, 0xc2,
0xb3, 0xe5,
}

Definition at line 30 of file HkdfTests.c.

◆ mHkdfSha256Salt

UINT8 mHkdfSha256Salt[13]
Initial value:
= {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
0x0a, 0x0b, 0x0c,
}

Definition at line 21 of file HkdfTests.c.

◆ mHkdfSha384Ikm

UINT8 mHkdfSha384Ikm[16]
Initial value:
= {
0x86, 0x77, 0xdc, 0x79, 0x23, 0x3e, 0xf3, 0x48, 0x07, 0x77,
0xc4, 0xc6, 0x01, 0xef, 0x4f, 0x0b,
}

This Hkdf-Sha384 test vector is form Project Wycheproof developed and maintained by members of Google Security Team. https://github.com/google/wycheproof/blob/master/testvectors/hkdf_sha384_test.json

Definition at line 50 of file HkdfTests.c.

◆ mHkdfSha384Info

UINT8 mHkdfSha384Info[20]
Initial value:
= {
0xa3, 0x8f, 0x63, 0x4d, 0x94, 0x78, 0x19, 0xa9, 0xbf, 0xa7,
0x92, 0x17, 0x4b, 0x42, 0xba, 0xa2, 0x0c, 0x9f, 0xce, 0x15,
}

Definition at line 60 of file HkdfTests.c.

◆ mHkdfSha384Okm

UINT8 mHkdfSha384Okm[64]
Initial value:
= {
0x75, 0x85, 0x46, 0x36, 0x2a, 0x07, 0x0c, 0x0f, 0x13, 0xcb,
0xfb, 0xf1, 0x75, 0x6e, 0x8f, 0x29, 0xb7, 0x81, 0x9f, 0xb9,
0x03, 0xc7, 0xed, 0x4f, 0x97, 0xa5, 0x6b, 0xe3, 0xc8, 0xf8,
0x1e, 0x8c, 0x37, 0xae, 0xf5, 0xc0, 0xf8, 0xe5, 0xd2, 0xb1,
0x7e, 0xb1, 0xaa, 0x02, 0xec, 0x04, 0xc3, 0x3f, 0x54, 0x6c,
0xb2, 0xf3, 0xd1, 0x93, 0xe9, 0x30, 0xa9, 0xf8, 0x9e, 0xc9,
0xce, 0x3a, 0x82, 0xb5
}

Definition at line 73 of file HkdfTests.c.

◆ mHkdfSha384Prk

UINT8 mHkdfSha384Prk[48]
Initial value:
= {
0x60, 0xae, 0xa0, 0xde, 0xca, 0x97, 0x62, 0xaa, 0x43, 0xaf,
0x0e, 0x77, 0xa8, 0x0f, 0xb7, 0x76, 0xd0, 0x08, 0x19, 0x62,
0xf8, 0x30, 0xb5, 0x0d, 0x92, 0x08, 0x92, 0x7a, 0x8a, 0xd5,
0x6a, 0x3d, 0xc4, 0x4a, 0x5d, 0xfe, 0xb6, 0xb4, 0x79, 0x2f,
0x97, 0x92, 0x71, 0xe6, 0xcb, 0x08, 0x86, 0x52,
}

Definition at line 65 of file HkdfTests.c.

◆ mHkdfSha384Salt

UINT8 mHkdfSha384Salt[16]
Initial value:
= {
0xad, 0x88, 0xdb, 0x71, 0x82, 0x44, 0xe2, 0xcb, 0x60, 0xe3,
0x5f, 0x87, 0x4d, 0x7a, 0xd8, 0x1f,
}

Definition at line 55 of file HkdfTests.c.

◆ mHkdfTest

TEST_DESC mHkdfTest[]
Initial value:
= {
{ "TestVerifyHkdfSha256()", "CryptoPkg.BaseCryptLib.Hkdf", TestVerifyHkdfSha256, NULL, NULL, NULL },
{ "TestVerifyHkdfSha384()", "CryptoPkg.BaseCryptLib.Hkdf", TestVerifyHkdfSha384, NULL, NULL, NULL },
}
#define NULL
Definition: Base.h:319

Definition at line 194 of file HkdfTests.c.

◆ mHkdfTestNum

UINTN mHkdfTestNum = ARRAY_SIZE (mHkdfTest)

Definition at line 202 of file HkdfTests.c.