From patchwork Sun Jan 14 16:41:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 124440 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp421618lje; Sun, 14 Jan 2018 08:41:32 -0800 (PST) X-Google-Smtp-Source: ACJfBot81PXJQA3pzNAuqnSnQ+rBqQN2pq294Vy/I+zZWV+MglpYCzUQHGisxK/z1pNhpsW99XDa X-Received: by 10.98.101.71 with SMTP id z68mr6991096pfb.181.1515948092336; Sun, 14 Jan 2018 08:41:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515948092; cv=none; d=google.com; s=arc-20160816; b=eQVDxG8gotPrgT0Col42xmDxf2cPtuvHhAgdCqIzxyU6ZdcgthHr6XKG0ffCwWc+V6 gxExUpKXCq/i37131R6zAuhTyLjyAGTFnnX/8lHAdCcMyO4dtrcmIhQfdYE+wM4NSyTt eOYWf+3yaLSiMypzSWwRmbmTctgCgetDa8yhwCs59/kpvsmA3arvVui+pLNVvTvtlAjG +Ii1ojJG4BnY0ZXy3BhCIZn2GDGLdFY6rKKbF64wQC0lekUtk02Q558EIuCg7ckvj3/F wUlKinaVgR8d6+RnXjfQYeiio5JIKfi/67JKxY8YrUzb44qnXm9Qfpq5ICHNvqdyFZsl pFVQ== 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:arc-authentication-results; bh=xuJWwfmlsX20HRZ1xryplCyFY+NqtILsmhcTsjkYkkA=; b=1DFtPvZtDrCNS+uhpk7mUfm1IQrGor4l09UusKj0ViBTpTb9UYYv5UwfneCekPh1eS r8rTEVKRRjrBJfAuwChEKtuKimQTwaACH/XpJpxax4Bh5Hphb9yZlANseeLy8QH038zj 7Sop9OKQS1Pyegg2asVVOCUp1NhvObWtmzgmPyFlQXYHo+9wyfgS1SaScPmIj+EHer+5 g9qGy7CTcXTBiQiukqgEvs9FItpexw3GtHhfRUexcJwrT1TJPSOvXQw2Uj9n+dWWAX1R TBOy3AztbIoIoQjb1DR+gv5nb4Os9ENfPVnSXvQHN82uYSDC0DanazSPPQ04L3YRSt/1 KqVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B+Ed+LqS; 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 e186si18965997pfe.182.2018.01.14.08.41.32; Sun, 14 Jan 2018 08:41:32 -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=pass header.i=@linaro.org header.s=google header.b=B+Ed+LqS; 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 S1751622AbeANQla (ORCPT + 1 other); Sun, 14 Jan 2018 11:41:30 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:44465 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751239AbeANQla (ORCPT ); Sun, 14 Jan 2018 11:41:30 -0500 Received: by mail-wm0-f65.google.com with SMTP id t74so1887598wme.3 for ; Sun, 14 Jan 2018 08:41:29 -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=xuJWwfmlsX20HRZ1xryplCyFY+NqtILsmhcTsjkYkkA=; b=B+Ed+LqS0OquQjf8XGiUul6b1F1PJPHulqV6ndtGJIDxR0PpXA4aNK/UMr/fZSPdNZ PEdKMbvgs+tHetWL6wC+q9zX+xWbrV0QNvqBRCmelDVdpa0YhL2IRFuZRx5Wcqlxguci IBVhDNhuiXJdemrT3D3QliR5JEufvqvBIui/g= 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=xuJWwfmlsX20HRZ1xryplCyFY+NqtILsmhcTsjkYkkA=; b=MDtLbsToirhlwGNN2Qx2EFuWIZAuwWkU8tRuqfZGTz9EEJ9nHylgHBq7FfE8+7Je0E fKF3hOJtRyQ42nhtF0IqfkSQ7fYROF8WquMXXCMBbHQrtHl324+6DJR+J4HLRZrhYEjH C0afoFOzooJJ+KXIGCR/u4pWJrpdtLo8ee355WPpyaEsRwpynbVyaU2D5DnWOZBVdMZ9 PrxcPeODJDFNcgPb4j9rwee8SY6dBA9awnHMJmVYLPgki1DI4qlG8bwiWgNdQuqna5kr UZm4Z68B5qUdTDknozA1+cMLyehq48hUciP/0bVyXsZd5NjPjQcz60M+ULT+4PNdIedY RZMw== X-Gm-Message-State: AKwxytdyqwxck/tK+EyY96S7pHn8fuJ3t5ZhoLDoamUs4X7UBDjrbzuu hTixt8LTrxEB0Y9+EX3AQDDHrw== X-Received: by 10.28.8.11 with SMTP id 11mr8681828wmi.63.1515948088819; Sun, 14 Jan 2018 08:41:28 -0800 (PST) Received: from localhost.localdomain ([105.141.218.128]) by smtp.gmail.com with ESMTPSA id q6sm24104197wrc.36.2018.01.14.08.41.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 08:41:27 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, will.deacon@arm.com, catalin.marinas@arm.com, steve.capper@linaro.org, jgarzik@redhat.com, arnd@arndb.de, Ard Biesheuvel Subject: [PATCH v2 0/3] sha3 fixes and new implementation for arm64 Date: Sun, 14 Jan 2018 16:41:15 +0000 Message-Id: <20180114164118.18330-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Add an implementation of SHA3 to arm64 using the new special instructions, and another one using scalar instructions but coded in assembler (#2) In preparation of that, fix a bug in the SHA3 (#1) and add some new test vectors to get better test coverage (#3). v2: Drop generic SHA3 as a fallback for the arm64 module. Instead, provide a special arm64 version to use as a fallback when the instructions are not available or when executing in a context that does not allow SIMD Drop patches that simplify the generic SHA3 and make it reusable by other modules. Ard Biesheuvel (3): crypto/generic: sha3 - fixes for alignment and big endian operation crypto/arm64: sha3 - new scalar + v8.2 Crypto Extensions implementation crypto/testmgr: sha3 - add new testcases arch/arm64/crypto/Kconfig | 4 + arch/arm64/crypto/Makefile | 3 + arch/arm64/crypto/sha3-arm64-core.S | 512 ++++++++++++++++++ arch/arm64/crypto/sha3-arm64-glue.c | 192 +++++++ crypto/sha3_generic.c | 5 +- crypto/testmgr.h | 550 ++++++++++++++++++++ 6 files changed, 1264 insertions(+), 2 deletions(-) create mode 100644 arch/arm64/crypto/sha3-arm64-core.S create mode 100644 arch/arm64/crypto/sha3-arm64-glue.c -- 2.11.0