Lines Matching refs:hash
82 memset(&handshake->hash, 0, NOISE_HASH_LEN); in handshake_zero()
432 static void mix_hash(u8 hash[NOISE_HASH_LEN], const u8 *src, size_t src_len) in mix_hash()
437 blake2s_update(&blake, hash, NOISE_HASH_LEN); in mix_hash()
439 blake2s_final(&blake, hash); in mix_hash()
442 static void mix_psk(u8 chaining_key[NOISE_HASH_LEN], u8 hash[NOISE_HASH_LEN], in mix_psk()
450 mix_hash(hash, temp_hash, NOISE_HASH_LEN); in mix_psk()
455 u8 hash[NOISE_HASH_LEN], in handshake_init()
458 memcpy(hash, handshake_init_hash, NOISE_HASH_LEN); in handshake_init()
460 mix_hash(hash, remote_static, NOISE_PUBLIC_KEY_LEN); in handshake_init()
465 u8 hash[NOISE_HASH_LEN]) in message_encrypt()
467 chacha20poly1305_encrypt(dst_ciphertext, src_plaintext, src_len, hash, in message_encrypt()
470 mix_hash(hash, dst_ciphertext, noise_encrypted_len(src_len)); in message_encrypt()
475 u8 hash[NOISE_HASH_LEN]) in message_decrypt()
478 hash, NOISE_HASH_LEN, in message_decrypt()
481 mix_hash(hash, src_ciphertext, src_len); in message_decrypt()
488 u8 hash[NOISE_HASH_LEN]) in message_ephemeral()
492 mix_hash(hash, ephemeral_src, NOISE_PUBLIC_KEY_LEN); in message_ephemeral()
537 handshake_init(handshake->chaining_key, handshake->hash, in wg_noise_handshake_create_initiation()
547 handshake->hash); in wg_noise_handshake_create_initiation()
557 NOISE_PUBLIC_KEY_LEN, key, handshake->hash); in wg_noise_handshake_create_initiation()
567 NOISE_TIMESTAMP_LEN, key, handshake->hash); in wg_noise_handshake_create_initiation()
592 u8 hash[NOISE_HASH_LEN]; in wg_noise_handshake_consume_initiation() local
602 handshake_init(chaining_key, hash, wg->static_identity.static_public); in wg_noise_handshake_consume_initiation()
605 message_ephemeral(e, src->unencrypted_ephemeral, chaining_key, hash); in wg_noise_handshake_consume_initiation()
613 sizeof(src->encrypted_static), key, hash)) in wg_noise_handshake_consume_initiation()
629 sizeof(src->encrypted_timestamp), key, hash)) in wg_noise_handshake_consume_initiation()
647 memcpy(handshake->hash, hash, NOISE_HASH_LEN); in wg_noise_handshake_consume_initiation()
659 memzero_explicit(hash, NOISE_HASH_LEN); in wg_noise_handshake_consume_initiation()
694 handshake->hash); in wg_noise_handshake_create_response()
707 mix_psk(handshake->chaining_key, handshake->hash, key, in wg_noise_handshake_create_response()
711 message_encrypt(dst->encrypted_nothing, NULL, 0, key, handshake->hash); in wg_noise_handshake_create_response()
735 u8 hash[NOISE_HASH_LEN]; in wg_noise_handshake_consume_response() local
755 memcpy(hash, handshake->hash, NOISE_HASH_LEN); in wg_noise_handshake_consume_response()
767 message_ephemeral(e, src->unencrypted_ephemeral, chaining_key, hash); in wg_noise_handshake_consume_response()
778 mix_psk(chaining_key, hash, key, preshared_key); in wg_noise_handshake_consume_response()
782 sizeof(src->encrypted_nothing), key, hash)) in wg_noise_handshake_consume_response()
795 memcpy(handshake->hash, hash, NOISE_HASH_LEN); in wg_noise_handshake_consume_response()
807 memzero_explicit(hash, NOISE_HASH_LEN); in wg_noise_handshake_consume_response()