From patchwork Fri Jan 19 12:04:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 125152 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp259550ljf; Fri, 19 Jan 2018 04:05:12 -0800 (PST) X-Google-Smtp-Source: ACJfBouJ3R8/fl6INI7AYTXuEwIhpmr2BN6YMXUydBqpAZpOXr1U0JcYuqLtNSKQ4NJj3ErGQIra X-Received: by 2002:a17:902:6b05:: with SMTP id o5-v6mr1465968plk.179.1516363512206; Fri, 19 Jan 2018 04:05:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516363512; cv=none; d=google.com; s=arc-20160816; b=vQmfpIlz4rkb0swogp53VwK+KrJ5nx7vskGxc2MWwUYDDJAoLyYVil4+kG8Jy2eEoh zNZFbK2Gn14ocCBJHbRc6HgEXXJB+0cs12hGGZ2Sy/B7nWi40wDmuYsqK6UJT9gw6Qhh nsv7goJA8VBZSWLyGFYdDutrxgzoT/g8glglvbbFVO/9pcsywD7/igbUGkXlv3T02Gpa 95E/YFRgx3O4cVpyXqEyNVt5OxeO8Tc3yPs958gTv4YdrK1ozrIXICefOtX2g1BpPGmH HrKcjbLNeOtMh8Cdu5zX3VrkbnPgYloi9WeGJoTv/fDA1MB3UyocRdoKWF3YTuX9VXu7 cKBA== 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=6Y22AgYL1ev/U0Wlj3hgSlkm5KhGvcnOGlq3Jhn06KY=; b=NlbqDwZS1a8XoSCIrSAQWRld9nRQYmSZvKPucS+hrXGk87T5Z8lyYATyhZlnil9vS5 Hb3xmxlcHLlkO5Xd3SuVLyM5q7Vn76hAjDT1vzpzB9wTKfVzG5ztN7md5H2EQBs8eF2A /LDJjuHMXz7fx1T4gkm4+b6vgHdyFFmkpnrYZi8uQ210bt4JaryA8y9hFLJQPuVCvTM/ 4eysuPALN4pHwprIPOkQZJJop4ArNVWyHmB7r4E/mmQiNyHIqC8o8N6AA5MWLCasDY6o TQfM6SB7deTgBzbxalBN5JTr/MJjJdTOYaFJfVw4LGsGYRtxA3sY2xQ9FMrzo/OCM3gD zbBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PSx68s2L; 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 y2si5314051pgq.384.2018.01.19.04.05.11; Fri, 19 Jan 2018 04:05:12 -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=PSx68s2L; 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 S1754860AbeASMFK (ORCPT + 1 other); Fri, 19 Jan 2018 07:05:10 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33560 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752368AbeASMFJ (ORCPT ); Fri, 19 Jan 2018 07:05:09 -0500 Received: by mail-wm0-f67.google.com with SMTP id x4so6960140wmc.0 for ; Fri, 19 Jan 2018 04:05:09 -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=6Y22AgYL1ev/U0Wlj3hgSlkm5KhGvcnOGlq3Jhn06KY=; b=PSx68s2L0uJpBHZHjwpnyqjWMJsVvowtMKdNxZ29WCQp/+k1gAr1aFHJzaBD2C2Uiu /3A7YoC54Vd1nhwr42eYldxYdgjpePCe1bak2OnkxBsuFZxeqtmD+vlCSraN1J3VVXOq QTV42LXJpHIz0li4V16ncFfVStGwTVfNYRuBE= 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=6Y22AgYL1ev/U0Wlj3hgSlkm5KhGvcnOGlq3Jhn06KY=; b=Gy7rmpCIqLhbfab+5039YJCvJMnmdQb9Nc3pWlRc0njtd6WVzFclt14q58790B8xq3 TCdUu/JDY4x/8rH3dqWxvN2e8cTJ0miX9XsQUQ0mvSbMj9kIgjNIBVV7JiVFjA29KbK7 9Uvlc+F5bOOup4axBcbtU2uhT3vjrMnT1td5vIpVh6njAcH7iDBF5QmGTfKUEafZRzWe 5DopmMoXD2733bk+w2AiQcZt6FJEwLVjLNVwh1VAd97WRb7W9V3HvP/d+7wZmwJr5hqD oM5NIMS8FfOGp98lFZ8bH8PgwjU+wtjHvYR0rIy9S11z5tc8bJRHZgIr7VD++pppmglv m9Nw== X-Gm-Message-State: AKwxytet6/+7lybADfhu2qA+eCgXKKUKE0HIXReJv+8aemIIkDvFTo6w H2U4MHqb/vlk9dvwJTq0W4mj9+vanzs= X-Received: by 10.28.216.149 with SMTP id p143mr7688799wmg.80.1516363508108; Fri, 19 Jan 2018 04:05:08 -0800 (PST) Received: from localhost.localdomain ([160.170.62.40]) by smtp.gmail.com with ESMTPSA id 127sm1039149wmk.14.2018.01.19.04.05.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jan 2018 04:05:06 -0800 (PST) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, herbert@gondor.apana.org.au, Ard Biesheuvel Subject: [PATCH 0/8] crypto: arm64+generic - SHA3/SHA-512/SM-3 roundup Date: Fri, 19 Jan 2018 12:04:32 +0000 Message-Id: <20180119120440.31556-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 This supersedes all outstanding patches from me related to SHA-3, SHA-512 or SM-3. - fix a correctness issue in the SHA-3 code (#1) and a performance issue (#2), the first one is definitely a -stable candidate, the second one potentially as well - patches #3 and #4 make the generic SHA-3 code reusable as a fallback for the accelerated code introduced in #6 - patch #5 adds some SHA-3 test cases - patch #6 implements SHA-3 using special arm64 instructions - patch #7 implements the Chinese SM3 secure hash algorithm using special arm64 instructions - patch #8 contains some fixes for the recently queued SHA-512 arm64 code. Ard Biesheuvel (8): crypto/generic: sha3 - fixes for alignment and big endian operation crypto/generic: sha3: rewrite KECCAK transform to help the compiler optimize crypto/generic: sha3 - simplify code crypto/generic: sha3 - export init/update/final routines crypto/testmgr: sha3 - add new testcases crypto/arm64: sha3 - new v8.2 Crypto Extensions implementation crypto/arm64: sm3 - new v8.2 Crypto Extensions implementation crypto/arm64: sha512 - fix/improve new v8.2 Crypto Extensions code arch/arm64/crypto/Kconfig | 12 + arch/arm64/crypto/Makefile | 6 + arch/arm64/crypto/sha3-ce-core.S | 210 ++++++++ arch/arm64/crypto/sha3-ce-glue.c | 161 ++++++ arch/arm64/crypto/sha512-ce-core.S | 145 +++--- arch/arm64/crypto/sha512-glue.c | 1 + arch/arm64/crypto/sm3-ce-core.S | 141 +++++ arch/arm64/crypto/sm3-ce-glue.c | 92 ++++ crypto/sha3_generic.c | 332 ++++++------ crypto/testmgr.h | 550 ++++++++++++++++++++ include/crypto/sha3.h | 6 +- 11 files changed, 1413 insertions(+), 243 deletions(-) create mode 100644 arch/arm64/crypto/sha3-ce-core.S create mode 100644 arch/arm64/crypto/sha3-ce-glue.c create mode 100644 arch/arm64/crypto/sm3-ce-core.S create mode 100644 arch/arm64/crypto/sm3-ce-glue.c -- 2.11.0