Fabcoin Core
0.16.2
P2P Digital Currency
|
#include "pch.h"
#include "config.h"
#include "dll.h"
#include "cryptlib.h"
#include "filters.h"
#include "smartptr.h"
#include "misc.h"
#include <sstream>
#include <iostream>
Go to the source code of this file.
Macros | |
#define | CRYPTOPP_DEFAULT_NO_DLL |
Functions | |
CRYPTOPP_COMPILE_ASSERT (sizeof(s_moduleMac)==CryptoPP::SHA1::DIGESTSIZE) | |
const byte *CRYPTOPP_API | GetActualMacAndLocation (unsigned int &macSize, unsigned int &fileLocation) |
void | KnownAnswerTest (RandomNumberGenerator &rng, const char *output) |
template<class CIPHER > | |
void | X917RNG_KnownAnswerTest (const char *key, const char *seed, const char *deterministicTimeVector, const char *output) |
void | KnownAnswerTest (StreamTransformation &encryption, StreamTransformation &decryption, const char *plaintext, const char *ciphertext) |
template<class CIPHER > | |
void | SymmetricEncryptionKnownAnswerTest (const char *key, const char *hexIV, const char *plaintext, const char *ecb, const char *cbc, const char *cfb, const char *ofb, const char *ctr) |
void | KnownAnswerTest (HashTransformation &hash, const char *message, const char *digest) |
template<class HASH > | |
void | SecureHashKnownAnswerTest (const char *message, const char *digest) |
template<class MAC > | |
void | MAC_KnownAnswerTest (const char *key, const char *message, const char *digest) |
template<class SCHEME > | |
void | SignatureKnownAnswerTest (const char *key, const char *message, const char *signature) |
void | EncryptionPairwiseConsistencyTest (const PK_Encryptor &encryptor, const PK_Decryptor &decryptor) |
void | SignaturePairwiseConsistencyTest (const PK_Signer &signer, const PK_Verifier &verifier) |
template<class SCHEME > | |
void | SignaturePairwiseConsistencyTest (const char *key) |
MessageAuthenticationCode * | NewIntegrityCheckingMAC () |
Class object that calculates the MAC on the module. More... | |
bool | IntegrityCheckModule (const char *moduleFilename, const byte *expectedModuleMac, SecByteBlock *pActualMac, unsigned long *pMacFileLocation) |
Verifies the MAC on the module. More... | |
void | DoPowerUpSelfTest (const char *moduleFilename, const byte *expectedModuleMac) |
Performs the power-up self test. More... | |
void | DoDllPowerUpSelfTest () |
Performs the power-up self test on the DLL. More... | |
Variables | |
PowerUpSelfTestStatus | g_powerUpSelfTestStatus |
SecByteBlock | g_actualMac |
unsigned long | g_macFileLocation = 0 |
const void * | g_BaseAddressOfMAC = reinterpret_cast<void*>(0x42900000) |
#define CRYPTOPP_DEFAULT_NO_DLL |
Definition at line 8 of file fipstest.cpp.
CRYPTOPP_COMPILE_ASSERT | ( | sizeof(s_moduleMac) | = =CryptoPP::SHA1::DIGESTSIZE | ) |
void DoDllPowerUpSelfTest | ( | ) |
Performs the power-up self test on the DLL.
Performs the power-up self test using the filename of this DLL and the embedded module MAC, and sets the self test status to POWER_UP_SELF_TEST_PASSED or POWER_UP_SELF_TEST_FAILED.
The self tests for an algorithm are performed by the Algortihm class when CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 is defined.
Definition at line 623 of file fipstest.cpp.
void DoPowerUpSelfTest | ( | const char * | moduleFilename, |
const byte * | expectedModuleMac | ||
) |
Performs the power-up self test.
moduleFilename | the fully qualified name of the module |
expectedModuleMac | the expected MAC of the components protected by the integrity check |
Performs the power-up self test, and sets the self test status to POWER_UP_SELF_TEST_PASSED or POWER_UP_SELF_TEST_FAILED.
The self tests for an algorithm are performed by the Algortihm class when CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 is defined.
Definition at line 463 of file fipstest.cpp.
void EncryptionPairwiseConsistencyTest | ( | const PK_Encryptor & | encryptor, |
const PK_Decryptor & | decryptor | ||
) |
Definition at line 205 of file fipstest.cpp.
const byte* CRYPTOPP_API GetActualMacAndLocation | ( | unsigned int & | macSize, |
unsigned int & | fileLocation | ||
) |
bool IntegrityCheckModule | ( | const char * | moduleFilename, |
const byte * | expectedModuleMac, | ||
SecByteBlock * | pActualMac = NULL , |
||
unsigned long * | pMacFileLocation = NULL |
||
) |
Verifies the MAC on the module.
moduleFilename | the fully qualified name of the module |
expectedModuleMac | the expected MAC of the components protected by the integrity check |
pActualMac | the actual MAC of the components calculated by the integrity check |
pMacFileLocation | the offest of the MAC in the PE/PE+ module |
Definition at line 277 of file fipstest.cpp.
void KnownAnswerTest | ( | RandomNumberGenerator & | rng, |
const char * | output | ||
) |
Definition at line 80 of file fipstest.cpp.
void KnownAnswerTest | ( | StreamTransformation & | encryption, |
StreamTransformation & | decryption, | ||
const char * | plaintext, | ||
const char * | ciphertext | ||
) |
void KnownAnswerTest | ( | HashTransformation & | hash, |
const char * | message, | ||
const char * | digest | ||
) |
void MAC_KnownAnswerTest | ( | const char * | key, |
const char * | message, | ||
const char * | digest | ||
) |
MessageAuthenticationCode* NewIntegrityCheckingMAC | ( | ) |
Class object that calculates the MAC on the module.
Definition at line 271 of file fipstest.cpp.
void SecureHashKnownAnswerTest | ( | const char * | message, |
const char * | digest | ||
) |
void SignatureKnownAnswerTest | ( | const char * | key, |
const char * | message, | ||
const char * | signature | ||
) |
void SignaturePairwiseConsistencyTest | ( | const PK_Signer & | signer, |
const PK_Verifier & | verifier | ||
) |
Definition at line 241 of file fipstest.cpp.
void SignaturePairwiseConsistencyTest | ( | const char * | key | ) |
void SymmetricEncryptionKnownAnswerTest | ( | const char * | key, |
const char * | hexIV, | ||
const char * | plaintext, | ||
const char * | ecb, | ||
const char * | cbc, | ||
const char * | cfb, | ||
const char * | ofb, | ||
const char * | ctr | ||
) |
void X917RNG_KnownAnswerTest | ( | const char * | key, |
const char * | seed, | ||
const char * | deterministicTimeVector, | ||
const char * | output | ||
) |
SecByteBlock g_actualMac |
Definition at line 55 of file fipstest.cpp.
const void* g_BaseAddressOfMAC = reinterpret_cast<void*>(0x42900000) |
Definition at line 63 of file fipstest.cpp.
unsigned long g_macFileLocation = 0 |
Definition at line 56 of file fipstest.cpp.
PowerUpSelfTestStatus g_powerUpSelfTestStatus |
Definition at line 27 of file fips140.cpp.