Mbed TLS 4 moved its cryptography into TF-PSA-Crypto and the PSA Crypto API (psa_sign_message, psa_verify_message, psa_generate_key), the same API used by Arm's Trusted Firmware. The facts here were checked on the Alpine 3.24.2 package, Mbed TLS 4.1.1 (upstream had reached 4.2.0); features depend on the build configuration, as with every embedded library.
The signature encoding is the one that differs from OpenSSL-derived code: PSA returns the raw r‖s form, 64 bytes on P-256, not DER. Signatures for X.509, CMS or an OpenSSL verifier must be wrapped in DER, and DER signatures from those peers must be unwrapped before psa_verify_message, which otherwise reports PSA_ERROR_INVALID_SIGNATURE — the same status as for a forged signature or a 3-byte blob. Convert with the DER ⇄ raw converter.
Each key carries a policy with one permitted algorithm, so the choice between PSA_ALG_ECDSA (random nonce) and PSA_ALG_DETERMINISTIC_ECDSA (RFC 6979 — the RFC's test vector reproduced) is made when the key is created, as the sample shows. s is not normalized and verification accepts high-S. psa_sign_hash signs a precomputed digest.
This build signed and verified P-256, P-384, P-521, secp256k1 and the Brainpool r1 curves; P-224 was not available, and Ed25519 key generation was refused (PSA_ERROR_NOT_SUPPORTED). Post-quantum support is limited to LMS hash-based signature verification (MBEDTLS_LMS_C); there is no ML-KEM or ML-DSA key type, and the experimental ML-DSA driver from mldsa-native (TF_PSA_CRYPTO_PQCP_MLDSA_ENABLED) is commented out in this build's configuration. Public keys export as uncompressed SEC1 points through PSA and as SPKI DER through the pk layer.