aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/tools
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-08-23 18:08:03 -0700
committerJason A. Donenfeld <Jason@zx2c4.com>2018-08-28 23:20:13 -0600
commit1e7b209da908f815968f681d6ee4894a04399c97 (patch)
tree84c57fb3029513bfbe0313238b4563a8974af4c6 /src/tools
parentKconfig: use new-style help marker (diff)
downloadwireguard-monolithic-historical-1e7b209da908f815968f681d6ee4894a04399c97.tar.xz
wireguard-monolithic-historical-1e7b209da908f815968f681d6ee4894a04399c97.zip
crypto: use unaligned helpers
This is not useful for WireGuard, but for the general use case we probably want it this way, and the speed difference is mostly lost in the noise.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/curve25519.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tools/curve25519.c b/src/tools/curve25519.c
index b030853..043aefc 100644
--- a/src/tools/curve25519.c
+++ b/src/tools/curve25519.c
@@ -29,6 +29,9 @@ typedef int64_t s64;
#define le32_to_cpup(a) (*(a))
#define cpu_to_le64(a) (a)
#endif
+#define get_unaligned_le32(a) le32_to_cpup((u32 *)(a))
+#define get_unaligned_le64(a) le64_to_cpup((u64 *)(a))
+#define put_unaligned_le64(s, d) *(u64 *)(d) = cpu_to_le64(s)
#ifndef __always_inline
#define __always_inline __inline __attribute__((__always_inline__))
#endif