summaryrefslogtreecommitdiff
path: root/bench2.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-03-08 16:59:24 -0500
committerJeffrey Walton <noloader@gmail.com>2017-03-08 16:59:24 -0500
commitce38a411fc5324a2868da9fae890365d19a5757e (patch)
tree45c22de8a1f1312230b22c49805cb0a0cd65924d /bench2.cpp
parent2416c0eaf558060d93b8d9cc726c75f60cf28c5c (diff)
downloadcryptopp-git-ce38a411fc5324a2868da9fae890365d19a5757e.tar.gz
Add Random Number Generator benchmarks (Issue 386)
Move HTML header and footer into benchmark functions Switch to <cmath> and standard math routines Switch to <ctime> and standard clock and time routines Move static variable^Cinto anonymous namespace Add TimeToString function for printing start and end times
Diffstat (limited to 'bench2.cpp')
-rw-r--r--bench2.cpp214
1 files changed, 99 insertions, 115 deletions
diff --git a/bench2.cpp b/bench2.cpp
index f85d05e7..443f71b2 100644
--- a/bench2.cpp
+++ b/bench2.cpp
@@ -30,26 +30,20 @@
#include "oids.h"
#include "randpool.h"
-#include <time.h>
-#include <math.h>
-#include <iostream>
-#include <iomanip>
-
NAMESPACE_BEGIN(CryptoPP)
NAMESPACE_BEGIN(Test)
-void OutputResultOperations(const char *name, const char *operation, bool pc, unsigned long iterations, double timeTaken);
-
void BenchMarkEncryption(const char *name, PK_Encryptor &key, double timeTotal, bool pc=false)
{
unsigned int len = 16;
SecByteBlock plaintext(len), ciphertext(key.CiphertextLength(len));
Test::GlobalRNG().GenerateBlock(plaintext, len);
- const clock_t start = clock();
unsigned int i;
double timeTaken;
- for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++)
+
+ const clock_t start = ::clock();
+ for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(::clock() - start) / CLOCK_TICKS_PER_SECOND, i++)
key.Encrypt(Test::GlobalRNG(), plaintext, len, ciphertext);
OutputResultOperations(name, "Encryption", pc, i, timeTaken);
@@ -69,10 +63,11 @@ void BenchMarkDecryption(const char *name, PK_Decryptor &priv, PK_Encryptor &pub
Test::GlobalRNG().GenerateBlock(plaintext, len);
pub.Encrypt(Test::GlobalRNG(), plaintext, len, ciphertext);
- const clock_t start = clock();
unsigned int i;
double timeTaken;
- for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++)
+
+ const clock_t start = ::clock();
+ for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(::clock() - start) / CLOCK_TICKS_PER_SECOND, i++)
priv.Decrypt(Test::GlobalRNG(), ciphertext, ciphertext.size(), plaintext);
OutputResultOperations(name, "Decryption", false, i, timeTaken);
@@ -84,11 +79,12 @@ void BenchMarkSigning(const char *name, PK_Signer &key, double timeTotal, bool p
AlignedSecByteBlock message(len), signature(key.SignatureLength());
Test::GlobalRNG().GenerateBlock(message, len);
- const clock_t start = clock();
unsigned int i;
double timeTaken;
- for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++)
- key.SignMessage(Test::GlobalRNG(), message, len, signature);
+
+ const clock_t start = ::clock();
+ for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(::clock() - start) / CLOCK_TICKS_PER_SECOND, i++)
+ (void)key.SignMessage(Test::GlobalRNG(), message, len, signature);
OutputResultOperations(name, "Signature", pc, i, timeTaken);
@@ -106,15 +102,12 @@ void BenchMarkVerification(const char *name, const PK_Signer &priv, PK_Verifier
Test::GlobalRNG().GenerateBlock(message, len);
priv.SignMessage(Test::GlobalRNG(), message, len, signature);
- const clock_t start = clock();
unsigned int i;
double timeTaken;
- for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++)
- {
- // The return value is ignored because we are interested in throughput
- bool unused = pub.VerifyMessage(message, len, signature, signature.size());
- CRYPTOPP_UNUSED(unused);
- }
+
+ const clock_t start = ::clock();
+ for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(::clock() - start) / CLOCK_TICKS_PER_SECOND, i++)
+ (void)pub.VerifyMessage(message, len, signature, signature.size());
OutputResultOperations(name, "Verification", pc, i, timeTaken);
@@ -129,10 +122,11 @@ void BenchMarkKeyGen(const char *name, SimpleKeyAgreementDomain &d, double timeT
{
SecByteBlock priv(d.PrivateKeyLength()), pub(d.PublicKeyLength());
- const clock_t start = clock();
unsigned int i;
double timeTaken;
- for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++)
+
+ const clock_t start = ::clock();
+ for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(::clock() - start) / CLOCK_TICKS_PER_SECOND, i++)
d.GenerateKeyPair(Test::GlobalRNG(), priv, pub);
OutputResultOperations(name, "Key-Pair Generation", pc, i, timeTaken);
@@ -148,10 +142,11 @@ void BenchMarkKeyGen(const char *name, AuthenticatedKeyAgreementDomain &d, doubl
{
SecByteBlock priv(d.EphemeralPrivateKeyLength()), pub(d.EphemeralPublicKeyLength());
- const clock_t start = clock();
unsigned int i;
double timeTaken;
- for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i++)
+
+ const clock_t start = ::clock();
+ for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(::clock() - start) / CLOCK_TICKS_PER_SECOND, i++)
d.GenerateEphemeralKeyPair(Test::GlobalRNG(), priv, pub);
OutputResultOperations(name, "Key-Pair Generation", pc, i, timeTaken);
@@ -171,10 +166,11 @@ void BenchMarkAgreement(const char *name, SimpleKeyAgreementDomain &d, double ti
d.GenerateKeyPair(Test::GlobalRNG(), priv2, pub2);
SecByteBlock val(d.AgreedValueLength());
- const clock_t start = clock();
unsigned int i;
double timeTaken;
- for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i+=2)
+
+ const clock_t start = ::clock();
+ for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(::clock() - start) / CLOCK_TICKS_PER_SECOND, i+=2)
{
d.Agree(val, priv1, pub2);
d.Agree(val, priv2, pub1);
@@ -195,35 +191,11 @@ void BenchMarkAgreement(const char *name, AuthenticatedKeyAgreementDomain &d, do
d.GenerateEphemeralKeyPair(Test::GlobalRNG(), epriv2, epub2);
SecByteBlock val(d.AgreedValueLength());
- const clock_t start = clock();
unsigned int i;
double timeTaken;
- for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i+=2)
- {
- d.Agree(val, spriv1, epriv1, spub2, epub2);
- d.Agree(val, spriv2, epriv2, spub1, epub1);
- }
-
- OutputResultOperations(name, "Key Agreement", pc, i, timeTaken);
-}
-
-#if 0
-void BenchMarkAgreement(const char *name, AuthenticatedKeyAgreementDomainWithRoles &d, double timeTotal, bool pc=false)
-{
- SecByteBlock spriv1(d.StaticPrivateKeyLength()), spriv2(d.StaticPrivateKeyLength());
- SecByteBlock epriv1(d.EphemeralPrivateKeyLength()), epriv2(d.EphemeralPrivateKeyLength());
- SecByteBlock spub1(d.StaticPublicKeyLength()), spub2(d.StaticPublicKeyLength());
- SecByteBlock epub1(d.EphemeralPublicKeyLength()), epub2(d.EphemeralPublicKeyLength());
- d.GenerateStaticKeyPair(Test::GlobalRNG(), spriv1, spub1);
- d.GenerateStaticKeyPair(Test::GlobalRNG(), spriv2, spub2);
- d.GenerateEphemeralKeyPair(Test::GlobalRNG(), epriv1, epub1);
- d.GenerateEphemeralKeyPair(Test::GlobalRNG(), epriv2, epub2);
- SecByteBlock val(d.AgreedValueLength());
- const clock_t start = clock();
- unsigned int i;
- double timeTaken;
- for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(clock() - start) / CLOCK_TICKS_PER_SECOND, i+=2)
+ const clock_t start = ::clock();
+ for (timeTaken=(double)0, i=0; timeTaken < timeTotal; timeTaken = double(::clock() - start) / CLOCK_TICKS_PER_SECOND, i+=2)
{
d.Agree(val, spriv1, epriv1, spub2, epub2);
d.Agree(val, spriv2, epriv2, spub1, epub1);
@@ -231,12 +203,11 @@ void BenchMarkAgreement(const char *name, AuthenticatedKeyAgreementDomainWithRol
OutputResultOperations(name, "Key Agreement", pc, i, timeTaken);
}
-#endif
template <class SCHEME>
void BenchMarkCrypto(const char *filename, const char *name, double timeTotal)
{
- FileSource f(filename, true, new HexDecoder());
+ FileSource f(filename, true, new HexDecoder);
typename SCHEME::Decryptor priv(f);
typename SCHEME::Encryptor pub(priv);
BenchMarkEncryption(name, pub, timeTotal);
@@ -246,7 +217,7 @@ void BenchMarkCrypto(const char *filename, const char *name, double timeTotal)
template <class SCHEME>
void BenchMarkSignature(const char *filename, const char *name, double timeTotal)
{
- FileSource f(filename, true, new HexDecoder());
+ FileSource f(filename, true, new HexDecoder);
typename SCHEME::Signer priv(f);
typename SCHEME::Verifier pub(priv);
BenchMarkSigning(name, priv, timeTotal);
@@ -256,74 +227,86 @@ void BenchMarkSignature(const char *filename, const char *name, double timeTotal
template <class D>
void BenchMarkKeyAgreement(const char *filename, const char *name, double timeTotal)
{
- FileSource f(filename, true, new HexDecoder());
+ FileSource f(filename, true, new HexDecoder);
D d(f);
BenchMarkKeyGen(name, d, timeTotal);
BenchMarkAgreement(name, d, timeTotal);
}
-extern double g_hertz;
-
-void BenchmarkAll2(double t, double hertz)
+void Benchmark3(double t, double hertz)
{
+ g_allocatedTime = t;
g_hertz = hertz;
- std::cout << "<TABLE border=1><COLGROUP><COL align=left><COL align=right><COL align=right>" << std::endl;
- std::cout << "<THEAD><TR><TH>Operation<TH>Milliseconds/Operation" << (g_hertz ? "<TH>Megacycles/Operation" : "") << std::endl;
-
- std::cout << "\n<TBODY style=\"background: yellow\">";
- BenchMarkCrypto<RSAES<OAEP<SHA> > >(CRYPTOPP_DATA_DIR "TestData/rsa1024.dat", "RSA 1024", t);
- BenchMarkCrypto<LUCES<OAEP<SHA> > >(CRYPTOPP_DATA_DIR "TestData/luc1024.dat", "LUC 1024", t);
- BenchMarkCrypto<DLIES<> >(CRYPTOPP_DATA_DIR "TestData/dlie1024.dat", "DLIES 1024", t);
- BenchMarkCrypto<LUC_IES<> >(CRYPTOPP_DATA_DIR "TestData/lucc512.dat", "LUCELG 512", t);
-
- std::cout << "\n<TBODY style=\"background: white\">";
- BenchMarkCrypto<RSAES<OAEP<SHA> > >(CRYPTOPP_DATA_DIR "TestData/rsa2048.dat", "RSA 2048", t);
- BenchMarkCrypto<LUCES<OAEP<SHA> > >(CRYPTOPP_DATA_DIR "TestData/luc2048.dat", "LUC 2048", t);
- BenchMarkCrypto<DLIES<> >(CRYPTOPP_DATA_DIR "TestData/dlie2048.dat", "DLIES 2048", t);
- BenchMarkCrypto<LUC_IES<> >(CRYPTOPP_DATA_DIR "TestData/lucc1024.dat", "LUCELG 1024", t);
-
- std::cout << "\n<TBODY style=\"background: yellow\">";
- BenchMarkSignature<RSASS<PSSR, SHA> >(CRYPTOPP_DATA_DIR "TestData/rsa1024.dat", "RSA 1024", t);
- BenchMarkSignature<RWSS<PSSR, SHA> >(CRYPTOPP_DATA_DIR "TestData/rw1024.dat", "RW 1024", t);
- BenchMarkSignature<LUCSS<PSSR, SHA> >(CRYPTOPP_DATA_DIR "TestData/luc1024.dat", "LUC 1024", t);
- BenchMarkSignature<NR<SHA> >(CRYPTOPP_DATA_DIR "TestData/nr1024.dat", "NR 1024", t);
- BenchMarkSignature<DSA>(CRYPTOPP_DATA_DIR "TestData/dsa1024.dat", "DSA 1024", t);
- BenchMarkSignature<LUC_HMP<SHA> >(CRYPTOPP_DATA_DIR "TestData/lucs512.dat", "LUC-HMP 512", t);
- BenchMarkSignature<ESIGN<SHA> >(CRYPTOPP_DATA_DIR "TestData/esig1023.dat", "ESIGN 1023", t);
- BenchMarkSignature<ESIGN<SHA> >(CRYPTOPP_DATA_DIR "TestData/esig1536.dat", "ESIGN 1536", t);
-
- std::cout << "\n<TBODY style=\"background: white\">";
- BenchMarkSignature<RSASS<PSSR, SHA> >(CRYPTOPP_DATA_DIR "TestData/rsa2048.dat", "RSA 2048", t);
- BenchMarkSignature<RWSS<PSSR, SHA> >(CRYPTOPP_DATA_DIR "TestData/rw2048.dat", "RW 2048", t);
- BenchMarkSignature<LUCSS<PSSR, SHA> >(CRYPTOPP_DATA_DIR "TestData/luc2048.dat", "LUC 2048", t);
- BenchMarkSignature<NR<SHA> >(CRYPTOPP_DATA_DIR "TestData/nr2048.dat", "NR 2048", t);
- BenchMarkSignature<LUC_HMP<SHA> >(CRYPTOPP_DATA_DIR "TestData/lucs1024.dat", "LUC-HMP 1024", t);
- BenchMarkSignature<ESIGN<SHA> >(CRYPTOPP_DATA_DIR "TestData/esig2046.dat", "ESIGN 2046", t);
-
- std::cout << "\n<TBODY style=\"background: yellow\">";
- BenchMarkKeyAgreement<XTR_DH>(CRYPTOPP_DATA_DIR "TestData/xtrdh171.dat", "XTR-DH 171", t);
- BenchMarkKeyAgreement<XTR_DH>(CRYPTOPP_DATA_DIR "TestData/xtrdh342.dat", "XTR-DH 342", t);
- BenchMarkKeyAgreement<DH>(CRYPTOPP_DATA_DIR "TestData/dh1024.dat", "DH 1024", t);
- BenchMarkKeyAgreement<DH>(CRYPTOPP_DATA_DIR "TestData/dh2048.dat", "DH 2048", t);
- BenchMarkKeyAgreement<LUC_DH>(CRYPTOPP_DATA_DIR "TestData/lucd512.dat", "LUCDIF 512", t);
- BenchMarkKeyAgreement<LUC_DH>(CRYPTOPP_DATA_DIR "TestData/lucd1024.dat", "LUCDIF 1024", t);
- BenchMarkKeyAgreement<MQV>(CRYPTOPP_DATA_DIR "TestData/mqv1024.dat", "MQV 1024", t);
- BenchMarkKeyAgreement<MQV>(CRYPTOPP_DATA_DIR "TestData/mqv2048.dat", "MQV 2048", t);
+ std::cout << "\n<TABLE style=\"border:1px solid\">";
+ std::cout << "\n<COLGROUP><COL style=\"text-align: left;\"><COL style=";
+ std::cout << "\"text-align: right;\"><COL style=\"text-align: right;\">";
+ std::cout << "\n<THEAD style=\"background: #F0F0F0\"><TR><TH>Operation<TH>Milliseconds/Operation";
+ std::cout << (g_hertz > 1.0f ? "<TH>Megacycles/Operation" : "") << std::endl;
+
+ std::cout << "\n<TBODY style=\"background: white;\">";
+ {
+ BenchMarkCrypto<RSAES<OAEP<SHA> > >(CRYPTOPP_DATA_DIR "TestData/rsa1024.dat", "RSA 1024", t);
+ BenchMarkCrypto<LUCES<OAEP<SHA> > >(CRYPTOPP_DATA_DIR "TestData/luc1024.dat", "LUC 1024", t);
+ BenchMarkCrypto<DLIES<> >(CRYPTOPP_DATA_DIR "TestData/dlie1024.dat", "DLIES 1024", t);
+ BenchMarkCrypto<LUC_IES<> >(CRYPTOPP_DATA_DIR "TestData/lucc512.dat", "LUCELG 512", t);
+ }
+
+ std::cout << "\n<TBODY style=\"background: yellow;\">";
+ {
+ BenchMarkCrypto<RSAES<OAEP<SHA> > >(CRYPTOPP_DATA_DIR "TestData/rsa2048.dat", "RSA 2048", t);
+ BenchMarkCrypto<LUCES<OAEP<SHA> > >(CRYPTOPP_DATA_DIR "TestData/luc2048.dat", "LUC 2048", t);
+ BenchMarkCrypto<DLIES<> >(CRYPTOPP_DATA_DIR "TestData/dlie2048.dat", "DLIES 2048", t);
+ BenchMarkCrypto<LUC_IES<> >(CRYPTOPP_DATA_DIR "TestData/lucc1024.dat", "LUCELG 1024", t);
+ }
+
+ std::cout << "\n<TBODY style=\"background: white;\">";
+ {
+ BenchMarkSignature<RSASS<PSSR, SHA> >(CRYPTOPP_DATA_DIR "TestData/rsa1024.dat", "RSA 1024", t);
+ BenchMarkSignature<RWSS<PSSR, SHA> >(CRYPTOPP_DATA_DIR "TestData/rw1024.dat", "RW 1024", t);
+ BenchMarkSignature<LUCSS<PSSR, SHA> >(CRYPTOPP_DATA_DIR "TestData/luc1024.dat", "LUC 1024", t);
+ BenchMarkSignature<NR<SHA> >(CRYPTOPP_DATA_DIR "TestData/nr1024.dat", "NR 1024", t);
+ BenchMarkSignature<DSA>(CRYPTOPP_DATA_DIR "TestData/dsa1024.dat", "DSA 1024", t);
+ BenchMarkSignature<LUC_HMP<SHA> >(CRYPTOPP_DATA_DIR "TestData/lucs512.dat", "LUC-HMP 512", t);
+ BenchMarkSignature<ESIGN<SHA> >(CRYPTOPP_DATA_DIR "TestData/esig1023.dat", "ESIGN 1023", t);
+ BenchMarkSignature<ESIGN<SHA> >(CRYPTOPP_DATA_DIR "TestData/esig1536.dat", "ESIGN 1536", t);
+ }
+
+ std::cout << "\n<TBODY style=\"background: yellow;\">";
+ {
+ BenchMarkSignature<RSASS<PSSR, SHA> >(CRYPTOPP_DATA_DIR "TestData/rsa2048.dat", "RSA 2048", t);
+ BenchMarkSignature<RWSS<PSSR, SHA> >(CRYPTOPP_DATA_DIR "TestData/rw2048.dat", "RW 2048", t);
+ BenchMarkSignature<LUCSS<PSSR, SHA> >(CRYPTOPP_DATA_DIR "TestData/luc2048.dat", "LUC 2048", t);
+ BenchMarkSignature<NR<SHA> >(CRYPTOPP_DATA_DIR "TestData/nr2048.dat", "NR 2048", t);
+ BenchMarkSignature<LUC_HMP<SHA> >(CRYPTOPP_DATA_DIR "TestData/lucs1024.dat", "LUC-HMP 1024", t);
+ BenchMarkSignature<ESIGN<SHA> >(CRYPTOPP_DATA_DIR "TestData/esig2046.dat", "ESIGN 2046", t);
+ }
+
+ std::cout << "\n<TBODY style=\"background: white;\">";
+ {
+ BenchMarkKeyAgreement<XTR_DH>(CRYPTOPP_DATA_DIR "TestData/xtrdh171.dat", "XTR-DH 171", t);
+ BenchMarkKeyAgreement<XTR_DH>(CRYPTOPP_DATA_DIR "TestData/xtrdh342.dat", "XTR-DH 342", t);
+ BenchMarkKeyAgreement<DH>(CRYPTOPP_DATA_DIR "TestData/dh1024.dat", "DH 1024", t);
+ BenchMarkKeyAgreement<DH>(CRYPTOPP_DATA_DIR "TestData/dh2048.dat", "DH 2048", t);
+ BenchMarkKeyAgreement<LUC_DH>(CRYPTOPP_DATA_DIR "TestData/lucd512.dat", "LUCDIF 512", t);
+ BenchMarkKeyAgreement<LUC_DH>(CRYPTOPP_DATA_DIR "TestData/lucd1024.dat", "LUCDIF 1024", t);
+ BenchMarkKeyAgreement<MQV>(CRYPTOPP_DATA_DIR "TestData/mqv1024.dat", "MQV 1024", t);
+ BenchMarkKeyAgreement<MQV>(CRYPTOPP_DATA_DIR "TestData/mqv2048.dat", "MQV 2048", t);
#if 0
- BenchMarkKeyAgreement<ECHMQV160>(CRYPTOPP_DATA_DIR "TestData/hmqv160.dat", "HMQV P-160", t);
- BenchMarkKeyAgreement<ECHMQV256>(CRYPTOPP_DATA_DIR "TestData/hmqv256.dat", "HMQV P-256", t);
- BenchMarkKeyAgreement<ECHMQV384>(CRYPTOPP_DATA_DIR "TestData/hmqv384.dat", "HMQV P-384", t);
- BenchMarkKeyAgreement<ECHMQV512>(CRYPTOPP_DATA_DIR "TestData/hmqv512.dat", "HMQV P-512", t);
-
- BenchMarkKeyAgreement<ECFHMQV160>(CRYPTOPP_DATA_DIR "TestData/fhmqv160.dat", "FHMQV P-160", t);
- BenchMarkKeyAgreement<ECFHMQV256>(CRYPTOPP_DATA_DIR "TestData/fhmqv256.dat", "FHMQV P-256", t);
- BenchMarkKeyAgreement<ECFHMQV384>(CRYPTOPP_DATA_DIR "TestData/fhmqv384.dat", "FHMQV P-384", t);
- BenchMarkKeyAgreement<ECFHMQV512>(CRYPTOPP_DATA_DIR "TestData/fhmqv512.dat", "FHMQV P-512", t);
+ BenchMarkKeyAgreement<ECHMQV160>(CRYPTOPP_DATA_DIR "TestData/hmqv160.dat", "HMQV P-160", t);
+ BenchMarkKeyAgreement<ECHMQV256>(CRYPTOPP_DATA_DIR "TestData/hmqv256.dat", "HMQV P-256", t);
+ BenchMarkKeyAgreement<ECHMQV384>(CRYPTOPP_DATA_DIR "TestData/hmqv384.dat", "HMQV P-384", t);
+ BenchMarkKeyAgreement<ECHMQV512>(CRYPTOPP_DATA_DIR "TestData/hmqv512.dat", "HMQV P-512", t);
+
+ BenchMarkKeyAgreement<ECFHMQV160>(CRYPTOPP_DATA_DIR "TestData/fhmqv160.dat", "FHMQV P-160", t);
+ BenchMarkKeyAgreement<ECFHMQV256>(CRYPTOPP_DATA_DIR "TestData/fhmqv256.dat", "FHMQV P-256", t);
+ BenchMarkKeyAgreement<ECFHMQV384>(CRYPTOPP_DATA_DIR "TestData/fhmqv384.dat", "FHMQV P-384", t);
+ BenchMarkKeyAgreement<ECFHMQV512>(CRYPTOPP_DATA_DIR "TestData/fhmqv512.dat", "FHMQV P-512", t);
#endif
+ }
- std::cout << "\n<TBODY style=\"background: white\">";
+ std::cout << "\n<TBODY style=\"background: yellow;\">";
{
ECIES<ECP>::Decryptor cpriv(Test::GlobalRNG(), ASN1::secp256k1());
ECIES<ECP>::Encryptor cpub(cpriv);
@@ -350,7 +333,7 @@ void BenchmarkAll2(double t, double hertz)
BenchMarkAgreement("ECMQVC over GF(p) 256", ecmqvc, t);
}
- std::cout << "<TBODY style=\"background: yellow\">" << std::endl;
+ std::cout << "\n<TBODY style=\"background: white;\">";
{
ECIES<EC2N>::Decryptor cpriv(Test::GlobalRNG(), ASN1::sect233r1());
ECIES<EC2N>::Encryptor cpub(cpriv);
@@ -376,8 +359,9 @@ void BenchmarkAll2(double t, double hertz)
BenchMarkKeyGen("ECMQVC over GF(2^n) 233", ecmqvc, t);
BenchMarkAgreement("ECMQVC over GF(2^n) 233", ecmqvc, t);
}
- std::cout << "</TABLE>" << std::endl;
+
+ std::cout << "\n</TABLE>" << std::endl;
}
NAMESPACE_END // Test
-NAMESPACE_END // CryptoPP \ No newline at end of file
+NAMESPACE_END // CryptoPP