mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-06-25 22:56:35 +08:00
Bignum Mod: improve documentation and style
Signed-off-by: Janos Follath <janos.follath@arm.com>
This commit is contained in:
parent
0020df9cf9
commit
6eb92c0410
@ -211,7 +211,6 @@ int mbedtls_mpi_mod_read( mbedtls_mpi_mod_residue *r,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = mbedtls_mpi_mod_raw_read( r->p, m, buf, buflen, ext_rep );
|
ret = mbedtls_mpi_mod_raw_read( r->p, m, buf, buflen, ext_rep );
|
||||||
|
|
||||||
if( ret != 0 )
|
if( ret != 0 )
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
@ -82,9 +82,7 @@ typedef struct {
|
|||||||
* and interpreted according to the value of the `m->int_rep` field.
|
* and interpreted according to the value of the `m->int_rep` field.
|
||||||
*
|
*
|
||||||
* The modulus \p m will be the modulus associated with \p r. The residue \p r
|
* The modulus \p m will be the modulus associated with \p r. The residue \p r
|
||||||
* should only be used in operations where the modulus is \p m or a modulus
|
* should only be used in operations where the modulus is \p m.
|
||||||
* equivalent to \p m (in the sense that all their fields or memory pointed to by
|
|
||||||
* their fields hold the same value).
|
|
||||||
*
|
*
|
||||||
* \param[out] r The address of the residue to setup.
|
* \param[out] r The address of the residue to setup.
|
||||||
* \param[in] m The address of the modulus related to \p r.
|
* \param[in] m The address of the modulus related to \p r.
|
||||||
@ -96,7 +94,7 @@ typedef struct {
|
|||||||
* pointed to by `m->p`) and already in the representation
|
* pointed to by `m->p`) and already in the representation
|
||||||
* indicated by `m->int_rep`.
|
* indicated by `m->int_rep`.
|
||||||
* \param p_limbs The number of limbs of \p p. Must be the same as the number
|
* \param p_limbs The number of limbs of \p p. Must be the same as the number
|
||||||
* of limbs in the modulus \p m.)
|
* of limbs in the modulus \p m.
|
||||||
*
|
*
|
||||||
* \return \c 0 if successful.
|
* \return \c 0 if successful.
|
||||||
* \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \p p_limbs is less than the
|
* \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \p p_limbs is less than the
|
||||||
@ -219,7 +217,7 @@ int mbedtls_mpi_mod_read( mbedtls_mpi_mod_residue *r,
|
|||||||
* based on the value of `m->int_rep` field.
|
* based on the value of `m->int_rep` field.
|
||||||
*
|
*
|
||||||
* \warning If the buffer is smaller than `m->bits`, the number of
|
* \warning If the buffer is smaller than `m->bits`, the number of
|
||||||
* leading zeroes is leaked through side channels. If \p r is
|
* leading zeroes is leaked through timing. If \p r is
|
||||||
* secret, the caller must ensure that \p buflen is at least
|
* secret, the caller must ensure that \p buflen is at least
|
||||||
* (`m->bits`+7)/8.
|
* (`m->bits`+7)/8.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user