From: Dhananjay Phadke <dphadke@linux.microsoft.com>
To: Neal Liu <neal_liu@aspeedtech.com>,
Corentin Labbe <clabbe.montjoie@gmail.com>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Randy Dunlap <rdunlap@infradead.org>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S . Miller" <davem@davemloft.net>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Joel Stanley <joel@jms.id.au>, Andrew Jeffery <andrew@aj.id.au>,
Dhananjay Phadke <dhphadke@microsoft.com>,
Johnny Huang <johnny_huang@aspeedtech.com>
Cc: linux-aspeed@lists.ozlabs.org, linux-crypto@vger.kernel.org,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, BMC-SW@aspeedtech.com
Subject: Re: [PATCH v7 1/5] crypto: aspeed: Add HACE hash driver
Date: Wed, 13 Jul 2022 00:24:45 -0700 [thread overview]
Message-ID: <7041bf01-d91f-3149-e8ba-5db4ba59f9bb@linux.microsoft.com> (raw)
In-Reply-To: <45058512-0661-5d34-7faf-ddf3eb6142ec@linux.microsoft.com>
On 7/12/2022 10:32 PM, Dhananjay Phadke wrote:
>> +static void aspeed_ahash_iV(struct aspeed_sham_reqctx *rctx)
>> +{
>> + if (rctx->flags & SHA_FLAGS_SHA1)
>> + memcpy(rctx->digest, sha1_iv, 32);
>> + else if (rctx->flags & SHA_FLAGS_SHA224)
>> + memcpy(rctx->digest, sha224_iv, 32);
>> + else if (rctx->flags & SHA_FLAGS_SHA256)
>> + memcpy(rctx->digest, sha256_iv, 32);
>> + else if (rctx->flags & SHA_FLAGS_SHA384)
>> + memcpy(rctx->digest, sha384_iv, 64);
>> + else if (rctx->flags & SHA_FLAGS_SHA512)
>> + memcpy(rctx->digest, sha512_iv, 64);
>> + else if (rctx->flags & SHA_FLAGS_SHA512_224)
>> + memcpy(rctx->digest, sha512_224_iv, 64);
>> + else if (rctx->flags & SHA_FLAGS_SHA512_256)
>> + memcpy(rctx->digest, sha512_256_iv, 64);
>> +}
>
> Can use the "digsize" from reqctx to memcpy() instead lots of if..else
> conditionals for every request?
Sorry, meant pre-initialized ivsize not digsize, which could be
in alg wrapper structure (aspeed_hace_alg).
Thanks,
Dhananjay
next prev parent reply other threads:[~2022-07-13 7:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-05 2:09 [PATCH v7 0/5] Add Aspeed crypto driver for hardware acceleration Neal Liu
2022-07-05 2:09 ` [PATCH v7 1/5] crypto: aspeed: Add HACE hash driver Neal Liu
2022-07-13 5:32 ` Dhananjay Phadke
2022-07-13 7:24 ` Dhananjay Phadke [this message]
2022-07-18 6:05 ` Neal Liu
2022-07-18 9:14 ` Neal Liu
2022-07-05 2:09 ` [PATCH v7 2/5] dt-bindings: clock: Add AST2500/AST2600 HACE reset definition Neal Liu
2022-07-05 2:09 ` [PATCH v7 3/5] ARM: dts: aspeed: Add HACE device controller node Neal Liu
2022-07-13 7:48 ` Dhananjay Phadke
2022-07-05 2:09 ` [PATCH v7 4/5] dt-bindings: crypto: add documentation for aspeed hace Neal Liu
2022-07-05 2:09 ` [PATCH v7 5/5] crypto: aspeed: add HACE crypto driver Neal Liu
2022-07-11 3:23 ` [PATCH v7 0/5] Add Aspeed crypto driver for hardware acceleration Neal Liu
2022-07-15 8:21 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7041bf01-d91f-3149-e8ba-5db4ba59f9bb@linux.microsoft.com \
--to=dphadke@linux.microsoft.com \
--cc=BMC-SW@aspeedtech.com \
--cc=andrew@aj.id.au \
--cc=christophe.jaillet@wanadoo.fr \
--cc=clabbe.montjoie@gmail.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=dhphadke@microsoft.com \
--cc=herbert@gondor.apana.org.au \
--cc=joel@jms.id.au \
--cc=johnny_huang@aspeedtech.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=neal_liu@aspeedtech.com \
--cc=rdunlap@infradead.org \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).