DES-MAC calculation with SAM AV2

Question asked by Nazar Pelykh on Jun 20, 2018
Latest reply on Jul 2, 2018 by Nazar Pelykh

Hi,

We are working on solution using SAM AV2 for DES-MAC calculation that uses cipher block chaining (CBC) mode.

To do it we have tried to store the following types of keys: "(011) 3 key TDEA ISO 10116" and "(110) TDEA ISO 10116 (8-byte MAC)". Then we have used Offline Crypto commands: SAM_ActivateOfflineKey and SAM_Generate_MAC. But we do not have any success.

Note: In this way we can successfully calculate TDEA-CMAC using "(011) 3 key TDEA ISO 10116" key.

We have some examples with results calculated by DES-MAC (CBC) algorithm. But our results calculated by SAM AV2 are different.

Examples:

MAC key (64 b): 01 23 45 67 89 AB CD EF

Note: This DES key we stored twice to form a 2 key TDEA key where the 2 keys are identical.

Sample 1:

Input (28 B): 37 36 35 34 33 32 31 20 4e 6f 77 20 69 73 20 74 68 65 20 74 69 6d 65 20 66 6f 72 20

MAC value (16 b): F1 D3

MAC value (32 b): F1 D3 0F 68

MAC value (48 b): F1 D3 0F 68 49 31

MAC value (64 b): F1 D3 0F 68 49 31 2C A4

Sample 2:

Input (8 B): B2 3D 1C A6 57 E9 F0 48

MAC value (16 b): 08 73

MAC value (32 b): 08 73 27 20

MAC value (48 b): 08 73 27 20 5F 9D

MAC value (64 b): 08 73 27 20 5F 9D 08 D7

We assume that there is a problem with wrong type of key because we have found the folowing information from documentation:

"DES and TDEA MACs for key types 0 and 1 (bit 3 to 5 in SET are 000b or 001b are CBC-MACs"
"DES and TDEA MACs for key types 3 and 6 (bit 3 to 5 in SET are 011b or 110b) are CMACs."

Also if there is document that can be useful please provide its name.

If these questions can not be answered in public forum please send us instructions where it can be done.