Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp172601rwi; Tue, 25 Oct 2022 22:29:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM57SqOH/RhbaBafucZCXb7pi+FFFq0/MBnl02M06xAdjiRKOfY9pE4Io62xnPVhEsPehbqw X-Received: by 2002:a17:907:1dc7:b0:78d:c153:d64a with SMTP id og7-20020a1709071dc700b0078dc153d64amr35571912ejc.429.1666762142584; Tue, 25 Oct 2022 22:29:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666762142; cv=none; d=google.com; s=arc-20160816; b=Yb5s7FpZbkG4Gl/1Px/TKfnlmFqSqG0hw3RDGnGElUhDg/ryjHA+ZoaJYzKZSZDyXl 7qckN2THzRa/vCbZrVaQ3pcLVppz4qGVoMDYuMb8xAcnJn6NRRa23LpwV06Z/w6Wrhmp a8HFrxOsZoTdjPVUqATTUmqR6+4ctd8qarmrva36QJ677S1VDRDHDCMlgQAVwO3fhMyA vyGM+MBmkXPRSAYE1bQZGGZfDe2Cm6KGbSft4nP4pxGGinsPUJaYaEa15BFvNYubRREh +UZo3NCXRO/IBhkVPXM14X3eGWuy6n2ItigiKcpAMFcC7LKCdGcK9qUAGufWeX31kj7n Uj7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=2AWZBE84PI7ARl0hgJNRPVmC7BCiIPk2wi6a0nWgpfk=; b=e5rvFmI0WuAORJxe4AjQ6vOUQ99Bcs+4ynzq7uYKofJF5miluxdELdsYxgKlW+zFdG 1bJbYrx7xNoAeI5oM1Mbs4DWXBtpxf2XtBmFDL+jGBT36jb57jnBnOB1o0F/H6EJ1fL3 zr09b2RBVsqDGcMBKDOu/v/capRtrt3eVNRA3KXVEAP99iGG9i110xxs96YOfuw42/qG t89ZO8VStSqVY4I9yyWtbzk1hmI177/cV3CJALjSz2L6mfEZvoFU2EknTQQ2xCA2uWOD pHV3wv70PhHOnTKXiF/7YAyzV3njm0zliYF+qZme0nMWxtqvlUTychsD9VHffSJzGZNH BH5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Q13vSPw4; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y2-20020aa7ce82000000b0044eae9b2c48si4234545edv.273.2022.10.25.22.28.29; Tue, 25 Oct 2022 22:29:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Q13vSPw4; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232813AbiJZFWj (ORCPT + 99 others); Wed, 26 Oct 2022 01:22:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231640AbiJZFWj (ORCPT ); Wed, 26 Oct 2022 01:22:39 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B09B2B0B07 for ; Tue, 25 Oct 2022 22:22:37 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id p3so12062326pld.10 for ; Tue, 25 Oct 2022 22:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2AWZBE84PI7ARl0hgJNRPVmC7BCiIPk2wi6a0nWgpfk=; b=Q13vSPw49P3NxDgquo6xASxJQ7Sz/idKZYLephhb0lCsGeJMbdcEfb/FpeTc96wN6M RLD7/IpDMFjbwduLlcHS9K6/d6uYP1GlibiCNWkL6Og+h0XD8VqIY67y+FSsWrFMbYMx ST3UBTxspEl6Qy/gLYAOntJyftd4Qp5fzIXKNbUeumETy+su4zs+uTTGl7f1+H+ljsqb iwFiT5QoQzFh6rclhbM08D2BWmEDim4h2IvOt3/WzJC08kDgLkuLnkSoCOJLP8T8qhLR AObkzTC5BRqMjV6mh5XEG65OxsSetqzi/wb9SLLxos+TE/D0SagmEvd/biK3p+3aUUSS Weiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2AWZBE84PI7ARl0hgJNRPVmC7BCiIPk2wi6a0nWgpfk=; b=FEqjlNvGxjEytw75uKWYDFIPatiBYBQ5+Jj7yZj6MvKgQpzZqv2/izCGabWAgpTVxJ rrlU547ER1Jfr85CWNe2KuzekyQZOpeEx0VeQr8n+hVy/J1H0ZZOkUBeT0PFehJtEwtL nXm9r/DBoW5XuBcqV2oIxor7EnM+7iLfVmd//RKgfnMfnLKrI96KV/f8MzZDKMaR61Je EsxOUTvMadwr/zF4t6bfgroreBvi8yEg6Y0JJ1oBGklkJi43+YtSlU1AA1CjDG/KUK06 DrHCsRRoQQKq0kff1ilWxjasgEaTS2yIKHewu8SVH21O47uB8526KHus/Lg2DjThKEn5 KQXg== X-Gm-Message-State: ACrzQf2J5zM++E5dcGakrVGi+f66qV4Ok3j71Wycd8hTPpisFA7PGfpA htqNVlVQVwPVZkVSpyTc16zhrHyAnPxKDw== X-Received: by 2002:a17:902:7296:b0:180:1330:b3c0 with SMTP id d22-20020a170902729600b001801330b3c0mr41315442pll.170.1666761756770; Tue, 25 Oct 2022 22:22:36 -0700 (PDT) Received: from localhost.localdomain ([182.213.254.91]) by smtp.gmail.com with ESMTPSA id s5-20020a656445000000b00462ae17a1c4sm2119254pgv.33.2022.10.25.22.22.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 22:22:35 -0700 (PDT) From: Taehee Yoo To: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au, davem@davemloft.net, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, x86@kernel.org, jussi.kivilinna@iki.fi Cc: ap420073@gmail.com Subject: [PATCH 0/2] crypto: aria: implement aria-avx2 and aria-avx512 Date: Wed, 26 Oct 2022 05:20:55 +0000 Message-Id: <20221026052057.12688-1-ap420073@gmail.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This patchset is to implement aria-avx2 and aria-avx512. There are some differences between aria-avx, aria-avx2, and aria-avx512, but they are not core logic(s-box, diffusion layer). ARIA-AVX2 It supports 32way parallel processing using 256bit registers. Like ARIA-AVX, it supports both AES-NI based s-box layer algorithm and GFNI based s-box layer algorithm. These algorithms are the same as ARIA-AVX except that AES-NI doesn't support 256bit registers, so it is used twice. ARIA-AVX512 It supports 64way parallel processing using 512bit registers. It supports only GFNI based s-box layer algorithm. Benchmarks with i3-12100 commands: modprobe tcrypt mode=610 num_mb=8192 ARIA-AVX512(128bit and 256bit) testing speed of multibuffer ecb(aria) (ecb-aria-avx512) encryption tcrypt: 1 operation in 1504 cycles (1024 bytes) tcrypt: 1 operation in 4595 cycles (4096 bytes) tcrypt: 1 operation in 1763 cycles (1024 bytes) tcrypt: 1 operation in 5540 cycles (4096 bytes) testing speed of multibuffer ecb(aria) (ecb-aria-avx512) decryption tcrypt: 1 operation in 1502 cycles (1024 bytes) tcrypt: 1 operation in 4615 cycles (4096 bytes) tcrypt: 1 operation in 1759 cycles (1024 bytes) tcrypt: 1 operation in 5554 cycles (4096 bytes) ARIA-AVX2 with GFNI(128bit and 256bit) testing speed of multibuffer ecb(aria) (ecb-aria-avx2) encryption tcrypt: 1 operation in 2003 cycles (1024 bytes) tcrypt: 1 operation in 5867 cycles (4096 bytes) tcrypt: 1 operation in 2358 cycles (1024 bytes) tcrypt: 1 operation in 7295 cycles (4096 bytes) testing speed of multibuffer ecb(aria) (ecb-aria-avx2) decryption tcrypt: 1 operation in 2004 cycles (1024 bytes) tcrypt: 1 operation in 5956 cycles (4096 bytes) tcrypt: 1 operation in 2409 cycles (1024 bytes) tcrypt: 1 operation in 7564 cycles (4096 bytes) ARIA-AVX with GFNI(128bit and 256bit) testing speed of multibuffer ecb(aria) (ecb-aria-avx) encryption tcrypt: 1 operation in 2761 cycles (1024 bytes) tcrypt: 1 operation in 9390 cycles (4096 bytes) tcrypt: 1 operation in 3401 cycles (1024 bytes) tcrypt: 1 operation in 11876 cycles (4096 bytes) testing speed of multibuffer ecb(aria) (ecb-aria-avx) decryption tcrypt: 1 operation in 2735 cycles (1024 bytes) tcrypt: 1 operation in 9424 cycles (4096 bytes) tcrypt: 1 operation in 3369 cycles (1024 bytes) tcrypt: 1 operation in 11954 cycles (4096 bytes) Taehee Yoo (2): crypto: aria: implement aria-avx2 crypto: aria: implement aria-avx512 arch/x86/crypto/Kconfig | 38 + arch/x86/crypto/Makefile | 6 + arch/x86/crypto/aria-aesni-avx2-asm_64.S | 1436 +++++++++++++++++++++ arch/x86/crypto/aria-avx.h | 45 + arch/x86/crypto/aria-gfni-avx512-asm_64.S | 1023 +++++++++++++++ arch/x86/crypto/aria_aesni_avx2_glue.c | 240 ++++ arch/x86/crypto/aria_aesni_avx_glue.c | 6 + arch/x86/crypto/aria_gfni_avx512_glue.c | 236 ++++ 8 files changed, 3030 insertions(+) create mode 100644 arch/x86/crypto/aria-aesni-avx2-asm_64.S create mode 100644 arch/x86/crypto/aria-gfni-avx512-asm_64.S create mode 100644 arch/x86/crypto/aria_aesni_avx2_glue.c create mode 100644 arch/x86/crypto/aria_gfni_avx512_glue.c -- 2.17.1