2017-04-14 11:19:04 +00:00
|
|
|
// regtest2.cpp - originally written and placed in the public domain by Wei Dai
|
2018-07-28 01:18:51 +00:00
|
|
|
// regtest.cpp split into 3 files due to OOM kills by JW
|
|
|
|
// in April 2017. A second split occured in July 2018.
|
2015-11-05 06:59:46 +00:00
|
|
|
|
|
|
|
#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
|
|
|
|
|
|
|
|
#include "cryptlib.h"
|
|
|
|
#include "factory.h"
|
2017-04-14 01:45:21 +00:00
|
|
|
#include "bench.h"
|
2017-03-08 21:59:24 +00:00
|
|
|
#include "cpu.h"
|
2017-04-14 01:45:21 +00:00
|
|
|
|
2018-07-27 22:16:25 +00:00
|
|
|
// For MAC's
|
|
|
|
#include "hmac.h"
|
2015-11-05 06:59:46 +00:00
|
|
|
#include "cmac.h"
|
|
|
|
#include "dmac.h"
|
2018-07-27 22:16:25 +00:00
|
|
|
#include "vmac.h"
|
|
|
|
#include "ttmac.h"
|
2017-04-14 01:45:21 +00:00
|
|
|
|
2018-07-27 22:16:25 +00:00
|
|
|
// Ciphers
|
2017-04-14 01:45:21 +00:00
|
|
|
#include "md5.h"
|
2016-09-09 00:24:25 +00:00
|
|
|
#include "keccak.h"
|
2017-04-14 01:45:21 +00:00
|
|
|
#include "sha.h"
|
2015-11-05 06:59:46 +00:00
|
|
|
#include "sha3.h"
|
2016-04-17 07:06:28 +00:00
|
|
|
#include "blake2.h"
|
2017-04-14 01:45:21 +00:00
|
|
|
#include "ripemd.h"
|
2016-11-27 20:31:50 +00:00
|
|
|
#include "poly1305.h"
|
2016-12-17 08:58:36 +00:00
|
|
|
#include "siphash.h"
|
2017-04-14 01:45:21 +00:00
|
|
|
#include "panama.h"
|
2017-03-08 21:59:24 +00:00
|
|
|
|
2018-07-27 22:16:25 +00:00
|
|
|
// Stream ciphers
|
|
|
|
#include "arc4.h"
|
|
|
|
#include "seal.h"
|
|
|
|
#include "wake.h"
|
|
|
|
#include "chacha.h"
|
|
|
|
#include "salsa.h"
|
|
|
|
#include "rabbit.h"
|
|
|
|
#include "hc128.h"
|
|
|
|
#include "hc256.h"
|
|
|
|
#include "panama.h"
|
|
|
|
#include "sosemanuk.h"
|
|
|
|
|
|
|
|
// Block for CMAC
|
|
|
|
#include "aes.h"
|
|
|
|
#include "des.h"
|
|
|
|
|
2015-11-05 06:59:46 +00:00
|
|
|
// Aggressive stack checking with VS2005 SP1 and above.
|
2017-05-11 16:05:57 +00:00
|
|
|
#if (_MSC_FULL_VER >= 140050727)
|
2015-11-05 06:59:46 +00:00
|
|
|
# pragma strict_gs_check (on)
|
|
|
|
#endif
|
|
|
|
|
2017-06-02 09:18:52 +00:00
|
|
|
#if CRYPTOPP_MSC_VERSION
|
|
|
|
# pragma warning(disable: 4505 4355)
|
|
|
|
#endif
|
|
|
|
|
2015-11-05 06:59:46 +00:00
|
|
|
USING_NAMESPACE(CryptoPP)
|
|
|
|
|
2018-07-27 22:16:25 +00:00
|
|
|
// MAC ciphers
|
2017-04-14 01:45:21 +00:00
|
|
|
void RegisterFactories2()
|
2015-11-05 06:59:46 +00:00
|
|
|
{
|
|
|
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<Weak::MD5> >();
|
|
|
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<RIPEMD160> >();
|
2017-08-07 23:04:14 +00:00
|
|
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<SHA1> >();
|
2015-11-05 06:59:46 +00:00
|
|
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<SHA224> >();
|
|
|
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<SHA256> >();
|
|
|
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<SHA384> >();
|
|
|
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<SHA512> >();
|
|
|
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, TTMAC>();
|
|
|
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, VMAC<AES> >();
|
|
|
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, VMAC<AES, 64> >();
|
|
|
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, Weak::PanamaMAC<LittleEndian> >();
|
|
|
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, Weak::PanamaMAC<BigEndian> >();
|
|
|
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, CMAC<AES> >();
|
|
|
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, DMAC<AES> >();
|
2016-11-27 20:31:50 +00:00
|
|
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, Poly1305<AES> >();
|
2015-11-05 06:59:46 +00:00
|
|
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, CMAC<DES_EDE3> >();
|
2016-04-24 17:24:45 +00:00
|
|
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, BLAKE2s>();
|
|
|
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, BLAKE2b>();
|
2016-12-17 08:58:36 +00:00
|
|
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, SipHash<2,4> >();
|
|
|
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, SipHash<4,8> >();
|
2018-07-27 22:16:25 +00:00
|
|
|
}
|
2017-04-14 01:45:21 +00:00
|
|
|
|
2018-07-27 22:16:25 +00:00
|
|
|
// Stream ciphers
|
|
|
|
void RegisterFactories3()
|
|
|
|
{
|
2018-07-28 01:18:51 +00:00
|
|
|
RegisterSymmetricCipherDefaultFactories<Weak::MARC4>();
|
|
|
|
RegisterSymmetricCipherDefaultFactories<SEAL<> >();
|
2018-07-27 22:16:25 +00:00
|
|
|
RegisterSymmetricCipherDefaultFactories<SEAL<LittleEndian> >();
|
|
|
|
RegisterSymmetricCipherDefaultFactories<WAKE_OFB<LittleEndian> >();
|
|
|
|
RegisterSymmetricCipherDefaultFactories<WAKE_OFB<BigEndian> >();
|
2015-11-05 06:59:46 +00:00
|
|
|
RegisterSymmetricCipherDefaultFactories<PanamaCipher<LittleEndian> >();
|
|
|
|
RegisterSymmetricCipherDefaultFactories<PanamaCipher<BigEndian> >();
|
2018-07-27 22:16:25 +00:00
|
|
|
|
2015-11-05 06:59:46 +00:00
|
|
|
RegisterSymmetricCipherDefaultFactories<Salsa20>();
|
|
|
|
RegisterSymmetricCipherDefaultFactories<XSalsa20>();
|
2018-08-17 10:19:30 +00:00
|
|
|
RegisterSymmetricCipherDefaultFactories<ChaCha>();
|
2015-11-05 06:59:46 +00:00
|
|
|
RegisterSymmetricCipherDefaultFactories<Sosemanuk>();
|
2018-07-04 07:47:28 +00:00
|
|
|
RegisterSymmetricCipherDefaultFactories<Rabbit>();
|
|
|
|
RegisterSymmetricCipherDefaultFactories<RabbitWithIV>();
|
2018-07-05 04:29:07 +00:00
|
|
|
RegisterSymmetricCipherDefaultFactories<HC128>();
|
2018-07-05 10:43:04 +00:00
|
|
|
RegisterSymmetricCipherDefaultFactories<HC256>();
|
2015-11-05 06:59:46 +00:00
|
|
|
}
|