BLAKE2S_HASH_SIZE
POOL_BITS = BLAKE2S_HASH_SIZE * 8,
.hash.h = { BLAKE2S_IV0 ^ (0x01010000 | BLAKE2S_HASH_SIZE),
.hash.outlen = BLAKE2S_HASH_SIZE,
u8 seed[BLAKE2S_HASH_SIZE], next_key[BLAKE2S_HASH_SIZE];
blake2s_init_key(&input_pool.hash, BLAKE2S_HASH_SIZE, next_key, sizeof(next_key));
i = min_t(size_t, len, BLAKE2S_HASH_SIZE);
NOISE_HASH_LEN = BLAKE2S_HASH_SIZE
u8 i_hash[BLAKE2S_HASH_SIZE] __aligned(__alignof__(u32));
blake2s_init(&blake, BLAKE2S_HASH_SIZE);
blake2s_init(&blake, BLAKE2S_HASH_SIZE);
blake2s_init(&blake, BLAKE2S_HASH_SIZE);
blake2s_update(&blake, i_hash, BLAKE2S_HASH_SIZE);
memcpy(out, i_hash, BLAKE2S_HASH_SIZE);
memzero_explicit(i_hash, BLAKE2S_HASH_SIZE);
u8 output[BLAKE2S_HASH_SIZE + 1];
u8 secret[BLAKE2S_HASH_SIZE];
(first_len > BLAKE2S_HASH_SIZE ||
second_len > BLAKE2S_HASH_SIZE ||
third_len > BLAKE2S_HASH_SIZE ||
hmac(output, output, secret, 1, BLAKE2S_HASH_SIZE);
output[BLAKE2S_HASH_SIZE] = 2;
hmac(output, output, secret, BLAKE2S_HASH_SIZE + 1, BLAKE2S_HASH_SIZE);
output[BLAKE2S_HASH_SIZE] = 3;
hmac(output, output, secret, BLAKE2S_HASH_SIZE + 1, BLAKE2S_HASH_SIZE);
memzero_explicit(secret, BLAKE2S_HASH_SIZE);
memzero_explicit(output, BLAKE2S_HASH_SIZE + 1);
WARN_ON(IS_ENABLED(DEBUG) && (!outlen || outlen > BLAKE2S_HASH_SIZE ||
outlen > BLAKE2S_HASH_SIZE || keylen > BLAKE2S_KEY_SIZE ||
static const u8 hash_testvec_consolidated[BLAKE2S_HASH_SIZE] = {
static const u8 blake2s_keyed_testvec_consolidated[BLAKE2S_HASH_SIZE] = {
u8 digest[BLAKE2S_HASH_SIZE];
for (int out_len = 1; out_len <= BLAKE2S_HASH_SIZE; out_len++) {
u8 hash[BLAKE2S_HASH_SIZE];
u8 out[BLAKE2S_HASH_SIZE])
blake2s(NULL, 0, data, len, out, BLAKE2S_HASH_SIZE);
blake2s_init(ctx, BLAKE2S_HASH_SIZE);
#define HASH_SIZE BLAKE2S_HASH_SIZE
u8 main_hash[BLAKE2S_HASH_SIZE];
blake2s_init(&main_ctx, BLAKE2S_HASH_SIZE);
for (int out_len = 1; out_len <= BLAKE2S_HASH_SIZE; out_len++) {
BLAKE2S_HASH_SIZE);
u8 hash1[BLAKE2S_HASH_SIZE];
u8 hash2[BLAKE2S_HASH_SIZE];
hash1, BLAKE2S_HASH_SIZE);
hash2, BLAKE2S_HASH_SIZE);
KUNIT_ASSERT_MEMEQ(test, hash1, hash2, BLAKE2S_HASH_SIZE);
blake2s_init_key(&ctx, BLAKE2S_HASH_SIZE, guarded_key, key_len);
KUNIT_ASSERT_MEMEQ(test, hash1, hash2, BLAKE2S_HASH_SIZE);