authentication - AES calculation CMAC Java to Swift -
i trying calculate cmac
byte[] key={0x09,0x11,0x12,0x34,0x56,0x78,0x00,0x01,0x01,0x13,0x14,0x36,0x58,0x7a,0x02,0x03}; aes maes=new aes(); maes.aesinit(key); byte[] response = maes.calccmac(challenge);
swift using lib cryptoswift
let key = [0x09,0x11,0x12,0x34,0x56,0x78,0x00,0x01,0x01,0x13,0x14,0x36,0x58,0x7a,0x02,0x03] [uint8] let message:nsdata = nsdata.fromhexstring("da55c255") let mac = authenticator.poly1305(key: key).authenticate(message.arrayofbytes())
but it's not working expected.
the expected result
challenge isda55c255
response ised7ca01a
we don't find solution, have created our own classe
Comments
Post a Comment