Hey,

Basically am just trying to implement the MAC field in a packet header
for authentication. Is the digest the result of the calculation on the
data? I am just trying to find a way of calculating the MAC and then
printing it so I can see I have a result...and then getting the
receiver to do the same calculation and see if they match up in order
to authenticate the data (ie it has not been changed)...is that the
way to go?

Since my programming is not great am just trying to find some example
code that I can use HMAC-SHA for to perform the calculation on some
test data, see it works by a printf and then adapt this to implement
by code.

I tried implementing the code you gave me in a file called auth.cpp
and used this makefile to try and put it all together:

CC=g++

authentication: auth.o   hmac.o  sha.o

        $(CC)   auth.o  hmac.o  sha.o   -o      authentication

auth.o: auth.cpp hmac.h sha.h

        $(CC)   -c      auth.cpp

sha.o: sha.cpp sha.h

        $(CC)   -c      sha.cpp

hmac.o: hmac.cpp hmac.h

        $(CC)   -c      hmac.cpp


 but got this error:

auth.cpp:
(.text._ZN8CryptoPP21SimpleKeyingInterfaceC2Ev[CryptoPP::SimpleKeyingInterface::SimpleKeyingInterface()]
+0x4): undefined reference to `vtable for
CryptoPP::SimpleKeyingInterface'
auth.o: In function `CryptoPP::SecBlock<unsigned char,
CryptoPP::AllocatorWithCleanup<unsigned char, false>
>::SecBlock(unsigned int)':
auth.cpp:
(.text._ZN8CryptoPP8SecBlockIhNS_20AllocatorWithCleanupIhLb0EEEEC1Ej[CryptoPP::SecBlock<unsigned
char, CryptoPP::AllocatorWithCleanup<unsigned char, false>
>::SecBlock(unsigned int)]+0x25): undefined reference to
`CryptoPP::AllocatorWithCleanup<unsigned char,
false>::allocate(unsigned int, void const*)'
auth.o: In function `CryptoPP::SecBlock<unsigned char,
CryptoPP::AllocatorWithCleanup<unsigned char, false> >::~SecBlock()':
auth.cpp:
(.text._ZN8CryptoPP8SecBlockIhNS_20AllocatorWithCleanupIhLb0EEEED1Ev[CryptoPP::SecBlock<unsigned
char, CryptoPP::AllocatorWithCleanup<unsigned char, false>
>::~SecBlock()]+0x21): undefined reference to
`CryptoPP::AllocatorWithCleanup<unsigned char,
false>::deallocate(void*, unsigned int)'
auth.o: In function
`CryptoPP::HashTransformation::HashTransformation(CryptoPP::HashTransformation
const&)':
auth.cpp:
(.text._ZN8CryptoPP18HashTransformationC2ERKS0_[CryptoPP::HashTransformation::HashTransformation(CryptoPP::HashTransformation
const&)]+0x19): undefined reference to `vtable for
CryptoPP::HashTransformation'
auth.o: In function `CryptoPP::IteratedHashBase<unsigned int,
CryptoPP::HashTransformation>::IteratedHashBase(CryptoPP::IteratedHashBase<unsigned
int, CryptoPP::HashTransformation> const&)':
auth.cpp:
(.text._ZN8CryptoPP16IteratedHashBaseIjNS_18HashTransformationEEC2ERKS2_[CryptoPP::IteratedHashBase<unsigned
int, CryptoPP::HashTransformation>::Iterat
....etc.....

Thanks for your help.

--~--~---------~--~----~------------~-------~--~----~
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