From e553818e00684e8905ede16e53aa490c153b7e7a Mon Sep 17 00:00:00 2001 From: weidai Date: Sat, 9 Dec 2006 17:18:13 +0000 Subject: add Salsa20 cipher git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@247 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- bench.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'bench.cpp') diff --git a/bench.cpp b/bench.cpp index 6ba5431..b1017c1 100644 --- a/bench.cpp +++ b/bench.cpp @@ -49,6 +49,7 @@ #include "mdc.h" #include "lubyrack.h" #include "tea.h" +#include "salsa.h" #include #include @@ -184,19 +185,19 @@ void BenchMark(const char *name, BufferedTransformation &bt, double timeTotal) //VC60 workaround: compiler bug triggered without the extra dummy parameters template -void BenchMarkKeyed(const char *name, double timeTotal, T *x=NULL) +void BenchMarkKeyed(const char *name, double timeTotal, const NameValuePairs ¶ms = g_nullNameValuePairs, T *x=NULL) { T c; - c.SetKey(key, c.DefaultKeyLength(), MakeParameters(Name::IV(), key, false)); + c.SetKey(key, c.DefaultKeyLength(), CombinedNameValuePairs(params, MakeParameters(Name::IV(), key, false))); BenchMark(name, c, timeTotal); } //VC60 workaround: compiler bug triggered without the extra dummy parameters template -void BenchMarkKeyedVariable(const char *name, double timeTotal, unsigned int keyLength, T *x=NULL) +void BenchMarkKeyedVariable(const char *name, double timeTotal, unsigned int keyLength, const NameValuePairs ¶ms = g_nullNameValuePairs, T *x=NULL) { T c; - c.SetKey(key, keyLength, MakeParameters(Name::IV(), key, false)); + c.SetKey(key, keyLength, CombinedNameValuePairs(params, MakeParameters(Name::IV(), key, false))); BenchMark(name, c, timeTotal); } @@ -287,6 +288,10 @@ void BenchmarkAll(double t) BenchMarkKeyedVariable("Camellia (128-bit key)", t, 16); BenchMarkKeyedVariable("Camellia (256-bit key)", t, 32); #endif + BenchMarkKeyed("Salsa20", t); + BenchMarkKeyed("Salsa20/12", t, MakeParameters(Name::Rounds(), 12)); + BenchMarkKeyed("Salsa20/8", t, MakeParameters(Name::Rounds(), 8)); + BenchMarkKeyed("MD5-MAC", t); BenchMarkKeyed >("XMACC/MD5", t); BenchMarkKeyed >("HMAC/MD5", t); -- cgit v1.2.1