From 6e4a10e8f2c73951f8e8fc2ac2821c5582d133bc Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 23 Dec 2016 16:25:18 +0100 Subject: cookies: use xchacha20poly1305 instead of chacha20poly1305 This allows us to precompute the blake2s calls and save cycles, since hchacha is fast. --- src/messages.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/messages.h') 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)]; }; -- cgit v1.2.3-59-g8ed1b