Hello,
I have an existing C/C++ program to which I have added Crypto++ 5.1 in
order to verify a digital signature on one of the files this program works
with. I'm basically using the RSAVerifyFile() function from the test
program and it works great. But unfortunately it's making my program a bit
larger than I'd like. Specifically before adding the verification
functionality my program was 225280 bytes in size. After adding crypto++ it
grew to 540672 bytes. That's quite a jump.
The first change I made in order to slim it down was to remove it's
dependency on the C++ file I/O library. I did this by writing an adaptation
of the FileSource filter that uses the C file I/O library. This was
successful and the resulting executable was 450560 bytes. But it's still
rather larger than I'd like it to be. I've also tried using the compiler's
switches to optimize for space instead of speed with a result of 397312
bytes. But almost all of my experience with this compiler(MSVC++ 6.0) is
with it set to generate code with the maximize speed setting. Thus I'd
prefer to leave it set that way.
What I'd like to try next is to strip my use of Crypto++ down to the
point where I'm using the bare minimum of what I need. Specifically I'd
like to somehow get it down to the point where I'm only using the crypto++
library to decrypt and unpad the signature and to compute the SHA hash on
the file I'm trying to verify. Then I can do the buffer management, file
I/O, and hash comparison myself and see how much space(if any) is saved.
It looks like computing an SHA hash is easy enough. But I'm still
somewhat new to OOP and I find crypto++ a bit impenetrable. Thus I don't
immediately see a way to replace the RSASSA_PKCS1v15_SHA_Verifier class with
something that will only decrypt and unpad the signature. Will the
RSAES_PKCS1v15_Decryptor class do what I need? I have a feeling it will do
something different with the padding. Or should I be looking somewhere
else? Any other ideas on slimming crypto++ down?
Thanks for any help you can provide,
John Stewart