summaryrefslogtreecommitdiff
path: root/macros.h
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2012-11-12 21:12:28 +0100
committerNiels Möller <nisse@lysator.liu.se>2012-11-12 21:13:25 +0100
commitc835888e63316162ba0154db81896fe88a32865f (patch)
tree7c1042ea52ac5808584deab70f2c8323b5cdb3bf /macros.h
parent8149d146d7558e0161175ecdeeefededc31bd776 (diff)
downloadnettle-c835888e63316162ba0154db81896fe88a32865f.tar.gz
New function _nettle_write_le64.
Diffstat (limited to 'macros.h')
-rw-r--r--macros.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/macros.h b/macros.h
index b2d6076f..dee35f8f 100644
--- a/macros.h
+++ b/macros.h
@@ -87,6 +87,18 @@ do { \
} while(0)
/* And the other, little-endian, byteorder */
+#define LE_WRITE_UINT64(p, i) \
+do { \
+ (p)[7] = ((i) >> 56) & 0xff; \
+ (p)[6] = ((i) >> 48) & 0xff; \
+ (p)[5] = ((i) >> 40) & 0xff; \
+ (p)[4] = ((i) >> 32) & 0xff; \
+ (p)[3] = ((i) >> 24) & 0xff; \
+ (p)[2] = ((i) >> 16) & 0xff; \
+ (p)[1] = ((i) >> 8) & 0xff; \
+ (p)[0] = (i) & 0xff; \
+} while (0)
+
#define LE_READ_UINT32(p) \
( (((uint32_t) (p)[3]) << 24) \
| (((uint32_t) (p)[2]) << 16) \