Crypto++  5.6.3
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 "sha3.h"
54 #include "blake2.h"
55 #include "hkdf.h"
56 
57 // Aggressive stack checking with VS2005 SP1 and above.
58 #if (CRYPTOPP_MSC_VERSION >= 1410)
59 # pragma strict_gs_check (on)
60 #endif
61 
62 // Quiet deprecated warnings intended to benefit users.
63 #if CRYPTOPP_MSC_VERSION
64 # pragma warning(disable: 4996)
65 #endif
66 
67 #if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE
68 # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
69 #endif
70 
71 USING_NAMESPACE(CryptoPP)
72 
73 void RegisterFactories()
74 {
75  static bool s_registered = false;
76  if (s_registered)
77  return;
78 
120  RegisterAsymmetricCipherDefaultFactories<RSAES<OAEP<SHA1> > >("RSA/OAEP-MGF1(SHA-1)");
121  RegisterAsymmetricCipherDefaultFactories<DLIES<> >("DLIES(NoCofactorMultiplication, KDF2(SHA-1), XOR, HMAC(SHA-1), DHAES)");
122  RegisterSignatureSchemeDefaultFactories<DSA>();
123  RegisterSignatureSchemeDefaultFactories<DSA2<SHA224> >();
124  RegisterSignatureSchemeDefaultFactories<DSA2<SHA256> >();
125  RegisterSignatureSchemeDefaultFactories<DSA2<SHA384> >();
126  RegisterSignatureSchemeDefaultFactories<DSA2<SHA512> >();
127  RegisterSignatureSchemeDefaultFactories<NR<SHA1> >("NR(1363)/EMSA1(SHA-1)");
128  RegisterSignatureSchemeDefaultFactories<GDSA<SHA1> >("DSA-1363/EMSA1(SHA-1)");
129  RegisterSignatureSchemeDefaultFactories<RSASS<PKCS1v15, Weak::MD2> >("RSA/PKCS1-1.5(MD2)");
130  RegisterSignatureSchemeDefaultFactories<RSASS<PKCS1v15, SHA1> >("RSA/PKCS1-1.5(SHA-1)");
131  RegisterSignatureSchemeDefaultFactories<ESIGN<SHA1> >("ESIGN/EMSA5-MGF1(SHA-1)");
132  RegisterSignatureSchemeDefaultFactories<RWSS<P1363_EMSA2, SHA1> >("RW/EMSA2(SHA-1)");
133  RegisterSignatureSchemeDefaultFactories<RSASS<PSS, SHA1> >("RSA/PSS-MGF1(SHA-1)");
134  RegisterSymmetricCipherDefaultFactories<SEAL<> >();
135  RegisterSymmetricCipherDefaultFactories<ECB_Mode<SHACAL2> >();
136  RegisterSymmetricCipherDefaultFactories<ECB_Mode<Camellia> >();
137  RegisterSymmetricCipherDefaultFactories<ECB_Mode<TEA> >();
138  RegisterSymmetricCipherDefaultFactories<ECB_Mode<XTEA> >();
139  RegisterSymmetricCipherDefaultFactories<PanamaCipher<LittleEndian> >();
140  RegisterSymmetricCipherDefaultFactories<PanamaCipher<BigEndian> >();
141  RegisterSymmetricCipherDefaultFactories<ECB_Mode<AES> >();
142  RegisterSymmetricCipherDefaultFactories<CBC_Mode<AES> >();
143  RegisterSymmetricCipherDefaultFactories<CFB_Mode<AES> >();
144  RegisterSymmetricCipherDefaultFactories<OFB_Mode<AES> >();
145  RegisterSymmetricCipherDefaultFactories<CTR_Mode<AES> >();
146  RegisterSymmetricCipherDefaultFactories<Salsa20>();
147  RegisterSymmetricCipherDefaultFactories<XSalsa20>();
148  RegisterSymmetricCipherDefaultFactories<ChaCha8>();
149  RegisterSymmetricCipherDefaultFactories<ChaCha12>();
150  RegisterSymmetricCipherDefaultFactories<ChaCha20>();
151  RegisterSymmetricCipherDefaultFactories<Sosemanuk>();
152  RegisterSymmetricCipherDefaultFactories<Weak::MARC4>();
153  RegisterSymmetricCipherDefaultFactories<WAKE_OFB<LittleEndian> >();
154  RegisterSymmetricCipherDefaultFactories<WAKE_OFB<BigEndian> >();
155  RegisterSymmetricCipherDefaultFactories<SEAL<LittleEndian> >();
156  RegisterAuthenticatedSymmetricCipherDefaultFactories<CCM<AES> >();
157  RegisterAuthenticatedSymmetricCipherDefaultFactories<GCM<AES> >();
158  RegisterAuthenticatedSymmetricCipherDefaultFactories<EAX<AES> >();
159  RegisterSymmetricCipherDefaultFactories<CTR_Mode<Camellia> >();
160  RegisterSymmetricCipherDefaultFactories<CTR_Mode<Twofish> >();
161  RegisterSymmetricCipherDefaultFactories<CTR_Mode<Serpent> >();
162  RegisterSymmetricCipherDefaultFactories<CTR_Mode<CAST256> >();
163  RegisterSymmetricCipherDefaultFactories<CTR_Mode<RC6> >();
164  RegisterSymmetricCipherDefaultFactories<ECB_Mode<MARS> >();
165  RegisterSymmetricCipherDefaultFactories<CTR_Mode<MARS> >();
166  RegisterSymmetricCipherDefaultFactories<CTR_Mode<SHACAL2> >();
167  RegisterSymmetricCipherDefaultFactories<CTR_Mode<DES> >();
168  RegisterSymmetricCipherDefaultFactories<CTR_Mode<DES_XEX3> >();
169  RegisterSymmetricCipherDefaultFactories<CTR_Mode<DES_EDE3> >();
170  RegisterSymmetricCipherDefaultFactories<CTR_Mode<IDEA> >();
171  RegisterSymmetricCipherDefaultFactories<CTR_Mode<RC5> >();
172  RegisterSymmetricCipherDefaultFactories<CTR_Mode<TEA> >();
173  RegisterSymmetricCipherDefaultFactories<CTR_Mode<XTEA> >();
174  RegisterSymmetricCipherDefaultFactories<CTR_Mode<CAST128> >();
175  RegisterSymmetricCipherDefaultFactories<CTR_Mode<SKIPJACK> >();
176  RegisterSymmetricCipherDefaultFactories<CTR_Mode<Blowfish> >();
177  RegisterSymmetricCipherDefaultFactories<ECB_Mode<SEED> >();
178  RegisterSymmetricCipherDefaultFactories<CTR_Mode<SEED> >();
183 
184  s_registered = true;
185 }
Classes for RIPEMD message digest.
Class file for modes of operation.
Classes for the RC5 block cipher.
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 stream cipher.
Classes for Diffie-Hellman key exchange.
Classes for SHA-3 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 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.