Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3892989iob; Mon, 2 May 2022 08:08:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcFrAVpfQMGUaS9/AmOIpEOWsvsOzVOiaIjoSiJgjddxIk+GxyMQGZd2xfV8mojhH//zrH X-Received: by 2002:a05:6512:5c6:b0:472:9a4:9382 with SMTP id o6-20020a05651205c600b0047209a49382mr8790452lfo.333.1651504097886; Mon, 02 May 2022 08:08:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651504097; cv=none; d=google.com; s=arc-20160816; b=KJZw/dNK9+dSpT/IhaevOQNNtAcSTQKLVvnVZ/V0D4SgDYpG/6NRAMVDjANxR1aQs2 AK1unRm04ZBOddPIDTIYEly5BVrw9g+ZknYI0uJvEcSwpVHVNi0WYBnrM3VD2UnT8Efm Mf5LMuwzxyH6RTxfaySkzOvteyM1dPdjlOdJxubswyJ4rOAWcons+y7IKutrJCh7neD3 GUFs3KGMZsv5mGle10TJXyMeFg6CRPzQM4SZIhD6UR8wkQ7wSvTzr3NbZ8EYw5/ze/Cy vnaT8yim8dQx6TaB1C0F4EYcW7phRrS6NoGQO8KoXyz3rc4px57eI9SOZ9E5u4Hti+13 uUnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=eYDJi6l2SzVM0yS/R3J/DdZ9x2aP8t0pOICXIEu3APY=; b=s5l+VnIn7+/aHeWQS1xncjtmcOLwBK/XTdEUlY0cqC/w4jnWTLKxkWoJyqhAny5mND 9wTirv1MDS48to5Y6ZelkxQ+gRImT3PrX38292CvdSYvb81JtzbHNJFA6fyw021qlzHO u4+hsHJxqzFmfwrbrCPh5Wgee24hIb/PhwstvSoo4+dlqvd7CiO5ZB6Q27eCTwEehEz7 RGOMgikd5ynvbAYqxKVe8CQzdU6XTu6KkAj+NzlVKBOX6vVLVKqPUV3mpzco9+9p74qf J3MxISbP+sw8AoqFJQfBLIfqvxE/vFGxoGAIunGi/DGR/gmWWKpCdnZFoY1knugnYA7t JWkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mJK5T4K+; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y23-20020a0565123f1700b00472308247edsi13374552lfa.604.2022.05.02.08.07.13; Mon, 02 May 2022 08:08:17 -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=@kernel.org header.s=k20201202 header.b=mJK5T4K+; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378162AbiEAWNE (ORCPT + 99 others); Sun, 1 May 2022 18:13:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378883AbiEAWMr (ORCPT ); Sun, 1 May 2022 18:12:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D9A324596 for ; Sun, 1 May 2022 15:09:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BCB0D61093 for ; Sun, 1 May 2022 22:09:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1CADC385A9; Sun, 1 May 2022 22:08:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651442940; bh=3AM2LPqUXOJEvhKUdQ7/6AGmjfNNTo+QZUxKRD+NOUM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mJK5T4K+SNba89tnbaXOHxxNM+eQrvLtMdTCOJS82hvk3OufVkLONqJn23hSgVVt9 +MDkKycvZy+IIW+0Kf8gDGrtLZm4/6TEC7lDZavHHIAR/2cxev/qSfkqlVrHM1laaF LoT7Mwm48Iw/SRvTDQp+xSwMDfgf/6ixItZYeYKfBEThBL/krQ7ROuL/X6HbGPxqcb nmiL8jm1AVoWoHvzoP/u4H4XwDcEp8rCacqmxprNTB3FdhASR8F6udVCkoGFhb/pag Eq0eoNBFHjl4/eTCVtSJmzjKpywf8U4GEWif5RbEVo0dLiNRpWUKJKka9z1c2K6rGl 2cs84GtIbTaeg== Date: Sun, 1 May 2022 15:08:56 -0700 From: Eric Biggers To: Nathan Huckleberry Cc: linux-crypto@vger.kernel.org, linux-fscrypt.vger.kernel.org@google.com, Herbert Xu , "David S. Miller" , linux-arm-kernel@lists.infradead.org, Paul Crowley , Sami Tolvanen , Ard Biesheuvel Subject: Re: [PATCH v5 5/8] crypto: arm64/aes-xctr: Add accelerated implementation of XCTR Message-ID: References: <20220427003759.1115361-1-nhuck@google.com> <20220427003759.1115361-6-nhuck@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220427003759.1115361-6-nhuck@google.com> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Wed, Apr 27, 2022 at 12:37:56AM +0000, Nathan Huckleberry wrote: > diff --git a/arch/arm64/crypto/aes-modes.S b/arch/arm64/crypto/aes-modes.S > index dc35eb0245c5..39a0c2b5c24d 100644 > --- a/arch/arm64/crypto/aes-modes.S > +++ b/arch/arm64/crypto/aes-modes.S > @@ -318,126 +318,186 @@ AES_FUNC_END(aes_cbc_cts_decrypt) > .byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff > .previous > > - > /* > - * aes_ctr_encrypt(u8 out[], u8 const in[], u8 const rk[], int rounds, > - * int bytes, u8 ctr[]) > + * This macro generates the code for CTR and XCTR mode. > */ So I did ask for the register aliases and extra comments, but it's hard to review this with the cleanups to the existing code mixed in with the XCTR-specific additions. Would you mind splitting this up into two patches, one to improve the readability of the existing aes_ctr_encrypt(), and one to add xctr support? Also, I noticed that the register aliases aren't being used consistently. E.g. ld1 {vctr.16b}, [x5] ... should use IV for x5, and eor x6, x6, x12 eor x7, x7, x12 eor x8, x8, x12 eor x9, x9, x12 eor x10, x10, x12 Should use IV_PART for x12. - Eric