Discussion:
CMAC AES calculation with specified IV and Key
Leonardo Carreira
2011-05-09 07:53:37 UTC
Permalink
Hi Masters,

Actually in Cryptopp5.6.1 there's a class to handle CMAC calculation..
But, i found a problem when use it with IV initialization..
I've already tried to initialize the IV, but it seems didn't work.. :(
Could you help me to give me simple snippet code to handle CMAC
AES-128 calculation, specify the IV and random byte input data?
And can we get K0, K1 and K2 of our CMAC Key (when CMAC calculation
time)?


Actually, my classmate have already done this..
But i want to create my own application which does the same..

Here's the output of my classmate's tool : (CMAC AES-128 CBC)

* 1st step
IV = 00000000000000000000000000000000
Key = 00000000000000000000000000000000
Input = 25
CMAC Result = F60AA29D615BC9C4C0A7C8A08D963DEF
=======================================================
* 2nd step
IV = F60AA29D615BC9C4C0A7C8A08D963DEF
Key = 00000000000000000000000000000000
Input = 25
CMAC Result = 1368BD293F9DC7DF8019BF0A90E7A853
=======================================================
* 3rd step
IV = F60AA29D615BC9C4C0A7C8A08D963DEF
Key = 00000000000000000000000000000000
Input = 25
CMAC Result = FBE134EEB0F9A5A9736E0C6DB4CFF2EB


How to achieve this using CMAC Cryptopp?
Please help me regarding this.

Thanks,

Leo
--
You received this message because you are subscribed to the "Crypto++ Users" Google Group.
To unsubscribe, send an email to cryptopp-users-***@googlegroups.com.
More information about Crypto++ and this group is available at http://www.cryptopp.com.
Leonardo Carreira
2011-05-10 00:58:26 UTC
Permalink
Hi All,

Actually, Crypto's pp CMAC can fill my need if the data is multiple
AES data block (16 bytes)..
So, what padding values that need to be used if the data is not
multiple 16 bytes?..

Please help me regarding this.

Thanks,

Leo
--
You received this message because you are subscribed to the "Crypto++ Users" Google Group.
To unsubscribe, send an email to cryptopp-users-***@googlegroups.com.
More information about Crypto++ and this group is available at http://www.cryptopp.com.
Jeffrey Walton
2011-05-10 06:34:43 UTC
Permalink
Post by Leonardo Carreira
Hi All,
Actually, Crypto's pp CMAC can fill my need if the data is multiple
AES data block (16 bytes)..
So, what padding values that need to be used if the data is not
multiple 16 bytes?..
Please help me regarding this.
A CMAC is a CBC-MAC done right (no problems if the message is not a
multiple of the underlying block size). Crypto++ has an example in its
self test code - see ValidateCMAC in validate1.cpp (it will lead you
into datatest.cpp). The wiki now has a sample at http://www.cryptopp.com/wiki/CMAC.

Jeff
--
You received this message because you are subscribed to the "Crypto++ Users" Google Group.
To unsubscribe, send an email to cryptopp-users-***@googlegroups.com.
More information about Crypto++ and this group is available at http://www.cryptopp.com.
Jeffrey Walton
2011-05-10 07:23:26 UTC
Permalink
Post by Leonardo Carreira
Hi Masters,
Actually in Cryptopp5.6.1 there's a class to handle CMAC calculation..
But, i found a problem when use it with IV initialization..
I've already tried to initialize the IV, but it seems didn't work.. :(
Could you help me to give me simple snippet code to handle CMAC
AES-128 calculation, specify the IV and random byte input data?
And can we get K0, K1 and K2 of our CMAC Key (when CMAC calculation
time)?
Actually, my classmate have already done this..
But i want to create my own application which does the same..
Here's the output of my classmate's tool : (CMAC AES-128 CBC)
* 1st step
IV  = 00000000000000000000000000000000
Key = 00000000000000000000000000000000
Input = 25
CMAC Result = F60AA29D615BC9C4C0A7C8A08D963DEF
=======================================================
* 2nd step
IV  = F60AA29D615BC9C4C0A7C8A08D963DEF
Key = 00000000000000000000000000000000
Input = 25
CMAC Result = 1368BD293F9DC7DF8019BF0A90E7A853
=======================================================
* 3rd step
IV  = F60AA29D615BC9C4C0A7C8A08D963DEF
Key = 00000000000000000000000000000000
Input = 25
CMAC Result = FBE134EEB0F9A5A9736E0C6DB4CFF2EB
How to achieve this using CMAC Cryptopp?
CMACs do not use an external IV.
--
You received this message because you are subscribed to the "Crypto++ Users" Google Group.
To unsubscribe, send an email to cryptopp-users-***@googlegroups.com.
More information about Crypto++ and this group is available at http://www.cryptopp.com.
Loading...