added TLS support for AES-CCM-8

This commit is contained in:
John Safranek
2013-01-15 15:20:30 -08:00
parent eb221238c2
commit ccff37f4b1
9 changed files with 274 additions and 50 deletions

View File

@@ -2660,10 +2660,12 @@ int AesCcmDecrypt(Aes* aes, byte* out, const byte* in, word32 inSz,
oSz = inSz;
XMEMCPY(B+1, nonce, AES_BLOCK_SIZE);
lenSz = AES_BLOCK_SIZE - 1 - nonceSz;
B[0] = (lenSz - 1);
for (i = 0; i < lenSz - 1; i++)
for (i = 0; i < lenSz; i++)
B[AES_BLOCK_SIZE - 1 - i] = 0;
B[15] = 1;
while (oSz >= AES_BLOCK_SIZE) {
AesEncrypt(aes, B, A);
xorbuf(A, in, AES_BLOCK_SIZE);