@@ -588,9 +588,12 @@ int mbedtls_rsa_private( mbedtls_rsa_context *ctx,
588
588
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
589
589
*
590
590
* \param ctx The initialized RSA context to use.
591
- * \param f_rng This is the RNG function used to generate the
592
- * PKCS#1 v2.1 padding encoding if \p mode is
593
- * #MBEDTLS_RSA_PRIVATE.
591
+ * \param f_rng The RNG to use. If PKCS#1 v2.1 padding encoding is
592
+ * used, this must be provided. Additionally, it is
593
+ * used for blinding if \p mode is #MBEDTLS_RSA_PRIVATE
594
+ * and should be provided in this case; see
595
+ * mbedtls_rsa_private() for more. It is ignored
596
+ * for PKCS#1 v1.5 padding with #MBEDTLS_RSA_PUBLIC.
594
597
* \param p_rng The RNG context to be passed to \p f_rng. May be
595
598
* \c NULL if \p f_rng is \c NULL or if \p f_rng doesn't
596
599
* need a context argument.
@@ -628,8 +631,10 @@ int mbedtls_rsa_pkcs1_encrypt( mbedtls_rsa_context *ctx,
628
631
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
629
632
*
630
633
* \param ctx The initialized RSA context to use.
631
- * \param f_rng The RNG function, needed for padding generation if
632
- * \p mode is #MBEDTLS_RSA_PRIVATE.
634
+ * \param f_rng The RNG function to use. It is needed for padding generation
635
+ * if \p mode is #MBEDTLS_RSA_PUBLIC. If \p mode is
636
+ * #MBEDTLS_RSA_PRIVATE (discouraged), it is used for
637
+ * blinding and should be provided; see mbedtls_rsa_private().
633
638
* \param p_rng The RNG context to be passed to \p f_rng. This may
634
639
* be \c NULL if \p f_rng is \c NULL or if \p f_rng
635
640
* doesn't need a context argument.
@@ -670,11 +675,10 @@ int mbedtls_rsa_rsaes_pkcs1_v15_encrypt( mbedtls_rsa_context *ctx,
670
675
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
671
676
*
672
677
* \param ctx The initnialized RSA context to use.
673
- * \param f_rng The RNG function, needed for padding and PKCS#1 v2.1
674
- * encoding if \p mode is #MBEDTLS_RSA_PRIVATE .
678
+ * \param f_rng The RNG function to use. This is needed for padding
679
+ * generation and must be provided .
675
680
* \param p_rng The RNG context to be passed to \p f_rng. This may
676
- * be \c NULL if \p f_rng is \c NULL or if \p f_rng
677
- * doesn't need a context argument.
681
+ * be \c NULL if \p f_rng doesn't need a context argument.
678
682
* \param mode The mode of operation. This must be either
679
683
* #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE (deprecated).
680
684
* \param label The buffer holding the custom label to use.
@@ -883,10 +887,11 @@ int mbedtls_rsa_rsaes_oaep_decrypt( mbedtls_rsa_context *ctx,
883
887
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
884
888
*
885
889
* \param ctx The initialized RSA context to use.
886
- * \param f_rng The RNG function. If the padding mode is PKCS#1 v2.1
887
- * and \p mode is set to #MBEDTLS_RSA_PRIVATE, it is used for
888
- * blinding and should be provided; see mbedtls_rsa_private().
889
- * It is ignored otherwise.
890
+ * \param f_rng The RNG function to use. If the padding mode is PKCS#1 v2.1,
891
+ * this must be provided. If the padding mode is PKCS#1 v1.5 and
892
+ * \p mode is #MBEDTLS_RSA_PRIVATE, it is used for blinding
893
+ * and should be provided; see mbedtls_rsa_private() for more
894
+ * more. It is ignored otherwise.
890
895
* \param p_rng The RNG context to be passed to \p f_rng. This may be \c NULL
891
896
* if \p f_rng is \c NULL or doesn't need a context argument.
892
897
* \param mode The mode of operation. This must be either
@@ -1045,8 +1050,9 @@ int mbedtls_rsa_rsassa_pss_sign( mbedtls_rsa_context *ctx,
1045
1050
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
1046
1051
*
1047
1052
* \param ctx The initialized RSA public key context to use.
1048
- * \param f_rng The RNG function to use. This is only needed if
1049
- * \p mode is #MBEDTLS_RSA_PRIVATE.
1053
+ * \param f_rng The RNG function to use. If \p mode is #MBEDTLS_RSA_PRIVATE,
1054
+ * this is used for blinding and should be provided; see
1055
+ * mbedtls_rsa_private() for more. Otherwise, it is ignored.
1050
1056
* \param p_rng The RNG context to be passed to \p f_rng. This may be
1051
1057
* \c NULL if \p f_rng is \c NULL or doesn't need a context.
1052
1058
* \param mode The mode of operation. This must be either
@@ -1090,8 +1096,9 @@ int mbedtls_rsa_pkcs1_verify( mbedtls_rsa_context *ctx,
1090
1096
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
1091
1097
*
1092
1098
* \param ctx The initialized RSA public key context to use.
1093
- * \param f_rng The RNG function to use. This is only needed if
1094
- * \p mode is #MBEDTLS_RSA_PRIVATE.
1099
+ * \param f_rng The RNG function to use. If \p mode is #MBEDTLS_RSA_PRIVATE,
1100
+ * this is used for blinding and should be provided; see
1101
+ * mbedtls_rsa_private() for more. Otherwise, it is ignored.
1095
1102
* \param p_rng The RNG context to be passed to \p f_rng. This may be
1096
1103
* \c NULL if \p f_rng is \c NULL or doesn't need a context.
1097
1104
* \param mode The mode of operation. This must be either
@@ -1146,8 +1153,9 @@ int mbedtls_rsa_rsassa_pkcs1_v15_verify( mbedtls_rsa_context *ctx,
1146
1153
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
1147
1154
*
1148
1155
* \param ctx The initialized RSA public key context to use.
1149
- * \param f_rng The RNG function to use. This is only needed if
1150
- * \p mode is #MBEDTLS_RSA_PRIVATE.
1156
+ * \param f_rng The RNG function to use. If \p mode is #MBEDTLS_RSA_PRIVATE,
1157
+ * this is used for blinding and should be provided; see
1158
+ * mbedtls_rsa_private() for more. Otherwise, it is ignored.
1151
1159
* \param p_rng The RNG context to be passed to \p f_rng. This may be
1152
1160
* \c NULL if \p f_rng is \c NULL or doesn't need a context.
1153
1161
* \param mode The mode of operation. This must be either
@@ -1190,8 +1198,9 @@ int mbedtls_rsa_rsassa_pss_verify( mbedtls_rsa_context *ctx,
1190
1198
* \note The \p hash_id in the RSA context is ignored.
1191
1199
*
1192
1200
* \param ctx The initialized RSA public key context to use.
1193
- * \param f_rng The RNG function to use. This is only needed if
1194
- * \p mode is #MBEDTLS_RSA_PRIVATE.
1201
+ * \param f_rng The RNG function to use. If \p mode is #MBEDTLS_RSA_PRIVATE,
1202
+ * this is used for blinding and should be provided; see
1203
+ * mbedtls_rsa_private() for more. Otherwise, it is ignored.
1195
1204
* \param p_rng The RNG context to be passed to \p f_rng. This may be
1196
1205
* \c NULL if \p f_rng is \c NULL or doesn't need a context.
1197
1206
* \param mode The mode of operation. This must be either
0 commit comments