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

Go to the source code of this file.

Data Structures

struct  Generator
 

Macros

#define EC_CURVE_NUM_SUPPORTED   3
 

Functions

UNIT_TEST_STATUS EFIAPI TestVerifyEcPreReq (UNIT_TEST_CONTEXT Context)
 
VOID EFIAPI TestVerifyEcCleanUp (UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestVerifyEcBasic (UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestVerifyEcDh (UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestVerifyEcKey (UNIT_TEST_CONTEXT Context)
 

Variables

UINTN EcCurveList [EC_CURVE_NUM_SUPPORTED] = { CRYPTO_NID_SECP256R1, CRYPTO_NID_SECP384R1, CRYPTO_NID_SECP521R1 }
 
UINTN EcKeyHalfSize [EC_CURVE_NUM_SUPPORTED] = { 32, 48, 66 }
 
struct Generator EcCurveGenerator [EC_CURVE_NUM_SUPPORTED]
 
GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 mEccTestRootCer []
 
GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 mEccTestPemKey []
 
CONST CHAR8 * mEcPayload = "payload data for PKCS#7 EC Signing"
 
VOID * Ec1
 
VOID * Ec2
 
VOID * Group
 
VOID * Point1
 
VOID * Point2
 
VOID * PointRes
 
VOID * BnX
 
VOID * BnY
 
VOID * BnP
 
VOID * BnOrder
 
TEST_DESC mEcTest []
 
UINTN mEcTestNum = ARRAY_SIZE (mEcTest)
 

Detailed Description

Application for Diffie-Hellman Primitives Validation.

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

Definition in file EcTests.c.

Macro Definition Documentation

◆ EC_CURVE_NUM_SUPPORTED

#define EC_CURVE_NUM_SUPPORTED   3

Definition at line 11 of file EcTests.c.

Function Documentation

◆ TestVerifyEcBasic()

UNIT_TEST_STATUS EFIAPI TestVerifyEcBasic ( UNIT_TEST_CONTEXT  Context)

Definition at line 200 of file EcTests.c.

◆ TestVerifyEcCleanUp()

VOID EFIAPI TestVerifyEcCleanUp ( UNIT_TEST_CONTEXT  Context)

Definition at line 182 of file EcTests.c.

◆ TestVerifyEcDh()

UNIT_TEST_STATUS EFIAPI TestVerifyEcDh ( UNIT_TEST_CONTEXT  Context)

Definition at line 299 of file EcTests.c.

◆ TestVerifyEcKey()

UNIT_TEST_STATUS EFIAPI TestVerifyEcKey ( UNIT_TEST_CONTEXT  Context)

Definition at line 367 of file EcTests.c.

◆ TestVerifyEcPreReq()

UNIT_TEST_STATUS EFIAPI TestVerifyEcPreReq ( UNIT_TEST_CONTEXT  Context)

Definition at line 159 of file EcTests.c.

Variable Documentation

◆ BnOrder

VOID* BnOrder

Definition at line 155 of file EcTests.c.

◆ BnP

VOID* BnP

Definition at line 154 of file EcTests.c.

◆ BnX

VOID* BnX

Definition at line 152 of file EcTests.c.

◆ BnY

VOID* BnY

Definition at line 153 of file EcTests.c.

◆ Ec1

VOID* Ec1

Definition at line 146 of file EcTests.c.

◆ Ec2

VOID* Ec2

Definition at line 147 of file EcTests.c.

◆ EcCurveGenerator

struct Generator EcCurveGenerator[EC_CURVE_NUM_SUPPORTED]

Definition at line 21 of file EcTests.c.

◆ EcCurveList

UINTN EcCurveList[EC_CURVE_NUM_SUPPORTED] = { CRYPTO_NID_SECP256R1, CRYPTO_NID_SECP384R1, CRYPTO_NID_SECP521R1 }

Definition at line 12 of file EcTests.c.

◆ EcKeyHalfSize

UINTN EcKeyHalfSize[EC_CURVE_NUM_SUPPORTED] = { 32, 48, 66 }

Definition at line 13 of file EcTests.c.

◆ Group

VOID* Group

Definition at line 148 of file EcTests.c.

◆ mEccTestPemKey

GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 mEccTestPemKey[]
Initial value:
= {
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x45,
0x43, 0x20, 0x50, 0x41, 0x52, 0x41, 0x4d, 0x45, 0x54, 0x45, 0x52, 0x53,
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x42, 0x67, 0x67, 0x71, 0x68, 0x6b,
0x6a, 0x4f, 0x50, 0x51, 0x4d, 0x42, 0x42, 0x77, 0x3d, 0x3d, 0x0a, 0x2d,
0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x45, 0x43, 0x20, 0x50,
0x41, 0x52, 0x41, 0x4d, 0x45, 0x54, 0x45, 0x52, 0x53, 0x2d, 0x2d, 0x2d,
0x2d, 0x2d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49,
0x4e, 0x20, 0x45, 0x43, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45,
0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x48,
0x63, 0x43, 0x41, 0x51, 0x45, 0x45, 0x49, 0x4d, 0x4a, 0x54, 0x69, 0x75,
0x34, 0x56, 0x54, 0x54, 0x57, 0x68, 0x78, 0x4b, 0x62, 0x51, 0x65, 0x78,
0x6e, 0x30, 0x43, 0x58, 0x41, 0x77, 0x33, 0x44, 0x57, 0x6b, 0x6f, 0x78,
0x79, 0x77, 0x6b, 0x7a, 0x46, 0x50, 0x62, 0x32, 0x48, 0x68, 0x5a, 0x6e,
0x5a, 0x52, 0x6f, 0x41, 0x6f, 0x47, 0x43, 0x43, 0x71, 0x47, 0x53, 0x4d,
0x34, 0x39, 0x0a, 0x41, 0x77, 0x45, 0x48, 0x6f, 0x55, 0x51, 0x44, 0x51,
0x67, 0x41, 0x45, 0x45, 0x61, 0x51, 0x47, 0x5a, 0x62, 0x5a, 0x35, 0x62,
0x6e, 0x4b, 0x32, 0x32, 0x41, 0x6d, 0x45, 0x6b, 0x6f, 0x59, 0x52, 0x43,
0x64, 0x37, 0x71, 0x30, 0x41, 0x78, 0x67, 0x38, 0x59, 0x72, 0x2f, 0x66,
0x4e, 0x37, 0x4f, 0x37, 0x41, 0x65, 0x36, 0x70, 0x62, 0x6a, 0x56, 0x46,
0x2b, 0x56, 0x69, 0x4d, 0x79, 0x32, 0x49, 0x0a, 0x73, 0x5a, 0x72, 0x6d,
0x38, 0x77, 0x6c, 0x44, 0x44, 0x71, 0x6e, 0x33, 0x50, 0x4f, 0x6b, 0x67,
0x75, 0x72, 0x32, 0x78, 0x50, 0x41, 0x4f, 0x4a, 0x48, 0x69, 0x72, 0x2f,
0x62, 0x67, 0x6a, 0x2f, 0x4c, 0x67, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d,
0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x45, 0x43, 0x20, 0x50, 0x52, 0x49,
0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d,
0x2d, 0x0a,
}

Definition at line 112 of file EcTests.c.

◆ mEccTestRootCer

GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 mEccTestRootCer[]

Definition at line 66 of file EcTests.c.

◆ mEcPayload

CONST CHAR8* mEcPayload = "payload data for PKCS#7 EC Signing"

Definition at line 144 of file EcTests.c.

◆ mEcTest

TEST_DESC mEcTest[]
Initial value:
= {
{ "TestVerifyEcBasic()", "CryptoPkg.BaseCryptLib.Ec", TestVerifyEcBasic, TestVerifyEcPreReq, TestVerifyEcCleanUp, NULL },
{ "TestVerifyEcDh()", "CryptoPkg.BaseCryptLib.Ec", TestVerifyEcDh, TestVerifyEcPreReq, TestVerifyEcCleanUp, NULL },
{ "TestVerifyEcKey()", "CryptoPkg.BaseCryptLib.Ec", TestVerifyEcKey, NULL, NULL, NULL },
}
#define NULL
Definition: Base.h:319

Definition at line 437 of file EcTests.c.

◆ mEcTestNum

UINTN mEcTestNum = ARRAY_SIZE (mEcTest)

Definition at line 446 of file EcTests.c.

◆ Point1

VOID* Point1

Definition at line 149 of file EcTests.c.

◆ Point2

VOID* Point2

Definition at line 150 of file EcTests.c.

◆ PointRes

VOID* PointRes

Definition at line 151 of file EcTests.c.