summaryrefslogtreecommitdiff
path: root/cmac.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-05-13 19:18:24 -0400
committerJeffrey Walton <noloader@gmail.com>2017-05-13 19:18:24 -0400
commitcea45eb024b73a11598fb9f9f697c00781c22db8 (patch)
tree7505b4841beed798e0d8e0de2230b8b8c93b3542 /cmac.cpp
parentd654c893ef4658da83ed5753cb4c360e60e5afa3 (diff)
downloadcryptopp-git-cea45eb024b73a11598fb9f9f697c00781c22db8.tar.gz
Revert "Add polynomial for 1024-bit block cipher."
This reverts commit d654c893ef4658da83ed5753cb4c360e60e5afa3. The polinomial for 1024-bit block sizes had a typo.
Diffstat (limited to 'cmac.cpp')
-rw-r--r--cmac.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/cmac.cpp b/cmac.cpp
index 81047827..ca04d0bd 100644
--- a/cmac.cpp
+++ b/cmac.cpp
@@ -31,24 +31,15 @@ static void MulU(byte *k, unsigned int length)
k[15] ^= 0x87;
break;
case 32:
- // https://crypto.stackexchange.com/q/9815/10496
- // Polynomial x^256 + x^10 + x^5 + x + 1
+ // Should this be 0x425?
k[30] ^= 4;
k[31] ^= 0x23;
break;
case 64:
// https://crypto.stackexchange.com/q/9815/10496
- // Polynomial x^512 + x^8 + x^5 + x^2 + 1
k[62] ^= 1;
k[63] ^= 0x25;
break;
- case 128:
- // https://crypto.stackexchange.com/q/9815/10496
- // Polynomial x^1024 + x^19 + x^6 + x + 1
- k[126] ^= 8;
- k[126] ^= 0x00;
- k[127] ^= 0x43;
- break;
default:
throw InvalidArgument("CMAC: " + IntToString(length) + " is not a supported cipher block size");
}