Add documentation for new bignum functions
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
diff --git a/library/bignum_mod_raw.h b/library/bignum_mod_raw.h
index 21743e0..2d7fc81 100644
--- a/library/bignum_mod_raw.h
+++ b/library/bignum_mod_raw.h
@@ -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,