From: "Sascha Hauer" <s.hauer@pengutronix.de>
To: "Michael Tretter" <m.tretter@pengutronix.de>
Cc: BAREBOX <barebox@lists.infradead.org>,
Michael Tretter <m.tretter@pengutronix.de>
Subject: Re: [PATCH 2/2] PBL: add oneshot helper for sha384 and sha512
Date: Tue, 29 Sep 2026 07:08:56 +0000 [thread overview]
Message-ID: <07b3447f-f077-4664-b906-aa949b8ca6eb@pengutronix.de> (raw)
In-Reply-To: <20260928-crypto-pbl-sha384-v1-2-bc7095590123@pengutronix.de>
On 2026-09-28 14:25, Michael Tretter wrote:
> Similar to the oneshot helper for sha256, add helpers for sha384 and
> sha512.
>
> The helper functions don't use the ARMv8 Crypto Extensions, yet.
>
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> ---
> include/crypto/pbl-sha.h | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/include/crypto/pbl-sha.h b/include/crypto/pbl-sha.h
> index dbfb79647462..8a20e0a2b84b 100644
> --- a/include/crypto/pbl-sha.h
> +++ b/include/crypto/pbl-sha.h
> @@ -28,7 +28,29 @@ int sha512_init(struct digest *desc);
> int sha512_update(struct digest *desc, const void *data, unsigned long len);
> int sha512_final(struct digest *desc, u8 *out);
>
> +static inline void pbl_sha512(const void *buf, size_t len,
> + u8 out[SHA512_DIGEST_SIZE])
> +{
> + struct sha512_state state = { };
> + struct digest d = { .ctx = &state, .length = SHA512_DIGEST_SIZE };
> +
> + sha512_init(&d);
> + sha512_update(&d, buf, len);
> + sha512_final(&d, out);
> +}
Instead of making these static inline functions, could you follow the
template in pbl/sha256.c to give future developers an idea how for
example the crypto extensions should be implemented?
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2026-09-29 7:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 12:25 [PATCH 0/2] PBL: enable hash functions for Vendor Authorized Boot Michael Tretter
2026-09-28 12:25 ` [PATCH 1/2] crypto: make sha384 and sha512 available in PBL Michael Tretter
2026-09-28 12:25 ` [PATCH 2/2] PBL: add oneshot helper for sha384 and sha512 Michael Tretter
2026-09-29 7:08 ` Sascha Hauer [this message]
2026-09-29 8:36 ` Michael Tretter
2026-09-29 11:09 ` Sascha Hauer
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=07b3447f-f077-4664-b906-aa949b8ca6eb@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=m.tretter@pengutronix.de \
/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