From patchwork Wed Jun 1 18:26:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 577817 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:8f0c:0:0:0:0 with SMTP id mq12csp855599mab; Wed, 1 Jun 2022 11:26:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXN0fNeC+UyCuAib7iQwhfhPVSwbspu6zuJuT/axWXs3p4U3utx/+NKYligA/muy6GqRmq X-Received: by 2002:a92:cd8d:0:b0:2d1:416b:e7c9 with SMTP id r13-20020a92cd8d000000b002d1416be7c9mr921834ilb.108.1654108006665; Wed, 01 Jun 2022 11:26:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654108006; cv=none; d=google.com; s=arc-20160816; b=ld0s9YiZdZXq/9ggLCyUUYx7D3wfEC4Cte+Fq50vXYp3BoNFClhyhFrbG23GD6oHrw zLXFLuR9UtQdAma/vCqVFptGo6qaOicPxyQMrHSjqRcU9SR+tdcad627yp+eftzbpzmU 3cyTnPDprFUDGFkJl9CsAcZgNnfStqAXjQBpjTZ2bNj3Q34h9zhMqK+M0P0tbr8c2UGj aEXNpCTABgquPwD0anKvB+tiSBARn+408SjgsFPGri9yh88sE6oco6cO89u9aD70kbYy WkRyFMNdLqnsFaMAaZmmEBr8ESO/6AHjBgdKeHTfOnTxazXEJ4Z9STRqw1zxbzUMU9a4 M/hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=BKqlqGxYfhX7iegO3RAXuVwHjUD9PXyPls5TexgxH30=; b=F51bLqz5EyBgrekoTb6NwFbxPziBsyvP9+eEyQNdHDxlWhwvrAvkaG7A0YXVuxDjsy jZOyvbSDPP2sQwb7F7SjGxJRvT4FhN/Z/y1C1xZamQyMS89xc0eoG4ofy2KO9DM6IAc2 n/kx5BuIuWRHjSGEX7TiGAn9lPGRe8aiENJGCU6XJU9V3s5nOyGQroTGcDBanbSlK7Z4 XOfrN1qUZOktXvu8l8tnHrRaCR8bwxSyXvVcnuH9YYlc9cME0zZuHc6Oj84fQ5iZEPpl x374f21Cm+7TTxqs+tOkPZPuYxJmVN4RyHg6HO3yJXKoShgTRlAz1j6LczySUHU/fZbx 8p1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I4yacjl6; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id x9-20020a056e02194900b002d118f5a53asi2772956ilu.69.2022.06.01.11.26.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 11:26:46 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I4yacjl6; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 33BE2842B6; Wed, 1 Jun 2022 20:26:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="I4yacjl6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0F9FC842F1; Wed, 1 Jun 2022 20:26:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 51A3283E81 for ; Wed, 1 Jun 2022 20:26:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=loic.poulain@linaro.org Received: by mail-wm1-x330.google.com with SMTP id m32-20020a05600c3b2000b0039756bb41f2so1551710wms.3 for ; Wed, 01 Jun 2022 11:26:35 -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=BKqlqGxYfhX7iegO3RAXuVwHjUD9PXyPls5TexgxH30=; b=I4yacjl6Unoz8ZtqpTt3n3vL4tbonSzMLLaDo8CrdpQ9rQwrGjyhZgHht47JPApmu/ TlNkxk/eudyZHPrtssfkO0rgYFQn+uPUq6kJqwKS1Kz7a1gkpGkTfMyW5qFnKmAmU/vM r4XjKS9tCLLQXURz5/lKBDM+ODUk9eThgipGqpuHS+b5wQZ6yBmYR19ndEaGdqN2MzLA jLdcOCjBmhbTyimEuXj2ZXPW090CsMR6YWUaTWZ9+8SV8KSbh7KbE6+XZ61aHXHDKvEP giH94YD70BCXZWddEyyRzhIm1YK6NwxOdCCZZUlpQ72BncAZaw9JYFSF0N5FZzbUt72f wNNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=BKqlqGxYfhX7iegO3RAXuVwHjUD9PXyPls5TexgxH30=; b=xNtjmzv4bw/hDdZghWrYCXsPyxD/3bw/06PYIiamxBrFD+pL+ZtHXQSy15LTFQVuog 8dLGkabkYqLqD1Iyz7O2TB6llSOrp6oBRTcTZoTzdgNJQ59sdbtahKjICswh0qe1Vb2h 3FfMsYn+cUVMD4MaImb/RHUtSEeu3cB0WKnVYW1NAIVkrMs/x3MPuAZj6G0v9/75YU+d xRqvk7RL9fze+m1iF3fmuvRAkrVZuOowhVRj7Glafo/n548JzzzsPAG66GDEwLQB/MB7 B6xidBnWzPOdDPTboGrBen5YT7k6WzNr5qzXgu0jUI1GNBxmaypr2IfE0TqfgltU5yoK pUGw== X-Gm-Message-State: AOAM533f2bn6mg6Nyf7MI0pPE4O3vkoIWqm7x0x5SUwvE3P5S12NPyjo pB8C/mZV/e+x12c/mLeVkmPpIw== X-Received: by 2002:a05:600c:1d9f:b0:397:4192:4302 with SMTP id p31-20020a05600c1d9f00b0039741924302mr29514881wms.193.1654107994854; Wed, 01 Jun 2022 11:26:34 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:82c:5f0:58:ccc3:729d:30c2]) by smtp.gmail.com with ESMTPSA id m30-20020a05600c3b1e00b00395f15d993fsm6672837wms.5.2022.06.01.11.26.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Jun 2022 11:26:34 -0700 (PDT) From: Loic Poulain To: trini@konsulko.com Cc: u-boot@lists.denx.de, michal.simek@xilinx.com, kettenis@openbsd.org, Loic Poulain Subject: [PATCH v2 0/5] Add ARMv8 CE sha1/sha256 support Date: Wed, 1 Jun 2022 20:26:26 +0200 Message-Id: <1654107991-598-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean This series adds support for the SHA-1 and SHA-256 Secure Hash Algorithm for CPUs that have support of the ARM v8 Crypto Extensions. It Improves speed of integrity & signature checking procedures. V2: - Add cover letter & sha256 support. - Kconfig default 'y' only if SHA1 and SHA256 selected Loic Poulain (5): lib: sha1: Add support for hardware specific sha1_process sha1: Fix digest state size/type armv8 SHA-1 using ARMv8 Crypto Extensions: lib: sha256: Add support for hardware specific sha256_process armv8 SHA-256 using ARMv8 Crypto Extensions arch/arm/cpu/armv8/Kconfig | 15 ++++ arch/arm/cpu/armv8/Makefile | 2 + arch/arm/cpu/armv8/sha1_ce_core.S | 132 +++++++++++++++++++++++++++++++++++ arch/arm/cpu/armv8/sha1_ce_glue.c | 21 ++++++ arch/arm/cpu/armv8/sha256_ce_core.S | 134 ++++++++++++++++++++++++++++++++++++ arch/arm/cpu/armv8/sha256_ce_glue.c | 21 ++++++ include/u-boot/sha1.h | 2 +- lib/sha1.c | 26 +++++-- lib/sha256.c | 26 +++++-- 9 files changed, 364 insertions(+), 15 deletions(-) create mode 100644 arch/arm/cpu/armv8/sha1_ce_core.S create mode 100644 arch/arm/cpu/armv8/sha1_ce_glue.c create mode 100644 arch/arm/cpu/armv8/sha256_ce_core.S create mode 100644 arch/arm/cpu/armv8/sha256_ce_glue.c