]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commitdiff
wg: fight compiler slightly harder
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 5 Feb 2019 00:00:52 +0000 (01:00 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 5 Feb 2019 00:00:52 +0000 (01:00 +0100)
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
src/curve25519.c
src/encoding.c

index 648daed2715e51100f34e068133481023dc63969..c116e218ed23016f057bf36029f5537f570faf35 100644 (file)
@@ -72,7 +72,7 @@ static inline void put_unaligned_le64(u64 s, u8 *d)
 static noinline void memzero_explicit(void *s, size_t count)
 {
        memset(s, 0, count);
-       asm volatile("": :"r"(s) :"memory");
+       asm volatile("": :"r"(s) : "memory");
 }
 
 #ifdef __SIZEOF_INT128__
index efe004fc88e4e95ee02661d250e6503a08b25a49..bf5fd54ce31d8305e0401e13fcebdd1847fb254c 100644 (file)
@@ -119,7 +119,7 @@ bool key_is_zero(const uint8_t key[static WG_KEY_LEN])
 
        for (unsigned int i = 0; i < WG_KEY_LEN; ++i) {
                acc |= key[i];
-               asm("" : "=r" (acc) : "0" (acc));
+               asm volatile("" : "=r"(acc) : "0"(acc));
        }
        return 1 & ((acc - 1) >> 8);
 }