From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DEEDC77B7A for ; Fri, 19 May 2023 08:43:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230282AbjESInf (ORCPT ); Fri, 19 May 2023 04:43:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230032AbjESInf (ORCPT ); Fri, 19 May 2023 04:43:35 -0400 Received: from 167-179-156-38.a7b39c.syd.nbn.aussiebb.net (167-179-156-38.a7b39c.syd.nbn.aussiebb.net [167.179.156.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0099E7; Fri, 19 May 2023 01:43:32 -0700 (PDT) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1pzvhb-00Anno-Cq; Fri, 19 May 2023 16:43:08 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 19 May 2023 16:43:07 +0800 Date: Fri, 19 May 2023 16:43:07 +0800 From: Herbert Xu To: David Yang Cc: linux-crypto@vger.kernel.org, Weili Qian , Zhou Wang , "David S. Miller" , Philipp Zabel , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] crypto: hisilicon/advca - Add SHA support Message-ID: References: <20230513074339.266879-1-mmyangfl@gmail.com> <20230513074339.266879-3-mmyangfl@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230513074339.266879-3-mmyangfl@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Sat, May 13, 2023 at 03:43:22PM +0800, David Yang wrote: > > +static int hica_sha_export(const struct hica_sha_priv *priv, void *out, > + unsigned int digestsize) > +{ > + if (hica_sha_wait(priv, SHA_RECORD_READY)) > + return -ETIMEDOUT; > + > + for (unsigned int i = 0; i < digestsize; i += sizeof(u32)) > + *(u32 *) (out + i) = > + be32_to_cpu(readl_relaxed(priv->base + SHA_OUT0 + i)); > + > + return 0; > +} Can you please explain what this is doing? Is this exporting the finalized hash, or the intermediate state? If it's exporting the intermediate state, why aren't you implementing an import function? Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt