Received: by 10.213.65.68 with SMTP id h4csp1177475imn; Sat, 7 Apr 2018 20:20:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx48GzwIc8JDR3Z8MwxyZvsC1kCXlgaQpkNQjp8sgTRzXaFAvbYhVY9/w4xBk6GnIeBrNeyV2 X-Received: by 2002:a17:902:28a4:: with SMTP id f33-v6mr32747466plb.115.1523157603625; Sat, 07 Apr 2018 20:20:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523157603; cv=none; d=google.com; s=arc-20160816; b=NyQH2QQ42NlloRF5to2ehRPhpbwM1iUrKjWD8yVz8uMnMF0FMbap8ZvsLSmBc6w8Rk aGTclqkmF3cRs2eJJ8huuZvMjYzRNqm0f6QGrX+imwDt6SmzhyM7wyYdJMNGyrg+y8Ph PGorM7MluQD5KhRb3YimgsU6otwrcJWOAWtOw38PBVYjA4vT8NKLJw9R3z2oboRpR49H RvqaMxbnEQzkQAPgiP5Hoh/9FPowMaZQZSP7OxshGpEMiawXrR/VSAixo/Pqeqj3SZpU v+UhfNsaqLsAJr+ml0hLR/QNhlZxQ1ylDbBMCAPmpQ6hegr1rfA17NifJs1jRVVC6R7Y SnVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=J7VzfgjH9kZsaVsARQSfczpPgqUQDVa9VrhjMY/0rNs=; b=eC8xeE8w3rxb8U5ojymoT79xPp+Z2kTVifZ5ZxKjL/MIRopMX0PVs2+IoBHZO897xf ZummKm5WBAa9z9e2NG0GiMs+J0uflLhNCSjytiOAneAmao7M2YZGAGA0NsmSML9wK1Sm W8jKZzWBYKArwtK7VED/hpF3hcU+BWdsVdFPpjdHoNfTg9pdNAdkS1zMYf67G2rted11 wM75Hx9KRek+JHUOmeBdxL3ToeL0lnGGdkg8pW9/ggYGj5EsEg4iLMTVyy/Wwtzd89D3 +B9CM4bBFrjsIcf5W5YuAtKWy0/fjdaM3HkCL1A65Mk4ylrg164Q1GXX5TnSh1P/YTpf 38Cw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p12si10093805pff.280.2018.04.07.20.19.26; Sat, 07 Apr 2018 20:20:03 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752713AbeDHDPl (ORCPT + 99 others); Sat, 7 Apr 2018 23:15:41 -0400 Received: from orcrist.hmeau.com ([104.223.48.154]:57156 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752460AbeDHDPj (ORCPT ); Sat, 7 Apr 2018 23:15:39 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1f50np-0006Fx-To; Sun, 08 Apr 2018 11:15:38 +0800 Received: from herbert by gondobar with local (Exim 4.84_2) (envelope-from ) id 1f50nE-0006ZQ-MI; Sun, 08 Apr 2018 11:15:00 +0800 Date: Sun, 8 Apr 2018 11:15:00 +0800 From: Herbert Xu To: Salvatore Mesoraca Cc: linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, linux-crypto@vger.kernel.org, "David S. Miller" , Kees Cook , Eric Biggers , Laura Abbott Subject: Re: [PATCH 1/6] crypto: api - laying macros for statically allocated buffers Message-ID: <20180408031500.GA25197@gondor.apana.org.au> References: <1523126303-23205-1-git-send-email-s.mesoraca16@gmail.com> <1523126303-23205-2-git-send-email-s.mesoraca16@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1523126303-23205-2-git-send-email-s.mesoraca16@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 07, 2018 at 08:38:18PM +0200, Salvatore Mesoraca wrote: > Creating 2 new compile-time constants for internal use, > in preparation for the removal of VLAs[1] from crypto code. > All ciphers implemented in Linux have a block size less than or > equal to 16 bytes and the most demanding hw require 16 bytes > alignment for the block buffer. > > [1] http://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com > > Signed-off-by: Salvatore Mesoraca > --- > crypto/internal.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/crypto/internal.h b/crypto/internal.h > index 9a3f399..89ae41e 100644 > --- a/crypto/internal.h > +++ b/crypto/internal.h > @@ -26,6 +26,14 @@ > #include > #include > > +/* > + * Maximum values for blocksize and alignmask, used to allocate > + * static buffers that are big enough for any combination of > + * ciphers and architectures. > + */ > +#define MAX_BLOCKSIZE 16 > +#define MAX_ALIGNMASK 15 No please don't put this here if you intend on using it everywhere. This file is reserved for truly internal bits. Perhaps include/crypto/algapi.h would be a better place. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt