1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

mbedtls_mpi_read_binary() document that function guarantees to return an MPI with exactly the necessary number of limbs and remove redundant call to mbedtls_mpi_grow()

Signed-off-by: Przemyslaw Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
Przemyslaw Stekiel
2022-02-21 13:42:09 +01:00
parent aeaa4f0651
commit 76960a7217
2 changed files with 6 additions and 1 deletions

View File

@ -785,6 +785,9 @@ static void mpi_bigendian_to_host( mbedtls_mpi_uint * const p, size_t limbs )
/*
* Import X from unsigned binary data, little endian
*
* This function is guaranteed to return an MPI with exactly the necessary
* number of limbs (in particular, it does not skip 0s in the input).
*/
int mbedtls_mpi_read_binary_le( mbedtls_mpi *X,
const unsigned char *buf, size_t buflen )
@ -811,6 +814,9 @@ cleanup:
/*
* Import X from unsigned binary data, big endian
*
* This function is guaranteed to return an MPI with exactly the necessary
* number of limbs (in particular, it does not skip 0s in the input).
*/
int mbedtls_mpi_read_binary( mbedtls_mpi *X, const unsigned char *buf, size_t buflen )
{