[Botan-devel] Reducing Botan size

Felix Gartsman garisman at netvision.net.il
Tue Feb 20 13:31:53 EST 2007


Hello,
Thanks for the help.
I removed the X.509 stuff, but it didn't help much - apparently the linker
eliminated it.
Empty main - 40kb
Main with only LibraryInitializer - 490kb
Full encryption sample - 530kb
So the size issue is within the core stuff. Any ideas what code that
LibraryInitializer references can be removed?

> -----Original Message-----
> From: botan-devel-bounces at randombit.net [mailto:botan-devel-
> bounces at randombit.net] On Behalf Of Jack Lloyd
> Sent: Monday, February 19, 2007 8:29 PM
> To: Botan development list
> Subject: Re: [Botan-devel] Reducing Botan size
> 
> Hi,
> 
> This will be a bit harder than the ciphers, because the public keys
> interact with the ASN.1/BER portions of the code. First step is
> removing all the x509* code except x509_key.cpp, as well as:
> 
> pkcs10.{h,cpp}
> certstore.{h,cpp}
> crl_ent.{h,cpp}
> 
> [You can also probably drop some of the asn1_ files, like asn1_ku,
> asn1_alt, asn1_att, etc]
> 
> And then edit libstate.cpp and libstate.h and remove the declarations
> and definitions of set_x509_state and x509_state. That will dump the
> cert/CRL code which can take up a lot of size. Dropping the rest of
> the ASN.1 code would require heavy surgery.
> 
> Dropping public key algorithms can help a lot. Just edit pk_algs.cpp
> to remove the reference and then you can savely delete the sources
> (you can also save even more space by editing def_ops.cpp to remove
> the lowlevel operations, but that's a little more complex).
> 
> -Jack
> 
> On Sat, Feb 17, 2007 at 01:55:10PM +0200, Felix Gartsman wrote:
> > Hello,
> > I'm trying to reduce Botan size. First, I removed the patented stuff
> and
> > ciphers/hashes I doubt I'll need/use. Second, I played with compiler
> > switches (minimum size, etc). Now I want to remove the
> X.509/ASN.1/BER/PEM
> > stuff. Any pointers for best strategy to do this?
> >
> > Felix.
> >
> > _______________________________________________
> > botan-devel mailing list
> > botan-devel at randombit.net
> > http://www.randombit.net/mailman/listinfo/botan-devel
> _______________________________________________
> botan-devel mailing list
> botan-devel at randombit.net
> http://www.randombit.net/mailman/listinfo/botan-devel



More information about the botan-devel mailing list