diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-01-31 15:58:17 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-01-31 15:58:17 +0100 |
commit | bd3f0d8a896a55346ff235424e3786122994c365 (patch) | |
tree | 654886cc481e96c9342cdc6c6204f25e6280fde4 /src/tools | |
parent | chacha20poly1305: better buffer alignment (diff) | |
download | wireguard-monolithic-historical-bd3f0d8a896a55346ff235424e3786122994c365.tar.xz wireguard-monolithic-historical-bd3f0d8a896a55346ff235424e3786122994c365.zip |
tools: dedup secret normalization
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/curve25519.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/tools/curve25519.c b/src/tools/curve25519.c index 061b913..0ed4977 100644 --- a/src/tools/curve25519.c +++ b/src/tools/curve25519.c @@ -35,6 +35,7 @@ typedef u32 __le32; #ifndef __force #define __force #endif +#define normalize_secret(a) curve25519_normalize_secret(a) static noinline void memzero_explicit(void *s, size_t count) { @@ -42,13 +43,6 @@ static noinline void memzero_explicit(void *s, size_t count) __asm__ __volatile__("": :"r"(s) :"memory"); } -static __always_inline void normalize_secret(u8 secret[CURVE25519_POINT_SIZE]) -{ - secret[0] &= 248; - secret[31] &= 127; - secret[31] |= 64; -} - #ifdef __SIZEOF_INT128__ #include "../crypto/curve25519-hacl64.h" #else |