svn rev #21601: branches/aes-ccm/src/lib/crypto/enc_provider/
lhoward@MIT.EDU
lhoward at MIT.EDU
Fri Dec 26 07:06:54 EST 2008
http://src.mit.edu/fisheye/changelog/krb5/?cs=21601
Commit By: lhoward
Log Message:
correctly initialize counter blocks' flags field
Changed Files:
U branches/aes-ccm/src/lib/crypto/enc_provider/aes_ctr.c
Modified: branches/aes-ccm/src/lib/crypto/enc_provider/aes_ctr.c
===================================================================
--- branches/aes-ccm/src/lib/crypto/enc_provider/aes_ctr.c 2008-12-26 11:48:37 UTC (rev 21600)
+++ branches/aes-ccm/src/lib/crypto/enc_provider/aes_ctr.c 2008-12-26 12:06:54 UTC (rev 21601)
@@ -29,6 +29,8 @@
#include "aes.h"
#include "../aead.h"
+#define CCM_COUNTER_LENGTH 3
+
static void xorblock(unsigned char *out, const unsigned char *in)
{
int z;
@@ -62,7 +64,7 @@
else
memset(ctr, 0, BLOCK_SIZE);
- ctr[0] &= 0x7;
+ ctr[0] = CCM_COUNTER_LENGTH - 1; /* q=3 */
blockno = (ctr[13] << 16);
blockno |= (ctr[14] << 8 );
@@ -120,7 +122,7 @@
else
memset(ctr, 0, BLOCK_SIZE);
- ctr[0] &= 0x7;
+ ctr[0] = CCM_COUNTER_LENGTH - 1; /* q=3 */
blockno = (ctr[13] << 16);
blockno |= (ctr[14] << 8 );
More information about the cvs-krb5
mailing list