pc-dart icon indicating copy to clipboard operation
pc-dart copied to clipboard

Bug in CMAC with AES256 key

Open huckym opened this issue 2 years ago • 3 comments

IV needs to match block size but the key size could be 256bit. CMAC.init works fine if coincidentally AES128 keys are used because the blocksize and key size are same. Breaks for AES256

https://github.com/bcgit/pc-dart/blob/59e06028bff338adc7d25ff9da4063a3b2e28b4c/lib/macs/cmac.dart#L185C5-L185C52

huckym avatar Jul 20 '23 22:07 huckym

+1 Up voting this issue... The IV size is definitively wrong for block cipher modes. It should match the block size.

smlu avatar Jun 27 '24 11:06 smlu

Can this be picked up? Do you want me to create a PR?

DibranMulder avatar Jul 25 '25 07:07 DibranMulder