So I found some sample code on codeproject (Sample 3) relating the GCM
functionality of crypto++

http://www.codeproject.com/KB/security/EncryptThenAuthenticate.aspx?display=Print

I've got the crypto++  library  compiled and I wrote a makefile for that
sample that links against the crypto++ library:

CC     = g++
CCOPTS =  -I../../cryptopp
LDOPTS =  -L../../cryptopp -lcryptopp

all: example_3

stdafx.o: stdafx.cpp
    $(CC) $(CCOPTS) -c stdafx.cpp -o stdafx.o

example_3: Sample.cpp stdafx.o stdafx.h
    $(CC) $(CCOPTS) $(LDOPTS) Sample.cpp -o example_3 stdafx.o

clean:
    rm -rf example_3 *.o


But when I go to do the final linking, I get this:

Undefined symbols:
  "CryptoPP::Rijndael::Enc::AdvancedProcessBlocks(unsigned char const*,
unsigned char const*, unsigned char*, unsigned long, unsigned int) const",
referenced from:
      vtable for CryptoPP::BlockCipherFinal<(CryptoPP::CipherDir)0,
CryptoPP::Rijndael::Enc>in ccz7OlpQ.o
      vtable for
CryptoPP::ClonableImpl<CryptoPP::BlockCipherFinal<(CryptoPP::CipherDir)0,
CryptoPP::Rijndael::Enc>, CryptoPP::Rijndael::Enc>in ccz7OlpQ.o
  "non-virtual thunk to
CryptoPP::Rijndael::Enc::AdvancedProcessBlocks(unsigned char const*,
unsigned char const*, unsigned char*, unsigned long, unsigned int) const",
referenced from:
      vtable for CryptoPP::BlockCipherFinal<(CryptoPP::CipherDir)0,
CryptoPP::Rijndael::Enc>in ccz7OlpQ.o
      vtable for
CryptoPP::ClonableImpl<CryptoPP::BlockCipherFinal<(CryptoPP::CipherDir)0,
CryptoPP::Rijndael::Enc>, CryptoPP::Rijndael::Enc>in ccz7OlpQ.o
ld: symbol(s) not found


Checking in rijndael.cpp I can see the function defintiion, but it's wrapper
in an ifdef :

#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)

Rijndae::Enc::AdvancedProcessBlocks
#endif

Which would seem to indicate those flags are false and undefined
respectively.  But the GCM encryptor/decryptor is still trying to use
this function.

Is this a bug or have I somehow mis-compiled (I just ran make -f
GNUmakefile)?



Here's my uname and gcc -v info

uname:
Darwin localhost 9.7.0 Darwin Kernel Version 9.7.0: Tue Mar 31 22:52:17 PDT
2009; root:xnu-1228.12.14~1/RELEASE_I386 i386 i386

gcc -v

Target: i686-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5465~16/src/configure --disable-checking
-enable-werror --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^.-]*$/s/$/-4.0/
--with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib
--build=i686-apple-darwin9 --with-arch=apple --with-tune=generic
--host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5465)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
-~----------~----~----~----~------~----~------~--~---

Reply via email to