[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] 0_0_6-patches) Fix counter-mode bug.



Update of /home/or/cvsroot/src/common
In directory moria.mit.edu:/tmp/cvs-serv27984/src/common

Modified Files:
      Tag: tor-0_0_6-patches
	aes.c 
Log Message:
(0_0_6-patches) Fix counter-mode bug.

Index: aes.c
===================================================================
RCS file: /home/or/cvsroot/src/common/aes.c,v
retrieving revision 1.10
retrieving revision 1.10.4.1
diff -u -d -r1.10 -r1.10.4.1
--- aes.c	7 Apr 2004 19:57:39 -0000	1.10
+++ aes.c	6 May 2004 16:28:21 -0000	1.10.4.1
@@ -47,14 +47,14 @@
   u32 counter1 = cipher->counter1;
   u8 buf[16];
   memset(buf, 0, 8);
-  buf[15] = (counter0 >> 0)  && 0xff;
-  buf[14] = (counter0 >> 8)   && 0xff;
-  buf[13] = (counter0 >> 16) && 0xff;
-  buf[12] = (counter0 >> 24) && 0xff;
-  buf[11] = (counter1 >> 0)  && 0xff;
-  buf[10] = (counter1 >> 8)  && 0xff;
-  buf[ 9] = (counter1 >> 16) && 0xff;
-  buf[ 8] = (counter1 >> 24) && 0xff;
+  buf[15] = (counter0 >> 0)  & 0xff;
+  buf[14] = (counter0 >> 8)  & 0xff;
+  buf[13] = (counter0 >> 16) & 0xff;
+  buf[12] = (counter0 >> 24) & 0xff;
+  buf[11] = (counter1 >> 0)  & 0xff;
+  buf[10] = (counter1 >> 8)  & 0xff;
+  buf[ 9] = (counter1 >> 16) & 0xff;
+  buf[ 8] = (counter1 >> 24) & 0xff;
 
   rijndaelEncrypt(cipher->rk, cipher->nr, buf, cipher->buf);
   cipher->pos = 0;