1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-08 17:42:09 +03:00

Merge pull request #6723 from mpg/restartable-vs-use-psa

Document ECP_RESTARTABLE and make it compatible with USE_PSA
This commit is contained in:
Gilles Peskine
2022-12-15 19:47:44 +01:00
committed by GitHub
12 changed files with 202 additions and 37 deletions

View File

@@ -1162,8 +1162,12 @@ static int ecdsa_sign_wrap( void *ctx_arg, mbedtls_md_type_t md_alg,
size_t key_len;
unsigned char buf[MBEDTLS_PK_ECP_PRV_DER_MAX_BYTES];
unsigned char *p;
psa_algorithm_t psa_sig_md =
PSA_ALG_ECDSA( mbedtls_hash_info_psa_from_md( md_alg ) );
psa_algorithm_t psa_hash = mbedtls_hash_info_psa_from_md( md_alg );
#if defined(MBEDTLS_ECDSA_DETERMINISTIC)
psa_algorithm_t psa_sig_md = PSA_ALG_DETERMINISTIC_ECDSA( psa_hash );
#else
psa_algorithm_t psa_sig_md = PSA_ALG_ECDSA( psa_hash );
#endif
size_t curve_bits;
psa_ecc_family_t curve =
mbedtls_ecc_group_to_psa( ctx->grp.id, &curve_bits );