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

Function BenchMarkDecryption

src/cryptopp/bench2.cpp:68–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68void BenchMarkDecryption(const char *name, PK_Decryptor &priv, PK_Encryptor &pub, double timeTotal)
69{
70 unsigned int len = 16;
71 SecByteBlock ciphertext(pub.CiphertextLength(len));
72 SecByteBlock plaintext(pub.MaxPlaintextLength(ciphertext.size()));
73 GlobalRNG().GenerateBlock(plaintext, len);
74 pub.Encrypt(GlobalRNG(), plaintext, len, ciphertext);
75
76 const clock_t start = clock();
77 unsigned int i;
78 double timeTaken;
79 for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++)
80 priv.Decrypt(GlobalRNG(), ciphertext, ciphertext.size(), plaintext);
81
82 OutputResultOperations(name, "Decryption", false, i, timeTaken);
83}
84
85void BenchMarkSigning(const char *name, PK_Signer &key, double timeTotal, bool pc=false)
86{

Callers 2

BenchMarkCryptoFunction · 0.85
BenchmarkAll2Function · 0.85

Calls 5

OutputResultOperationsFunction · 0.85
sizeMethod · 0.45
GenerateBlockMethod · 0.45
EncryptMethod · 0.45
DecryptMethod · 0.45

Tested by

no test coverage detected