CMAC encoding works fine when the message to encode has 8, 16 32 etc.
bytes. When ever the length is not a standard block size, the results
are not correct (I have a list with testvectors to check the result).
According the the standard (NIST 800-38B) the message should be
extended with padding byte, first byte 0x80, the others 0x00. When I
do this the result is also incorrect.
I can imaging that I have to set a parameter to indicate padding is
provided, but it is not clear what must be done to get the encoding
correct when using padding bytes.
Does anyone has a suggestion?
The relevant piece of source code is:

        CMAC<AES> Cmac;

// Fill bKey; bTestdata with testdata : result in bTestDecr

        Cmac.SetKey(bKey, sizeof(bKey));
        Cmac.Update(bTestdata, sizeof(bTestdata));
        Cmac.Final(bTestDecr);

regards,
Ger
--~--~---------~--~----~------------~-------~--~----~
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