Select padding for mbedtls_pk_decrypt()
Currently the default padding used in pk.h (i.e. mbedtls_pk_decrypt) is PKCS#1 v1.5. However, in rsa.h, PKCS v2.1 OAEP/PSS padding is supported. It would be nice if OAEP/PSS padding was exposed in some way to the pk.h interface (function argument, setting in the pk context, etc.).
I agree that it would be nice to have a clean interface for that in the PK layer. In the meantime, I believe
mbedtls_rsa_set_padding( mbedtls_pk_rsa( pk_ctx ), ... ) should do the trick.
That works, and its very simple, thanks!