Hi,
I'm referring document SW-TM4C-DRL-UG-2.0 from Tivaware, topic 25 SHA/MD5. I'm trying example code. The example code works. But when i tried to verify the result with some python script, they don't match. My python script works properly as I can verify HMAC result with some online calculators available. Why do the HMAC signature calculated by Tivaware example not match with online calculators available?
As per sample example in the document mentioned above -data and key are defined as
uint32_t
g_ui32HMACKey[16] =
{
0x8a5f1b22, 0xcb935d29, 0xcc1ac092, 0x5dad8c9e,
0x6a83b39f, 0x8607dc60, 0xda0ba4d2, 0xf49b0fa2,
0xaf35d524, 0xffa8001d, 0xbcc931e8, 0x4a2c99ef,
0x7fa297ab, 0xab943bae, 0x07c61cc4, 0x47c8627d
};
g_ui32RandomData[16] =
{
0xe2bec16b, 0x969f402e, 0x117e3de9, 0x2a179373,
0x578a2dae, 0x9cac031e, 0xac6fb79e, 0x518eaf45,
0x461cc830, 0x11e45ca3, 0x19c1fbe5, 0xef520a1a,
0x45249ff6, 0x179b4fdf, 0x7b412bad, 0x10376ce6
};
To feed above data to python script, I'm attaching all the hex numbers in above arrays as a string as below
g_ui32HMACKey='5f8a221b93cb295d1acc92c0ad5d9e8c836a9fb3078660dc0bdad2a49bf4a20f35af24d5a8ff1d00c9bce8312c4aef99a27fab9794abae3bc607c41cc8477d62'
g_ui32RandomData='e2bec16b969f402e117e3de92a179373578a2dae9cac031eac6fb79e518eaf45461cc83011e45ca319c1fbe5ef520a1a45249ff6179b4fdf7b412bad10376ce6'
Is the above method of treating key and message data as a string correct?