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