mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/7] test: self: add digest test
Date: Thu, 25 May 2023 10:37:18 +0200	[thread overview]
Message-ID: <20230525083718.GZ15436@pengutronix.de> (raw)
In-Reply-To: <20230522053044.1039572-3-a.fatoum@pengutronix.de>

On Mon, May 22, 2023 at 07:30:39AM +0200, Ahmad Fatoum wrote:
> Later commits will touch existing digest code, so this is a good
> opportunity to add a self test to ensure MD5/SHA continues to work.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  test/self/Kconfig  |   6 ++
>  test/self/Makefile |   1 +
>  test/self/digest.c | 190 +++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 197 insertions(+)
>  create mode 100644 test/self/digest.c
> 
> +static void test_digests_sha12(const char *suffix)
> +{
> +	bool cond;
> +
> +	cond = !strcmp(suffix, "asm") ? IS_ENABLED(CONFIG_DIGEST_SHA1_ARM) :
> +	       IS_ENABLED(CONFIG_HAVE_DIGEST_SHA1);
> +
> +	test_digest(cond, digest_suffix("sha1", suffix),
> +		TEST_CASE(zeroes7, "77ce0377defbd11b77b1f4ad54ca40ea5ef28490"),
> +		TEST_CASE(one32,   "cbd9cbfc20182e4b71e593e7ad598fc383cc6058"),
> +		TEST_CASE(inc4097, "c627e736efd8bb0dff1778335c9c79cb1f27e396"));
> +
> +
> +	cond = !strcmp(suffix, "asm") ? IS_ENABLED(CONFIG_DIGEST_SHA256_ARM) :
> +	       IS_ENABLED(CONFIG_HAVE_DIGEST_SHA1);
> +
> +	test_digest(cond, digest_suffix("sha224", suffix),
> +		TEST_CASE(zeroes7, "fbf6df85218ac5632461a8a17c6f294e6f35264cbfc0a9774a4f665b"),
> +		TEST_CASE(one32,   "343cb3950305e6e6331e294b0a4925739d09ecbd2b43a2fc87c09941"),
> +		TEST_CASE(inc4097, "6596b5dcfbd857f4246d6b94508b8a1a5b715a4f644a0c1e7d54c4f7"));

This breaks on mips qemu-malta_defconfig:

https://github.com/barebox/barebox/actions/runs/5077359707/jobs/9120526730

This config has SHA256 enabled, but not SHA224. It seems we have to run
this test conditionally somehow.

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 |



  reply	other threads:[~2023-05-25  8:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-22  5:30 [PATCH 0/7] ARM64: crypto: add Crypto Extensions accelerated SHA implementation Ahmad Fatoum
2023-05-22  5:30 ` [PATCH 1/7] crypto: digest: match driver name if no algo name matches Ahmad Fatoum
2023-05-22  5:30 ` [PATCH 2/7] test: self: add digest test Ahmad Fatoum
2023-05-25  8:37   ` Sascha Hauer [this message]
2023-05-22  5:30 ` [PATCH 3/7] include: sync <linux/linkage.h> with Linux Ahmad Fatoum
2023-05-25  8:29   ` Sascha Hauer
2023-05-22  5:30 ` [PATCH 4/7] ARM: asm: implement CPU_BE/CPU_LE Ahmad Fatoum
2023-05-22  5:30 ` [PATCH 5/7] ARM: asm: import Linux adr_l/ldr_l assembler.h definitions Ahmad Fatoum
2023-05-22  5:30 ` [PATCH 6/7] crypto: sha: reorder struct sha*_state into Linux order Ahmad Fatoum
2023-05-22  5:30 ` [PATCH 7/7] ARM64: crypto: add Crypto Extensions accelerated SHA implementation Ahmad Fatoum
2023-05-25  6:48 ` [PATCH 0/7] " 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=20230525083718.GZ15436@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.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