Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp111093imm; Tue, 18 Sep 2018 17:47:34 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbdUOVbbspjobf9H0hY9pXtjvXE7vA8VCa2qaFwNwFqgPwtxq5G87bq8e8OR+puoBstHMTj X-Received: by 2002:a63:d90b:: with SMTP id r11-v6mr30171728pgg.315.1537318054316; Tue, 18 Sep 2018 17:47:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537318054; cv=none; d=google.com; s=arc-20160816; b=GNKVvGy62i4m8OjDc81PH/S8Xxazp5njqnKeDxv9V7qf3Glf0+O2bW43omXJLwfQ/h m83k8yJGHj2JjBu0YCWHcrmY9t1J3/0cFr0mpcS7h0oUHmH957McfSCq22Zdzz3sxJVS QUEfHPGlXIe4IEuMCT5YBgJRiO/wt6FEOZ+VZMP76nqBGNqeG3O5EI0x75cxCi/y6+sz Imz9N8xbXOInhkgX7ZUDkg1DLoVpxPl6F04Y4d1XKS8Bm+opVVfEikpMVkousn7pYRa0 /2KQvA6n7MzDmnwgWkLhLgGbyIEjYO96sW13hQbB7N7TaOfebcG9fPXwprGs2s+tT+pv pJVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ueFQdys1MYKF+jP4KGoSRBADXY2H0n6r1pdyu2UvVlE=; b=NkOHGgpOHEMef2IftJObhRmKVY7aoqj27beGXhEGX87lZyteyOS5AIgcjuUIsa3ku8 ds2eJg9AgzUGZXwBmC+8qwcGnSWwvezGv+X2HkRhivFLrtZ7FM7OWmTlgsHNJDh5h8rx 8mPA/97+yipOd2SIrJ9AA1sOVwpdZDYjSv9OPrN4syQ4REaGCB+UsCk7lxxOiV+Rkjyf 1sreinPjXoN222S7no5DnEFsgWFZXeJG/hP+3TBd1hO4IeWBvrSa6h3AeO91bx/7cVaw lyLFLEr4RvNcrklJ5saIAJXvPO0UsEKM/W3ntwp9k18V8XBoFrhL930agullxYRT1a9O uoDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=xsrcl7i3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v188-v6si19789640pgb.96.2018.09.18.17.46.48; Tue, 18 Sep 2018 17:47:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=xsrcl7i3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730761AbeISGVL (ORCPT + 99 others); Wed, 19 Sep 2018 02:21:11 -0400 Received: from frisell.zx2c4.com ([192.95.5.64]:37789 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727686AbeISGVL (ORCPT ); Wed, 19 Sep 2018 02:21:11 -0400 Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 2fd69d60; Wed, 19 Sep 2018 00:28:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=mime-version :references:in-reply-to:from:date:message-id:subject:to:cc :content-type; s=mail; bh=Ej8cbOf50zxWVmDYal00+LfH7Dk=; b=xsrcl7 i3iHFZM95G9gp3ntTEjVuDq30fibtgfPe+VEdEmlZJc9Aqb3VUwwU9CdXl/pik4i AcJzP90XgFJKfd2i0Pon4XLQCzoCI+Di88AOA3JWIhKieI5DZ/qhGNdlh3JdUM2n Y5a1Dw51ukRwguJeKl323cO5pr3LtPtusjuhWvdLLDR/CBeGD2RwD3XnLcj+ic3e MR5D3J2QGzmyYz0m+Brb3NNgGt+NPIG9/wpfViqxtm5KIdTBAIcjOY5QJomnjcaz zLXWRpTfEGx5NymV6M3uQIL0/fxkbOo8qtwlyE8dtt2JHopEujmmkRj1vydU1ibs Ui1eih5ylRCxwivA== Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 0904a8f8 (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128:NO); Wed, 19 Sep 2018 00:28:21 +0000 (UTC) Received: by mail-oi0-f54.google.com with SMTP id r69-v6so3535151oie.3; Tue, 18 Sep 2018 17:45:58 -0700 (PDT) X-Gm-Message-State: APzg51Ap16VeSaDbN83Y8INaaeydt0nCn0shn9KYbecSArmDRb/U63cc 7dSEPvuiyawtLsINsA1MnfBpKTunaCqVZaWjn4M= X-Received: by 2002:aca:b256:: with SMTP id b83-v6mr186110oif.235.1537317957448; Tue, 18 Sep 2018 17:45:57 -0700 (PDT) MIME-Version: 1.0 References: <20180918161646.19105-1-Jason@zx2c4.com> <20180918161646.19105-13-Jason@zx2c4.com> <20180919004132.GB74746@gmail.com> In-Reply-To: <20180919004132.GB74746@gmail.com> From: "Jason A. Donenfeld" Date: Wed, 19 Sep 2018 02:45:46 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH net-next v5 12/20] zinc: BLAKE2s generic C implementation and selftest To: Eric Biggers Cc: LKML , Netdev , Linux Crypto Mailing List , David Miller , Greg Kroah-Hartman , Samuel Neves , Andrew Lutomirski , Jean-Philippe Aumasson Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey Eric, On Wed, Sep 19, 2018 at 2:41 AM Eric Biggers wrote: > This buffer is 4 times too long. Nice catch. > Or how about something much simpler: > > static inline void blake2s_final(struct blake2s_state *state, u8 *out, > const size_t outlen) > { > #ifdef DEBUG > BUG_ON(!out || !outlen || outlen > BLAKE2S_OUTBYTES); > #endif > __blake2s_final(state); > > cpu_to_le32_array(state->h, ARRAY_SIZE(state->h)); > memcpy(out, state->h, outlen); > > memzero_explicit(state, sizeof(*state)); > } Oh, that's excellent, thanks. Much better than prior. I'll do exactly that. Jason