Add documentation for new bignum functions
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
diff --git a/library/bignum_mod.h b/library/bignum_mod.h
index 97b3fc7..a4f0248 100644
--- a/library/bignum_mod.h
+++ b/library/bignum_mod.h
@@ -63,21 +63,57 @@
MBEDTLS_MPI_MOD_EXT_REP_BE
} mbedtls_mpi_mod_ext_rep;
-void mbedtls_mpi_mod_residue_release( mbedtls_mpi_mod_residue *r );
+/** Setup a residue structure.
+ *
+ * \param r The address of residue to setup. The size is determined by \p m.
+ * \param m The address of a modulus related to \p r.
+ * \param p The address of the MPI used for \p r.
+ * \param pn The number of limbs of \p p.
+ *
+ * \return \c 0 if successful.
+ * \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \p r, \p m or \p p is
+ * #NULL pointer or if \p p is less then \p m.
+ */
int mbedtls_mpi_mod_residue_setup( mbedtls_mpi_mod_residue *r,
mbedtls_mpi_mod_modulus *m,
mbedtls_mpi_uint *p,
size_t pn );
+/** Unbind elements of a residue structure.
+ *
+ * \param r The address of residue to release.
+ */
+void mbedtls_mpi_mod_residue_release( mbedtls_mpi_mod_residue *r );
+
+/** Initialize a modulus structure.
+ *
+ * \param m The address of a modulus.
+ */
void mbedtls_mpi_mod_modulus_init( mbedtls_mpi_mod_modulus *m );
-void mbedtls_mpi_mod_modulus_free( mbedtls_mpi_mod_modulus *m );
-
+/** Setup a residue structure.
+ *
+ * \param m The address of a modulus.
+ * \param p The address of the MPI used for \p m.
+ * \param pn The number of limbs of \p p.
+ * \param ext_rep The external representation of \p m (eg. byte order).
+ * \param int_rep The selector which representation is used.
+ *
+ * \return \c 0 if successful.
+ * \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \p m or \p p is
+ * #NULL pointer or if \p ext_rep or \p int_rep is invalid.
+ */
int mbedtls_mpi_mod_modulus_setup( mbedtls_mpi_mod_modulus *m,
mbedtls_mpi_uint *p,
size_t pn,
int ext_rep,
int int_rep );
+/** Unbind elements of a modulus structure.
+ *
+ * \param m The address of a modulus.
+ */
+void mbedtls_mpi_mod_modulus_free( mbedtls_mpi_mod_modulus *m );
+
#endif /* MBEDTLS_BIGNUM_MOD_H */