Hi Christian,
We don't provide such a function. Even in the TLS module, the conversion is done indirectly, from TLS::SignatureScheme to Mbed_TLS::mbedtls_{md,pk}_type_t and from those to psa_algorithm_t.
The signature scheme mostly breaks down into a signature algorithm octet and a hash algorithm octet. You can get away with breaking it down as
switch (sigalg & 0xff) { case 0x01: alg = PSA_ALG_RSA_PKCS1_V15_SIGN_BASE; /* etc */ } switch (sigalg & 0xff00) { case 0x0200: hash_alg = PSA_ALG_SHA1; /* etc */ } alg |= hash_alg & PSA_ALG_HASH_MASK;
Although do note that the _BASE and _MASK constants are not part of the public API (but they're very unlikely to be removed from 3.6 LTS). Considering that such bit-twiddling comes up quite often, I wonder if we should be less wary of making them official.
Best regards,