summaryrefslogtreecommitdiffstats
path: root/cryptopp562/fips140.cpp
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2024-10-21 11:09:00 -0400
committerMalfurious <m@lfurio.us>2024-10-24 06:41:41 -0400
commit5494fc310acf0aabb9d828451331e44483eb21c7 (patch)
tree77280a586d52470fca89b9ed73f5f1faaf7907c6 /cryptopp562/fips140.cpp
parent428471d39fb8c205a9fad899c88c30a2cb7df685 (diff)
downloadcompass-5494fc310acf0aabb9d828451331e44483eb21c7.tar.gz
compass-5494fc310acf0aabb9d828451331e44483eb21c7.zip
Remove Crypto++ library
The tracked version of Crypto++ is going on 10 years old and doesn't always compile properly on modern tooling. This removes the entire subdirectory as well as references to files in the build script. Due to the number of files touched by this commit, I opt to add its replacement in the next commit. Signed-off-by: Malfurious <m@lfurio.us>
Diffstat (limited to 'cryptopp562/fips140.cpp')
-rw-r--r--cryptopp562/fips140.cpp84
1 files changed, 0 insertions, 84 deletions
diff --git a/cryptopp562/fips140.cpp b/cryptopp562/fips140.cpp
deleted file mode 100644
index 1fcf590..0000000
--- a/cryptopp562/fips140.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-// fips140.cpp - written and placed in the public domain by Wei Dai
-
-#include "pch.h"
-
-#ifndef CRYPTOPP_IMPORTS
-
-#include "fips140.h"
-#include "trdlocal.h" // needs to be included last for cygwin
-
-NAMESPACE_BEGIN(CryptoPP)
-
-// Define this to 1 to turn on FIPS 140-2 compliance features, including additional tests during
-// startup, random number generation, and key generation. These tests may affect performance.
-#ifndef CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2
-#define CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 0
-#endif
-
-#if (CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 && !defined(THREADS_AVAILABLE))
-#error FIPS 140-2 compliance requires the availability of thread local storage.
-#endif
-
-#if (CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 && !defined(OS_RNG_AVAILABLE))
-#error FIPS 140-2 compliance requires the availability of OS provided RNG.
-#endif
-
-PowerUpSelfTestStatus g_powerUpSelfTestStatus = POWER_UP_SELF_TEST_NOT_DONE;
-
-bool FIPS_140_2_ComplianceEnabled()
-{
- return CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2;
-}
-
-void SimulatePowerUpSelfTestFailure()
-{
- g_powerUpSelfTestStatus = POWER_UP_SELF_TEST_FAILED;
-}
-
-PowerUpSelfTestStatus CRYPTOPP_API GetPowerUpSelfTestStatus()
-{
- return g_powerUpSelfTestStatus;
-}
-
-#if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2
-ThreadLocalStorage & AccessPowerUpSelfTestInProgress()
-{
- static ThreadLocalStorage selfTestInProgress;
- return selfTestInProgress;
-}
-#endif
-
-bool PowerUpSelfTestInProgressOnThisThread()
-{
-#if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2
- return AccessPowerUpSelfTestInProgress().GetValue() != NULL;
-#else
- assert(false); // should not be called
- return false;
-#endif
-}
-
-void SetPowerUpSelfTestInProgressOnThisThread(bool inProgress)
-{
-#if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2
- AccessPowerUpSelfTestInProgress().SetValue((void *)inProgress);
-#endif
-}
-
-void EncryptionPairwiseConsistencyTest_FIPS_140_Only(const PK_Encryptor &encryptor, const PK_Decryptor &decryptor)
-{
-#if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2
- EncryptionPairwiseConsistencyTest(encryptor, decryptor);
-#endif
-}
-
-void SignaturePairwiseConsistencyTest_FIPS_140_Only(const PK_Signer &signer, const PK_Verifier &verifier)
-{
-#if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2
- SignaturePairwiseConsistencyTest(signer, verifier);
-#endif
-}
-
-NAMESPACE_END
-
-#endif