ext-cryptopp/regtest3.cpp
Jeffrey Walton bf92cb0039
Split regtest.cpp into regtest{1|2|3}.cpp
regtest.cpp is where ciphers register by name. The library has added a number of ciphers over the last couple of years and the source file has experienced bloat. Most of the ARM and MIPS test borads were suffering Out of Memory (OOM) kills as the compiler processed the source fille and the included header files.
This won't stop the OOM kills, but it will help the situation. An early BeagleBoard with 512 MB of RAM is still going to have trouble, but it can be worked around by building with 1 make job as opposed to 2 or 4.
2017-04-13 21:45:21 -04:00

54 lines
2.1 KiB
C++

// regtest.cpp - originally written and placed in the public domain by Wei Dai
// regtest.cpp split into 3 files due to OOM kills by JW in April 2017
#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
#include "cryptlib.h"
#include "factory.h"
#include "bench.h"
#include "cpu.h"
#include "dh.h"
#include "nr.h"
#include "rw.h"
#include "rsa.h"
#include "dsa.h"
#include "pssr.h"
#include "esign.h"
// Hashes
#include "md2.h"
#include "md5.h"
#include "sha.h"
// Aggressive stack checking with VS2005 SP1 and above.
#if (CRYPTOPP_MSC_VERSION >= 1410)
# pragma strict_gs_check (on)
#endif
USING_NAMESPACE(CryptoPP)
void RegisterFactories3()
{
RegisterDefaultFactoryFor<SimpleKeyAgreementDomain, DH>();
RegisterAsymmetricCipherDefaultFactories<RSAES<OAEP<SHA1> > >("RSA/OAEP-MGF1(SHA-1)");
RegisterAsymmetricCipherDefaultFactories<DLIES<> >("DLIES(NoCofactorMultiplication, KDF2(SHA-1), XOR, HMAC(SHA-1), DHAES)");
RegisterSignatureSchemeDefaultFactories<DSA>();
RegisterSignatureSchemeDefaultFactories<DSA2<SHA224> >();
RegisterSignatureSchemeDefaultFactories<DSA2<SHA256> >();
RegisterSignatureSchemeDefaultFactories<DSA2<SHA384> >();
RegisterSignatureSchemeDefaultFactories<DSA2<SHA512> >();
RegisterSignatureSchemeDefaultFactories<DSA_RFC6979<SHA1> >();
RegisterSignatureSchemeDefaultFactories<DSA_RFC6979<SHA224> >();
RegisterSignatureSchemeDefaultFactories<DSA_RFC6979<SHA256> >();
RegisterSignatureSchemeDefaultFactories<DSA_RFC6979<SHA384> >();
RegisterSignatureSchemeDefaultFactories<DSA_RFC6979<SHA512> >();
RegisterSignatureSchemeDefaultFactories<NR<SHA1> >("NR(1363)/EMSA1(SHA-1)");
RegisterSignatureSchemeDefaultFactories<GDSA<SHA1> >("DSA-1363/EMSA1(SHA-1)");
RegisterSignatureSchemeDefaultFactories<RSASS<PKCS1v15, Weak::MD2> >("RSA/PKCS1-1.5(MD2)");
RegisterSignatureSchemeDefaultFactories<RSASS<PKCS1v15, SHA1> >("RSA/PKCS1-1.5(SHA-1)");
RegisterSignatureSchemeDefaultFactories<ESIGN<SHA1> >("ESIGN/EMSA5-MGF1(SHA-1)");
RegisterSignatureSchemeDefaultFactories<RWSS<P1363_EMSA2, SHA1> >("RW/EMSA2(SHA-1)");
RegisterSignatureSchemeDefaultFactories<RSASS<PSS, SHA1> >("RSA/PSS-MGF1(SHA-1)");
}