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()
311 size_t data_len, const u8 chaining_key[NOISE_HASH_LEN]) in kdf() argument
325 blake2s256_hmac(secret, data, chaining_key, data_len, NOISE_HASH_LEN); in kdf()
361 const u8 chaining_key[NOISE_HASH_LEN]) in derive_keys() argument
371 static bool __must_check mix_dh(u8 chaining_key[NOISE_HASH_LEN], in mix_dh() argument
380 kdf(chaining_key, key, NULL, dh_calculation, NOISE_HASH_LEN, in mix_dh()
386 static bool __must_check mix_precomputed_dh(u8 chaining_key[NOISE_HASH_LEN], in mix_precomputed_dh() argument
393 kdf(chaining_key, key, NULL, precomputed, NOISE_HASH_LEN, in mix_precomputed_dh()
399 static void mix_hash(u8 hash[NOISE_HASH_LEN], const u8 *src, size_t src_len) in mix_hash() argument
403 blake2s_init(&blake, NOISE_HASH_LEN); in mix_hash()
404 blake2s_update(&blake, hash, NOISE_HASH_LEN); in mix_hash()
409 static void mix_psk(u8 chaining_key[NOISE_HASH_LEN], u8 hash[NOISE_HASH_LEN], in mix_psk() argument
413 u8 temp_hash[NOISE_HASH_LEN]; in mix_psk()
415 kdf(chaining_key, temp_hash, key, psk, NOISE_HASH_LEN, NOISE_HASH_LEN, in mix_psk()
417 mix_hash(hash, temp_hash, NOISE_HASH_LEN); in mix_psk()
418 memzero_explicit(temp_hash, NOISE_HASH_LEN); in mix_psk()
421 static void handshake_init(u8 chaining_key[NOISE_HASH_LEN], in handshake_init() argument
422 u8 hash[NOISE_HASH_LEN], in handshake_init() argument
425 memcpy(hash, handshake_init_hash, NOISE_HASH_LEN); in handshake_init()
426 memcpy(chaining_key, handshake_init_chaining_key, NOISE_HASH_LEN); in handshake_init()
432 u8 hash[NOISE_HASH_LEN]) in message_encrypt() argument
435 NOISE_HASH_LEN, in message_encrypt()
442 u8 hash[NOISE_HASH_LEN]) in message_decrypt() argument
445 hash, NOISE_HASH_LEN, in message_decrypt()
454 u8 chaining_key[NOISE_HASH_LEN], in message_ephemeral() argument
455 u8 hash[NOISE_HASH_LEN]) in message_ephemeral() argument
460 kdf(chaining_key, NULL, NULL, ephemeral_src, NOISE_HASH_LEN, 0, 0, in message_ephemeral()
558 u8 chaining_key[NOISE_HASH_LEN]; in wg_noise_handshake_consume_initiation()
559 u8 hash[NOISE_HASH_LEN]; in wg_noise_handshake_consume_initiation()
614 memcpy(handshake->hash, hash, NOISE_HASH_LEN); in wg_noise_handshake_consume_initiation()
615 memcpy(handshake->chaining_key, chaining_key, NOISE_HASH_LEN); in wg_noise_handshake_consume_initiation()
626 memzero_explicit(hash, NOISE_HASH_LEN); in wg_noise_handshake_consume_initiation()
627 memzero_explicit(chaining_key, NOISE_HASH_LEN); in wg_noise_handshake_consume_initiation()
702 u8 hash[NOISE_HASH_LEN]; in wg_noise_handshake_consume_response()
703 u8 chaining_key[NOISE_HASH_LEN]; in wg_noise_handshake_consume_response()
722 memcpy(hash, handshake->hash, NOISE_HASH_LEN); in wg_noise_handshake_consume_response()
723 memcpy(chaining_key, handshake->chaining_key, NOISE_HASH_LEN); in wg_noise_handshake_consume_response()
762 memcpy(handshake->hash, hash, NOISE_HASH_LEN); in wg_noise_handshake_consume_response()
763 memcpy(handshake->chaining_key, chaining_key, NOISE_HASH_LEN); in wg_noise_handshake_consume_response()
774 memzero_explicit(hash, NOISE_HASH_LEN); in wg_noise_handshake_consume_response()
775 memzero_explicit(chaining_key, NOISE_HASH_LEN); in wg_noise_handshake_consume_response()