From patchwork Thu Jan 26 17:17:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 92539 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp291239qgi; Thu, 26 Jan 2017 09:18:00 -0800 (PST) X-Received: by 10.99.99.68 with SMTP id x65mr4363750pgb.126.1485451080522; Thu, 26 Jan 2017 09:18:00 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si1901384pll.246.2017.01.26.09.18.00; Thu, 26 Jan 2017 09:18:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753286AbdAZRR7 (ORCPT + 1 other); Thu, 26 Jan 2017 12:17:59 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:37320 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752479AbdAZRR6 (ORCPT ); Thu, 26 Jan 2017 12:17:58 -0500 Received: by mail-wm0-f53.google.com with SMTP id c206so95635893wme.0 for ; Thu, 26 Jan 2017 09:17:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Jkl6iqnl+2ESoDKuF0DNr4OjTgysoSezC+j6G5PicY4=; b=EBk3agj8TM8Lz3y4VH7I6zr1vHYq9wZ8XnZXU5neorr7L4axapZD0N1y74OoNous6e 2jfkan9kTKlFNVKDQ8fRZUnnD8NJy37IruzGQvjmycxJZoFBwlKOyGOpx7GFopOlYFkO Y3/dL6Y7aMkixIMrtzLAoFBsaaLtQTRfGV8js= 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; bh=Jkl6iqnl+2ESoDKuF0DNr4OjTgysoSezC+j6G5PicY4=; b=se2QLMknemPdolfDKu897RhILC36PKg7wAPnqYtQxv7/XLFjB63S6H7p6imViFGiY1 24pfZQfJWtnzJtxCX2m+OL09qM1NpF/9xlwsMzU6lptcj4aIU0rtS7H71vid02X3lCjC 7P2GESbCWKPpTPJvdirjLt9qzz9rpOZNw7v2VT60vO1TZEgLU5nCU9pcDFKerIfIRsdS I7EN6vTn3wI07aiyjSZAUvbAy36mZn+VaOH5xNDFbHhvsCW/eTaRD1GDSBu9PmB+xddW Paxk8226rZkaR02F9rsGJLABgPqTKU2GVbzEEENI6UD3GzUhlBzk22Oca2BkFPs+G61W Z+oA== X-Gm-Message-State: AIkVDXLc7XKKAf690Z7uMRORqobvfD1/8Wdduu/eOwqntYFj2HkpIzS2kapbHlv/dKTuSJn/ X-Received: by 10.28.173.140 with SMTP id w134mr3484076wme.56.1485451076874; Thu, 26 Jan 2017 09:17:56 -0800 (PST) Received: from localhost.localdomain ([160.163.215.165]) by smtp.gmail.com with ESMTPSA id x39sm3573280wrb.3.2017.01.26.09.17.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Jan 2017 09:17:56 -0800 (PST) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: herbert@gondor.apana.org.au, Ard Biesheuvel Subject: [PATCH 0/4] crypto: time invariant AES for CCM (and GCM/CTR) Date: Thu, 26 Jan 2017 17:17:39 +0000 Message-Id: <1485451063-11822-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This series is primarily directed at improving the performance and security of CCM on the Rasperry Pi 3. This involves splitting the MAC handling of CCM into a separate driver so that we can efficiently replace it by something else using the ordinary algo resolution machinery. Patch #1 adds some testcases for cbcmac(aes), which will be introduced later. Patch #2 replaces the open coded CBC MAC hashing routines in the CCM driver with calls to a cbcmac() hash, and implements a template for producing such transforms. This eliminates all the fuzzy scatterwalk code as well. Patch #3 implements cbcmac(aes) using NEON on arm64 Patch #4 is an RFC patch that implements ctr(aes) and cbcmac(aes) in a way that is intended to eliminate observeable data dependent latencies in AES processing, by replacing the usual 16 KB of lookup tables with a single Sbox that is prefetched before processing each block. It is 50% slower than generic AES, but this may be acceptable in many cases. Ard Biesheuvel (4): crypto: testmgr - add test cases for cbcmac(aes) crypto: ccm - switch to separate cbcmac driver crypto: arm64/aes - add NEON and Crypto Extension CBC-MAC driver crypto: aes - add generic time invariant AES for CTR/CCM/GCM arch/arm64/crypto/aes-glue.c | 102 ++++++ arch/arm64/crypto/aes-modes.S | 19 + crypto/Kconfig | 15 + crypto/Makefile | 1 + crypto/aes_ti.c | 314 ++++++++++++++++ crypto/ccm.c | 373 +++++++++++++------- crypto/testmgr.c | 7 + crypto/testmgr.h | 58 +++ 8 files changed, 753 insertions(+), 136 deletions(-) create mode 100644 crypto/aes_ti.c -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html