Fix benchmark selection code (GH #464)
parent
7851a0d510
commit
559fc3bd89
9
bench.h
9
bench.h
|
|
@ -16,13 +16,14 @@ NAMESPACE_BEGIN(Test)
|
||||||
|
|
||||||
// More granular control over benchmarks
|
// More granular control over benchmarks
|
||||||
enum TestClass {
|
enum TestClass {
|
||||||
UnkeyedRNG=1,UnkeyedHash=2,UnkeyedOther=4,
|
UnkeyedRNG=(1<<0),UnkeyedHash=(1<<1),UnkeyedOther=(1<<2),
|
||||||
SharedKeyMAC=8,SharedKeyStream=16,SharedKeyBlock=32,SharedKeyOther=64,
|
SharedKeyMAC=(1<<3),SharedKeyStream=(1<<4),SharedKeyBlock=(1<<5),SharedKeyOther=(1<<6),
|
||||||
PublicKeyAgreement=128,PublicKeyEncryption=256,PublicKeySignature=512,PublicKeyOther=1024,
|
PublicKeyAgreement=(1<<7),PublicKeyEncryption=(1<<8),PublicKeySignature=(1<<9),PublicKeyOther=(1<<10),
|
||||||
Unkeyed=UnkeyedRNG|UnkeyedHash|UnkeyedOther,
|
Unkeyed=UnkeyedRNG|UnkeyedHash|UnkeyedOther,
|
||||||
SharedKey=SharedKeyMAC|SharedKeyStream|SharedKeyBlock|SharedKeyOther,
|
SharedKey=SharedKeyMAC|SharedKeyStream|SharedKeyBlock|SharedKeyOther,
|
||||||
PublicKey=PublicKeyAgreement|PublicKeyEncryption|PublicKeySignature|PublicKeyOther,
|
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;
|
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);
|
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;
|
suites = Test::All;
|
||||||
|
|
||||||
// Unkeyed algorithms
|
// Unkeyed algorithms
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue