Thanks for reply.

I have been looking at the HMAC-SHA test function in .cpp. But how do
I go about actually using this piece of code to compute and then print
a digest? Cant seem to figure it out.

Many thanks.

On Jun 6, 12:42 am, "Jeffrey Walton" <[EMAIL PROTECTED]> wrote:
> Hi Adam,
>
> Wei calcualtes a HMAC in test.cpp. Take a quick look at function
> HmacFile(...) at line 485. Since you are using a string ('Hi There'),
> declare it as a std::string instead of a byte[]. Then use a
> StringSource rather than a FileSource.
>
> Jeff
>
> On Thu, Jun 5, 2008 at 7:16 PM, Adam Harding <[EMAIL PROTECTED]> wrote:
>
> > Hey there,
>
> > I am trying to figure out how to use the message authentication code
> > for cryptopp.
>
> > Based on reading the FAQ I have come up with this code to try and
> > produce a digest for this test vector:
>
> > test_case =     1
> > key =           0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
> > key_len =       16
> > data =          "Hi There"
> > data_len =      8
> > digest =        0x9294727a3638bb1c13f48ef8158bfc9d
>
> > However I have some errors.
>
> > It looks simple enough to implement but my programming is pretty
> > rubbish so if you could help me out with what needs to be done to get
> > an output for a digest that would be great.
>
> > Am confused that the digest is needed to be declared as I thought that
> > was the result not an input.
>
> > Thanks for any help!
>
> > Here is my code implementing HMAC-SHA1 (similar to the code in the
> > FAQ)
>
> > #include "sha.h"
> > #include "hmac.h"
>
> > int main()
> > {
>
> > HMAC<SHA >(const byte* key = 0x0b, size_t length= 20)).CalculateDigest
> > (byte *digest, const byte *input = "Hi there", size_t length= 64)
>
> > }
>
> > Here is my makefile:
>
> > CC=g++
>
> > authentication:auth.o   hmac.o  sha.o
>
> >        $(CC)   auth.o  hmac1.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
>
> > And here is my error message:
>
> > g++ -c auth.cpp
> > In file included from sha.h:4,
> >                 from auth.cpp:1:
> > iterhash.h: In member function 'void
> > CryptoPP::IteratedHashWithStaticTransform<T, B, S,
> > M>::vTransform(const T*)':
> > ...
> > [SNIP]
--~--~---------~--~----~------------~-------~--~----~
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