Crypto++  5.6.5
Free C++ class library of cryptographic schemes
validate.h
1 #ifndef CRYPTOPP_VALIDATE_H
2 #define CRYPTOPP_VALIDATE_H
3 
4 #include "cryptlib.h"
5 #include "pubkey.h"
6 #include <iostream>
7 #include <iomanip>
8 
9 bool ValidateAll(bool thorough);
10 bool TestSettings();
11 bool TestOS_RNG();
12 bool TestAutoSeeded();
13 bool TestAutoSeededX917();
14 
15 #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64)
16 bool TestRDRAND();
17 bool TestRDSEED();
18 #endif
19 
20 bool ValidateBaseCode();
21 bool ValidateCRC32();
22 bool ValidateCRC32C();
23 bool ValidateAdler32();
24 bool ValidateMD2();
25 bool ValidateMD4();
26 bool ValidateMD5();
27 bool ValidateSHA();
28 bool ValidateSHA2();
29 bool ValidateTiger();
30 bool ValidateRIPEMD();
31 bool ValidatePanama();
32 bool ValidateWhirlpool();
33 bool ValidateBLAKE2s();
34 bool ValidateBLAKE2b();
35 
36 bool ValidateHMAC();
37 bool ValidateTTMAC();
38 
39 bool ValidateCipherModes();
40 bool ValidatePBKDF();
41 bool ValidateHKDF();
42 
43 bool ValidateDES();
44 bool ValidateIDEA();
45 bool ValidateSAFER();
46 bool ValidateRC2();
47 bool ValidateARC4();
48 
49 bool ValidateRC5();
50 bool ValidateBlowfish();
51 bool ValidateThreeWay();
52 bool ValidateGOST();
53 bool ValidateSHARK();
54 bool ValidateSEAL();
55 bool ValidateCAST();
56 bool ValidateSquare();
57 bool ValidateSKIPJACK();
58 bool ValidateRC6();
59 bool ValidateMARS();
60 bool ValidateRijndael();
61 bool ValidateTwofish();
62 bool ValidateSerpent();
63 bool ValidateSHACAL2();
64 bool ValidateCamellia();
65 bool ValidateSalsa();
66 bool ValidateSosemanuk();
67 bool ValidateVMAC();
68 bool ValidateCCM();
69 bool ValidateGCM();
70 bool ValidateCMAC();
71 
72 bool ValidateBBS();
73 bool ValidateDH();
74 bool ValidateMQV();
75 bool ValidateHMQV();
76 bool ValidateFHMQV();
77 bool ValidateRSA();
78 bool ValidateElGamal();
79 bool ValidateDLIES();
80 bool ValidateNR();
81 bool ValidateDSA(bool thorough);
82 bool ValidateLUC();
83 bool ValidateLUC_DL();
84 bool ValidateLUC_DH();
85 bool ValidateXTR_DH();
86 bool ValidateRabin();
87 bool ValidateRW();
88 //bool ValidateBlumGoldwasser();
89 bool ValidateECP();
90 bool ValidateEC2N();
91 bool ValidateECDSA();
92 bool ValidateESIGN();
93 
94 // Added at Crypto++ 5.6.5 to ensure interop with past and present.
95 bool ValidateLegacyDLIES();
96 bool ValidateLegacyECIES();
97 // Added at Crypto++ 5.6.5, uses Bouncy Castle generated test data
98 bool ValidateInteropDLIES();
99 bool ValidateInteropECIES();
100 
101 #if CRYPTOPP_DEBUG
102 bool TestSecBlock();
103 bool TestPolynomialMod2();
104 bool TestHuffmanCodes();
105 #endif
106 
107 // Coverity finding
108 template <class T, bool NON_NEGATIVE>
109 T StringToValue(const std::string& str);
110 
111 // Coverity finding
112 template<>
113 int StringToValue<int, true>(const std::string& str);
114 
115 // Coverity finding
117 {
118 public:
119  StreamState(std::ostream& out)
120  : m_out(out), m_fmt(out.flags()), m_prec(out.precision())
121  {
122  }
123 
124  ~StreamState()
125  {
126  m_out.precision(m_prec);
127  m_out.flags(m_fmt);
128  }
129 
130 private:
131  std::ostream& m_out;
132  std::ios_base::fmtflags m_fmt;
133  std::streamsize m_prec;
134 };
135 
136 // Functions that need a RNG; uses AES inf CFB mode with Seed.
137 CryptoPP::RandomNumberGenerator & GlobalRNG();
138 
139 bool CryptoSystemValidate(CryptoPP::PK_Decryptor &priv, CryptoPP::PK_Encryptor &pub, bool thorough = false);
140 bool RunTestDataFile(const char *filename, const CryptoPP::NameValuePairs &overrideParameters=CryptoPP::g_nullNameValuePairs, bool thorough=true);
141 
142 #endif
This file contains helper classes/functions for implementing public key algorithms.
Abstract base classes that provide a uniform interface to this library.
const NameValuePairs & g_nullNameValuePairs
An empty set of name-value pairs.
Definition: cryptlib.cpp:76