From Crystal Kolipe.
-/* $OpenBSD: blake2s.c,v 1.2 2020/07/22 13:54:30 tobhe Exp $ */
+/* $OpenBSD: blake2s.c,v 1.3 2023/02/03 18:31:16 miod Exp $ */
/*
* Copyright (C) 2012 Samuel Neves <sneves@dei.uc.pt>. All Rights Reserved.
* Copyright (C) 2015-2020 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
void blake2s_init(struct blake2s_state *state, const size_t outlen)
{
-#ifdef DIAGNOSTIC
KASSERT(!(!outlen || outlen > BLAKE2S_HASH_SIZE));
-#endif
blake2s_init_param(state, 0x01010000 | outlen);
state->outlen = outlen;
}
{
uint8_t block[BLAKE2S_BLOCK_SIZE] = { 0 };
-#ifdef DIAGNOSTIC
KASSERT(!(!outlen || outlen > BLAKE2S_HASH_SIZE ||
!key || !keylen || keylen > BLAKE2S_KEY_SIZE));
-#endif
blake2s_init_param(state, 0x01010000 | keylen << 8 | outlen);
state->outlen = outlen;
uint32_t v[16];
int i;
-#ifdef DIAGNOSTIC
KASSERT(!((nblocks > 1 && inc != BLAKE2S_BLOCK_SIZE)));
-#endif
while (nblocks > 0) {
blake2s_increment_counter(state, inc);
-/* $OpenBSD: blake2s.h,v 1.2 2020/07/22 13:54:30 tobhe Exp $ */
+/* $OpenBSD: blake2s.h,v 1.3 2023/02/03 18:31:16 miod Exp $ */
/*
* Copyright (C) 2015-2020 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
* Copyright (C) 2019-2020 Matt Dunwoodie <ncon@noconroy.net>.
{
struct blake2s_state state;
-#ifdef DIAGNOSTIC
KASSERT((in != NULL || inlen == 0) &&
out != NULL && outlen <= BLAKE2S_HASH_SIZE &&
(key != NULL || keylen == 0) && keylen <= BLAKE2S_KEY_SIZE);
-#endif
if (keylen)
blake2s_init_key(&state, outlen, key, keylen);
-/* $OpenBSD: ahci.c,v 1.38 2022/04/09 20:10:26 naddy Exp $ */
+/* $OpenBSD: ahci.c,v 1.39 2023/02/03 18:31:16 miod Exp $ */
/*
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
printf("ahci_put_err_ccb but SACT %08x != 0?\n", sact);
KASSERT(ahci_pread(ap, AHCI_PREG_CI) == 0);
-#ifdef DIAGNOSTIC
/* Done with the CCB */
KASSERT(ccb == ap->ap_ccb_err);
-#endif
/* Restore outstanding command state */
ap->ap_sactive = ap->ap_err_saved_sactive;
-/* $OpenBSD: wg_noise.c,v 1.5 2021/03/21 18:13:59 sthen Exp $ */
+/* $OpenBSD: wg_noise.c,v 1.6 2023/02/03 18:31:17 miod Exp $ */
/*
* Copyright (C) 2015-2020 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
* Copyright (C) 2019-2020 Matt Dunwoodie <ncon@noconroy.net>
uint8_t out[BLAKE2S_HASH_SIZE + 1];
uint8_t sec[BLAKE2S_HASH_SIZE];
-#ifdef DIAGNOSTIC
KASSERT(a_len <= BLAKE2S_HASH_SIZE && b_len <= BLAKE2S_HASH_SIZE &&
c_len <= BLAKE2S_HASH_SIZE);
KASSERT(!(b || b_len || c || c_len) || (a && a_len));
KASSERT(!(c || c_len) || (b && b_len));
-#endif
/* Extract entropy from "x" into sec */
blake2s_hmac(sec, x, ck, BLAKE2S_HASH_SIZE, x_len, NOISE_HASH_LEN);