From 5c032b5e1bd3b072bc4d54be2f3db1f95eb5a78b Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Thu, 2 Feb 2023 15:10:32 +0100 Subject: [PATCH] pk_wrap: fix comment in ecdsa_verify_wrap Signed-off-by: Valerio Setti --- library/pk_wrap.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/library/pk_wrap.c b/library/pk_wrap.c index 2a71bd8529..7f266d23d7 100644 --- a/library/pk_wrap.c +++ b/library/pk_wrap.c @@ -689,9 +689,11 @@ static int ecdsa_verify_wrap(void *ctx_arg, mbedtls_md_type_t md_alg, mbedtls_svc_key_id_t key_id = MBEDTLS_SVC_KEY_ID_INIT; psa_status_t status; size_t key_len; - /* This buffer contains first the public key (consisting of two public - * points plus a header byte), then the signature (consisting of two - * public points). Size it for the public key which is one byte larger. */ + /* This buffer will initially contain the public key and then the signature + * but at different points in time. For all curves except secp224k1, which + * is not currently supported in PSA, the public key is one byte longer + * (header byte + 2 numbers, while the signature is only 2 numbers), + * so use that as the buffer size. */ unsigned char buf[MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH]; unsigned char *p; psa_algorithm_t psa_sig_md = PSA_ALG_ECDSA_ANY;