1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-01 10:06:53 +03:00

Improve migration guide

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
Ronald Cron
2021-06-09 10:17:04 +02:00
parent 3a0375fff4
commit f8abfa8b1b

View File

@ -9,21 +9,21 @@ encoding and its hash. It just selects the PKCS#1 v1.5 encoding by default. If
you were using the PKCS#1 v2.1 encoding you now need, subsequently to the call you were using the PKCS#1 v2.1 encoding you now need, subsequently to the call
to mbedtls_rsa_init(), to call mbedtls_rsa_set_padding() to set it. to mbedtls_rsa_init(), to call mbedtls_rsa_set_padding() to set it.
Code migration examples: To choose the padding type when initializing a context, instead of
```C ```C
mbedtls_rsa_init(ctx, padding, hash_id); mbedtls_rsa_init(ctx, padding, hash_id);
``` ```
to , use
```C ```C
mbedtls_rsa_init(ctx); mbedtls_rsa_init(ctx);
mbedtls_rsa_set_padding(ctx, padding, hash_id); mbedtls_rsa_set_padding(ctx, padding, hash_id);
``` ```
or
To use PKCS#1 v1.5 padding, instead of
```C ```C
mbedtls_rsa_init(ctx, MBEDTLS_RSA_PKCS_V15, <ignored>); mbedtls_rsa_init(ctx, MBEDTLS_RSA_PKCS_V15, <ignored>);
``` ```
to , just use
```C ```C
mbedtls_rsa_init(ctx); mbedtls_rsa_init(ctx);
``` ```