Fabcoin Core  0.16.2
P2P Digital Currency
Macros | Functions | Variables
fipstest.cpp File Reference
#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>
Include dependency graph for fipstest.cpp:

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)
 
MessageAuthenticationCodeNewIntegrityCheckingMAC ()
 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)
 

Macro Definition Documentation

#define CRYPTOPP_DEFAULT_NO_DLL

Definition at line 8 of file fipstest.cpp.

Function Documentation

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.

Here is the caller graph for this function:

void DoPowerUpSelfTest ( const char *  moduleFilename,
const byte expectedModuleMac 
)

Performs the power-up self test.

Parameters
moduleFilenamethe fully qualified name of the module
expectedModuleMacthe 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.

Here is the call graph for this function:

void EncryptionPairwiseConsistencyTest ( const PK_Encryptor encryptor,
const PK_Decryptor decryptor 
)

Definition at line 205 of file fipstest.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

const byte* CRYPTOPP_API GetActualMacAndLocation ( unsigned int &  macSize,
unsigned int &  fileLocation 
)

Definition at line 73 of file fipstest.cpp.

Here is the call graph for this function:

bool IntegrityCheckModule ( const char *  moduleFilename,
const byte expectedModuleMac,
SecByteBlock pActualMac = NULL,
unsigned long *  pMacFileLocation = NULL 
)

Verifies the MAC on the module.

Parameters
moduleFilenamethe fully qualified name of the module
expectedModuleMacthe expected MAC of the components protected by the integrity check
pActualMacthe actual MAC of the components calculated by the integrity check
pMacFileLocationthe offest of the MAC in the PE/PE+ module
Returns
true if the MAC is valid, false otherwise

Definition at line 277 of file fipstest.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void KnownAnswerTest ( RandomNumberGenerator rng,
const char *  output 
)

Definition at line 80 of file fipstest.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void KnownAnswerTest ( StreamTransformation encryption,
StreamTransformation decryption,
const char *  plaintext,
const char *  ciphertext 
)

Definition at line 112 of file fipstest.cpp.

Here is the call graph for this function:

void KnownAnswerTest ( HashTransformation hash,
const char *  message,
const char *  digest 
)

Definition at line 158 of file fipstest.cpp.

Here is the call graph for this function:

template<class MAC >
void MAC_KnownAnswerTest ( const char *  key,
const char *  message,
const char *  digest 
)

Definition at line 176 of file fipstest.cpp.

Here is the call graph for this function:

MessageAuthenticationCode* NewIntegrityCheckingMAC ( )

Class object that calculates the MAC on the module.

Returns
the MAC for the module

Definition at line 271 of file fipstest.cpp.

Here is the caller graph for this function:

template<class HASH >
void SecureHashKnownAnswerTest ( const char *  message,
const char *  digest 
)

Definition at line 169 of file fipstest.cpp.

Here is the call graph for this function:

template<class SCHEME >
void SignatureKnownAnswerTest ( const char *  key,
const char *  message,
const char *  signature 
)

Definition at line 186 of file fipstest.cpp.

Here is the call graph for this function:

void SignaturePairwiseConsistencyTest ( const PK_Signer signer,
const PK_Verifier verifier 
)

Definition at line 241 of file fipstest.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class SCHEME >
void SignaturePairwiseConsistencyTest ( const char *  key)

Definition at line 263 of file fipstest.cpp.

Here is the call graph for this function:

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 
)

Definition at line 127 of file fipstest.cpp.

Here is the call graph for this function:

template<class CIPHER >
void X917RNG_KnownAnswerTest ( const char *  key,
const char *  seed,
const char *  deterministicTimeVector,
const char *  output 
)

Definition at line 92 of file fipstest.cpp.

Here is the call graph for this function:

Variable Documentation

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.