aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/tools/encoding.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/encoding.c')
-rw-r--r--src/tools/encoding.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tools/encoding.c b/src/tools/encoding.c
index 2e2d915..af2fc82 100644
--- a/src/tools/encoding.c
+++ b/src/tools/encoding.c
@@ -1,6 +1,6 @@
-/* SPDX-License-Identifier: GPL-2.0
- *
- * Copyright (C) 2015-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
*
* This is a specialized constant-time base64/hex implementation that resists side-channel attacks.
*/
@@ -84,7 +84,7 @@ void key_to_hex(char hex[static WG_KEY_LEN_HEX], const uint8_t key[static WG_KEY
bool key_from_hex(uint8_t key[static WG_KEY_LEN], const char *hex)
{
- uint8_t c, c_acc = 0, c_alpha0, c_alpha, c_num0, c_num, c_val;
+ uint8_t c, c_acc, c_alpha0, c_alpha, c_num0, c_num, c_val;
volatile uint8_t ret = 0;
if (strlen(hex) != WG_KEY_LEN_HEX - 1)
@@ -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);
}