speedtest_SOURCES = \
base32.cc \
base64.cc base64.hh \
+ dnssecinfra.cc dnssecinfra.hh \
dnslabeltext.cc \
dnsname.cc dnsname.hh \
dnsparser.cc dnsparser.hh \
if PKCS11
testrunner_SOURCES += pkcs11signers.cc pkcs11signers.hh
testrunner_LDADD += $(P11KIT1_LIBS)
+speedtest_SOURCES += pkcs11signers.cc pkcs11signers.hh
+speedtest_LDADD += $(P11KIT1_LIBS)
endif
if LIBSODIUM
#include "iputils.hh"
#include <fstream>
#include "uuid-utils.hh"
+#include "dnssecinfra.hh"
#ifndef RECURSOR
#include "statbag.hh"
}
};
+struct NSEC3HashTest
+{
+ explicit NSEC3HashTest(int iterations, string salt) : d_iterations(iterations), d_salt(salt) {}
+
+ string getName() const
+ {
+ return (boost::format("%d NSEC3 iterations, salt length %d") % d_iterations % d_salt.length()).str();
+ }
+
+ void operator()() const
+ {
+ hashQNameWithSalt(d_salt, d_iterations, d_name);
+ }
+ int d_iterations;
+ string d_salt;
+ DNSName d_name = DNSName("www.example.com");
+};
+
int main(int argc, char** argv)
try
{
doRun(UUIDGenTest());
+ doRun(NSEC3HashTest(1, "ABCD"));
+ doRun(NSEC3HashTest(10, "ABCD"));
+ doRun(NSEC3HashTest(50, "ABCD"));
+ doRun(NSEC3HashTest(150, "ABCD"));
+ doRun(NSEC3HashTest(500, "ABCD"));
+
+ doRun(NSEC3HashTest(1, "ABCDABCDABCDABCDABCDABCDABCDABCD"));
+ doRun(NSEC3HashTest(10, "ABCDABCDABCDABCDABCDABCDABCDABCD"));
+ doRun(NSEC3HashTest(50, "ABCDABCDABCDABCDABCDABCDABCDABCD"));
+ doRun(NSEC3HashTest(150, "ABCDABCDABCDABCDABCDABCDABCDABCD"));
+ doRun(NSEC3HashTest(500, "ABCDABCDABCDABCDABCDABCDABCDABCD"));
+
#ifndef RECURSOR
S.doRings();