1 Reply Latest reply: Mar 1, 2012 3:05 PM by safarmer RSS

    How to calculate CMAC ( checking from document sample ) ?

    918876
      Dear All,

      I have to reverse the calculation of CMAC from some doc as below :

      COMMAND :
      -----------------
      84D800815031B85ED2EBFCA617DBD36D3B43E239110097FC479D6162240F4C09
      174996F118521CCD1946C3949366C4BDB01F2E5B5377C8311BF5731B3F623868
      7378AAB13920325FC5BDEB4DF1 *2AD7E7327491EB98*

      SPLIT IN 8 Bytes and padding with 80 00 00
      --------------------------
      84D800815031B85E
      D2EBFCA617DBD36D
      3B43E239110097FC
      479D6162240F4C09
      174996F118521CCD
      1946C3949366C4BD
      B01F2E5B5377C831
      1BF5731B3F623868
      7378AAB13920325F
      C5BDEB4DF1800000
      CMAC : *2AD7E7327491EB98*

      iv:_3DA9845E0ED08319_ ( CMAC from previous commands EXTERNAL AUTHENTICATE )

      sku mac : CFD96CA06B11FAAB *334D48802AAFBD68*

      Recalculation : using first iv from prev. command.
      h3. data ________________ iv ________________ cbcdes     
      -----
      84D800815031B85E------------ *3DA9845E0ED08319* ------------B7F02E17EC57AC29
      D2EBFCA617DBD36D------------B7F02E17EC57AC29------------0CC957B13FBA1579
      3B43E239110097FC-------------0CC957B13FBA1579------------E5B4911518303F0E
      479D6162240F4C09------------E5B4911518303F0E------------035633FECF8033F6
      174996F118521CCD------------035633FECF8033F6------------B8D0629C7183E7CF
      1946C3949366C4BD------------B8D0629C7183E7CF------------C108E68C35FDE8BB
      B01F2E5B5377C831------------     C108E68C35FDE8BB------------EAC16D0983417415
      1BF5731B3F623868------------     EAC16D0983417415------------1FFD98DE948B50B7
      7378AAB13920325F------------1FFD98DE948B50B7------------3BE0A5B7FBFEB783

      Last data-----------------------------iv------------------------------cbc3des
      C5BDEB4DF1800000------------3BE0A5B7FBFEB783------------ DD525AA2C984733A

      if first iv: *0000000000000000*
      h3. data ________________ iv ________________ cbcdes     
      -----
      84D800815031B85E------------ *0000000000000000* ------------9CF7AB4B66ECEB5D
      D2EBFCA617DBD36D------------9CF7AB4B66ECEB5D------------1A97B6C7FAFE24BE
      3B43E239110097FC------------1A97B6C7FAFE24BE------------EDB449931A8637D4
      479D6162240F4C09------------EDB449931A8637D4------------53217E96FE788A11
      174996F118521CCD------------53217E96FE788A11------------1F2DF6991D4F8D97
      1946C3949366C4BD------------1F2DF6991D4F8D97------------FDDF41AB3D039DEC
      B01F2E5B5377C831------------FDDF41AB3D039DEC------------08FC56E923468048
      1BF5731B3F623868------------08FC56E923468048------------DE042E72367E98A5
      7378AAB13920325F------------DE042E72367E98A5------------81A8196AC2166720

      Last data-----------------------------iv------------------------------cbc3des
      C5BDEB4DF1800000------------81A8196AC2166720------------ *4C0B8390990A1E2E*

      Why the last result is not the same as mentioned in the doc. ?
      What am I missing in the calculation ?

      I have read all the post/thread regarding the CMAC, especially from user Shane ( I really appreciate your post ).

      Warmest regards,

      312Y