00001 #ifndef CRYPTOPP_FIPS140_H
00002 #define CRYPTOPP_FIPS140_H
00003
00004
00005
00006
00007
00008 #include "cryptlib.h"
00009
00010 NAMESPACE_BEGIN(CryptoPP)
00011
00012
00013 class CRYPTOPP_DLL SelfTestFailure : public Exception
00014 {
00015 public:
00016 explicit SelfTestFailure(const std::string &s) : Exception(OTHER_ERROR, s) {}
00017 };
00018
00019
00020 CRYPTOPP_DLL bool FIPS_140_2_ComplianceEnabled();
00021
00022
00023 enum PowerUpSelfTestStatus {POWER_UP_SELF_TEST_NOT_DONE, POWER_UP_SELF_TEST_FAILED, POWER_UP_SELF_TEST_PASSED};
00024
00025
00026 CRYPTOPP_DLL void DoPowerUpSelfTest(const char *moduleFilename, const byte *expectedModuleMac);
00027
00028
00029 CRYPTOPP_DLL void SimulatePowerUpSelfTestFailure();
00030
00031
00032 CRYPTOPP_DLL PowerUpSelfTestStatus CRYPTOPP_API GetPowerUpSelfTestStatus();
00033
00034 typedef PowerUpSelfTestStatus (CRYPTOPP_API * PGetPowerUpSelfTestStatus)();
00035
00036 CRYPTOPP_DLL const byte * CRYPTOPP_API GetActualMacAndLocation(unsigned int &macSize, unsigned int &fileLocation);
00037
00038 typedef const byte * (CRYPTOPP_API * PGetActualMacAndLocation)(unsigned int &macSize, unsigned int &fileLocation);
00039
00040
00041 bool PowerUpSelfTestInProgressOnThisThread();
00042
00043 void SetPowerUpSelfTestInProgressOnThisThread(bool inProgress);
00044
00045 void SignaturePairwiseConsistencyTest(const PK_Signer &signer, const PK_Verifier &verifier);
00046 void EncryptionPairwiseConsistencyTest(const PK_Encryptor &encryptor, const PK_Decryptor &decryptor);
00047
00048 NAMESPACE_END
00049
00050 #endif