On 11/20/2012 3:40 PM, jeetendra gangele wrote:
Hi,
I need to use only AES,SHA-2,EC-DH,EC-DSA.
I configure for only those ciphertext and compile the code still I am
getting 3.3MB library.
How can I minimize it?.
When I build with all the ciphertext enable that time also I am
getting 3.3 MB size.
Please guide me How can i minimize the size since I need only selected
algorithms.
Are you sure you want to reduce the size of the ".a" file?
Since an ".a" file is a collection or ".o" files only some of which will
be included in any given program, it is usually more interesting to reduce
the amount of unused code ending up in your (real or sample) program.
What I generally do is to find a linker option which will tell me which
.o files got included, how much the contribute to the size of the program
and (for better linkers) why those .o files were included. Then start
looking for ways to
1. Avoid .o files which are not really used (but the linker thinks so
because of a badly placed reference in a really used .o file)
2. Avoid large .o files where only a small portion of that .o file is
needed (the rest is linked in only because someone put it in the same
.c file as the needed stuff)
I have found that libcrypt is particularly bad in both areas:
1. Many common or required functions contain code such as
if (ourObject->somepointer) /* Rarely true */
SomeOtherObject_Free(ourObject->somepointer);
Or even worse
pAlg = SearchTableBySomeId(n); // Pulls in all the algs in table
2. Functions pulled in by logic such as the first bad example above are
often in the same .o file as the full implementation of all
functionality and needs of "SomeOtherObject", which tends to be much
more than what is needed by the (really unused) _Free(ptr) method.
A lot of the bloat in libcrypt.a comes from the ASN.1 object handling
code, from functions that take an algorithm or object id rather than
a pointer to an algorithm/type descriptor, and from functions that
are coded to fallback to some specific method if NULL is passed in
(thus forcing the fallback to be linked in even if never called with
NULL).
My own attempts to reduce this were not as successful as I had hoped.
Enjoy
Jakob
--
Jakob Bohm, CIO, Partner, WiseMo A/S. http://www.wisemo.com
Transformervej 29, 2730 Herlev, Denmark. Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager majord...@openssl.org