Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1257796rwr; Wed, 26 Apr 2023 12:13:50 -0700 (PDT) X-Google-Smtp-Source: AKy350bOQ94H5vxlE2t+S8+oiVT+k5Cs0R9BmfUXT/spy9/z69irVV2Syxh2zmFDrr56lYoupFED X-Received: by 2002:a17:902:dad2:b0:1a4:f4e6:b68 with SMTP id q18-20020a170902dad200b001a4f4e60b68mr26668372plx.3.1682536430315; Wed, 26 Apr 2023 12:13:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682536430; cv=none; d=google.com; s=arc-20160816; b=N7ujXvir+ffv6SCndQsW2l7Xcru3T/ZGr43yWpDLjeflcMOhE2vWBqF4j3qd5rStf5 DYnBSOIHWy2S873ue0T62XyksXMFpYnlgfn0+I3EVPH0PPU7AcD4412Qer6eon7+wOuT Y++DyY/+HJdyqsHC3kma/GWCYrFaWnzDFCwNd99FNyzb6Ww57ZfNWTKdnxjGYM2/BCuT LHun+h9GBrHohC2LB5Z3bUbtPqkYTXC1lTTLOR/sZMRnpceE3qntxsiEDUwOlPKXfau9 6xDfZftnWX9/Rah+nXrlwgPkt+MFjU3buFg6c2qkPUpuiECZnKSFlErmOWUaFS6C25ZR 2bXg== 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:dkim-signature; bh=yhvrAIKR5O57Y5/51eA5aOty3mrW59iWoKUgs2oPvAQ=; b=iinmTvvIGCxsJDPyvdSj+EkzIPgB2+2/8HEmjrfGbSpM0rhcE4MTpSv7ornfFduXDE hffjUXKvU73ST7zxTYN6Mc10N+akS7vLCMDy768bacGlCqL37DHa9mLaOMUgaAQwftCW aUrDFJsRtdmtVBmCpiyLdfY+/yvxVo8Zp8o2AQ6aTDQmaPpJvcoBHRF2KzobKkebJXTt L4Tp8A6Et5pZXCudUVYz4r1WjzwyeZo/a0/o8GFrERwNoN+qJH4c42WD2BtLybLXXsRe tfsCabuS6wsfu5UTxzJ+1TSMKlOtEv+NdZdp62R3lrO91UF10CqZDnp2yMl31sLw/DmN iODA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="H/PJ+d8I"; 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b4-20020a1709027e0400b001a9581bfb91si11789854plm.543.2023.04.26.12.13.33; Wed, 26 Apr 2023 12:13:50 -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=@ibm.com header.s=pp1 header.b="H/PJ+d8I"; 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=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238401AbjDZTMO (ORCPT + 99 others); Wed, 26 Apr 2023 15:12:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235268AbjDZTMN (ORCPT ); Wed, 26 Apr 2023 15:12:13 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E36C133; Wed, 26 Apr 2023 12:12:10 -0700 (PDT) Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33QJ9dwD028793; Wed, 26 Apr 2023 19:11:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=yhvrAIKR5O57Y5/51eA5aOty3mrW59iWoKUgs2oPvAQ=; b=H/PJ+d8IO01PGaMx8ecDjU40okUO18C8qBr2ImM4Pp6VBkuvVuZGSN+CxsqRC8HucE0T jQKg9mUUiGdQ1I7/tUqOH5/jehwnybZUtKMGK8pITFKTl4U3kU9hqL/H6NNx50xfmVaP vrjj/bVkFIc/y58KvRc+0I6xPJDVZAO7F+BOItIx9F5jzsMRlXn/grV0jGVf14IuttAn BexiSvvAarQ/lX9YWXgHzC8zkIHWpu2Zdw8NjbLF0N0rlJIFGuGfFXU6+ultiZP/QtOD hZtBxv8a4v7i/j1JnuePzgFPInPU/TqRxmvyaNutTDVdM6WwTc8FpjzuEH71eSb9s3mP Ag== Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3q78023apk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Apr 2023 19:11:53 +0000 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 33QIYbWi009083; Wed, 26 Apr 2023 19:11:52 GMT Received: from smtprelay03.wdc07v.mail.ibm.com ([9.208.129.113]) by ppma03dal.us.ibm.com (PPS) with ESMTPS id 3q4778cgba-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Apr 2023 19:11:52 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay03.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 33QJBoqh36438288 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Apr 2023 19:11:50 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 71C4C58059; Wed, 26 Apr 2023 19:11:50 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3CCE258055; Wed, 26 Apr 2023 19:11:50 +0000 (GMT) Received: from ltcden12-lp3.aus.stglabs.ibm.com (unknown [9.40.195.53]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 26 Apr 2023 19:11:50 +0000 (GMT) From: Danny Tsen To: linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, leitao@debian.org, nayna@linux.ibm.com, appro@cryptogams.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au, ltcgcw@linux.vnet.ibm.com, dtsen@us.ibm.com, Danny Tsen Subject: [PATCH v2 0/5] crypto: Accelerated Chacha20/Poly1305 implementation Date: Wed, 26 Apr 2023 15:11:42 -0400 Message-Id: <20230426191147.60610-1-dtsen@linux.ibm.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 1iYHzCvbW89hit0Gy51rS9MZavwYgW2Q X-Proofpoint-ORIG-GUID: 1iYHzCvbW89hit0Gy51rS9MZavwYgW2Q X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-26_10,2023-04-26_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 spamscore=0 impostorscore=0 malwarescore=0 lowpriorityscore=0 mlxscore=0 bulkscore=0 phishscore=0 mlxlogscore=536 clxscore=1015 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304260169 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 patch series provide an accelerated/optimized Chacha20 and Poly1305 implementation for Power10 or later CPU (ppc64le). This module implements algorithm specified in RFC7539. The implementation provides 3.5X better performance than the baseline for Chacha20 and Poly1305 individually and 1.5X improvement for Chacha20/Poly1305 operation. This patch has been tested with the kernel crypto module tcrypt.ko and has passed the selftest. The patch is also tested with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS enabled. Danny Tsen (5): An optimized Chacha20 implementation with 8-way unrolling for ppc64le. Glue code for optmized Chacha20 implementation for ppc64le. An optimized Poly1305 implementation with 4-way unrolling for ppc64le. Glue code for optmized Poly1305 implementation for ppc64le. Update Kconfig and Makefile. arch/powerpc/crypto/Kconfig | 26 + arch/powerpc/crypto/Makefile | 4 + arch/powerpc/crypto/chacha-p10-glue.c | 221 +++++ arch/powerpc/crypto/chacha-p10le-8x.S | 842 ++++++++++++++++++ arch/powerpc/crypto/poly1305-p10-glue.c | 186 ++++ arch/powerpc/crypto/poly1305-p10le_64.S | 1075 +++++++++++++++++++++++ 6 files changed, 2354 insertions(+) create mode 100644 arch/powerpc/crypto/chacha-p10-glue.c create mode 100644 arch/powerpc/crypto/chacha-p10le-8x.S create mode 100644 arch/powerpc/crypto/poly1305-p10-glue.c create mode 100644 arch/powerpc/crypto/poly1305-p10le_64.S -- 2.31.1