diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-12-23 16:25:18 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-12-23 21:09:23 +0100 |
commit | 6e4a10e8f2c73951f8e8fc2ac2821c5582d133bc (patch) | |
tree | ca4a7d47dcc49b699c4916addfd7cc555b977fb2 /src/messages.h | |
parent | wg-config: cleanups (diff) | |
download | wireguard-monolithic-historical-6e4a10e8f2c73951f8e8fc2ac2821c5582d133bc.tar.xz wireguard-monolithic-historical-6e4a10e8f2c73951f8e8fc2ac2821c5582d133bc.zip |
cookies: use xchacha20poly1305 instead of chacha20poly1305
This allows us to precompute the blake2s calls and save cycles, since
hchacha is fast.
Diffstat (limited to 'src/messages.h')
-rw-r--r-- | src/messages.h | 4 |
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)]; }; |