[PATCH v4 02/14] ecdsa: initial support of ecdsa using mbedtls

Simon Glass sjg at chromium.org
Mon Apr 20 04:11:19 CEST 2026


Hi Philippe,

On 2026-04-17T13:02:04, Philippe Reynes <philippe.reynes at softathome.com> wrote:
> ecdsa: initial support of ecdsa using mbedtls
>
> Adds an initial support of ecdsa verify using mbedtls.
>
> Signed-off-by: Philippe Reynes <philippe.reynes at softathome.com>
>
> include/crypto/ecdsa-uclass.h   |  15 +----
>  include/crypto/internal/ecdsa.h |  28 ++++++++
>  lib/mbedtls/Makefile            |   3 +
>  lib/mbedtls/ecdsa.c             | 146 ++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 178 insertions(+), 14 deletions(-)

> diff --git a/lib/mbedtls/ecdsa.c b/lib/mbedtls/ecdsa.c
> @@ -0,0 +1,146 @@
> +     err = mbedtls_mpi_read_binary(&Q.Y, pubkey->y, key_len);
> +     if (err) {
> +             log_debug("could not read value y of the public key (err = %d)\n",
> +                       err);
> +             err = -EINVAL;
> +             goto out2;
> +     }
> +     mbedtls_mpi_lset(&Q.Z, 1);
> +     if (err) {
> +             log_debug("could not set value z of the public key (err = %d)\n",
> +                       err);
> +             err = -EINVAL;
> +             goto out2;
> +     }

Shouldn't this be:

    err = mbedtls_mpi_lset(&Q.Z, 1);
    if (err) {

> diff --git a/include/crypto/internal/ecdsa.h b/include/crypto/internal/ecdsa.h
> @@ -0,0 +1,28 @@
> +int ecdsa_hash_verify(const struct ecdsa_public_key *pubkey,
> +                   const void *hash, size_t hash_len,
> +                   const void *signature, size_t sig_len);

Please can you add a kerneldoc comment documenting the parameters and
return value?

Regards,
Simon


More information about the U-Boot mailing list