Fabcoin Core  0.16.2
P2P Digital Currency
validate.h
Go to the documentation of this file.
1 #ifndef CRYPTOPP_VALIDATE_H
2 #define CRYPTOPP_VALIDATE_H
3 
4 #include "cryptlib.h"
5 #include <iostream>
6 #include <iomanip>
7 
8 bool ValidateAll(bool thorough);
9 bool TestSettings();
10 bool TestOS_RNG();
11 bool TestNIST_DRBG();
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 
34 bool ValidateBLAKE2s();
35 bool ValidateBLAKE2b();
36 bool ValidatePoly1305();
37 bool ValidateSipHash();
38 
39 bool ValidateHMAC();
40 bool ValidateTTMAC();
41 
42 bool ValidateCipherModes();
43 bool ValidatePBKDF();
44 bool ValidateHKDF();
45 
46 bool ValidateDES();
47 bool ValidateIDEA();
48 bool ValidateSAFER();
49 bool ValidateRC2();
50 bool ValidateARC4();
51 
52 bool ValidateRC5();
53 bool ValidateBlowfish();
54 bool ValidateThreeWay();
55 bool ValidateGOST();
56 bool ValidateSHARK();
57 bool ValidateSEAL();
58 bool ValidateCAST();
59 bool ValidateSquare();
60 bool ValidateSKIPJACK();
61 bool ValidateRC6();
62 bool ValidateMARS();
63 bool ValidateRijndael();
64 bool ValidateTwofish();
65 bool ValidateSerpent();
66 bool ValidateSHACAL2();
67 bool ValidateCamellia();
68 bool ValidateSalsa();
69 bool ValidateSosemanuk();
70 bool ValidateVMAC();
71 bool ValidateCCM();
72 bool ValidateGCM();
73 bool ValidateCMAC();
74 
75 bool ValidateBBS();
76 bool ValidateDH();
77 bool ValidateMQV();
78 bool ValidateHMQV();
79 bool ValidateFHMQV();
80 bool ValidateRSA();
81 bool ValidateElGamal();
82 bool ValidateDLIES();
83 bool ValidateNR();
84 bool ValidateDSA(bool thorough);
85 bool ValidateLUC();
86 bool ValidateLUC_DL();
87 bool ValidateLUC_DH();
88 bool ValidateXTR_DH();
89 bool ValidateRabin();
90 bool ValidateRW();
91 bool ValidateECP();
92 bool ValidateEC2N();
93 bool ValidateECDSA();
94 bool ValidateECGDSA();
95 bool ValidateESIGN();
96 
97 #if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_IMPORTS)
98 // http://github.com/weidai11/cryptopp/issues/92
99 bool TestSecBlock();
100 // http://github.com/weidai11/cryptopp/issues/64
101 bool TestPolynomialMod2();
102 // http://github.com/weidai11/cryptopp/issues/336
103 bool TestIntegerBitops();
104 // http://github.com/weidai11/cryptopp/issues/242
105 bool TestHuffmanCodes();
106 // http://github.com/weidai11/cryptopp/issues/346
107 bool TestASN1Parse();
108 #endif
109 
110 // Coverity finding
111 template <class T, bool NON_NEGATIVE>
112 T StringToValue(const std::string& str);
113 
114 // Coverity finding
115 template<>
116 int StringToValue<int, true>(const std::string& str);
117 
118 // Coverity finding
120 {
121 public:
122  StreamState(std::ostream& out)
123  : m_out(out), m_fmt(out.flags()), m_prec(out.precision())
124  {
125  }
126 
128  {
129  m_out.precision(m_prec);
130  m_out.flags(m_fmt);
131  }
132 
133 private:
134  std::ostream& m_out;
135  std::ios_base::fmtflags m_fmt;
136  std::streamsize m_prec;
137 };
138 
139 // Functions that need a RNG; uses AES inf CFB mode with Seed.
140 CryptoPP::RandomNumberGenerator & GlobalRNG();
141 
142 bool RunTestDataFile(const char *filename, const CryptoPP::NameValuePairs &overrideParameters=CryptoPP::g_nullNameValuePairs, bool thorough=true);
143 
144 #endif
bool ValidatePoly1305()
Definition: validat3.cpp:782
bool ValidateMD4()
Definition: validat3.cpp:173
bool TestAutoSeeded()
Definition: validat1.cpp:458
std::ostream & m_out
Definition: validate.h:134
bool ValidateSAFER()
Definition: validat1.cpp:1610
bool ValidateAll(bool thorough)
Definition: validat1.cpp:70
bool ValidateRC5()
Definition: validat1.cpp:1832
bool ValidateElGamal()
Definition: validat2.cpp:638
bool ValidateCipherModes()
Definition: validat1.cpp:1299
#define T(i, x)
bool ValidateCAST()
Definition: validat1.cpp:2156
bool ValidateECGDSA()
Definition: validat2.cpp:1062
bool ValidateARC4()
Definition: validat1.cpp:1664
Abstract base classes that provide a uniform interface to this library.
bool ValidateVMAC()
Definition: validat1.cpp:2436
bool ValidateSipHash()
Definition: validat3.cpp:900
bool ValidateBLAKE2b()
Definition: validat3.cpp:1475
bool ValidateSquare()
Definition: validat1.cpp:2219
bool ValidateMARS()
Definition: validat1.cpp:1893
bool ValidateCamellia()
Definition: validat1.cpp:2390
bool ValidateGCM()
Definition: validat1.cpp:2448
bool RunTestDataFile(const char *filename, const CryptoPP::NameValuePairs &overrideParameters=CryptoPP::g_nullNameValuePairs, bool thorough=true)
bool TestAutoSeededX917()
Definition: validat1.cpp:462
bool ValidateSalsa()
Definition: validat1.cpp:2423
bool ValidateSosemanuk()
Definition: validat1.cpp:2430
bool ValidateDH()
Definition: validat2.cpp:368
~StreamState()
Definition: validate.h:127
bool ValidateHMQV()
Definition: validat2.cpp:386
bool ValidateCCM()
Definition: validat1.cpp:2442
bool ValidateWhirlpool()
Definition: validat3.cpp:370
bool ValidatePBKDF()
Definition: validat3.cpp:602
bool ValidateMQV()
Definition: validat2.cpp:377
bool ValidateSHA2()
Definition: validat3.cpp:217
bool ValidateBBS()
Definition: validat2.cpp:74
bool ValidateAdler32()
Definition: validat3.cpp:135
bool ValidateSHACAL2()
Definition: validat1.cpp:2358
bool ValidateRabin()
Definition: validat2.cpp:756
bool ValidateCRC32C()
Definition: validat3.cpp:115
CryptoPP::RandomNumberGenerator & GlobalRNG()
Definition: test.cpp:123
bool ValidateBlowfish()
Definition: validat1.cpp:2019
bool ValidateRW()
Definition: validat2.cpp:775
bool ValidateLUC_DH()
Definition: validat2.cpp:620
bool ValidateLUC_DL()
Definition: validat2.cpp:737
bool ValidateSHA()
Definition: validat3.cpp:211
bool ValidateECP()
Definition: validat2.cpp:913
bool ValidateRijndael()
Definition: validat1.cpp:1926
int StringToValue< int, true >(const std::string &str)
Definition: test.cpp:458
StreamState(std::ostream &out)
Definition: validate.h:122
bool ValidateCRC32()
Definition: validat3.cpp:95
bool ValidateNR()
Definition: validat2.cpp:679
const NameValuePairs & g_nullNameValuePairs
An empty set of name-value pairs.
Definition: cryptlib.cpp:76
bool ValidateTwofish()
Definition: validat1.cpp:1960
bool ValidateSKIPJACK()
Definition: validat1.cpp:2241
bool ValidateRSA()
Definition: validat2.cpp:281
bool ValidateTTMAC()
Definition: validat3.cpp:514
bool ValidateFHMQV()
Definition: validat2.cpp:503
std::streamsize m_prec
Definition: validate.h:136
bool ValidateSerpent()
Definition: validat1.cpp:1989
T StringToValue(const std::string &str)
Definition: test.cpp:437
bool TestOS_RNG()
Definition: validat1.cpp:345
bool ValidateESIGN()
Definition: validat2.cpp:1404
bool ValidateDES()
Definition: validat1.cpp:1253
bool ValidateBLAKE2s()
Definition: validat3.cpp:1080
bool ValidateSEAL()
Definition: validat1.cpp:2263
bool ValidateEC2N()
Definition: validat2.cpp:962
bool ValidateMD5()
Definition: validat3.cpp:192
bool ValidateRC6()
Definition: validat1.cpp:1860
std::ios_base::fmtflags m_fmt
Definition: validate.h:135
bool TestNIST_DRBG()
Definition: validat1.cpp:753
bool ValidateDLIES()
Definition: validat2.cpp:656
bool ValidateDSA(bool thorough)
Definition: validat2.cpp:701
bool ValidateLUC()
Definition: validat2.cpp:718
bool ValidateIDEA()
Definition: validat1.cpp:1602
bool ValidateECDSA()
Definition: validat2.cpp:1011
bool ValidateXTR_DH()
Definition: validat2.cpp:629
bool ValidateHKDF()
Definition: validat3.cpp:688
bool ValidateRIPEMD()
Definition: validat3.cpp:245
bool ValidateTiger()
Definition: validat3.cpp:223
bool ValidateRC2()
Definition: validat1.cpp:1623
bool ValidateHMAC()
Definition: validat3.cpp:440
bool ValidateThreeWay()
Definition: validat1.cpp:2082
bool ValidateSHARK()
Definition: validat1.cpp:2130
bool TestSettings()
Definition: validat1.cpp:184
bool ValidateMD2()
Definition: validat3.cpp:154
bool ValidateCMAC()
Definition: validat1.cpp:2457
bool ValidateGOST()
Definition: validat1.cpp:2104
bool ValidateBaseCode()
Definition: validat1.cpp:2291
bool ValidatePanama()
Definition: validat3.cpp:365