
Hi,
I have to understand decryption process of Crypto CCM implementation.
I'm using the first example AE (authentication/encryption) from Crypto++ Wiki.
Here is my example output from this program:
key: 6DFB2E83D016999B8F4CA9B564AB2B6A
iv: 37F1A6DD11DD2D14C3CABBAD
plain text: Authenticated Encryption
cipher text: 61CBA7195D8F9619C4190D61D0D953301FFE2169785BAC5501E768279E7BC5AA
recovered text: Authenticated Encryption
Now, here is my understanding of decryption process:
Text "Authenticated Encryption" is 24 bytes long so the firs 24 bytes are cipher:
"61CBA7195D8F9619C4190D61D0D953301FFE2169785BAC55"
we have remain 8 bytes and it is correct because
TAG_SIZE = 8, so the last 8 bytes are the tag "01E768279E7BC5AA".
remain I have to write only encryption/veryfication function (because I'm facing Linux program using Crypto++ with embedded system which Crypto++ is not supporting). I have AES in CTR and CBC Crypto hardware support on that chip.
I have started from generating counter blocks:
so I tooked the iv 37F1A6DD11DD2D14C3CABBAD and I have add 3 bytes (counter) and tooked it as input data to AES ECB encryption with key 6DFB2E83D016999B8F4CA9B564AB2B6A
****************************************
Key: 6DFB2E83D016999B8F4CA9B564AB2B6A
Algorithm: AES-128
Mode: ECB
Crypto operation: Encryption
Data: 37F1A6DD11DD2D14C3CABBAD000000
----------------------------------------
Encrypted data: 77B133ED82AE801FCABAC8F51BCA4141
Now I was suposing that I have a first counter block, so I've made a XOR operation with first 16 bytes of cipher text
Here is result

16 7A 94 F4 DF 21 16 06 0E A3 C5 94 CB 13 12 71
and when I changed this into ASCII it is far away from first 16 bytes of plain text: "Authenticated En".
I'm getting crazy with this because it suppose to work that way, and I'm out of ideas with it.
Please help