summaryrefslogtreecommitdiff
path: root/bench2.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2016-07-14 17:30:37 -0400
committerJeffrey Walton <noloader@gmail.com>2016-07-14 17:30:37 -0400
commit168c6250de3d8721d92c3d27308b8aff770d989b (patch)
tree88170f409fbb1d06b0fe1442ec7bd44dae8f20bb /bench2.cpp
parent2983211dab952435b29cccb9cfe943b1be1aa8c2 (diff)
downloadcryptopp-git-168c6250de3d8721d92c3d27308b8aff770d989b.tar.gz
Stub-out BenchMarkAgreement for HMQV and FHMQV benchmarks
Diffstat (limited to 'bench2.cpp')
-rw-r--r--bench2.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/bench2.cpp b/bench2.cpp
index 6f80f222..60bc9f9b 100644
--- a/bench2.cpp
+++ b/bench2.cpp
@@ -211,6 +211,32 @@ void BenchMarkAgreement(const char *name, AuthenticatedKeyAgreementDomain &d, do
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(GlobalRNG(), spriv1, spub1);
+ d.GenerateStaticKeyPair(GlobalRNG(), spriv2, spub2);
+ d.GenerateEphemeralKeyPair(GlobalRNG(), epriv1, epub1);
+ d.GenerateEphemeralKeyPair(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);
+}
+#endif
+
//VC60 workaround: compiler bug triggered without the extra dummy parameters
template <class SCHEME>
void BenchMarkCrypto(const char *filename, const char *name, double timeTotal, SCHEME *x=NULL)