diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-01-11 01:13:35 -0800 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-01-23 14:29:44 +0100 |
commit | 777fe674c4c534bb0b9a97c4e5d90f06343c8f23 (patch) | |
tree | e6c1819a7891634ad35b968e922357f4b39a3c7b /src | |
parent | keygen-html: bring back pure javascript implementation (diff) | |
download | wireguard-tools-777fe674c4c534bb0b9a97c4e5d90f06343c8f23.tar.xz wireguard-tools-777fe674c4c534bb0b9a97c4e5d90f06343c8f23.zip |
global: normalize -> clamp
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/curve25519.c | 2 | ||||
-rw-r--r-- | src/curve25519.h | 2 | ||||
-rw-r--r-- | src/genkey.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/curve25519.c b/src/curve25519.c index 7949933..0d52bc8 100644 --- a/src/curve25519.c +++ b/src/curve25519.c @@ -68,7 +68,7 @@ static inline void put_unaligned_le64(u64 s, u8 *d) #ifndef __force #define __force #endif -#define normalize_secret(a) curve25519_normalize_secret(a) +#define clamp_secret(a) curve25519_clamp_secret(a) static noinline void memzero_explicit(void *s, size_t count) { diff --git a/src/curve25519.h b/src/curve25519.h index a5c3066..badcda0 100644 --- a/src/curve25519.h +++ b/src/curve25519.h @@ -15,7 +15,7 @@ enum curve25519_lengths { void curve25519(uint8_t mypublic[static CURVE25519_KEY_SIZE], const uint8_t secret[static CURVE25519_KEY_SIZE], const uint8_t basepoint[static CURVE25519_KEY_SIZE]); void curve25519_generate_public(uint8_t pub[static CURVE25519_KEY_SIZE], const uint8_t secret[static CURVE25519_KEY_SIZE]); -static inline void curve25519_normalize_secret(uint8_t secret[static CURVE25519_KEY_SIZE]) +static inline void curve25519_clamp_secret(uint8_t secret[static CURVE25519_KEY_SIZE]) { secret[0] &= 248; secret[31] &= 127; diff --git a/src/genkey.c b/src/genkey.c index 65711e1..645f614 100644 --- a/src/genkey.c +++ b/src/genkey.c @@ -71,7 +71,7 @@ int genkey_main(int argc, char *argv[]) return 1; } if (!strcmp(argv[0], "genkey")) - curve25519_normalize_secret(key); + curve25519_clamp_secret(key); key_to_base64(base64, key); puts(base64); |