mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-25 14:55:37 +00:00
Add documentation notes about the required size of the signature buffers
This commit is contained in:
parent
199707fcff
commit
eee98e9d82
|
@ -343,6 +343,10 @@ int mbedtls_pk_verify_ext( mbedtls_pk_type_t type, const void *options,
|
||||||
*
|
*
|
||||||
* \note For RSA, md_alg may be MBEDTLS_MD_NONE if hash_len != 0.
|
* \note For RSA, md_alg may be MBEDTLS_MD_NONE if hash_len != 0.
|
||||||
* For ECDSA, md_alg may never be MBEDTLS_MD_NONE.
|
* For ECDSA, md_alg may never be MBEDTLS_MD_NONE.
|
||||||
|
*
|
||||||
|
* \note In order to ensure enough space for the signature, the
|
||||||
|
* \p sig buffer size must be of at least
|
||||||
|
* `max(MBEDTLS_ECDSA_MAX_LEN, MBEDTLS_MPI_MAX_SIZE)` bytes.
|
||||||
*/
|
*/
|
||||||
int mbedtls_pk_sign( mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg,
|
int mbedtls_pk_sign( mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg,
|
||||||
const unsigned char *hash, size_t hash_len,
|
const unsigned char *hash, size_t hash_len,
|
||||||
|
|
|
@ -819,6 +819,7 @@ int mbedtls_rsa_rsaes_oaep_decrypt( mbedtls_rsa_context *ctx,
|
||||||
*
|
*
|
||||||
* \note The \p sig buffer must be as large as the size
|
* \note The \p sig buffer must be as large as the size
|
||||||
* of \p ctx->N. For example, 128 Bytes if RSA-1024 is used.
|
* of \p ctx->N. For example, 128 Bytes if RSA-1024 is used.
|
||||||
|
* A buffer length of #MBEDTLS_MPI_MAX_SIZE is always safe.
|
||||||
*
|
*
|
||||||
* \note For PKCS#1 v2.1 encoding, see comments on
|
* \note For PKCS#1 v2.1 encoding, see comments on
|
||||||
* mbedtls_rsa_rsassa_pss_sign() for details on
|
* mbedtls_rsa_rsassa_pss_sign() for details on
|
||||||
|
@ -862,6 +863,7 @@ int mbedtls_rsa_pkcs1_sign( mbedtls_rsa_context *ctx,
|
||||||
*
|
*
|
||||||
* \note The \p sig buffer must be as large as the size
|
* \note The \p sig buffer must be as large as the size
|
||||||
* of \p ctx->N. For example, 128 Bytes if RSA-1024 is used.
|
* of \p ctx->N. For example, 128 Bytes if RSA-1024 is used.
|
||||||
|
* A buffer length of #MBEDTLS_MPI_MAX_SIZE is always safe.
|
||||||
*/
|
*/
|
||||||
int mbedtls_rsa_rsassa_pkcs1_v15_sign( mbedtls_rsa_context *ctx,
|
int mbedtls_rsa_rsassa_pkcs1_v15_sign( mbedtls_rsa_context *ctx,
|
||||||
int (*f_rng)(void *, unsigned char *, size_t),
|
int (*f_rng)(void *, unsigned char *, size_t),
|
||||||
|
@ -902,6 +904,7 @@ int mbedtls_rsa_rsassa_pkcs1_v15_sign( mbedtls_rsa_context *ctx,
|
||||||
*
|
*
|
||||||
* \note The \p sig buffer must be as large as the size
|
* \note The \p sig buffer must be as large as the size
|
||||||
* of \p ctx->N. For example, 128 Bytes if RSA-1024 is used.
|
* of \p ctx->N. For example, 128 Bytes if RSA-1024 is used.
|
||||||
|
* A buffer length of #MBEDTLS_MPI_MAX_SIZE is always safe.
|
||||||
*
|
*
|
||||||
* \note The \p hash_id in the RSA context is the one used for the
|
* \note The \p hash_id in the RSA context is the one used for the
|
||||||
* encoding. \p md_alg in the function call is the type of hash
|
* encoding. \p md_alg in the function call is the type of hash
|
||||||
|
|
Loading…
Reference in a new issue