QEMU-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Jamin Lin <jamin_lin@aspeedtech.com>
Cc: "Cédric Le Goater" <clg@kaod.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Steven Lee" <steven_lee@aspeedtech.com>,
	"Troy Lee" <leetroy@gmail.com>,
	"Kane Chen" <kane_chen@aspeedtech.com>,
	"Andrew Jeffery" <andrew@codeconstruct.com.au>,
	"Joel Stanley" <joel@jms.id.au>, "Eric Blake" <eblake@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"open list:All patches CC here" <qemu-devel@nongnu.org>,
	"open list:ASPEED BMCs" <qemu-arm@nongnu.org>,
	"Troy Lee" <troy_lee@aspeedtech.com>
Subject: Re: [PATCH v2 9/9] tests/qtest: Add ASPEED SBC ECDSA engine test
Date: Thu, 27 Aug 2026 13:47:37 +0100	[thread overview]
Message-ID: <apAx6ZY2uXW5rhDr@redhat.com> (raw)
In-Reply-To: <20260821032036.1829294-10-jamin_lin@aspeedtech.com>

On Fri, Aug 21, 2026 at 03:20:49AM +0000, Jamin Lin wrote:
> Add a qtest for the ASPEED secure boot controller ECDSA engine. It stages
> the public key, signature and SHA-384 digest of a secp384r1 known-answer
> vector (from the Linux kernel crypto self-test manager,
> ecdsa_nist_p384_tv_template) into the SEC SRAM, triggers the engine's
> verify command and checks the status register: a valid signature reports
> done + pass, and a tampered signature reports done without pass.
> 
> The test is skipped when the crypto backend does not support ECDSA, via
> qcrypto_akcipher_supports().
> 
> Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
> ---
>  tests/qtest/aspeed-sbc-test.c | 193 ++++++++++++++++++++++++++++++++++
>  tests/qtest/meson.build       |   2 +
>  2 files changed, 195 insertions(+)
>  create mode 100644 tests/qtest/aspeed-sbc-test.c
> 

> +static void aspeed_add_sbc_ecdsa_tests(const char *prefix, const char *machine,
> +                                       uint32_t sec_addr, uint64_t sram_addr)
> +{
> +    int i;
> +
> +    for (i = 0; i < ARRAY_SIZE(sbc_ecdsa_tests); i++) {
> +        QCryptoAkCipherOptions opts = {
> +            .alg = QCRYPTO_AK_CIPHER_ALGO_ECDSA,
> +            .u.ecdsa.curve_id = sbc_ecdsa_tests[i].curve_id,
> +        };
> +        g_autofree char *path = NULL;
> +        AspeedSBCTest *t;
> +
> +        if (!qcrypto_akcipher_supports(&opts)) {
> +            g_printerr("# skip SBC ECDSA %s test: not supported by the crypto "
> +                       "backend\n", sbc_ecdsa_tests[i].name);

We ought to use  g_test_skip(...) instead of g_printerr("# skip....)
so we don't assume use of TAP format.

> +            continue;
> +        }
> +
> +        path = g_strdup_printf("%s/sbc/ecdsa/%s", prefix,
> +                               sbc_ecdsa_tests[i].name);
> +        t = g_new0(AspeedSBCTest, 1);
> +        t->machine = machine;
> +        t->sec_addr = sec_addr;
> +        t->sram_addr = sram_addr;
> +        t->index = i;
> +        qtest_add_data_func_full(path, t, test_ecdsa_verify, g_free);
> +    }
> +}

With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|



      reply	other threads:[~2026-08-27 12:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21  3:20 [PATCH v2 0/9] Add ECDSA akcipher support and the ASPEED SBC ECDSA engine for AST10x0 Jamin Lin
2026-08-21  3:20 ` [PATCH v2 1/9] qapi/crypto: Add ECDSA algorithm and curve id Jamin Lin
2026-08-27 12:34   ` Daniel P. Berrangé
2026-08-21  3:20 ` [PATCH v2 2/9] crypto/akcipher: Support ECDSA sign/verify with gcrypt Jamin Lin
2026-08-27 12:41   ` Daniel P. Berrangé
2026-08-21  3:20 ` [PATCH v2 3/9] crypto/akcipher: Support ECDSA sign/verify with nettle Jamin Lin
2026-08-27 12:42   ` Daniel P. Berrangé
2026-08-21  3:20 ` [PATCH v2 4/9] hw/arm/aspeed_ast10x0: Remove obsolete unimplemented SBC mapping Jamin Lin
2026-08-27 12:43   ` Daniel P. Berrangé
2026-08-21  3:20 ` [PATCH v2 5/9] tests/crypto: Add ECDSA sign/verify tests Jamin Lin
2026-08-27 12:45   ` Daniel P. Berrangé
2026-08-21  3:20 ` [PATCH v2 6/9] hw/misc/aspeed_sbc: Support the ECDSA verify command Jamin Lin
2026-08-21  3:20 ` [PATCH v2 7/9] hw/misc/aspeed_sbc: Increase register space to 0x1000 Jamin Lin
2026-08-21  3:20 ` [PATCH v2 8/9] hw/arm/aspeed_ast10x0: Wire SEC SRAM to the SBC model Jamin Lin
2026-08-21  3:20 ` [PATCH v2 9/9] tests/qtest: Add ASPEED SBC ECDSA engine test Jamin Lin
2026-08-27 12:47   ` Daniel P. Berrangé [this message]

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=apAx6ZY2uXW5rhDr@redhat.com \
    --to=berrange@redhat.com \
    --cc=andrew@codeconstruct.com.au \
    --cc=armbru@redhat.com \
    --cc=clg@kaod.org \
    --cc=eblake@redhat.com \
    --cc=farosas@suse.de \
    --cc=jamin_lin@aspeedtech.com \
    --cc=joel@jms.id.au \
    --cc=kane_chen@aspeedtech.com \
    --cc=leetroy@gmail.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=steven_lee@aspeedtech.com \
    --cc=troy_lee@aspeedtech.com \
    /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