summaryrefslogtreecommitdiff
path: root/cmac.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cmac.cpp')
-rw-r--r--cmac.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmac.cpp b/cmac.cpp
index f8570a7f..ca04d0bd 100644
--- a/cmac.cpp
+++ b/cmac.cpp
@@ -31,9 +31,15 @@ static void MulU(byte *k, unsigned int length)
k[15] ^= 0x87;
break;
case 32:
+ // Should this be 0x425?
k[30] ^= 4;
k[31] ^= 0x23;
break;
+ case 64:
+ // https://crypto.stackexchange.com/q/9815/10496
+ k[62] ^= 1;
+ k[63] ^= 0x25;
+ break;
default:
throw InvalidArgument("CMAC: " + IntToString(length) + " is not a supported cipher block size");
}