ext-cryptopp/regtest2.cpp

106 lines
3.8 KiB
C++
Raw Normal View History

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
2020-12-19 01:04:43 +00:00
// in April 2017. A second split occurred in July 2018.
2015-11-05 06:59:46 +00:00
#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
#include "cryptlib.h"
#include "factory.h"
#include "bench.h"
#include "cpu.h"
// For MAC's
#include "hmac.h"
2015-11-05 06:59:46 +00:00
#include "cmac.h"
#include "dmac.h"
#include "vmac.h"
#include "ttmac.h"
// Ciphers
#include "md5.h"
Squashed commit of the following: commit 47c75c6e9397e240919207e50e5a611d3e2a2428 Merge: d7685c2 42085ee Author: Jeffrey Walton <noloader@gmail.com> Date: Thu Sep 8 20:20:39 2016 -0400 Attempting to fix binary file merge conflict commit d7685c2d946beecc419ddb6901c24e972c7cf3ee Author: Jeffrey Walton <noloader@gmail.com> Date: Thu Sep 8 16:39:23 2016 -0400 Add vsClean.cmd to vs2010.zip commit 4b96fdf1c551260da60eb021f324bcc3fcfec626 Author: Jeffrey Walton <noloader@gmail.com> Date: Thu Sep 8 16:15:38 2016 -0400 Add Keccak to vs2010.zip commit 3962db73b7113ee805b46a5bb4da64e204fe6bb0 Author: Jeffrey Walton <noloader@gmail.com> Date: Thu Sep 8 15:40:35 2016 -0400 Fold hmqv.cpp and fhmqv.cpp into mqv.cpp. There's no need for three empty source files commit 44401448cbb6c8125b0f1ab4419c5b174408ffd7 Author: Jeffrey Walton <noloader@gmail.com> Date: Thu Sep 8 15:39:23 2016 -0400 Fold hmqv.cpp and fhmqv.cpp into mqv.cpp. There's no need for three empty source files commit 847bfccb8d5c388e67745dc8c69768fa503c5135 Author: Jeffrey Walton <noloader@gmail.com> Date: Thu Sep 8 14:48:02 2016 -0400 Whitespace cleanup commit 46a37be6fef361704dcf852bc9a099ce0a1da4c8 Merge: aefb8f8 3697867 Author: Jeffrey Walton <noloader@gmail.com> Date: Thu Sep 8 14:43:01 2016 -0400 Merge 'master' into 'keccak' commit aefb8f8ff2b81b967089c53b457a92fc6f7544d6 Merge: 51a828b 3c91d93 Author: Jeffrey Walton <noloader@gmail.com> Date: Thu Sep 8 12:39:51 2016 -0400 Merge 'master' into 'keccak' commit 51a828b88e37a4d18abb00300cd5522bd0e110c5 Merge: 4152870 e7c7722 Author: Jeffrey Walton <noloader@gmail.com> Date: Thu Sep 8 10:41:36 2016 -0400 Merge 'master' into 'keccak' commit 415287041e69ddadf5ca1f6fc794b87e145fc2db Merge: 357a0c5 83ac849 Author: Jeffrey Walton <noloader@gmail.com> Date: Thu Sep 8 10:34:45 2016 -0400 Merge 'master' into 'keccak' commit 357a0c510f75e4e58078b500dd469462e90f7650 Author: Jeffrey Walton <noloader@gmail.com> Date: Thu Sep 8 10:13:32 2016 -0400 Removed deprecated warning from SHA3 classes commit 5cf9ec10d53b895b5a583e265e4e1298ed402195 Merge: 10ce0ed c2d60cc Author: Jeffrey Walton <noloader@gmail.com> Date: Thu Sep 8 09:43:15 2016 -0400 Merge 'master' into 'keccak' commit 10ce0ed4c5b8a1ea230062fd2dfdec0d87ec5b42 Author: Jeffrey Walton <noloader@gmail.com> Date: Thu Sep 8 09:37:40 2016 -0400 Add Keccak implementation based on early SHA3. Change SHA3 to NIST FIPS 202 conforming implementation
2016-09-09 00:24:25 +00:00
#include "keccak.h"
#include "sha.h"
2015-11-05 06:59:46 +00:00
#include "sha3.h"
#include "blake2.h"
#include "ripemd.h"
2019-02-06 06:03:28 +00:00
#include "chacha.h"
2016-11-27 20:31:50 +00:00
#include "poly1305.h"
#include "siphash.h"
#include "panama.h"
// 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.
#if (_MSC_FULL_VER >= 140050727)
2015-11-05 06:59:46 +00:00
# pragma strict_gs_check (on)
#endif
#if CRYPTOPP_MSC_VERSION
# pragma warning(disable: 4505 4355)
#endif
2015-11-05 06:59:46 +00:00
USING_NAMESPACE(CryptoPP)
// MAC ciphers
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> >();
RegisterDefaultFactoryFor<MessageAuthenticationCode, Poly1305TLS>();
2015-11-05 06:59:46 +00:00
RegisterDefaultFactoryFor<MessageAuthenticationCode, CMAC<DES_EDE3> >();
RegisterDefaultFactoryFor<MessageAuthenticationCode, BLAKE2s>();
RegisterDefaultFactoryFor<MessageAuthenticationCode, BLAKE2b>();
RegisterDefaultFactoryFor<MessageAuthenticationCode, SipHash<2,4> >();
RegisterDefaultFactoryFor<MessageAuthenticationCode, SipHash<4,8> >();
}
// Stream ciphers
void RegisterFactories3()
{
2018-07-28 01:18:51 +00:00
RegisterSymmetricCipherDefaultFactories<Weak::MARC4>();
RegisterSymmetricCipherDefaultFactories<SEAL<> >();
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> >();
2015-11-05 06:59:46 +00:00
RegisterSymmetricCipherDefaultFactories<Salsa20>();
RegisterSymmetricCipherDefaultFactories<XSalsa20>();
RegisterSymmetricCipherDefaultFactories<ChaCha>();
RegisterSymmetricCipherDefaultFactories<ChaChaTLS>();
2019-02-06 06:03:28 +00:00
RegisterSymmetricCipherDefaultFactories<XChaCha20>();
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
}