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 | bc3f283148437370f36dcc3843b13f0126688c6b (patch) | |
tree | f9a0d930f020714c31a36415d12462e3308703a8 | |
parent | wg: fread doesn't change errno (diff) | |
download | wireguard-tools-bc3f283148437370f36dcc3843b13f0126688c6b.tar.xz wireguard-tools-bc3f283148437370f36dcc3843b13f0126688c6b.zip |
wg: dedup secret normalization
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | src/curve25519.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/curve25519.c b/src/curve25519.c index 061b913..0ed4977 100644 --- a/src/curve25519.c +++ b/src/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 |