[PATCH v5 06/15] test: dm: ecdsa.c: clean this test as software ecdsa is now implemented

Simon Glass sjg at chromium.org
Wed Apr 22 02:12:56 CEST 2026


Hi Philippe,

On 2026-04-21T21:09:51, Philippe Reynes <philippe.reynes at softathome.com> wrote:
> test: dm: ecdsa.c: clean this test as software ecdsa is now implemented
>
> The test ecdsa was done when ecdsa was only supported by hardware.
> So it wasn't possible to test ecdsa on sandbox, and there is a test
> to check that ecdsa is not supported on sandbox.
> Now, there is a software implementation of ecdsa. So we remove
> this outdated test.
>
> Signed-off-by: Philippe Reynes <philippe.reynes at softathome.com>
>
> test/dm/ecdsa.c | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++------
>  1 file changed, 97 insertions(+), 10 deletions(-)

> diff --git a/test/dm/ecdsa.c b/test/dm/ecdsa.c
> @@ -3,36 +3,123 @@

The commit message says "we remove this outdated test" but this patch
refactors it to perform actual ECDSA verification. Please can you
rephrase to describe what it actually does.

> diff --git a/test/dm/ecdsa.c b/test/dm/ecdsa.c
> @@ -3,36 +3,123 @@
> +#define CHECK(op) ({                                                 \
> +             int err = op;                                           \
> +             if (err < 0) {                                          \
> +                     printf("%s: %s: %s\n", __func__, #op,           \
> +                            fdt_strerror(err));                      \
> +                     return err;                                     \
> +             }                                                       \
> +                                                                     \
> +             err;                                                    \
> +     })

hex2bin() returns -1 on error, which is not a valid fdt_strerror()
input. Consider using a more generic error message.

> diff --git a/test/dm/ecdsa.c b/test/dm/ecdsa.c
> @@ -3,36 +3,123 @@
> +     value = malloc(len / 2);
> +     if (!value) {
> +             ret = -EINVAL;
> +             goto out;
> +     }

We use -ENOMEM when out of malloc() space.

> diff --git a/test/dm/ecdsa.c b/test/dm/ecdsa.c
> @@ -3,36 +3,123 @@
> +     size_t fdt_size = 512;
> +     char fdt[512];

The value 512 is duplicated. Please can you use a #define for clarity.

Regards,
Simon


More information about the U-Boot mailing list