Hello,
      I am a complete C++ newbie but I think the best way to learn is to get
stuck into it. Anyhow what I want to do is simply try to use the CryptoPP
library in a small learning program. For example starting out using SHA
hashes or the like. So I downloaded the source, extracted it into cryptopp
directory in my source root. I then copied the GNUmakefile to Makefile, ran
gmake. One thing I had to do thoguh was compile integer.cpp by hand as it
did not compile with -O2 (-O1 worked fine). After this I ran tried compiling
the program from the FAQ entitled "How do I use a block cipher in Crypto++
5.0?" by 2005-Oct-21 7:38am jeffrey. I only changed the include paths as
below.

#include "cryptopp/modes.h"
#include "cryptopp/aes.h"
#include "cryptopp/filters.h"


However I get lots of errors and the compilation fails. I am running
FreeBSD:

FreeBSD xxx.xxx.xxx 5.4-RELEASE FreeBSD 5.4-RELEASE #0: Sun May  8 10:21:06
UTC 2005  i386

Here are some of the erorrors, as far as I can understand these are linker
errors and not compilation erros right?:

/var/tmp//ccb6QI7E.o(.gnu.linkonce.t._ZN8CryptoPP8Rijndael3EncC2ERKS1_+0x28)
: In function `CryptoPP::Rijndael::Enc::Enc(CryptoPP::Rijndael::Enc
const&)':
: undefined reference to `vtable for CryptoPP::Rijndael::Enc'
/var/tmp//ccb6QI7E.o(.gnu.linkonce.t._ZN8CryptoPP8SecBlockIjNS_20AllocatorWi
thCleanupIjEEEC1ERKS3_+0x25): In function `CryptoPP::SecBlock<unsigned int,
CryptoPP::AllocatorWithCleanup<unsigned int>
>::SecBlock(CryptoPP::SecBlock<unsigned int,
CryptoPP::AllocatorWithCleanup<unsigned int> > const&)':
: undefined reference to `CryptoPP::AllocatorWithCleanup<unsigned
int>::allocate(unsigned int, void const*)'


This is the command I used to compile:

# g++ crypt_test.cpp -o cptest.out

I also tried using for SHA in my own really simple program but get the same
errors. 

Am I missing something. Like I said I am VERY new to C++ so maybe I haven't
yet grasped how the libraries are supposed to be used (I have compiled other
OOP programs I've written myself though without problems). I have searched
for code examples on the net but almost all are Windows code. I have tried
the -lcryptopp and -L path switches but still get the same error. Also the
cryptotest v fails on many tests.

Tests complete. Total tests = 16. Failed tests = 16.
SOME TESTS FAILED!

Whirlpool Hash Function validation suite running...
AlgorithmType: MessageDigest
Comment: Message digests of strings of 0-bits and lengths 0-127 bytes
Digest: 470F0409ABAA446E49667D4EBE12A14387CEDBD10DD17B8243CAD550A089DC0F\
Message: r0 0x00
Name: Whirlpool
Source: Tweaked NESSIE submission

CryptoPP::Exception caught: Unexpected error during validation test

Thankful for any tips or nudges in the right direction.

// bobey

Reply via email to