shishi-commit
[Top][All Lists]
Advanced

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

CVS shishi/crypto


From: shishi-commit
Subject: CVS shishi/crypto
Date: Tue, 09 Nov 2004 20:02:52 +0100

Update of /home/cvs/shishi/crypto
In directory dopio:/tmp/cvs-serv4857

Modified Files:
        macros.h 
Log Message:
Sync upstream.


--- /home/cvs/shishi/crypto/macros.h    2003/08/09 01:30:44     1.1
+++ /home/cvs/shishi/crypto/macros.h    2004/11/09 19:02:52     1.2
@@ -78,6 +78,17 @@
   (p)[0] = (i) & 0xff;                         \
 } while(0)
 
+/* Analogous macros, for 16 bit numbers */
+#define LE_READ_UINT16(p)                      \
+  (  (((uint32_t) (p)[1]) << 8)                        \
+     |  ((uint32_t) (p)[0]))
+
+#define LE_WRITE_UINT16(p, i)                  \
+  do {                                         \
+    (p)[1] = ((i) >> 8) & 0xff;                        \
+    (p)[0] = (i) & 0xff;                       \
+  } while(0)
+
 /* Macro to make it easier to loop over several blocks. */
 #define FOR_BLOCKS(length, dst, src, blocksize)        \
   assert( !((length) % (blocksize)));           \





reply via email to

[Prev in Thread] Current Thread [Next in Thread]