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

Jack Lloyd lloyd at randombit.net
Tue Sep 30 12:41:37 EDT 2008

On Sun, Sep 28, 2008 at 09:58:53PM -0400, Jack Lloyd wrote:
> I'm at the point now where I'm definitely feeling this branch is (if
> still a bit buggy/disorganized/incomplete compared to where I want it)
> a vast improvment over the old completely flat src + include
> directories. It makes it much more clear what depends on what, and
> allows much better control over what gets built (though disabling big
> things like the filter system doesn't work quite right yet, it is not
> handling disabling all the dependencies properly at the moment).

And now ~45 hours and 165 checkins to the branch later, I'm feeling
like it is at the least handling everything configure.pl does on
mainline (for a while asm for BigInt was not working, but that started
working late last night) and is a much better organization than before
(hard to get much worse).

There is certainly additional work along these lines, mostly with
regards to removing dependencies and generally decoupling modules from
each other (for instance right now, though you can disable
Nyberg-Rueppel or Rabin-Williams, about half the code needed for these
algorithms will still get built due to dependencies by other code).
However it is overall pretty nice.

Binary sizes for Botan shared object (libbotan-1.7.14.so) compiled on
my Core2 (Linux/2.6, GCC 4.3.1), sizes using du -k:

Configured with default modules:

1696 -Os stripped
1988 -Os
2268 -O2 stripped
2552 -O2

Configured with SHA, AES, DSA, RSA, and a few other things but most algorithms removed using

configure.pl --no-module=arc4,blowfish,cast,gost,idea,kasumi,lion,lubyrack,mars,misty1,noekeon,rc2,rc5,rc6,safer,salsa20,seed,serpent,skipjack,square,tea,turing,twofish,wid_wake,xtea,fork256,has160,md2,md4,md5,par_hash,rmd128,rmd160,tiger,whirlpool,cbc_mac,ssl3mac,x919_mac,openpgp,emsa2,adler32,crc24,crc32,pbes1,pbes2,cfb,cts,eax,ofb,tlsv1,sslv3,x942,pgps2k,pbkdf1,eme_pkcs,dlies,cbc,ctr,ecb,selftest,emsa_raw,des,egd,proc_walk,unix_procs,gettimeofday,posix_rt,cpu_counter,x931_rng,sha1_sse2,sha1_amd64,cmac,elgamal,nr,rw,cms,alloc_mmap,x509

904 -Os stripped
1076 -Os
1248 -O2 stripped
1416 -O2

It is not yet possible to disable the public key code entirely, but it
will be a goal going forward since that might be useful in some
contexts (and generally speaking, decoupling different parts of the
library seems a good move - that is one thing this branch has made
much easier, since it is easier to logically group code when it can
also be physically grouped into directories - yet another case of
limitations of the tools limiting the thoughts one has).

I have only recieved one comment on the branch, which was offlist and
positive. In the absence of other commentary I'm probably going to
merge it to mainline and do a release later. Current branch head has
been tested with GCC on Windows/x86, Linux/x86-64, and Linux/ppc64,
Intel C++ on Linux/x86-64, and Visual C++ 2008 on Windows/x86.

Note that configure.pl now uses the perl5 File::Find module. AFAIK
that has been included since 5.0, but I have only tested the build
with Perl v5.8 and 5.10.


More information about the botan-devel mailing list