COOKIE_LEN
blake2s_init_key(&blake, COOKIE_LEN, checker->secret, NOISE_HASH_LEN);
u8 computed_mac[COOKIE_LEN];
u8 cookie[COOKIE_LEN];
if (crypto_memneq(computed_mac, macs->mac1, COOKIE_LEN))
if (crypto_memneq(computed_mac, macs->mac2, COOKIE_LEN))
memcpy(peer->latest_cookie.last_mac1_sent, macs->mac1, COOKIE_LEN);
memset(macs->mac2, 0, COOKIE_LEN);
u8 cookie[COOKIE_LEN];
xchacha20poly1305_encrypt(dst->encrypted_cookie, cookie, COOKIE_LEN,
macs->mac1, COOKIE_LEN, dst->nonce,
u8 cookie[COOKIE_LEN];
peer->latest_cookie.last_mac1_sent, COOKIE_LEN, src->nonce,
memcpy(peer->latest_cookie.cookie, cookie, COOKIE_LEN);
static void compute_mac1(u8 mac1[COOKIE_LEN], const void *message, size_t len,
blake2s(key, NOISE_SYMMETRIC_KEY_LEN, message, len, mac1, COOKIE_LEN);
static void compute_mac2(u8 mac2[COOKIE_LEN], const void *message, size_t len,
const u8 cookie[COOKIE_LEN])
blake2s(cookie, COOKIE_LEN, message, len, mac2, COOKIE_LEN);
static void make_cookie(u8 cookie[COOKIE_LEN], struct sk_buff *skb,
u8 cookie[COOKIE_LEN];
u8 last_mac1_sent[COOKIE_LEN];
u8 encrypted_cookie[noise_encrypted_len(COOKIE_LEN)];
u8 mac1[COOKIE_LEN];
u8 mac2[COOKIE_LEN];