monotone

monotone Mtn Source Tree

Root/cryptopp/fips140.h

1#ifndef CRYPTOPP_FIPS140_H
2#define CRYPTOPP_FIPS140_H
3
4/*! \file
5FIPS 140 related functions and classes.
6*/
7
8#include "cryptlib.h"
9
10NAMESPACE_BEGIN(CryptoPP)
11
12//! exception thrown when a crypto algorithm is used after a self test fails
13class SelfTestFailure : public Exception
14{
15public:
16explicit SelfTestFailure(const std::string &s) : Exception(OTHER_ERROR, s) {}
17};
18
19//! returns whether FIPS 140-2 compliance features were enabled at compile time
20bool FIPS_140_2_ComplianceEnabled();
21
22//! enum values representing status of the power-up self test
23enum PowerUpSelfTestStatus {POWER_UP_SELF_TEST_NOT_DONE, POWER_UP_SELF_TEST_FAILED, POWER_UP_SELF_TEST_PASSED};
24
25//! perform the power-up self test, and set the self test status
26void DoPowerUpSelfTest(const char *moduleFilename, const byte *expectedModuleSha1Digest);
27
28//! set the power-up self test status to POWER_UP_SELF_TEST_FAILED
29void SimulatePowerUpSelfTestFailure();
30
31//! return the current power-up self test status
32PowerUpSelfTestStatus GetPowerUpSelfTestStatus();
33
34// this is used by Algorithm constructor to allow Algorithm objects to be constructed for the self test
35bool PowerUpSelfTestInProgressOnThisThread();
36
37void SetPowerUpSelfTestInProgressOnThisThread(bool inProgress);
38
39void SignaturePairwiseConsistencyTest(const PK_Signer &signer, const PK_Verifier &verifier);
40void EncryptionPairwiseConsistencyTest(const PK_Encryptor &encryptor, const PK_Decryptor &decryptor);
41
42void SignaturePairwiseConsistencyTest_FIPS_140_Only(const PK_Signer &signer, const PK_Verifier &verifier);
43void EncryptionPairwiseConsistencyTest_FIPS_140_Only(const PK_Encryptor &encryptor, const PK_Decryptor &decryptor);
44
45NAMESPACE_END
46
47#endif

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status