MicrochipTech/cryptoauthlib

ATECC608B not returning a 64-byte ECDSA signature

davmoz opened this issue · 1 comments

I'm trying to get the 64-byte ECDSA signature after signing from signature, but the returned size (olen) varies between 70-72 bytes.

ESP_LOGI(TAG, " Generating ECDSA Signature...");
ret = mbedtls_pk_sign(&pkey, MBEDTLS_MD_SHA256, hash, 0, signature, MBEDTLS_MPI_MAX_SIZE, olen,
                          mbedtls_ctr_drbg_random, &ctr_drbg);
if (ret != 0)
{
    ESP_LOGI(TAG, " failed ! mbedtls_pk_sign returned -0x%04x", -ret);
    goto exit;
}

ESP_LOGI(TAG, " ok");

I'm using the following configuration:

CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y

I have also configured the project according to the instructions in this example, which currently I'm using.

Any reason/pointers as to why the resulting signature size is not 64 bytes?

Sorry, mixed up this repo with espressif's repo.
Created an issue there instead.