From: Herbert Xu <herbert@gondor.apana.org.au>
To: Christian Marangi <ansuelsmth@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Antoine Tenart <atenart@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
Waiman Long <longman@redhat.com>,
Boqun Feng <boqun.feng@gmail.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
linux-crypto@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
upstream@airoha.com, Richard van Schagen <vschagen@icloud.com>
Subject: Re: [PATCH v11 3/3] crypto: Add Inside Secure SafeXcel EIP-93 crypto engine support
Date: Tue, 1 Apr 2025 18:53:05 +0800 [thread overview]
Message-ID: <Z-vFkUmd6vgciU6V@gondor.apana.org.au> (raw)
In-Reply-To: <20250114123935.18346-4-ansuelsmth@gmail.com>
On Tue, Jan 14, 2025 at 01:36:36PM +0100, Christian Marangi wrote:
>
> +static void eip93_hash_export_sa_state(struct ahash_request *req,
> + struct eip93_hash_export_state *state)
> +{
> + struct eip93_hash_reqctx *rctx = ahash_request_ctx_dma(req);
> + struct sa_state *sa_state = &rctx->sa_state;
> +
> + /*
> + * EIP93 have special handling for state_byte_cnt in sa_state.
> + * Even if a zero packet is passed (and a BADMSG is returned),
> + * state_byte_cnt is incremented to the digest handled (with the hash
> + * primitive). This is problematic with export/import as EIP93
> + * expect 0 state_byte_cnt for the very first iteration.
> + */
> + if (!rctx->len)
> + memset(state->state_len, 0, sizeof(u32) * 2);
I don't understand when this can occur. As far as I can see,
zero-length packets are never passed to the hardware for hashing.
> + else
> + memcpy(state->state_len, sa_state->state_byte_cnt,
> + sizeof(u32) * 2);
I need to know the endianness of state_byte_cnt, which I presume
is the number of bytes that have been hashed into the partial
hash state.
I need this because I'm changing the export format of all ahash
algorithms to match that of the generic implementation. This is
so that you can seamlessly switch between an async ahash and its
sync fallback.
Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
next prev parent reply other threads:[~2025-04-01 10:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-14 12:36 [PATCH v11 0/3] crypto: Add EIP-93 crypto engine support Christian Marangi
2025-01-14 12:36 ` [PATCH v11 1/3] spinlock: extend guard with spinlock_bh variants Christian Marangi
2025-01-14 12:36 ` [PATCH v11 2/3] dt-bindings: crypto: Add Inside Secure SafeXcel EIP-93 crypto engine Christian Marangi
2025-01-14 12:36 ` [PATCH v11 3/3] crypto: Add Inside Secure SafeXcel EIP-93 crypto engine support Christian Marangi
2025-04-01 10:07 ` Herbert Xu
2025-04-01 10:54 ` Christian Marangi (Ansuel)
2025-04-01 10:57 ` Herbert Xu
2025-04-01 11:20 ` Christian Marangi (Ansuel)
2025-04-01 11:32 ` Herbert Xu
2025-04-01 11:48 ` Christian Marangi (Ansuel)
2025-04-01 10:53 ` Herbert Xu [this message]
2025-04-01 11:13 ` Christian Marangi (Ansuel)
2025-04-01 11:33 ` Herbert Xu
2025-02-09 10:21 ` [PATCH v11 0/3] crypto: Add " 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=Z-vFkUmd6vgciU6V@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=ansuelsmth@gmail.com \
--cc=atenart@kernel.org \
--cc=boqun.feng@gmail.com \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=justinstitt@google.com \
--cc=krzk+dt@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=longman@redhat.com \
--cc=mingo@redhat.com \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=peterz@infradead.org \
--cc=robh@kernel.org \
--cc=upstream@airoha.com \
--cc=vschagen@icloud.com \
--cc=will@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.