mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-02 07:14:22 +01:00
Improve documentation of PKCS1 decryption functions
Document the preconditions on the input and output buffers for the PKCS1 decryption functions - mbedtls_rsa_pkcs1_decrypt, - mbedtls_rsa_rsaes_pkcs1_v15_decrypt - mbedtls_rsa_rsaes_oaep_decrypt
This commit is contained in:
parent
8a2855ee3c
commit
573bb96416
@ -336,9 +336,15 @@ int rsa_rsaes_oaep_encrypt( rsa_context *ctx,
|
|||||||
*
|
*
|
||||||
* \return 0 if successful, or an POLARSSL_ERR_RSA_XXX error code
|
* \return 0 if successful, or an POLARSSL_ERR_RSA_XXX error code
|
||||||
*
|
*
|
||||||
* \note The output buffer must be as large as the size
|
* \note The output buffer length \c output_max_len should be
|
||||||
* of ctx->N (eg. 128 bytes if RSA-1024 is used) otherwise
|
* as large as the size ctx->len of ctx->N (eg. 128 bytes
|
||||||
* an error is thrown.
|
* if RSA-1024 is used) to be able to hold an arbitrary
|
||||||
|
* decrypted message. If it is not large enough to hold
|
||||||
|
* the decryption of the particular ciphertext provided,
|
||||||
|
* the function will return POLARSSL_ERR_RSA_OUTPUT_TOO_LARGE.
|
||||||
|
*
|
||||||
|
* \note The input buffer must be as large as the size
|
||||||
|
* of ctx->N (eg. 128 bytes if RSA-1024 is used).
|
||||||
*/
|
*/
|
||||||
int rsa_pkcs1_decrypt( rsa_context *ctx,
|
int rsa_pkcs1_decrypt( rsa_context *ctx,
|
||||||
int (*f_rng)(void *, unsigned char *, size_t),
|
int (*f_rng)(void *, unsigned char *, size_t),
|
||||||
@ -363,9 +369,15 @@ int rsa_pkcs1_decrypt( rsa_context *ctx,
|
|||||||
*
|
*
|
||||||
* \return 0 if successful, or an POLARSSL_ERR_RSA_XXX error code
|
* \return 0 if successful, or an POLARSSL_ERR_RSA_XXX error code
|
||||||
*
|
*
|
||||||
* \note The output buffer must be as large as the size
|
* \note The output buffer length \c output_max_len should be
|
||||||
* of ctx->N (eg. 128 bytes if RSA-1024 is used) otherwise
|
* as large as the size ctx->len of ctx->N (eg. 128 bytes
|
||||||
* an error is thrown.
|
* if RSA-1024 is used) to be able to hold an arbitrary
|
||||||
|
* decrypted message. If it is not large enough to hold
|
||||||
|
* the decryption of the particular ciphertext provided,
|
||||||
|
* the function will return POLARSSL_ERR_RSA_OUTPUT_TOO_LARGE.
|
||||||
|
*
|
||||||
|
* \note The input buffer must be as large as the size
|
||||||
|
* of ctx->N (eg. 128 bytes if RSA-1024 is used).
|
||||||
*/
|
*/
|
||||||
int rsa_rsaes_pkcs1_v15_decrypt( rsa_context *ctx,
|
int rsa_rsaes_pkcs1_v15_decrypt( rsa_context *ctx,
|
||||||
int (*f_rng)(void *, unsigned char *, size_t),
|
int (*f_rng)(void *, unsigned char *, size_t),
|
||||||
@ -392,9 +404,15 @@ int rsa_rsaes_pkcs1_v15_decrypt( rsa_context *ctx,
|
|||||||
*
|
*
|
||||||
* \return 0 if successful, or an POLARSSL_ERR_RSA_XXX error code
|
* \return 0 if successful, or an POLARSSL_ERR_RSA_XXX error code
|
||||||
*
|
*
|
||||||
* \note The output buffer must be as large as the size
|
* \note The output buffer length \c output_max_len should be
|
||||||
* of ctx->N (eg. 128 bytes if RSA-1024 is used) otherwise
|
* as large as the size ctx->len of ctx->N (eg. 128 bytes
|
||||||
* an error is thrown.
|
* if RSA-1024 is used) to be able to hold an arbitrary
|
||||||
|
* decrypted message. If it is not large enough to hold
|
||||||
|
* the decryption of the particular ciphertext provided,
|
||||||
|
* the function will return POLARSSL_ERR_RSA_OUTPUT_TOO_LARGE.
|
||||||
|
*
|
||||||
|
* \note The input buffer must be as large as the size
|
||||||
|
* of ctx->N (eg. 128 bytes if RSA-1024 is used).
|
||||||
*/
|
*/
|
||||||
int rsa_rsaes_oaep_decrypt( rsa_context *ctx,
|
int rsa_rsaes_oaep_decrypt( rsa_context *ctx,
|
||||||
int (*f_rng)(void *, unsigned char *, size_t),
|
int (*f_rng)(void *, unsigned char *, size_t),
|
||||||
|
Loading…
Reference in New Issue
Block a user