aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/peer.c
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
commit6e4a10e8f2c73951f8e8fc2ac2821c5582d133bc (patch)
treeca4a7d47dcc49b699c4916addfd7cc555b977fb2 /src/peer.c
parentwg-config: cleanups (diff)
downloadwireguard-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/peer.c')
-rw-r--r--src/peer.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/peer.c b/src/peer.c
index 38a7ae1..ae54fb7 100644
--- a/src/peer.c
+++ b/src/peer.c
@@ -35,6 +35,7 @@ struct wireguard_peer *peer_create(struct wireguard_device *wg, const u8 public_
peer->device = wg;
cookie_init(&peer->latest_cookie);
noise_handshake_init(&peer->handshake, &wg->static_identity, public_key, peer);
+ cookie_checker_precompute_keys(&wg->cookie_checker, peer);
mutex_init(&peer->keypairs.keypair_update_lock);
INIT_WORK(&peer->transmit_handshake_work, packet_send_queued_handshakes);
rwlock_init(&peer->endpoint_lock);