Lines Matching refs:COOKIE_LEN

75 static void compute_mac1(u8 mac1[COOKIE_LEN], const void *message, size_t len,  in compute_mac1()  argument
80 blake2s(mac1, message, key, COOKIE_LEN, len, NOISE_SYMMETRIC_KEY_LEN); in compute_mac1()
83 static void compute_mac2(u8 mac2[COOKIE_LEN], const void *message, size_t len, in compute_mac2() argument
84 const u8 cookie[COOKIE_LEN]) in compute_mac2() argument
88 blake2s(mac2, message, cookie, COOKIE_LEN, len, COOKIE_LEN); in compute_mac2()
91 static void make_cookie(u8 cookie[COOKIE_LEN], struct sk_buff *skb, in make_cookie() argument
106 blake2s_init_key(&state, COOKIE_LEN, checker->secret, NOISE_HASH_LEN); in make_cookie()
126 u8 computed_mac[COOKIE_LEN]; in wg_cookie_validate_packet()
127 u8 cookie[COOKIE_LEN]; in wg_cookie_validate_packet()
132 if (crypto_memneq(computed_mac, macs->mac1, COOKIE_LEN)) in wg_cookie_validate_packet()
143 if (crypto_memneq(computed_mac, macs->mac2, COOKIE_LEN)) in wg_cookie_validate_packet()
165 memcpy(peer->latest_cookie.last_mac1_sent, macs->mac1, COOKIE_LEN); in wg_cookie_add_mac_to_packet()
176 memset(macs->mac2, 0, COOKIE_LEN); in wg_cookie_add_mac_to_packet()
186 u8 cookie[COOKIE_LEN]; in wg_cookie_message_create()
193 xchacha20poly1305_encrypt(dst->encrypted_cookie, cookie, COOKIE_LEN, in wg_cookie_message_create()
194 macs->mac1, COOKIE_LEN, dst->nonce, in wg_cookie_message_create()
202 u8 cookie[COOKIE_LEN]; in wg_cookie_message_consume()
218 peer->latest_cookie.last_mac1_sent, COOKIE_LEN, src->nonce, in wg_cookie_message_consume()
224 memcpy(peer->latest_cookie.cookie, cookie, COOKIE_LEN); in wg_cookie_message_consume()