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

Go to the source code of this file.

Data Structures

struct  _OAEP_ENC_DEC_TEST_CONTEXT
 

Typedefs

typedef struct _OAEP_ENC_DEC_TEST_CONTEXT OAEP_ENC_DEC_TEST_CONTEXT
 
typedef BOOLEAN(EFIAPI * OAEP_TEST_ENCRYPT) (IN OAEP_ENC_DEC_TEST_CONTEXT *TestContext, IN CONST UINT8 *ClearText, IN UINTN ClearTextSize, IN CONST UINT8 *PrngSeed, IN UINTN PrngSeedSize, IN UINT16 DigestLen, OUT UINT8 **CipherText, OUT UINTN *CipherTextSize)
 
typedef BOOLEAN(EFIAPI * OAEP_TEST_DECRYPT) (IN OAEP_ENC_DEC_TEST_CONTEXT *TestContext, IN CONST UINT8 *CipherText, IN UINTN CipherTextSize, IN UINT16 DigestLen, OUT UINT8 **ClearText, OUT UINTN *ClearTextSize)
 

Functions

BOOLEAN EFIAPI CallPkcs1v2Encrypt (OAEP_ENC_DEC_TEST_CONTEXT *TestCtx, CONST UINT8 *ClearText, UINTN ClearTextSize, CONST UINT8 *PrngSeed, UINTN PrngSeedSize, UINT16 DigestLen, UINT8 **CipherText, UINTN *CipherTextSize)
 
BOOLEAN EFIAPI CallPkcs1v2Decrypt (OAEP_ENC_DEC_TEST_CONTEXT *TestCtx, CONST UINT8 *CipherText, UINTN CipherTextSize, UINT16 DigestLen, UINT8 **ClearText, UINTN *ClearTextSize)
 
BOOLEAN EFIAPI CallRsaOaepEncrypt (OAEP_ENC_DEC_TEST_CONTEXT *TestCtx, CONST UINT8 *ClearText, UINTN ClearTextSize, CONST UINT8 *RandSeedIn, UINTN RandSeedSizeIn, UINT16 DigestLen, UINT8 **CipherText, UINTN *CipherTextSize)
 
BOOLEAN EFIAPI CallRsaOaepDecrypt (OAEP_ENC_DEC_TEST_CONTEXT *TestCtx, CONST UINT8 *CipherText, UINTN CipherTextSize, UINT16 DigestLen, UINT8 **ClearText, UINTN *ClearTextSize)
 
UNIT_TEST_STATUS EFIAPI TestVerifyEncrypt (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestVerifyDecrypt (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestVerifyEncryptDecrypt (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestVerifyPkcs1v2EncryptInterface (IN UNIT_TEST_CONTEXT Context)
 
UNIT_TEST_STATUS EFIAPI TestVerifyRsaOaepEncryptInterface (IN UNIT_TEST_CONTEXT Context)
 

Variables

STATIC CONST UINT8 RandSeed [] = "This is the random seed for PRNG verification."
 
GLOBAL_REMOVE_IF_UNREFERENCED STATIC CONST UINT8 SelfTestCert []
 
GLOBAL_REMOVE_IF_UNREFERENCED STATIC CONST UINT8 PrivateKey []
 
GLOBAL_REMOVE_IF_UNREFERENCED STATIC CONST UINT8 RsaN []
 
GLOBAL_REMOVE_IF_UNREFERENCED STATIC CONST UINT8 RsaE []
 
GLOBAL_REMOVE_IF_UNREFERENCED STATIC CONST UINT8 RsaD []
 
GLOBAL_REMOVE_IF_UNREFERENCED STATIC CONST UINT8 Msg1230 []
 
GLOBAL_REMOVE_IF_UNREFERENCED STATIC CONST UINT8 Ct1230RsaesOaepMdSha1Mgf1Sha1 []
 
GLOBAL_REMOVE_IF_UNREFERENCED STATIC CONST UINT8 Ct1230RsaesOaep2048MdSha256Mgf1Sha256 []
 
OAEP_ENC_DEC_TEST_CONTEXT mTestVerifyPkcs1v2Msg1230
 
OAEP_ENC_DEC_TEST_CONTEXT mTestVerifyPkcs1v2Msg1230PrngSeed
 
OAEP_ENC_DEC_TEST_CONTEXT mTestVerifyRsaOaepMsg1230
 
OAEP_ENC_DEC_TEST_CONTEXT mTestVerifyRsaOaepMsg1230PrngSeed
 
OAEP_ENC_DEC_TEST_CONTEXT mTestVerifyPkcs1v2EncryptRsaOaepDecrypt
 
OAEP_ENC_DEC_TEST_CONTEXT mTestVerifyRsaOaepEncryptPkcs1v2Decrypt
 
OAEP_ENC_DEC_TEST_CONTEXT mTestVerifyRsaesOaep2048MdDefaultBgf1Default
 
OAEP_ENC_DEC_TEST_CONTEXT mTestVerifyRsaesOaep2048MdSha1Mgf1Sha1
 
OAEP_ENC_DEC_TEST_CONTEXT mTestVerifyRsaesOaep2048MdSha256Mgf1Sha256
 
TEST_DESC mOaepTest []
 
UINTN mOaepTestNum = ARRAY_SIZE (mOaepTest)
 

Detailed Description

This is a unit test for RSA OAEP encrypt/decrypt.

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

Definition in file OaepEncryptTests.c.

Typedef Documentation

◆ OAEP_ENC_DEC_TEST_CONTEXT

Definition at line 246 of file OaepEncryptTests.c.

◆ OAEP_TEST_DECRYPT

typedef BOOLEAN(EFIAPI * OAEP_TEST_DECRYPT) (IN OAEP_ENC_DEC_TEST_CONTEXT *TestContext, IN CONST UINT8 *CipherText, IN UINTN CipherTextSize, IN UINT16 DigestLen, OUT UINT8 **ClearText, OUT UINTN *ClearTextSize)

Definition at line 261 of file OaepEncryptTests.c.

◆ OAEP_TEST_ENCRYPT

typedef BOOLEAN(EFIAPI * OAEP_TEST_ENCRYPT) (IN OAEP_ENC_DEC_TEST_CONTEXT *TestContext, IN CONST UINT8 *ClearText, IN UINTN ClearTextSize, IN CONST UINT8 *PrngSeed, IN UINTN PrngSeedSize, IN UINT16 DigestLen, OUT UINT8 **CipherText, OUT UINTN *CipherTextSize)

Definition at line 248 of file OaepEncryptTests.c.

Function Documentation

◆ CallPkcs1v2Decrypt()

BOOLEAN EFIAPI CallPkcs1v2Decrypt ( OAEP_ENC_DEC_TEST_CONTEXT TestCtx,
CONST UINT8 *  CipherText,
UINTN  CipherTextSize,
UINT16  DigestLen,
UINT8 **  ClearText,
UINTN ClearTextSize 
)

Definition at line 325 of file OaepEncryptTests.c.

◆ CallPkcs1v2Encrypt()

BOOLEAN EFIAPI CallPkcs1v2Encrypt ( OAEP_ENC_DEC_TEST_CONTEXT TestCtx,
CONST UINT8 *  ClearText,
UINTN  ClearTextSize,
CONST UINT8 *  PrngSeed,
UINTN  PrngSeedSize,
UINT16  DigestLen,
UINT8 **  CipherText,
UINTN CipherTextSize 
)

Definition at line 296 of file OaepEncryptTests.c.

◆ CallRsaOaepDecrypt()

BOOLEAN EFIAPI CallRsaOaepDecrypt ( OAEP_ENC_DEC_TEST_CONTEXT TestCtx,
CONST UINT8 *  CipherText,
UINTN  CipherTextSize,
UINT16  DigestLen,
UINT8 **  ClearText,
UINTN ClearTextSize 
)

Definition at line 388 of file OaepEncryptTests.c.

◆ CallRsaOaepEncrypt()

BOOLEAN EFIAPI CallRsaOaepEncrypt ( OAEP_ENC_DEC_TEST_CONTEXT TestCtx,
CONST UINT8 *  ClearText,
UINTN  ClearTextSize,
CONST UINT8 *  RandSeedIn,
UINTN  RandSeedSizeIn,
UINT16  DigestLen,
UINT8 **  CipherText,
UINTN CipherTextSize 
)

Definition at line 349 of file OaepEncryptTests.c.

◆ TestVerifyDecrypt()

UNIT_TEST_STATUS EFIAPI TestVerifyDecrypt ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 484 of file OaepEncryptTests.c.

◆ TestVerifyEncrypt()

UNIT_TEST_STATUS EFIAPI TestVerifyEncrypt ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 426 of file OaepEncryptTests.c.

◆ TestVerifyEncryptDecrypt()

UNIT_TEST_STATUS EFIAPI TestVerifyEncryptDecrypt ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 519 of file OaepEncryptTests.c.

◆ TestVerifyPkcs1v2EncryptInterface()

UNIT_TEST_STATUS EFIAPI TestVerifyPkcs1v2EncryptInterface ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 581 of file OaepEncryptTests.c.

◆ TestVerifyRsaOaepEncryptInterface()

UNIT_TEST_STATUS EFIAPI TestVerifyRsaOaepEncryptInterface ( IN UNIT_TEST_CONTEXT  Context)

Definition at line 630 of file OaepEncryptTests.c.

Variable Documentation

◆ Ct1230RsaesOaep2048MdSha256Mgf1Sha256

GLOBAL_REMOVE_IF_UNREFERENCED STATIC CONST UINT8 Ct1230RsaesOaep2048MdSha256Mgf1Sha256[]
Initial value:
= {
0xa7, 0x20, 0xa9, 0x31, 0xb5, 0xad, 0x83, 0x0a, 0x07, 0xee, 0x36, 0x46, 0xa5, 0x78, 0x3a, 0xda,
0x9d, 0xdf, 0xe6, 0x05, 0x0f, 0x7c, 0x46, 0xfe, 0x5f, 0xd6, 0x58, 0x16, 0xb6, 0xaa, 0x82, 0x7c,
0x58, 0x8a, 0x52, 0x14, 0x12, 0x29, 0x6f, 0x62, 0x80, 0xa7, 0x61, 0xfe, 0x29, 0x72, 0x6f, 0x73,
0xf6, 0x2f, 0x54, 0x38, 0x58, 0x7b, 0xbd, 0xa1, 0x2f, 0x9d, 0x12, 0x83, 0x72, 0xbc, 0x3d, 0x29,
0x65, 0x39, 0xcb, 0x93, 0x95, 0x3e, 0x73, 0xc9, 0x6f, 0xb9, 0xe8, 0xd5, 0x8b, 0x91, 0x0d, 0x87,
0x7e, 0x22, 0xb5, 0x93, 0x3d, 0xa8, 0x4a, 0xd9, 0x1a, 0x13, 0xf7, 0xf4, 0x7f, 0x16, 0x42, 0xfe,
0x63, 0x10, 0x7e, 0xa1, 0xe5, 0x04, 0xcf, 0xed, 0x93, 0x2d, 0x16, 0x3b, 0x79, 0x1f, 0x53, 0x41,
0xe3, 0xca, 0x69, 0x18, 0x6a, 0xe5, 0xec, 0x9a, 0xce, 0xbc, 0x47, 0xf6, 0x77, 0x9a, 0x5c, 0xea,
0xac, 0x7e, 0x28, 0xeb, 0x1e, 0xfe, 0x75, 0xa6, 0xbf, 0x1e, 0xfd, 0x1c, 0x63, 0x69, 0x47, 0x04,
0xaf, 0x69, 0x7e, 0x1c, 0xa1, 0x7f, 0x00, 0xcf, 0xec, 0x16, 0x34, 0xd9, 0xde, 0x91, 0x0e, 0x0f,
0x0b, 0x1e, 0x66, 0xc3, 0x41, 0x88, 0x43, 0xbe, 0xa3, 0x2a, 0x7c, 0x87, 0xff, 0xc0, 0x67, 0xdc,
0xc7, 0xeb, 0x28, 0x07, 0x00, 0x72, 0x85, 0x17, 0xca, 0x05, 0x9f, 0x29, 0x6b, 0xad, 0xc6, 0xae,
0x1c, 0x4a, 0xf2, 0xfe, 0x97, 0xc7, 0x6e, 0x4b, 0xbf, 0xfd, 0x46, 0xbe, 0xf8, 0x76, 0xc9, 0x70,
0x58, 0x3a, 0x73, 0xcc, 0x34, 0xda, 0xfe, 0x5b, 0x6d, 0x98, 0x74, 0x95, 0x85, 0xc7, 0xc9, 0x84,
0x02, 0xa8, 0x97, 0x13, 0xa3, 0x83, 0xcb, 0x28, 0x3d, 0xbb, 0x2b, 0x3b, 0x45, 0xf1, 0x6e, 0xc5,
0x37, 0x23, 0x21, 0xe6, 0x74, 0x2d, 0x48, 0x19, 0x97, 0xaf, 0xee, 0x3d, 0x9b, 0xd0, 0x05, 0xc7
}

Definition at line 227 of file OaepEncryptTests.c.

◆ Ct1230RsaesOaepMdSha1Mgf1Sha1

GLOBAL_REMOVE_IF_UNREFERENCED STATIC CONST UINT8 Ct1230RsaesOaepMdSha1Mgf1Sha1[]
Initial value:
= {
0x88, 0x5d, 0xf3, 0x00, 0x66, 0x77, 0x91, 0x94, 0x5c, 0x8d, 0x45, 0xb6, 0xb2, 0x24, 0x26, 0x26,
0x37, 0xbe, 0xe0, 0x87, 0x4f, 0x50, 0xbf, 0x88, 0xde, 0x5d, 0xe9, 0xe0, 0xb2, 0x7e, 0x66, 0xfa,
0x6c, 0xfd, 0x0d, 0x19, 0x48, 0x41, 0xfe, 0x7a, 0x86, 0xa8, 0x28, 0xc2, 0x01, 0xcf, 0x76, 0xd7,
0xea, 0xab, 0x6d, 0xc3, 0x5e, 0x2c, 0x36, 0x04, 0xc0, 0x54, 0xc2, 0x68, 0x67, 0xe7, 0x04, 0x27,
0x56, 0xbe, 0x53, 0xb5, 0x80, 0x94, 0xd8, 0xde, 0x8c, 0x75, 0x69, 0x42, 0xba, 0x55, 0xd6, 0x2c,
0xda, 0x22, 0xe6, 0x09, 0xf6, 0x90, 0x27, 0x4b, 0x10, 0x54, 0x40, 0xa0, 0x74, 0x31, 0xdb, 0x5f,
0x80, 0x06, 0xc7, 0x67, 0x96, 0xe8, 0x45, 0xea, 0x7f, 0x72, 0x18, 0x24, 0xe8, 0x0d, 0x46, 0xc2,
0xa0, 0x83, 0xca, 0x71, 0xca, 0x91, 0x4b, 0x89, 0x80, 0x61, 0x01, 0x8e, 0xcf, 0xa1, 0x68, 0x81,
0x2d, 0xf2, 0x08, 0xd2, 0x02, 0x9e, 0xc0, 0xa4, 0x91, 0x71, 0x90, 0x84, 0x2f, 0x4e, 0x18, 0x37,
0x9b, 0x61, 0x0b, 0xf5, 0x88, 0xf7, 0x6b, 0x87, 0xb9, 0x4e, 0x31, 0xda, 0xf3, 0xb5, 0xe2, 0x60,
0x4d, 0xd9, 0x52, 0x99, 0x6b, 0x19, 0x98, 0xa2, 0x28, 0xaa, 0xeb, 0x5a, 0x33, 0xef, 0xf1, 0x4e,
0x29, 0x86, 0xbf, 0x70, 0x08, 0xfd, 0x34, 0x8a, 0x8c, 0x6d, 0xef, 0xc4, 0xa1, 0xfe, 0xdf, 0x4d,
0xeb, 0xf0, 0x2c, 0x4c, 0xf5, 0xb3, 0xe8, 0xf8, 0xc3, 0x45, 0xc7, 0x6b, 0x59, 0x1c, 0x9b, 0xd9,
0x52, 0xdf, 0x65, 0x87, 0x18, 0xd2, 0x6d, 0xff, 0x8b, 0x98, 0x2a, 0x97, 0xeb, 0x93, 0xea, 0x6a,
0x23, 0x23, 0xc6, 0x32, 0xf5, 0xea, 0x45, 0xe3, 0x99, 0xa0, 0x4d, 0x4b, 0x8f, 0xf8, 0x1d, 0xad,
0xa9, 0x97, 0xa2, 0xd6, 0xaf, 0x5e, 0x11, 0xf7, 0x5f, 0x28, 0xfb, 0x38, 0x80, 0x38, 0x50, 0xc4,
}

Definition at line 207 of file OaepEncryptTests.c.

◆ mOaepTest

TEST_DESC mOaepTest[]

Definition at line 884 of file OaepEncryptTests.c.

◆ mOaepTestNum

UINTN mOaepTestNum = ARRAY_SIZE (mOaepTest)

Definition at line 922 of file OaepEncryptTests.c.

◆ Msg1230

Initial value:
= {
0x31, 0x32, 0x33, 0x00
}

Definition at line 202 of file OaepEncryptTests.c.

◆ mTestVerifyPkcs1v2EncryptRsaOaepDecrypt

OAEP_ENC_DEC_TEST_CONTEXT mTestVerifyPkcs1v2EncryptRsaOaepDecrypt
Initial value:
= {
.SelfTestCert = SelfTestCert,
.SelfTestCertSize = sizeof (SelfTestCert),
.PrivateKey = PrivateKey,
.PrivateKeySize = sizeof (PrivateKey),
.RsaN = RsaN,
.RsaNSize = sizeof (RsaN),
.RsaE = RsaE,
.RsaESize = sizeof (RsaE),
.RsaD = RsaD,
.RsaDSize = sizeof (RsaD),
.ClearText = Msg1230,
.ClearTextSize = sizeof (Msg1230),
.CipherText = Ct1230RsaesOaepMdSha1Mgf1Sha1,
.CipherTextSize = sizeof (Ct1230RsaesOaepMdSha1Mgf1Sha1),
.DigestLen = 0,
.Encrypt = CallPkcs1v2Encrypt,
.Decrypt = CallRsaOaepDecrypt,
.Expect = UNIT_TEST_PASSED
}

Definition at line 779 of file OaepEncryptTests.c.

◆ mTestVerifyPkcs1v2Msg1230

OAEP_ENC_DEC_TEST_CONTEXT mTestVerifyPkcs1v2Msg1230
Initial value:
= {
.SelfTestCert = SelfTestCert,
.SelfTestCertSize = sizeof (SelfTestCert),
.PrivateKey = PrivateKey,
.PrivateKeySize = sizeof (PrivateKey),
.RsaN = NULL,
.RsaNSize = 0,
.RsaE = NULL,
.RsaESize = 0,
.RsaD = NULL,
.RsaDSize = 0,
.PrngSeed = NULL,
.PrngSeedSize = 0,
.ClearText = Msg1230,
.ClearTextSize = sizeof (Msg1230),
.CipherText = Ct1230RsaesOaepMdSha1Mgf1Sha1,
.CipherTextSize = sizeof (Ct1230RsaesOaepMdSha1Mgf1Sha1),
.DigestLen = 0,
.Encrypt = CallPkcs1v2Encrypt,
.Decrypt = CallPkcs1v2Decrypt,
.Expect = UNIT_TEST_PASSED
}
#define NULL
Definition: Base.h:319

Definition at line 687 of file OaepEncryptTests.c.

◆ mTestVerifyPkcs1v2Msg1230PrngSeed

OAEP_ENC_DEC_TEST_CONTEXT mTestVerifyPkcs1v2Msg1230PrngSeed
Initial value:
= {
.SelfTestCert = SelfTestCert,
.SelfTestCertSize = sizeof (SelfTestCert),
.PrivateKey = PrivateKey,
.PrivateKeySize = sizeof (PrivateKey),
.RsaN = NULL,
.RsaNSize = 0,
.RsaE = NULL,
.RsaESize = 0,
.RsaD = NULL,
.RsaDSize = 0,
.PrngSeed = RandSeed,
.PrngSeedSize = sizeof (RandSeed),
.ClearText = Msg1230,
.ClearTextSize = sizeof (Msg1230),
.CipherText = Ct1230RsaesOaepMdSha1Mgf1Sha1,
.CipherTextSize = sizeof (Ct1230RsaesOaepMdSha1Mgf1Sha1),
.DigestLen = 0,
.Encrypt = CallPkcs1v2Encrypt,
.Decrypt = CallPkcs1v2Decrypt,
.Expect = UNIT_TEST_PASSED
}

Definition at line 710 of file OaepEncryptTests.c.

◆ mTestVerifyRsaesOaep2048MdDefaultBgf1Default

OAEP_ENC_DEC_TEST_CONTEXT mTestVerifyRsaesOaep2048MdDefaultBgf1Default
Initial value:
= {
.SelfTestCert = NULL,
.SelfTestCertSize = 0,
.PrivateKey = NULL,
.PrivateKeySize = 0,
.RsaN = RsaN,
.RsaNSize = sizeof (RsaN),
.RsaE = RsaE,
.RsaESize = sizeof (RsaE),
.RsaD = RsaD,
.RsaDSize = sizeof (RsaD),
.ClearText = Msg1230,
.ClearTextSize = sizeof (Msg1230),
.CipherText = Ct1230RsaesOaepMdSha1Mgf1Sha1,
.CipherTextSize = sizeof (Ct1230RsaesOaepMdSha1Mgf1Sha1),
.DigestLen = 0,
.Encrypt = CallRsaOaepEncrypt,
.Decrypt = CallRsaOaepDecrypt,
.Expect = UNIT_TEST_PASSED
}

Definition at line 821 of file OaepEncryptTests.c.

◆ mTestVerifyRsaesOaep2048MdSha1Mgf1Sha1

OAEP_ENC_DEC_TEST_CONTEXT mTestVerifyRsaesOaep2048MdSha1Mgf1Sha1
Initial value:
= {
.SelfTestCert = NULL,
.SelfTestCertSize = 0,
.PrivateKey = NULL,
.PrivateKeySize = 0,
.RsaN = RsaN,
.RsaNSize = sizeof (RsaN),
.RsaE = RsaE,
.RsaESize = sizeof (RsaE),
.RsaD = RsaD,
.RsaDSize = sizeof (RsaD),
.ClearText = Msg1230,
.ClearTextSize = sizeof (Msg1230),
.CipherText = Ct1230RsaesOaepMdSha1Mgf1Sha1,
.CipherTextSize = sizeof (Ct1230RsaesOaepMdSha1Mgf1Sha1),
.DigestLen = SHA1_DIGEST_SIZE,
.Encrypt = CallRsaOaepEncrypt,
.Decrypt = CallRsaOaepDecrypt,
.Expect = UNIT_TEST_PASSED
}
#define SHA1_DIGEST_SIZE
Definition: BaseCryptLib.h:39

Definition at line 842 of file OaepEncryptTests.c.

◆ mTestVerifyRsaesOaep2048MdSha256Mgf1Sha256

OAEP_ENC_DEC_TEST_CONTEXT mTestVerifyRsaesOaep2048MdSha256Mgf1Sha256
Initial value:
= {
.SelfTestCert = NULL,
.SelfTestCertSize = 0,
.PrivateKey = NULL,
.PrivateKeySize = 0,
.RsaN = RsaN,
.RsaNSize = sizeof (RsaN),
.RsaE = RsaE,
.RsaESize = sizeof (RsaE),
.RsaD = RsaD,
.RsaDSize = sizeof (RsaD),
.ClearText = Msg1230,
.ClearTextSize = sizeof (Msg1230),
.CipherText = Ct1230RsaesOaep2048MdSha256Mgf1Sha256,
.CipherTextSize = sizeof (Ct1230RsaesOaep2048MdSha256Mgf1Sha256),
.DigestLen = SHA256_DIGEST_SIZE,
.Encrypt = CallRsaOaepEncrypt,
.Decrypt = CallRsaOaepDecrypt,
.Expect = UNIT_TEST_PASSED
}
#define SHA256_DIGEST_SIZE
Definition: BaseCryptLib.h:44

Definition at line 863 of file OaepEncryptTests.c.

◆ mTestVerifyRsaOaepEncryptPkcs1v2Decrypt

OAEP_ENC_DEC_TEST_CONTEXT mTestVerifyRsaOaepEncryptPkcs1v2Decrypt
Initial value:
= {
.SelfTestCert = SelfTestCert,
.SelfTestCertSize = sizeof (SelfTestCert),
.PrivateKey = PrivateKey,
.PrivateKeySize = sizeof (PrivateKey),
.RsaN = RsaN,
.RsaNSize = sizeof (RsaN),
.RsaE = RsaE,
.RsaESize = sizeof (RsaE),
.RsaD = RsaD,
.RsaDSize = sizeof (RsaD),
.ClearText = Msg1230,
.ClearTextSize = sizeof (Msg1230),
.CipherText = Ct1230RsaesOaepMdSha1Mgf1Sha1,
.CipherTextSize = sizeof (Ct1230RsaesOaepMdSha1Mgf1Sha1),
.DigestLen = 0,
.Encrypt = CallRsaOaepEncrypt,
.Decrypt = CallPkcs1v2Decrypt,
.Expect = UNIT_TEST_PASSED
}

Definition at line 800 of file OaepEncryptTests.c.

◆ mTestVerifyRsaOaepMsg1230

OAEP_ENC_DEC_TEST_CONTEXT mTestVerifyRsaOaepMsg1230
Initial value:
= {
.SelfTestCert = NULL,
.SelfTestCertSize = 0,
.PrivateKey = NULL,
.PrivateKeySize = 0,
.RsaN = RsaN,
.RsaNSize = sizeof (RsaN),
.RsaE = RsaE,
.RsaESize = sizeof (RsaE),
.RsaD = RsaD,
.RsaDSize = sizeof (RsaD),
.PrngSeed = NULL,
.PrngSeedSize = 0,
.ClearText = Msg1230,
.ClearTextSize = sizeof (Msg1230),
.CipherText = Ct1230RsaesOaepMdSha1Mgf1Sha1,
.CipherTextSize = sizeof (Ct1230RsaesOaepMdSha1Mgf1Sha1),
.DigestLen = 0,
.Encrypt = CallRsaOaepEncrypt,
.Decrypt = CallRsaOaepDecrypt,
.Expect = UNIT_TEST_PASSED
}

Definition at line 733 of file OaepEncryptTests.c.

◆ mTestVerifyRsaOaepMsg1230PrngSeed

OAEP_ENC_DEC_TEST_CONTEXT mTestVerifyRsaOaepMsg1230PrngSeed
Initial value:
= {
.SelfTestCert = NULL,
.SelfTestCertSize = 0,
.PrivateKey = NULL,
.PrivateKeySize = 0,
.RsaN = RsaN,
.RsaNSize = sizeof (RsaN),
.RsaE = RsaE,
.RsaESize = sizeof (RsaE),
.RsaD = RsaD,
.RsaDSize = sizeof (RsaD),
.PrngSeed = RandSeed,
.PrngSeedSize = sizeof (RandSeed),
.ClearText = Msg1230,
.ClearTextSize = sizeof (Msg1230),
.CipherText = Ct1230RsaesOaepMdSha1Mgf1Sha1,
.CipherTextSize = sizeof (Ct1230RsaesOaepMdSha1Mgf1Sha1),
.DigestLen = 0,
.Encrypt = CallRsaOaepEncrypt,
.Decrypt = CallRsaOaepDecrypt,
.Expect = UNIT_TEST_PASSED
}

Definition at line 756 of file OaepEncryptTests.c.

◆ PrivateKey

Definition at line 79 of file OaepEncryptTests.c.

◆ RandSeed

STATIC CONST UINT8 RandSeed[] = "This is the random seed for PRNG verification."

Definition at line 11 of file OaepEncryptTests.c.

◆ RsaD

Initial value:
= {
0x13, 0xf7, 0xd1, 0x42, 0xf5, 0x9f, 0x42, 0xcb, 0x55, 0x91, 0xbe, 0x08, 0x4a, 0xc0, 0xcd, 0x0b,
0xbd, 0x35, 0xdc, 0x43, 0xe9, 0x8f, 0x16, 0x6e, 0xb6, 0x4d, 0x33, 0x39, 0xe7, 0xa4, 0x95, 0x0c,
0x2f, 0x69, 0xba, 0x0c, 0x42, 0x42, 0xac, 0x43, 0x46, 0x10, 0xd3, 0x92, 0x7f, 0x70, 0x74, 0x1e,
0x2e, 0x5b, 0x1c, 0xc1, 0x92, 0xb6, 0xa4, 0x0c, 0xf5, 0x7c, 0xd9, 0xb7, 0x54, 0x64, 0x74, 0x79,
0xb1, 0xff, 0xe6, 0x10, 0xb7, 0x8c, 0xf8, 0x53, 0x88, 0x6d, 0xa9, 0x97, 0x04, 0xd9, 0x26, 0x1f,
0x99, 0x12, 0xfb, 0xac, 0x65, 0xfb, 0xa5, 0xb3, 0x1c, 0x99, 0xb9, 0xbf, 0x6b, 0x35, 0x3e, 0x49,
0x55, 0xb5, 0x94, 0x4f, 0xe7, 0x25, 0x67, 0xb1, 0x01, 0xcd, 0xd2, 0x58, 0xe4, 0xbe, 0x87, 0x8c,
0x88, 0xd3, 0x0a, 0x38, 0xdc, 0x71, 0x5d, 0x88, 0x0a, 0xe2, 0x3e, 0x76, 0x63, 0x3b, 0xe4, 0x3c,
0x8f, 0x2f, 0x29, 0x1d, 0xd1, 0x66, 0x8d, 0xc0, 0x4a, 0x68, 0x15, 0x90, 0x4c, 0x95, 0x61, 0xf4,
0xfd, 0xe8, 0xfa, 0x9c, 0x6c, 0x00, 0x22, 0x23, 0xd5, 0x17, 0x6e, 0xee, 0xa8, 0xd8, 0x70, 0xc5,
0x74, 0xea, 0x09, 0x13, 0x7f, 0x0c, 0x37, 0x4d, 0x50, 0xcd, 0xe9, 0x16, 0xc2, 0xd5, 0xde, 0x5e,
0xc3, 0xfc, 0x46, 0x08, 0xf1, 0x99, 0xc0, 0xb4, 0x28, 0xfd, 0x2b, 0x29, 0xef, 0x76, 0xd7, 0x04,
0x4f, 0x02, 0x54, 0x16, 0x54, 0x55, 0x20, 0xec, 0xbc, 0xbf, 0x85, 0x5f, 0x12, 0xcc, 0xfc, 0x0d,
0xf2, 0xef, 0xfc, 0x4d, 0x3e, 0xa2, 0x5e, 0x97, 0xfe, 0x35, 0x10, 0x0f, 0x53, 0x1f, 0x80, 0xd5,
0xc0, 0xb4, 0xe9, 0xe9, 0x31, 0x4c, 0x89, 0x14, 0x72, 0x39, 0x65, 0x89, 0xef, 0x7a, 0x51, 0x4a,
0xb9, 0xa9, 0xcc, 0x1b, 0x52, 0xb0, 0x02, 0x52, 0x65, 0x2f, 0x0b, 0x89, 0x41, 0x70, 0x1e, 0x01,
}

Definition at line 182 of file OaepEncryptTests.c.

◆ RsaE

Initial value:
= {
0x01, 0x00, 0x01
}

Definition at line 178 of file OaepEncryptTests.c.

◆ RsaN

Initial value:
= {
0x00,
0xbc,0xe4, 0x67, 0xdc, 0xc7, 0xea, 0x6f, 0x8a, 0xa7, 0xcc, 0xb2, 0x54, 0x47, 0x48, 0x6a, 0xe2,
0x39,0xff, 0xc2, 0x48, 0x58, 0x34, 0x07, 0x03, 0x6d, 0x39, 0xb3, 0x67, 0x46, 0x4c, 0xbc, 0xa0,
0xfa,0x4e, 0x64, 0x23, 0x56, 0x47, 0x7b, 0xc9, 0x1a, 0x2a, 0x55, 0x42, 0x54, 0x10, 0x18, 0x30,
0x92,0x60, 0x30, 0x5b, 0x9e, 0xc0, 0x65, 0xd2, 0xd4, 0x05, 0x4a, 0xa6, 0x10, 0x66, 0x04, 0xa9,
0x54,0x4e, 0xee, 0x49, 0x39, 0x43, 0x65, 0x1e, 0x2e, 0x28, 0xde, 0x79, 0x24, 0xa9, 0x7e, 0xd8,
0x5b,0xbc, 0x2f, 0x46, 0x6a, 0xb7, 0xb6, 0x0d, 0x17, 0x88, 0x37, 0x52, 0x5c, 0xfe, 0x93, 0xc0,
0xe2,0xfd, 0x6a, 0x08, 0x1b, 0xfb, 0xd1, 0x87, 0xbd, 0xbd, 0x58, 0x57, 0x2c, 0x06, 0x5d, 0xd2,
0x7d,0x52, 0xe2, 0x49, 0x8e, 0xdc, 0xe5, 0x26, 0xbd, 0x92, 0x60, 0xb0, 0x3f, 0x58, 0x5e, 0x52,
0xd7,0x91, 0xda, 0x93, 0x62, 0x8d, 0x71, 0x80, 0x53, 0xba, 0x15, 0xc4, 0x1f, 0xf3, 0xbd, 0xe0,
0xc5,0xa4, 0xb8, 0xd3, 0x64, 0x12, 0x14, 0x1b, 0x11, 0x6b, 0x7b, 0xc2, 0x92, 0xc7, 0xe2, 0x94,
0x0b,0xb8, 0x67, 0x38, 0x48, 0x63, 0x11, 0x74, 0x25, 0x7c, 0x37, 0xc3, 0xb2, 0xae, 0xd9, 0xa7,
0x17,0x9c, 0x4b, 0x9d, 0x6c, 0x27, 0xb0, 0x87, 0x16, 0x6b, 0xf2, 0x96, 0xe5, 0x1d, 0x37, 0x27,
0xde,0xf2, 0x98, 0xb7, 0x81, 0x08, 0xd9, 0x7a, 0xba, 0x84, 0x14, 0x61, 0x60, 0x48, 0xce, 0xce,
0x51,0x73, 0xf4, 0xdb, 0xf1, 0x5f, 0x7a, 0x17, 0x71, 0x4f, 0xc1, 0x0b, 0xce, 0xc7, 0x31, 0xc1,
0x4e,0xa3, 0xee, 0x6f, 0x72, 0x97, 0x90, 0xfb, 0x8b, 0x54, 0x9f, 0x82, 0x5b, 0x48, 0x5a, 0xf1,
0xad,0x8b, 0x3a, 0xcd, 0xca, 0xb2, 0x8b, 0x7a, 0x53, 0xd4, 0xf7, 0x71, 0x16, 0x75, 0xa7, 0x35,
}

Definition at line 158 of file OaepEncryptTests.c.

◆ SelfTestCert

Definition at line 18 of file OaepEncryptTests.c.