CMAC calculation
843851Mar 6 2009 — edited Mar 6 2009I'm having problems calculating valid CMACs for APDUs following the External Authencitcate command (which works perfectly).
I use security level 0x01 and do not use SCP02. Currently, I follow the below procedure:
1. Set the 3rd least significant bit of the APDU's CLA byte.
2. Increment the APDU's Le byte with 8.
3. Pad the APDU.
4. Apply 3DES in CBC mode with CMAC session key and IV = previous CMAC.
The CMAC is now the 8 rightmost bytes of the result gained in step 4.
Isn't this correct?