Mbed TLS is now part of TrustedFirmware.org.

Select padding for mbedtls_pk_decrypt()

Dec 23, 2015 03:57

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.).

Jan 4, 2016 14:34
Manuel Pégourié-Gonnard

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.

Jan 5, 2016 18:40

That works, and its very simple, thanks!