From patchwork Wed Aug 21 14:32:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 171955 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp1055107ily; Wed, 21 Aug 2019 07:33:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqExX37gqQtdBwQTvT/L6UJBq07vGmtU5X5CJYfoTF/HLMV4KNhHf0hcYXhKBSPwvoBdU5 X-Received: by 2002:a62:80cb:: with SMTP id j194mr37029500pfd.183.1566397983339; Wed, 21 Aug 2019 07:33:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566397983; cv=none; d=google.com; s=arc-20160816; b=zMR7tkd0966svBD/AWGei+u7eM26ZmPG/7mT/COvdHcs8iOQ7k9XIfEiAv0zSDe+Bb n++XZuzXcyMGZBZAOsku43vUWivExvRrz9oUCmE2mRvpC6Pym9FRwlCXabWCQsCrwgfl QEKjUFw+mZcwSgR/jNQ7goahkkE6jxvXtBQ/KGTjztuQ8+TbDqK6GuhMrxgv5iMV34az WirJ0bhrFQKXcoNB/zhcEia7AkF74+bVmmaag9ruAHgJl9xkWVF2AlW7b2/VJvl4nrj4 Qv4dt37ye+8smv+wWykps2rF2mSTsGLF48i1ff1W5zIVP2i76NHlYU5Z9dIWy4/lz8Wa va+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=kUJpizLlmm66I2Pnnp3eJ7jlYiNKdCttYY5hdsXWS1c=; b=IGw+7UAzR+LrDZGbIb5Z8PAqJSY09kopc3ji24OJ1ZhWphWlly5UxBdS+v/J5exvdu 4EMx3VZ3SZWQCfiiEEtJLWg6gw/A70JwYRaLeuGYox2QdJCcXa35pCOev0W8IvIoSaRv +iJtjtNXXFI+XxYSvTuQN+hor+fz+nn+duasiDTwhJreR+k4nyy0p6yEQYsQo8H8cwx9 ajELQ3J4s7tQ4cwdqGVLyaU71R61n5AjDBjwzyqYxHTotG+cdfIaZ3Ie7jzK7IEBYTMc +ePuT4IQOaeAoKnLidqUwZgGdh7bNPG4BLYL70kLrWT+xx8dQD797qDDkv8Gd2K0YL6a qb2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p9W4spdn; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j16si15915283pfh.0.2019.08.21.07.33.03; Wed, 21 Aug 2019 07:33:03 -0700 (PDT) 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=pass header.i=@linaro.org header.s=google header.b=p9W4spdn; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728608AbfHUOdC (ORCPT + 3 others); Wed, 21 Aug 2019 10:33:02 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:37971 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728502AbfHUOdC (ORCPT ); Wed, 21 Aug 2019 10:33:02 -0400 Received: by mail-wm1-f68.google.com with SMTP id m125so2372670wmm.3 for ; Wed, 21 Aug 2019 07:33:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=kUJpizLlmm66I2Pnnp3eJ7jlYiNKdCttYY5hdsXWS1c=; b=p9W4spdnqcLjGzXvDCQvdK7Tv5WEFBqW4L3XIv/M7fP3l3hmUe8tj4WBVt+44ghxIi 8/miBHY97Eyf1AUhdXZ7HkoRpELWDuPA2wNlfgefbVbtYXy7uMN+t1kypZ6RrWFH3CO+ whV7OT4o0fVsVL7WP3AYG+5ITiYVmgPbevX8Vbzd7/nnl4TMuHeAvWhlk86MGsZ7dwuI 0iqWG52VPNjv25kS7pFjWZXthN9PMWcbn0hH80f1Dy85bFn0gz1Vw5BFo8FEXvSH1lFb VjpqB0qryqBlp1fj8bcJ4sH6E7Gl53DD1OeqAhjySk6f5ApDjsYSYVqrfEXDWMvo5x/P KhZw== 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=kUJpizLlmm66I2Pnnp3eJ7jlYiNKdCttYY5hdsXWS1c=; b=sLmMI6UTXiFBCGzis7OB3Hhy4BdZdTJc2CvJOS1eLDqptaSllmuDBy4z1h72jv8y5b 0p7Zh9xxhUz7Jk08e2ikWHQdu6THGB5neE7L8GFQuvR/25ecz8sVhB8mnvptgpDugaQm Qwuje/eKJUpNF+Fg6Lsh5T/eP1g9+ArSiGDkfkE9gx8BjHVDFY6rpKbr16gxd/ttaIAi cZcjaZ4iAO/CuYtrIiGygKf+PLrRWSutoUMPYIb8vcp8VaUfqojlBwtvwx2PuX74P9JF wq1l87ty/RLJBMR3mvTeTVE/JDLtApZcCtT8ZQhQyZaKz80LlViG/pm8Db8GG8qlmOTU TzJQ== X-Gm-Message-State: APjAAAXI1oSvFR6gMoUxJv1m6yYcQx33DNVx5Z8WZDb6bAAbbYa+ManG PzRwJU/sned8/8WWiGUH2EEGfSgY21nrTw== X-Received: by 2002:a7b:c651:: with SMTP id q17mr359364wmk.136.1566397979643; Wed, 21 Aug 2019 07:32:59 -0700 (PDT) Received: from mba13.lan (adsl-103.109.242.1.tellas.gr. [109.242.1.103]) by smtp.gmail.com with ESMTPSA id 16sm181427wmx.45.2019.08.21.07.32.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 07:32:58 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, ebiggers@kernel.org, Ard Biesheuvel Subject: [PATCH 00/17] crypto: arm/aes - XTS ciphertext stealing and other updates Date: Wed, 21 Aug 2019 17:32:36 +0300 Message-Id: <20190821143253.30209-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This is a collection of improvements for the ARM and arm64 implementations of the AES based skciphers. NOTES: - the last two patches add XTS ciphertext stealing test vectors and should NOT be merged until all AES-XTS implementations have been confirmed to work - this series applies onto v13 of my ESSIV series - tested for correctness [on both QEMU and actual hardware (via kernelci)] but not for performance regressions The most important part of this series is the implementation of ciphertext stealing support for the XTS skciphers. The CE and NEON bit slicing based code for both ARM and arm64 is updated to handle inputs of any length >= the XTS block size of 16 bytes. It also updates the arm64 CTS/CBC implementation not to use a request ctx structure, and ports the resulting implementation to ARM as well. The remaining patches are cleanups and minor improvements in the 'ongoing maintenance' category. None of these are -stable candidates AFAICT. Ard Biesheuvel (16): crypto: arm/aes - fix round key prototypes crypto: arm/aes-ce - yield the SIMD unit between scatterwalk steps crypto: arm/aes-ce - switch to 4x interleave crypto: arm/aes-ce - replace tweak mask literal with composition crypto: arm/aes-neonbs - replace tweak mask literal with composition crypto: arm64/aes-neonbs - replace tweak mask literal with composition crypto: arm64/aes-neon - limit exposed routines if faster driver is enabled crypto: skcipher - add the ability to abort a skcipher walk crypto: arm64/aes-cts-cbc-ce - performance tweak crypto: arm64/aes-cts-cbc - move request context data to the stack crypto: arm64/aes - implement support for XTS ciphertext stealing crypto: arm64/aes-neonbs - implement ciphertext stealing for XTS crypto: arm/aes-ce - implement ciphertext stealing for XTS crypto: arm/aes-neonbs - implement ciphertext stealing for XTS crypto: arm/aes-ce - implement ciphertext stealing for CBC crypto: testmgr - add test vectors for XTS ciphertext stealing Pascal van Leeuwen (1): crypto: testmgr - Add additional AES-XTS vectors for covering CTS arch/arm/crypto/aes-ce-core.S | 462 ++++++++++++++------ arch/arm/crypto/aes-ce-glue.c | 377 +++++++++++++--- arch/arm/crypto/aes-neonbs-core.S | 24 +- arch/arm/crypto/aes-neonbs-glue.c | 91 +++- arch/arm64/crypto/aes-ce.S | 3 + arch/arm64/crypto/aes-glue.c | 299 ++++++++----- arch/arm64/crypto/aes-modes.S | 107 ++++- arch/arm64/crypto/aes-neon.S | 5 + arch/arm64/crypto/aes-neonbs-core.S | 9 +- arch/arm64/crypto/aes-neonbs-glue.c | 111 ++++- crypto/skcipher.c | 3 + crypto/testmgr.h | 368 ++++++++++++++++ include/crypto/internal/skcipher.h | 5 + 13 files changed, 1498 insertions(+), 366 deletions(-) -- 2.17.1