[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[minion-cvs] Fix dumb bug.



Update of /home/minion/cvsroot/src/minion/src
In directory moria.seul.org:/tmp/cvs-serv15673

Modified Files:
	aes_ctr.c 
Log Message:
Fix dumb bug.

Note to self: in the future, write big-endian code on big-endian
platforms, and little-endian code on little-endian platforms.

And don't use ++foo as the argument to a macro.



Index: aes_ctr.c
===================================================================
RCS file: /home/minion/cvsroot/src/minion/src/aes_ctr.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- aes_ctr.c	12 Aug 2002 18:12:24 -0000	1.4
+++ aes_ctr.c	15 Aug 2002 05:26:08 -0000	1.5
@@ -59,7 +59,7 @@
                              ptr[3] = (i>>24) & 0xff; } 
 #define GET_U32(ptr)   GET_U32_cp(((u8*)(ptr)))
 #define SET_U32(ptr,i) SET_U32_cp(((u8*)(ptr)), i)
-#define INCR_U32(ptr, i) { i = GET_U32(ptr); SET_U32(ptr,++i); }
+#define INCR_U32(ptr, i) { i = GET_U32(ptr)+1; SET_U32(ptr,i); }
 #endif
 
 static inline void