linux-aspeed.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Dhananjay Phadke <dphadke@linux.microsoft.com>
To: linux-aspeed@lists.ozlabs.org
Subject: [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

  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=linux-aspeed@lists.ozlabs.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).