Fabcoin Core  0.16.2
P2P Digital Currency
fips140.h
Go to the documentation of this file.
1 // fips140.h - written and placed in the public domain by Wei Dai
2 
10 
11 #ifndef CRYPTOPP_FIPS140_H
12 #define CRYPTOPP_FIPS140_H
13 
14 #include "cryptlib.h"
15 #include "secblock.h"
16 
18 
24 {
25 public:
26  explicit SelfTestFailure(const std::string &s) : Exception(OTHER_ERROR, s) {}
27 };
28 
36 
39 
48 };
49 
57 CRYPTOPP_DLL void CRYPTOPP_API DoPowerUpSelfTest(const char *moduleFilename, const byte *expectedModuleMac);
58 
66 
70 
74 
75 #ifndef CRYPTOPP_DOXYGEN_PROCESSING
77 #endif
78 
82 
89 CRYPTOPP_DLL bool CRYPTOPP_API IntegrityCheckModule(const char *moduleFilename, const byte *expectedModuleMac, SecByteBlock *pActualMac = NULL, unsigned long *pMacFileLocation = NULL);
90 
91 #ifndef CRYPTOPP_DOXYGEN_PROCESSING
92 // this is used by Algorithm constructor to allow Algorithm objects to be constructed for the self test
94 
95 void SetPowerUpSelfTestInProgressOnThisThread(bool inProgress);
96 
97 void SignaturePairwiseConsistencyTest(const PK_Signer &signer, const PK_Verifier &verifier);
98 void EncryptionPairwiseConsistencyTest(const PK_Encryptor &encryptor, const PK_Decryptor &decryptor);
99 
100 void SignaturePairwiseConsistencyTest_FIPS_140_Only(const PK_Signer &signer, const PK_Verifier &verifier);
101 void EncryptionPairwiseConsistencyTest_FIPS_140_Only(const PK_Encryptor &encryptor, const PK_Decryptor &decryptor);
102 #endif
103 
109 #define CRYPTOPP_DUMMY_DLL_MAC "MAC_51f34b8db820ae8"
110 
112 
113 #endif
Base class for all exceptions thrown by the library.
Definition: cryptlib.h:140
void SetPowerUpSelfTestInProgressOnThisThread(bool inProgress)
Definition: fips140.cpp:62
CRYPTOPP_DLL MessageAuthenticationCode *CRYPTOPP_API NewIntegrityCheckingMAC()
Class object that calculates the MAC on the module.
Definition: fipstest.cpp:271
The self tests were executed via DoPowerUpSelfTest() or DoDllPowerUpSelfTest(), and the result was su...
Definition: fips140.h:47
Interface for message authentication codes.
Definition: cryptlib.h:1111
uint8_t byte
Definition: Common.h:57
void SignaturePairwiseConsistencyTest(const PK_Signer &signer, const PK_Verifier &verifier)
Definition: fipstest.cpp:241
CRYPTOPP_DLL void CRYPTOPP_API SimulatePowerUpSelfTestFailure()
Sets the power-up self test status to POWER_UP_SELF_TEST_FAILED.
Definition: fips140.cpp:34
#define NAMESPACE_BEGIN(x)
Definition: config.h:200
Interface for public-key signers.
Definition: cryptlib.h:2527
Interface for public-key encryptors.
Definition: cryptlib.h:2336
Abstract base classes that provide a uniform interface to this library.
The self tests were executed via DoPowerUpSelfTest() or DoDllPowerUpSelfTest(), but the result was fa...
Definition: fips140.h:44
SelfTestFailure(const std::string &s)
Definition: fips140.h:26
void EncryptionPairwiseConsistencyTest(const PK_Encryptor &encryptor, const PK_Decryptor &decryptor)
Definition: fipstest.cpp:205
Classes and functions for secure memory allocations.
void EncryptionPairwiseConsistencyTest_FIPS_140_Only(const PK_Encryptor &encryptor, const PK_Decryptor &decryptor)
Definition: fips140.cpp:70
Interface for public-key decryptors.
Definition: cryptlib.h:2372
Exception thrown when a crypto algorithm is used after a self test fails.
Definition: fips140.h:23
CRYPTOPP_DLL bool CRYPTOPP_API IntegrityCheckModule(const char *moduleFilename, const byte *expectedModuleMac, SecByteBlock *pActualMac=NULL, unsigned long *pMacFileLocation=NULL)
Verifies the MAC on the module.
Definition: fipstest.cpp:277
void SignaturePairwiseConsistencyTest_FIPS_140_Only(const PK_Signer &signer, const PK_Verifier &verifier)
Definition: fips140.cpp:78
#define CRYPTOPP_API
Definition: config.h:705
CRYPTOPP_DLL bool CRYPTOPP_API FIPS_140_2_ComplianceEnabled()
Determines whether the library provides FIPS validated cryptography.
Definition: fips140.cpp:29
bool PowerUpSelfTestInProgressOnThisThread()
Definition: fips140.cpp:52
The self tests have not been performed.
Definition: fips140.h:41
CRYPTOPP_DLL void CRYPTOPP_API DoPowerUpSelfTest(const char *moduleFilename, const byte *expectedModuleMac)
Performs the power-up self test.
Definition: fipstest.cpp:463
Interface for public-key signature verifiers.
Definition: cryptlib.h:2592
CRYPTOPP_DLL PowerUpSelfTestStatus CRYPTOPP_API GetPowerUpSelfTestStatus()
Provides the current power-up self test status.
Definition: fips140.cpp:39
PowerUpSelfTestStatus
Status of the power-up self test.
Definition: fips140.h:38
CRYPTOPP_DLL void CRYPTOPP_API DoDllPowerUpSelfTest()
Performs the power-up self test on the DLL.
Definition: fipstest.cpp:623
PowerUpSelfTestStatus(CRYPTOPP_API * PGetPowerUpSelfTestStatus)()
Definition: fips140.h:76
#define NAMESPACE_END
Definition: config.h:201
#define CRYPTOPP_DLL
Definition: config.h:704