[Botan-devel] New branch net.randombit.botan.modularized

Jack Lloyd lloyd at randombit.net
Sun Sep 28 15:45:02 EDT 2008


I've been hacking on a new branch this afternoon,
net.randombit.botan.modularized

The intent is
  a) Clean up the directory structure so things are easier to find
  b) Allow (cleanly) adding or removing algorithms at build time

So far I've modularized most of the cryptographic functions (except
for public key, due to a dependency on the engine code which I will
have to remove first). For example

$ ls src/cipher/ src/hash src/timer
src/cipher/:
aes/ blowfish/ des/ idea/ lion/ mars/ noekeon/ rc5/ safer/ seed/
skipjack/ tea/ twofish/ xtea/ arc4/ cast/ gost/ kasumi/ lubyrack/
misty1/ rc2/ rc6/ salsa20/ serpent/ square/ turing/ wid_wake/

src/hash:
fork256/ has160/ md2/ md4/ md5/ rmd128/ rmd160/ sha1/ sha1_sse2/ sha2/
tiger/ whirlpool/

src/timer:
cpu_counter/ gettimeofday/ posix_rt/ win32_query_perf_ctr/

(the contents of src/timer being previously modules/tm_*)

The X.509 code (certs, CA, CRLs PKCS #10) has also been all moved into
a new module x509.

(Though still a bunch of stuff remains in the 'core lib' of src/, and
as well there are some dependencies on the modules by the core lib
(for instance HMAC and AES)).

With only the most basic algorithms enabled Botan's binary is about
60% of the size of the default build. I expect this will drop further
once I mange to make the public key algorithms modular as well. One
can enable or disable say via

./configure.pl --modules=aes,hmac --no-modules=blowfish,rc5,x509

I'm definitely thinking about landing this on mainline relatively
shortly (eg before the next dev release), though there are still some
things to work out before that point. In particular enabling the
different SHA-1 implementations does not work right now, I need to fix
this. Also I need to get the dependencies correct for the core lib,
this should not be too difficult though in the long run.

Comments, review, etc most appreciated.

-Jack



More information about the botan-devel mailing list