1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

Add documentation for new bignum functions

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
Gabor Mezei
2022-08-02 17:22:18 +02:00
committed by Janos Follath
parent 23a1ce90ec
commit 37b06360b3
4 changed files with 146 additions and 13 deletions

View File

@ -26,11 +26,40 @@
#include "mbedtls/bignum.h"
#endif
/** Import X from unsigned binary data.
*
* 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).
*
* \param X The address of the MPI. The size is determined by \p m.
* \param m The address of a modulus related to \p X.
* \param buf The input buffer to import from.
* \param buflen Tne length in bytes of \p buf.
*
* \return \c 0 if successful.
* \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if \p X isn't
* large enough to hold the value in \p buf.
* \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if the external reprezentation
* of \p m is invalid or \p X is less then \p m.
*/
int mbedtls_mpi_mod_raw_read( mbedtls_mpi_uint *X,
mbedtls_mpi_mod_modulus *m,
unsigned char *buf,
size_t buflen );
/** Export X into unsigned binary data.
*
* \param X The address of the MPI. The size is determined by \p m.
* \param m The address of a modulus related to \p X.
* \param buf The output buffer to import.
* \param buflen Tne length in bytes of \p buf.
*
* \return \c 0 if successful.
* \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if \p buf isn't
* large enough to hold the value of \p X.
* \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if the external reprezentation
* of \p m is invalid.
*/
int mbedtls_mpi_mod_raw_write( mbedtls_mpi_uint *X,
mbedtls_mpi_mod_modulus *m,
unsigned char *buf,