From c569fc268f9195fd19decbcd6cfe1954767a54cf Mon Sep 17 00:00:00 2001 From: Paul Elliott Date: Fri, 10 Feb 2023 13:02:54 +0000 Subject: [PATCH] Switch from nbits to pbits Correct coordinate size is grp.nbits, not grp.pbits. Signed-off-by: Paul Elliott --- library/psa_crypto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 2328e3590..776a9c858 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -3556,7 +3556,7 @@ psa_status_t mbedtls_psa_sign_hash_start( mbedtls_ecdsa_restart_init(&operation->restart_ctx); operation->coordinate_bytes = PSA_BITS_TO_BYTES( - operation->ctx->grp.pbits); + operation->ctx->grp.nbits); psa_algorithm_t hash_alg = PSA_ALG_SIGN_GET_HASH(alg); operation->md_alg = mbedtls_hash_info_md_from_psa(hash_alg); @@ -3758,7 +3758,7 @@ psa_status_t mbedtls_psa_verify_hash_start( return status; } - coordinate_bytes = PSA_BITS_TO_BYTES(operation->ctx->grp.pbits); + coordinate_bytes = PSA_BITS_TO_BYTES(operation->ctx->grp.nbits); if (signature_length != 2 * coordinate_bytes) { return PSA_ERROR_INVALID_SIGNATURE;