Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5430194iob; Mon, 9 May 2022 16:34:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZO0Lom4SIX2nUsYwDJnCDYDO3D+NRoYAbNZK3fEqrZAy/1MnXf7d5z2ubqpA1BnxVPdBN X-Received: by 2002:a37:ef06:0:b0:6a0:e66:92b2 with SMTP id j6-20020a37ef06000000b006a00e6692b2mr13489402qkk.684.1652139292726; Mon, 09 May 2022 16:34:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652139292; cv=none; d=google.com; s=arc-20160816; b=s+g8oyTespTQBqp1yiY9XgWzBI0sjynzS/Onic5sPB29GBJvqgVNV1jzIwyQ0lZ+az oBfleF6ofRBu6uOR3gRUCHM8ddUJBkn5/lm3VBfYCjASYFt9sZ1DBnPp9/pLyAdU2hVP gNT9umzUg7MjooNNaEkpScF2saNbG1gvii6klHAu6waNOuDsOTfn7R9V98l7OJZ/9vly DCQdwKd9aNfk2aCapqkniy/bQ3joowAh952FlKFgaCQE6oSYZ+tHRJtUXSKMct1Q1wVD KIO5IT1m+YpE8gunJUo5J4aGr5LGAhCynkphcpsdzx5HVoysXEddsTOLA+J9BtFS5CTH kicQ== 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=tBtaC2J23JBo2Fl6RcOR6d5rsIJeEc1KrTb9a7Nfbfs=; b=xb+SIvK1hdznqOTx0ZDS2bg4qRxkZ78mYcj9DaCyvagqvrWzgpwAtOhH47dLZzAqJC gw2GbACp3J45E1jFxrEp1/HZjNHb5dz1Gv7DzF1lABnxW9L9UpYNk+FFS9yl87v5gACc y3NbZidv0yGhXvV8P04c11+XKEn7Zs+a/i/5N2cMHZbd1KCmECNSeB1faqPJt5/WBaky ShUWjd3ptFsaOJfH5hvXYzWjQfKgfuX3Ml/A7y5IvkJcem5Ct9YR8YOePvRCwfnFQytL zOkX2yXp4JaVLcAOawelnYUVuT4k+l6SvuIIfurzSPItzYL1CJklUdEnWK32+mWVDrKX bVeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="msh/uKHQ"; 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 n188-20020a37bdc5000000b006a024f9020esi8092672qkf.525.2022.05.09.16.34.23; Mon, 09 May 2022 16:34:52 -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="msh/uKHQ"; 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 S230398AbiEIWAa (ORCPT + 99 others); Mon, 9 May 2022 18:00:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231168AbiEIWA3 (ORCPT ); Mon, 9 May 2022 18:00:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17332737A0; Mon, 9 May 2022 14:56:34 -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 A7FBC60C72; Mon, 9 May 2022 21:56:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C433EC385C2; Mon, 9 May 2022 21:56:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652133393; bh=wHLWT1Gll/cvK2j3e8LMoFzDmeDWBW7dkJOSEFpCqlk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=msh/uKHQvklZ0wtmp5N5Of0ULdBVEMKEg8ske61MFbi1y/PAYyOhfESYV7FT2qlfS btnhan/bTDBZvgENyc8vd/6SsewsY+NoV7a3+l7rL117i4eTpufFz4LMWltbuPmhvF cdHQb8D6oVaW2z38/EwfKBReboVoN3zIABXNTcx183dvsxdz+ntAHxi/Cz3nwJkGq8 uL1GVTACgW0+ggSEkvKfFM0QhvWhMOawGDf2WsNmjJD/rlNpKUOSoqZXvyZOE2HMf0 LNXqNrpZeSDFRGItCZq2XUzRsk2lgHNug9hz5F3NQNRGNKEYdA1VlF4htCGpvdob1g 7atWZNlj+I/kw== Date: Mon, 9 May 2022 14:56:31 -0700 From: Eric Biggers To: Nathan Huckleberry Cc: linux-crypto@vger.kernel.org, linux-fscrypt@vger.kernel.org, Herbert Xu , "David S. Miller" , linux-arm-kernel@lists.infradead.org, Paul Crowley , Sami Tolvanen , Ard Biesheuvel Subject: Re: [PATCH v7 6/9] crypto: arm64/aes-xctr: Improve readability of XCTR and CTR modes Message-ID: References: <20220509191107.3556468-1-nhuck@google.com> <20220509191107.3556468-7-nhuck@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220509191107.3556468-7-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 Mon, May 09, 2022 at 07:11:04PM +0000, Nathan Huckleberry wrote: > Added some clarifying comments, changed the register allocations to make > the code clearer, and added register aliases. > > Signed-off-by: Nathan Huckleberry > Reviewed-by: Eric Biggers Did you mean to add Ard's Reviewed-by that he gave on v6 as well? One comment about the v7 changes below: > /* > * aes_ctr_encrypt(u8 out[], u8 const in[], u8 const rk[], int rounds, > * int bytes, u8 ctr[]) > + * > + * The input and output buffers must always be at least 16 bytes even if > + * encrypting/decrypting less than 16 bytes. Otherwise out of bounds > + * accesses will occur. > */ This comment, along with the other similar ones you added, doesn't properly describe the behavior when bytes < 16, as it's not mentioned that the extra space needs to be before the pointed-to regions rather than after. That's the most unusual part of these functions, so it really should be mentioned. Separately, applying this patch and the previous one causes the following whitespace errors to be reported: Applying: crypto: arm64/aes-xctr: Add accelerated implementation of XCTR .git/rebase-apply/patch:299: space before tab in indent. ld1 {v5.16b-v7.16b}, [x1], #48 warning: 1 line adds whitespace errors. Applying: crypto: arm64/aes-xctr: Improve readability of XCTR and CTR modes .git/rebase-apply/patch:216: space before tab in indent. ld1 {v5.16b-v7.16b}, [IN], #48 warning: 1 line adds whitespace errors. - Eric