MCPcopy Create free account
hub / github.com/LUX-Core/lux / BenchMarkSigning

Function BenchMarkSigning

src/cryptopp/bench2.cpp:85–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85void BenchMarkSigning(const char *name, PK_Signer &key, double timeTotal, bool pc=false)
86{
87 unsigned int len = 16;
88 AlignedSecByteBlock message(len), signature(key.SignatureLength());
89 GlobalRNG().GenerateBlock(message, len);
90
91 const clock_t start = clock();
92 unsigned int i;
93 double timeTaken;
94 for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++)
95 key.SignMessage(GlobalRNG(), message, len, signature);
96
97 OutputResultOperations(name, "Signature", pc, i, timeTaken);
98
99 if (!pc && key.GetMaterial().SupportsPrecomputation())
100 {
101 key.AccessMaterial().Precompute(16);
102 BenchMarkSigning(name, key, timeTotal, true);
103 }
104}
105
106void BenchMarkVerification(const char *name, const PK_Signer &priv, PK_Verifier &pub, double timeTotal, bool pc=false)
107{

Callers 2

BenchMarkSignatureFunction · 0.85
BenchmarkAll2Function · 0.85

Calls 5

OutputResultOperationsFunction · 0.85
GenerateBlockMethod · 0.45
SignMessageMethod · 0.45
PrecomputeMethod · 0.45

Tested by

no test coverage detected