Crypto++  5.6.5
Free C++ class library of cryptographic schemes
regtest.cpp
1 // regtest.cpp - written and placed in the public domain by Wei Dai
2 
3 #define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
4 
5 #include "cryptlib.h"
6 #include "factory.h"
7 #include "modes.h"
8 #include "dh.h"
9 #include "esign.h"
10 #include "md2.h"
11 #include "rw.h"
12 #include "md5.h"
13 #include "rsa.h"
14 #include "ripemd.h"
15 #include "dsa.h"
16 #include "seal.h"
17 #include "whrlpool.h"
18 #include "ttmac.h"
19 #include "camellia.h"
20 #include "shacal2.h"
21 #include "tea.h"
22 #include "panama.h"
23 #include "pssr.h"
24 #include "aes.h"
25 #include "salsa.h"
26 #include "chacha.h"
27 #include "vmac.h"
28 #include "tiger.h"
29 #include "md5.h"
30 #include "sosemanuk.h"
31 #include "arc4.h"
32 #include "ccm.h"
33 #include "gcm.h"
34 #include "eax.h"
35 #include "twofish.h"
36 #include "serpent.h"
37 #include "cast.h"
38 #include "rc6.h"
39 #include "mars.h"
40 #include "des.h"
41 #include "idea.h"
42 #include "rc5.h"
43 #include "tea.h"
44 #include "skipjack.h"
45 #include "cmac.h"
46 #include "dmac.h"
47 #include "blowfish.h"
48 #include "seed.h"
49 #include "wake.h"
50 #include "seal.h"
51 #include "crc.h"
52 #include "adler32.h"
53 #include "keccak.h"
54 #include "sha3.h"
55 #include "blake2.h"
56 #include "hkdf.h"
57 
58 // Aggressive stack checking with VS2005 SP1 and above.
59 #if (CRYPTOPP_MSC_VERSION >= 1410)
60 # pragma strict_gs_check (on)
61 #endif
62 
63 // Quiet deprecated warnings intended to benefit users.
64 #if CRYPTOPP_MSC_VERSION
65 # pragma warning(disable: 4996)
66 #endif
67 
68 #if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE
69 # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
70 #endif
71 
72 USING_NAMESPACE(CryptoPP)
73 
74 void RegisterFactories()
75 {
76  static bool s_registered = false;
77  if (s_registered)
78  return;
79 
125  RegisterAsymmetricCipherDefaultFactories<RSAES<OAEP<SHA1> > >("RSA/OAEP-MGF1(SHA-1)");
126  RegisterAsymmetricCipherDefaultFactories<DLIES<> >("DLIES(NoCofactorMultiplication, KDF2(SHA-1), XOR, HMAC(SHA-1), DHAES)");
127  RegisterSignatureSchemeDefaultFactories<DSA>();
128  RegisterSignatureSchemeDefaultFactories<DSA2<SHA224> >();
129  RegisterSignatureSchemeDefaultFactories<DSA2<SHA256> >();
130  RegisterSignatureSchemeDefaultFactories<DSA2<SHA384> >();
131  RegisterSignatureSchemeDefaultFactories<DSA2<SHA512> >();
132  RegisterSignatureSchemeDefaultFactories<NR<SHA1> >("NR(1363)/EMSA1(SHA-1)");
133  RegisterSignatureSchemeDefaultFactories<GDSA<SHA1> >("DSA-1363/EMSA1(SHA-1)");
134  RegisterSignatureSchemeDefaultFactories<RSASS<PKCS1v15, Weak::MD2> >("RSA/PKCS1-1.5(MD2)");
135  RegisterSignatureSchemeDefaultFactories<RSASS<PKCS1v15, SHA1> >("RSA/PKCS1-1.5(SHA-1)");
136  RegisterSignatureSchemeDefaultFactories<ESIGN<SHA1> >("ESIGN/EMSA5-MGF1(SHA-1)");
137  RegisterSignatureSchemeDefaultFactories<RWSS<P1363_EMSA2, SHA1> >("RW/EMSA2(SHA-1)");
138  RegisterSignatureSchemeDefaultFactories<RSASS<PSS, SHA1> >("RSA/PSS-MGF1(SHA-1)");
139  RegisterSymmetricCipherDefaultFactories<SEAL<> >();
140  RegisterSymmetricCipherDefaultFactories<ECB_Mode<SHACAL2> >();
141  RegisterSymmetricCipherDefaultFactories<ECB_Mode<Camellia> >();
142  RegisterSymmetricCipherDefaultFactories<ECB_Mode<TEA> >();
143  RegisterSymmetricCipherDefaultFactories<ECB_Mode<XTEA> >();
144  RegisterSymmetricCipherDefaultFactories<PanamaCipher<LittleEndian> >();
145  RegisterSymmetricCipherDefaultFactories<PanamaCipher<BigEndian> >();
146  RegisterSymmetricCipherDefaultFactories<ECB_Mode<AES> >();
147  RegisterSymmetricCipherDefaultFactories<CBC_Mode<AES> >();
148  RegisterSymmetricCipherDefaultFactories<CFB_Mode<AES> >();
149  RegisterSymmetricCipherDefaultFactories<OFB_Mode<AES> >();
150  RegisterSymmetricCipherDefaultFactories<CTR_Mode<AES> >();
151  RegisterSymmetricCipherDefaultFactories<Salsa20>();
152  RegisterSymmetricCipherDefaultFactories<XSalsa20>();
153  RegisterSymmetricCipherDefaultFactories<ChaCha8>();
154  RegisterSymmetricCipherDefaultFactories<ChaCha12>();
155  RegisterSymmetricCipherDefaultFactories<ChaCha20>();
156  RegisterSymmetricCipherDefaultFactories<Sosemanuk>();
157  RegisterSymmetricCipherDefaultFactories<Weak::MARC4>();
158  RegisterSymmetricCipherDefaultFactories<WAKE_OFB<LittleEndian> >();
159  RegisterSymmetricCipherDefaultFactories<WAKE_OFB<BigEndian> >();
160  RegisterSymmetricCipherDefaultFactories<SEAL<LittleEndian> >();
161  RegisterAuthenticatedSymmetricCipherDefaultFactories<CCM<AES> >();
162  RegisterAuthenticatedSymmetricCipherDefaultFactories<GCM<AES> >();
163  RegisterAuthenticatedSymmetricCipherDefaultFactories<EAX<AES> >();
164  RegisterSymmetricCipherDefaultFactories<CTR_Mode<Camellia> >();
165  RegisterSymmetricCipherDefaultFactories<CTR_Mode<Twofish> >();
166  RegisterSymmetricCipherDefaultFactories<CTR_Mode<Serpent> >();
167  RegisterSymmetricCipherDefaultFactories<CTR_Mode<CAST256> >();
168  RegisterSymmetricCipherDefaultFactories<CTR_Mode<RC6> >();
169  RegisterSymmetricCipherDefaultFactories<ECB_Mode<MARS> >();
170  RegisterSymmetricCipherDefaultFactories<CTR_Mode<MARS> >();
171  RegisterSymmetricCipherDefaultFactories<CTR_Mode<SHACAL2> >();
172  RegisterSymmetricCipherDefaultFactories<CTR_Mode<DES> >();
173  RegisterSymmetricCipherDefaultFactories<CTR_Mode<DES_XEX3> >();
174  RegisterSymmetricCipherDefaultFactories<CTR_Mode<DES_EDE3> >();
175  RegisterSymmetricCipherDefaultFactories<CTR_Mode<IDEA> >();
176  RegisterSymmetricCipherDefaultFactories<CTR_Mode<RC5> >();
177  RegisterSymmetricCipherDefaultFactories<CTR_Mode<TEA> >();
178  RegisterSymmetricCipherDefaultFactories<CTR_Mode<XTEA> >();
179  RegisterSymmetricCipherDefaultFactories<CTR_Mode<CAST128> >();
180  RegisterSymmetricCipherDefaultFactories<CTR_Mode<SKIPJACK> >();
181  RegisterSymmetricCipherDefaultFactories<CTR_Mode<Blowfish> >();
182  RegisterSymmetricCipherDefaultFactories<ECB_Mode<SEED> >();
183  RegisterSymmetricCipherDefaultFactories<CTR_Mode<SEED> >();
188 
189  s_registered = true;
190 }
Classes for RIPEMD message digest.
Class file for modes of operation.
Classes for HKDF from RFC 5869.
Classes for the RC5 block cipher.
Classes for Keccak message digests.
Abstract base classes that provide a uniform interface to this library.
Classes for the SEED block cipher.
Classes for the Cameliia block cipher.
Classes for Sosemanuk stream cipher.
Classes for CRC-32 and CRC-32C checksum algorithm.
Classes for the RC6 block cipher.
This file contains classes that implement the ESIGN signature schemes as defined in IEEE P1363a...
Classes for CMAC message authentication code.
Classes for the Twofish block cipher.
Classes for the Blowfish block cipher.
Classes for the VMAC message authentication code.
Classes for the MARS block cipher (IBM AES submission)
Classes for Rabin-Williams signature scheme.
Classes for the SKIPJACK block cipher.
Classes for Panama hash and stream cipher.
Classes for Diffie-Hellman key exchange.
Classes for SHA3 message digests.
Class file for the AES cipher (Rijndael)
Classes for the CAST-128 and CAST-256 block ciphers.
Classes for the TEA, BTEA and XTEA block ciphers.
Classes for DMAC message authentication code.
Classes for the DSA signature algorithm.
Classes for BLAKE2b and BLAKE2s message digests and keyed message digests.
Class file for ADLER-32 checksum calculations.
Classes for SEAL stream cipher.
Classes for WAKE stream cipher.
Classes for DES, 2-key Triple-DES, 3-key Triple-DES and DESX.
Classes for Salsa and Salsa20 stream ciphers.
Classes for the RSA cryptosystem.
EAX block cipher mode of operation.
GCM block cipher mode of operation.
Classes for the Serpent block cipher.
Crypto++ library namespace.
Classes for the TTMAC message authentication code.
Classes for probablistic signature schemes.
Classes for ARC4 cipher.
Classes for ChaCha8, ChaCha12 and ChaCha20 stream ciphers.
Classes for the IDEA block cipher.
CCM block cipher mode of operation.
Classes for the SHACAL-2 block cipher.