Received: by 10.213.65.68 with SMTP id h4csp882554imn; Sat, 7 Apr 2018 11:46:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+AXHmz9mGK2bZnRurGydbn0yWhiD4nerFALDvnydLWqdyx/PJXsk6RG4RluQv7nFcOpUlp X-Received: by 10.101.82.10 with SMTP id o10mr21007499pgp.148.1523126819455; Sat, 07 Apr 2018 11:46:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523126819; cv=none; d=google.com; s=arc-20160816; b=AMPoriDrPywvGxB+Q1M6+U1FP7BsMOqxx62IVBZq61n9VUVr7YMcGicshNWkdsf5e+ CA2Kzv6Fudfl2QyofrAfX2iJ56p2BqLlj5bJJ2brY3dMIg1Wrz+AjP4tr6D0l/JCjkr7 I1JivfcF1PyOScWlwAw1RWh4q68g4oZX/wvcVIZo0H8s0ULqESou7JRSC6nsdt1UGStX tcXBlAGCWgt+pEyHXr3GHz93Mlxn73hDjHiKa11VNhIY/G3CW/dY3AvTrmz/R/VSIN64 IylcUzoLfmVpC2x3N0+oXK7gE/EwPHQG9pleAb2uNErAZto1aAHz7/fmrYpBFrgNJ90F Ux9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=830I2FtaCI7kkwpzHkb1D64AA5JBuPJRaD87G/HzoCY=; b=Z6FenWKE8TgjaRaJ51wnZ5r0pgjr44cLo3fN7mhPOFvVQaKAhQoGaQmMpA7mnJSo2c BwIJvGCgSvfgdnq07Ja3vRo795mYqVmHLr/Qk1Pi9BYrr7Wm2KwniaQpSV30tTJ5lcap QN8zYRUc4UbX8msHUCeEyDGL4fza9c36QpWwXPjyIDYWWB1RxJ1Wu3mZLh4/ZqsXatFx W2Pf6Rys60wmL63m07Aisl43s0TC+0TQYAjV241rOgkfldXb61+I09gw2gAwWBh0H81J o8R7ccJxpDzi7nyYsEomAJzH2xASGyEwBWITuWXzDQO93kkXKTXL9n76ilSzAFUchwQQ XFnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B8gND4Up; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b4si1712943pgu.79.2018.04.07.11.46.22; Sat, 07 Apr 2018 11:46:59 -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=@gmail.com header.s=20161025 header.b=B8gND4Up; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752610AbeDGSkC (ORCPT + 99 others); Sat, 7 Apr 2018 14:40:02 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:54125 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751952AbeDGSij (ORCPT ); Sat, 7 Apr 2018 14:38:39 -0400 Received: by mail-wm0-f67.google.com with SMTP id 66so3046105wmd.3; Sat, 07 Apr 2018 11:38:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=830I2FtaCI7kkwpzHkb1D64AA5JBuPJRaD87G/HzoCY=; b=B8gND4Up2KAfvNWR9ywbIfoZ90ohlUVZD+E0nHmN7N+ZJcngAuCX+Q+JZy7nqSXfIn 3bB9i77wgD+VrXWVMlSUHO8sbDUWKdzd5GbfMWpVZDxLCVuFJNeeCRfwmnXjOriDKxIC PvXWlB2AjKB3achIM5B3qaK4iYzjIpTrpT9RTt7nkDQ2lW61+KfPze4on/lRGp8NU7hp /Mtzv/9VapjBFT+VYAxdCPSEidvoa5lsXnWMYOi5CNL1dpMjuNXrSWW1e7LhTBnmgQql /dkppdci8loaetB+efJDDc6WzFf6n8/g2OJCcSKDS43spOXEY7+btgcSYYEpA0ZKTw2k u07g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=830I2FtaCI7kkwpzHkb1D64AA5JBuPJRaD87G/HzoCY=; b=huvXvR3vmhCiWBe2GmrFd6fSKnTq2FQ6W4xpKAZ0kebnls2wsK5yiuBsA+dIKtPVQw sYWg3H7mrs6RnNTcEBX0mTvncdZBqRxDXcUqAAQJRmmFiTs/C50vG4qlgY54gUFIotpe q2tnBxPqqCmEOerMvMEI7LbaLvbc8MzeZvY8/WeigakterjeKpjWgGtTRuqNofvMoXeq PT9u5E4wpOrmp3BjOkWRmoTDcgbmSYcHC9RBOahmNGrP+8aO+qPJLhctBRfglCzuCVwp Eh+AVDGClmlBPmbKTT1D4WPupDYIFvSr3WUcAy+fP3khPwOHbGeH5htYy0R3xOMN5jes kVuA== X-Gm-Message-State: ALQs6tDhK7yQvEGnY0YUambaUNmwDUItkXf3xKgQh7LqMJADj+RsDNZB sdpzYa/We5xOuFEr0+DoqWwl42Xo+8o= X-Received: by 10.28.202.16 with SMTP id a16mr18912142wmg.52.1523126318196; Sat, 07 Apr 2018 11:38:38 -0700 (PDT) Received: from localhost ([31.159.162.22]) by smtp.gmail.com with ESMTPSA id m184sm7135034wme.15.2018.04.07.11.38.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 07 Apr 2018 11:38:37 -0700 (PDT) From: Salvatore Mesoraca To: linux-kernel@vger.kernel.org Cc: kernel-hardening@lists.openwall.com, linux-crypto@vger.kernel.org, "David S. Miller" , Herbert Xu , Kees Cook , Salvatore Mesoraca , Eric Biggers , Laura Abbott Subject: [PATCH 1/6] crypto: api - laying macros for statically allocated buffers Date: Sat, 7 Apr 2018 20:38:18 +0200 Message-Id: <1523126303-23205-2-git-send-email-s.mesoraca16@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1523126303-23205-1-git-send-email-s.mesoraca16@gmail.com> References: <1523126303-23205-1-git-send-email-s.mesoraca16@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 + /* Crypto notification events. */ enum { CRYPTO_MSG_ALG_REQUEST, -- 1.9.1