Lines Matching refs:NOISE_HASH_LEN

30 static u8 handshake_init_hash[NOISE_HASH_LEN] __ro_after_init;
31 static u8 handshake_init_chaining_key[NOISE_HASH_LEN] __ro_after_init;
39 NOISE_HASH_LEN, sizeof(handshake_name), 0); in wg_noise_init()
40 blake2s_init(&blake, NOISE_HASH_LEN); in wg_noise_init()
41 blake2s_update(&blake, handshake_init_chaining_key, NOISE_HASH_LEN); in wg_noise_init()
82 memset(&handshake->hash, 0, NOISE_HASH_LEN); in handshake_zero()
83 memset(&handshake->chaining_key, 0, NOISE_HASH_LEN); in handshake_zero()
346 size_t data_len, const u8 chaining_key[NOISE_HASH_LEN]) in kdf() argument
360 hmac(secret, data, chaining_key, data_len, NOISE_HASH_LEN); in kdf()
394 const u8 chaining_key[NOISE_HASH_LEN]) in derive_keys() argument
404 static bool __must_check mix_dh(u8 chaining_key[NOISE_HASH_LEN], in mix_dh() argument
413 kdf(chaining_key, key, NULL, dh_calculation, NOISE_HASH_LEN, in mix_dh()
419 static bool __must_check mix_precomputed_dh(u8 chaining_key[NOISE_HASH_LEN], in mix_precomputed_dh() argument
426 kdf(chaining_key, key, NULL, precomputed, NOISE_HASH_LEN, in mix_precomputed_dh()
432 static void mix_hash(u8 hash[NOISE_HASH_LEN], const u8 *src, size_t src_len) in mix_hash() argument
436 blake2s_init(&blake, NOISE_HASH_LEN); in mix_hash()
437 blake2s_update(&blake, hash, NOISE_HASH_LEN); in mix_hash()
442 static void mix_psk(u8 chaining_key[NOISE_HASH_LEN], u8 hash[NOISE_HASH_LEN], in mix_psk() argument
446 u8 temp_hash[NOISE_HASH_LEN]; in mix_psk()
448 kdf(chaining_key, temp_hash, key, psk, NOISE_HASH_LEN, NOISE_HASH_LEN, in mix_psk()
450 mix_hash(hash, temp_hash, NOISE_HASH_LEN); in mix_psk()
451 memzero_explicit(temp_hash, NOISE_HASH_LEN); in mix_psk()
454 static void handshake_init(u8 chaining_key[NOISE_HASH_LEN], in handshake_init() argument
455 u8 hash[NOISE_HASH_LEN], in handshake_init() argument
458 memcpy(hash, handshake_init_hash, NOISE_HASH_LEN); in handshake_init()
459 memcpy(chaining_key, handshake_init_chaining_key, NOISE_HASH_LEN); in handshake_init()
465 u8 hash[NOISE_HASH_LEN]) in message_encrypt() argument
468 NOISE_HASH_LEN, in message_encrypt()
475 u8 hash[NOISE_HASH_LEN]) in message_decrypt() argument
478 hash, NOISE_HASH_LEN, in message_decrypt()
487 u8 chaining_key[NOISE_HASH_LEN], in message_ephemeral() argument
488 u8 hash[NOISE_HASH_LEN]) in message_ephemeral() argument
493 kdf(chaining_key, NULL, NULL, ephemeral_src, NOISE_HASH_LEN, 0, 0, in message_ephemeral()
591 u8 chaining_key[NOISE_HASH_LEN]; in wg_noise_handshake_consume_initiation()
592 u8 hash[NOISE_HASH_LEN]; in wg_noise_handshake_consume_initiation()
647 memcpy(handshake->hash, hash, NOISE_HASH_LEN); in wg_noise_handshake_consume_initiation()
648 memcpy(handshake->chaining_key, chaining_key, NOISE_HASH_LEN); in wg_noise_handshake_consume_initiation()
659 memzero_explicit(hash, NOISE_HASH_LEN); in wg_noise_handshake_consume_initiation()
660 memzero_explicit(chaining_key, NOISE_HASH_LEN); in wg_noise_handshake_consume_initiation()
735 u8 hash[NOISE_HASH_LEN]; in wg_noise_handshake_consume_response()
736 u8 chaining_key[NOISE_HASH_LEN]; in wg_noise_handshake_consume_response()
755 memcpy(hash, handshake->hash, NOISE_HASH_LEN); in wg_noise_handshake_consume_response()
756 memcpy(chaining_key, handshake->chaining_key, NOISE_HASH_LEN); in wg_noise_handshake_consume_response()
795 memcpy(handshake->hash, hash, NOISE_HASH_LEN); in wg_noise_handshake_consume_response()
796 memcpy(handshake->chaining_key, chaining_key, NOISE_HASH_LEN); in wg_noise_handshake_consume_response()
807 memzero_explicit(hash, NOISE_HASH_LEN); in wg_noise_handshake_consume_response()
808 memzero_explicit(chaining_key, NOISE_HASH_LEN); in wg_noise_handshake_consume_response()