22 return UNIT_TEST_ERROR_TEST_FAILED;
27 return UNIT_TEST_ERROR_TEST_FAILED;
30 return UNIT_TEST_PASSED;
52TestVerifyDhGenerateKey (
58 UINTN PublicKey1Length;
60 UINTN PublicKey2Length;
70 PublicKey1Length =
sizeof (PublicKey1);
71 PublicKey2Length =
sizeof (PublicKey2);
72 Key1Length =
sizeof (Key1);
73 Key2Length =
sizeof (Key2);
87 Status =
DhComputeKey (mDh1, PublicKey2, PublicKey2Length, Key1, &Key1Length);
90 Status =
DhComputeKey (mDh2, PublicKey1, PublicKey1Length, Key2, &Key2Length);
97 return UNIT_TEST_PASSED;
104 {
"TestVerifyDhGenerateKey()",
"CryptoPkg.BaseCryptLib.Dh", TestVerifyDhGenerateKey, TestVerifyDhPreReq, TestVerifyDhCleanUp,
NULL },
BOOLEAN EFIAPI DhGenerateParameter(IN OUT VOID *DhContext, IN UINTN Generator, IN UINTN PrimeLength, OUT UINT8 *Prime)
BOOLEAN EFIAPI DhGenerateKey(IN OUT VOID *DhContext, OUT UINT8 *PublicKey, IN OUT UINTN *PublicKeySize)
VOID EFIAPI DhFree(IN VOID *DhContext)
BOOLEAN EFIAPI DhSetParameter(IN OUT VOID *DhContext, IN UINTN Generator, IN UINTN PrimeLength, IN CONST UINT8 *Prime)
BOOLEAN EFIAPI DhComputeKey(IN OUT VOID *DhContext, IN CONST UINT8 *PeerPublicKey, IN UINTN PeerPublicKeySize, OUT UINT8 *Key, IN OUT UINTN *KeySize)
#define ARRAY_SIZE(Array)
#define UT_ASSERT_MEM_EQUAL(BufferA, BufferB, Length)
#define UT_ASSERT_TRUE(Expression)
#define UT_ASSERT_EQUAL(ValueA, ValueB)