aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/messages.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-12-23 16:25:18 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2016-12-23 21:09:23 +0100
commit23fcffe5a6731591c0611f56f920d6d29184337d (patch)
treec68b92313b27b334ee3650f4a573fbb8d91a7c53 /src/messages.h
parentrouting-table: simplify and mask reparented root (diff)
downloadwireguard-linux-compat-23fcffe5a6731591c0611f56f920d6d29184337d.tar.xz
wireguard-linux-compat-23fcffe5a6731591c0611f56f920d6d29184337d.zip
cookies: use xchacha20poly1305 instead of chacha20poly1305
This allows us to precompute the blake2s calls and save cycles, since hchacha is fast. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/messages.h')
-rw-r--r--src/messages.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/messages.h b/src/messages.h
index f5362ac..8fa1c95 100644
--- a/src/messages.h
+++ b/src/messages.h
@@ -27,7 +27,7 @@ enum noise_lengths {
enum cookie_values {
COOKIE_SECRET_MAX_AGE = 2 * 60 * HZ,
COOKIE_SECRET_LATENCY = 5 * HZ,
- COOKIE_SALT_LEN = 32,
+ COOKIE_NONCE_LEN = XCHACHA20POLY1305_NONCELEN,
COOKIE_LEN = 16
};
@@ -99,7 +99,7 @@ struct message_handshake_response {
struct message_handshake_cookie {
struct message_header header;
__le32 receiver_index;
- u8 salt[COOKIE_SALT_LEN];
+ u8 nonce[COOKIE_NONCE_LEN];
u8 encrypted_cookie[noise_encrypted_len(COOKIE_LEN)];
};