summaryrefslogtreecommitdiff
path: root/macros.h
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2012-11-15 17:12:10 +0100
committerNiels Möller <nisse@lysator.liu.se>2012-11-15 17:12:10 +0100
commit314365b27659ab2ff02b2313eedf2b32b500cc6f (patch)
tree9c3d31ff278d2c3b84048c2d2230ccc3aa2438fb /macros.h
parentc41fbeb7429821ef00dc46e3ae8edd7a12f4a102 (diff)
downloadnettle-314365b27659ab2ff02b2313eedf2b32b500cc6f.tar.gz
New macro LE_READ_UINT64.
Diffstat (limited to 'macros.h')
-rw-r--r--macros.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/macros.h b/macros.h
index dee35f8f..ee206043 100644
--- a/macros.h
+++ b/macros.h
@@ -87,6 +87,16 @@ do { \
} while(0)
/* And the other, little-endian, byteorder */
+#define LE_READ_UINT64(p) \
+( (((uint64_t) (p)[7]) << 56) \
+ | (((uint64_t) (p)[6]) << 48) \
+ | (((uint64_t) (p)[5]) << 40) \
+ | (((uint64_t) (p)[4]) << 32) \
+ | (((uint64_t) (p)[3]) << 24) \
+ | (((uint64_t) (p)[2]) << 16) \
+ | (((uint64_t) (p)[1]) << 8) \
+ | ((uint64_t) (p)[0]))
+
#define LE_WRITE_UINT64(p, i) \
do { \
(p)[7] = ((i) >> 56) & 0xff; \