mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2025-03-02 02:15:34 +00:00
Fix benchmark selection code (GH #464)
This commit is contained in:
parent
7851a0d510
commit
559fc3bd89
9
bench.h
9
bench.h
@ -16,13 +16,14 @@ NAMESPACE_BEGIN(Test)
|
||||
|
||||
// More granular control over benchmarks
|
||||
enum TestClass {
|
||||
UnkeyedRNG=1,UnkeyedHash=2,UnkeyedOther=4,
|
||||
SharedKeyMAC=8,SharedKeyStream=16,SharedKeyBlock=32,SharedKeyOther=64,
|
||||
PublicKeyAgreement=128,PublicKeyEncryption=256,PublicKeySignature=512,PublicKeyOther=1024,
|
||||
UnkeyedRNG=(1<<0),UnkeyedHash=(1<<1),UnkeyedOther=(1<<2),
|
||||
SharedKeyMAC=(1<<3),SharedKeyStream=(1<<4),SharedKeyBlock=(1<<5),SharedKeyOther=(1<<6),
|
||||
PublicKeyAgreement=(1<<7),PublicKeyEncryption=(1<<8),PublicKeySignature=(1<<9),PublicKeyOther=(1<<10),
|
||||
Unkeyed=UnkeyedRNG|UnkeyedHash|UnkeyedOther,
|
||||
SharedKey=SharedKeyMAC|SharedKeyStream|SharedKeyBlock|SharedKeyOther,
|
||||
PublicKey=PublicKeyAgreement|PublicKeyEncryption|PublicKeySignature|PublicKeyOther,
|
||||
All=Unkeyed|SharedKey|PublicKey
|
||||
All=Unkeyed|SharedKey|PublicKey,
|
||||
TestFirst=(0), TestLast=(1<<11)
|
||||
};
|
||||
|
||||
extern const double CLOCK_TICKS_PER_SECOND;
|
||||
|
@ -375,7 +375,7 @@ void Benchmark(Test::TestClass suites, double t, double hertz)
|
||||
|
||||
g_testBegin = std::time(NULLPTR);
|
||||
|
||||
if (static_cast<int>(suites) > 256 || static_cast<int>(suites) == 0)
|
||||
if (static_cast<int>(suites) == 0 || static_cast<int>(suites) > TestLast)
|
||||
suites = Test::All;
|
||||
|
||||
// Unkeyed algorithms
|
||||
|
Loading…
x
Reference in New Issue
Block a user