Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp531126pxj; Thu, 10 Jun 2021 06:47:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz80qWnzItN+36aN5VIO7/ym6ChtEN7UTpphy9chT1y4RitQrOqicLIcRZ7bihgbcEDmMyO X-Received: by 2002:a17:906:5211:: with SMTP id g17mr4613057ejm.281.1623332824918; Thu, 10 Jun 2021 06:47:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623332824; cv=none; d=google.com; s=arc-20160816; b=0sic/k9TIHNSVSpuP7OgRkvJorYh6asSI/rGJqzyzznzBkx/RpnOKFsJDKd51RjhOR /O1lYXwuTD7Y5cx5GdJ6QdQ6ZpWHXZoZxOONryjVPdCTFk2sWphiDy59wrpq44nF0whV 1dDjSMuiQ580SeQs5xLawx/zm5hPVoJvAkpTbba53ZzH5AnKvorpBQm0wKMpsZW7fWa5 5v0IIjzPZxOD7nAwqkA0w2TT1NbW/7UU5xi5P9Lagd9E1WLGBkpxaxbDMqbCvz5BSocU LgS2y2jOIGGIPKVzSwx1q3eyZgOKErpWAfNr7JG1WnVKkxpYarMG7R1aNH/HaqWWoTSd b4tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=JiOuZTFPiZPUPjOpAT93yz5WmbJzVfzQEFtPZ8eptsc=; b=qDHLyWfq95RRxsIKHgAJTM/PxEmwlGdoyh0992oOn0oHzBEluy4TiZYzBKU7t52OU7 J4IeBGO3bpMsoQWg1kJHLL08R8np5ARpvZikyQSzk63a4DO+G8oARzSXDL+9ArSf1Txl yDZfKNZJdCimSFO8sulpfyBqH1XD3WeiU9VwAgBt4KpVgoRpS10UhrAo42CkNBKYeW+a Kl40tHwNRIUeMAaBrCE1X3HhKm4/wQxR+Za3G+Tsl2Rs0x7P+Qb/elb7IVglPUAquxdE VxVpHJFlh5vmZhWhMb/UCXoJpuC98UTdKKEKkX8HoMm1gARVQNi7a2vPCzkA5UXvr30Q txhQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dz22si2155092edb.470.2021.06.10.06.46.40; Thu, 10 Jun 2021 06:47:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231230AbhFJNrN (ORCPT + 99 others); Thu, 10 Jun 2021 09:47:13 -0400 Received: from out4436.biz.mail.alibaba.com ([47.88.44.36]:14974 "EHLO out4436.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231273AbhFJNrM (ORCPT ); Thu, 10 Jun 2021 09:47:12 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=tianjia.zhang@linux.alibaba.com;NM=1;PH=DS;RN=17;SR=0;TI=SMTPD_---0UbzAVm0_1623332700; Received: from localhost(mailfrom:tianjia.zhang@linux.alibaba.com fp:SMTPD_---0UbzAVm0_1623332700) by smtp.aliyun-inc.com(127.0.0.1); Thu, 10 Jun 2021 21:45:00 +0800 From: Tianjia Zhang To: Herbert Xu , "David S. Miller" , Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Gilad Ben-Yossef , Ard Biesheuvel , "Markku-Juhani O . Saarinen" , Jussi Kivilinna , x86@kernel.org, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Tianjia Zhang Subject: [PATCH 0/3] Introduce x86 assembler accelerated implementation for SM4 algorithm Date: Thu, 10 Jun 2021 21:44:56 +0800 Message-Id: <20210610134459.28541-1-tianjia.zhang@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.3.ge56e4f7 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This patchset extracts the public SM4 algorithm as a separate library, and introduces an accelerated implementation of the instruction set on x86, and will also introduce more mode-specific accelerated implementations later. Tianjia Zhang (3): crypto: sm4 - create SM4 library based on sm4 generic code crypto: arm64/sm4-ce - Make dependent on sm4 library instead of sm4-generic crypto: x86/sm4 - add AES-NI/AVX/x86_64 assembler implementation arch/arm64/crypto/Kconfig | 2 +- arch/arm64/crypto/sm4-ce-glue.c | 14 +- arch/x86/crypto/Makefile | 3 + arch/x86/crypto/sm4-aesni-avx-asm_64.S | 339 +++++++++++++++++++++++++ arch/x86/crypto/sm4_aesni_avx_glue.c | 115 +++++++++ crypto/Kconfig | 30 +++ crypto/sm4_generic.c | 164 +----------- include/crypto/sm4.h | 25 +- lib/crypto/Kconfig | 3 + lib/crypto/Makefile | 3 + lib/crypto/sm4.c | 184 ++++++++++++++ 11 files changed, 718 insertions(+), 164 deletions(-) create mode 100644 arch/x86/crypto/sm4-aesni-avx-asm_64.S create mode 100644 arch/x86/crypto/sm4_aesni_avx_glue.c create mode 100644 lib/crypto/sm4.c -- 2.19.1.3.ge56e4f7