Bignum: remove unnecessary NULL pointer checks
A null pointer dereference, or null pointer plus small offset, is a
clean runtime error in most environments. So it's not particularly
useful to protect against this.
While at it make a null pointer check that is actually necessary more
robust.
Signed-off-by: Janos Follath <janos.follath@arm.com>
diff --git a/library/bignum_mod.h b/library/bignum_mod.h
index 7950f09..ee9982a 100644
--- a/library/bignum_mod.h
+++ b/library/bignum_mod.h
@@ -78,9 +78,8 @@
* \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, \p pn is less than the limbs in \p m or if \p p is not
- * less than \p m.
+ * \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \p pn is less than the limbs
+ * in \p m or if \p p is not less than \p m.
*/
int mbedtls_mpi_mod_residue_setup( mbedtls_mpi_mod_residue *r,
mbedtls_mpi_mod_modulus *m,
@@ -119,8 +118,8 @@
* associated with \p m (see #mbedtls_mpi_mod_rep_selector).
*
* \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.
+ * \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA 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,