[prev in list] [next in list] [prev in thread] [next in thread] 

List:       botan-devel
Subject:    [Botan-devel] Botan 1.7.21: Major engine/lookup changes,
From:       lloyd () randombit ! net (Jack Lloyd)
Date:       2008-11-11 22:53:45
Message-ID: 20081111225345.GA11940 () randombit ! net
[Download RAW message or body]


http://botan.randombit.net/

I've released Botan 1.7.21 today with many changes to the internals of
the algorithm lookup code. It is now possible to query Botan to find
out which providers are available for an algorithm, compare them using
a builtin microbenchmark system, and then get a copy of the fastest
implementation (or, I suppose, the slowest, if desired).

A usage example:

-- CUT --
void benchmark(const std::string& algo, double ms,
               Timer& timer, RandomNumberGenerator& rng,
               Algorithm_Factory& af)
   {
   std::map<std::string, double> results;

   results = algorithm_benchmark(algo, ms, timer, rng, af);

   std::cout << algo << ":\n";
   for(std::map<std::string, double>::iterator i = results.begin(); i != results.end(); ++i)
      std::cout << "  " << i->first << ": " << i->second << " MiB/s\n";
   std::cout << "\n";
   }

int main()
   {
   LibraryInitializer init;

   AutoSeeded_RNG rng;
   POSIX_Timer timer;

   // Get implementations using af.make_XXX
   Algorithm_Factory& af = global_state().algorithm_factory();

   double ms = 5000; // 5 seconds

   benchmark("Blowfish", ms, timer, rng, af);
   benchmark("TripleDES", ms, timer, rng, af);
   benchmark("SHA-1", ms, timer, rng, af);
   benchmark("MD5", ms, timer, rng, af);
   benchmark("ARC4", ms, timer, rng, af);
   benchmark("Turing", ms, timer, rng, af);
   }
-- CUT --

On my Core2 system, the output is:

Blowfish:
  core: 75.9035 MiB/s
  openssl: 69.9064 MiB/s

TripleDES:
  core: 19.1453 MiB/s
  openssl: 14.9059 MiB/s

SHA-1:
  amd64: 213.725 MiB/s
  core: 211.791 MiB/s
  openssl: 338.505 MiB/s
  sse2: 297.687 MiB/s

MD5:
  core: 352.486 MiB/s
  openssl: 407.909 MiB/s

ARC4:
  core: 147.408 MiB/s
  openssl: 126.832 MiB/s

Turing:
  core: 308.358 MiB/s

A few interesting points to note about this output. Firstly, Turing
reports a speed significantly higher than the regular benchmark output
(probably due to their being no filter overhead in the microbenchmark
code). On the downside, OpenSSL's RC4 runs here at less than half the
speed reported by `openssl speed rc4`, and attempting to use AES
through OpenSSL in the benchmark crashes somewhere inside OpenSSL, for
reasons I don't understand yet.

Another downside: currently the lookup code isn't smart enough to
figure out that for "HMAC(SHA-1)", you might want to use the asm or
OpenSSL code for SHA-1.

Things are inching along towards 1.8.0, and still on track I think for
a release this year (which means by about mid-December, given my
schedule). I think there will probably be a RC1 in early December (two
weeks!), followed by either a second release candiate or the actual
release a week or so later.

-Jack


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic