bignum_mod: Renamed `m` -> N in mbedtls_mpi_mod_modulus_free
Signed-off-by: Mihir Raj Singh <mihirrajsingh123@gmail.com>
diff --git a/library/bignum_mod.c b/library/bignum_mod.c
index c826ce7..1e9303d 100644
--- a/library/bignum_mod.c
+++ b/library/bignum_mod.c
@@ -71,33 +71,35 @@
N->int_rep = MBEDTLS_MPI_MOD_REP_INVALID;
}
-void mbedtls_mpi_mod_modulus_free(mbedtls_mpi_mod_modulus *m)
+void mbedtls_mpi_mod_modulus_free( mbedtls_mpi_mod_modulus *N )
{
- if (m == NULL) {
+ if (N == NULL) {
return;
}
- switch (m->int_rep) {
+ switch( N->int_rep )
+ {
case MBEDTLS_MPI_MOD_REP_MONTGOMERY:
- if (m->rep.mont.rr != NULL) {
- mbedtls_platform_zeroize((mbedtls_mpi_uint *) m->rep.mont.rr,
- m->limbs * sizeof(mbedtls_mpi_uint));
- mbedtls_free((mbedtls_mpi_uint *) m->rep.mont.rr);
- m->rep.mont.rr = NULL;
+ if (N->rep.mont.rr != NULL)
+ {
+ mbedtls_platform_zeroize( (mbedtls_mpi_uint *) N->rep.mont.rr,
+ N->limbs * sizeof(mbedtls_mpi_uint) );
+ mbedtls_free( (mbedtls_mpi_uint *)N->rep.mont.rr );
+ N->rep.mont.rr = NULL;
}
- m->rep.mont.mm = 0;
+ N->rep.mont.mm = 0;
break;
case MBEDTLS_MPI_MOD_REP_OPT_RED:
- mbedtls_free(m->rep.ored);
+ mbedtls_free( N->rep.ored );
break;
case MBEDTLS_MPI_MOD_REP_INVALID:
break;
}
- m->p = NULL;
- m->limbs = 0;
- m->bits = 0;
- m->int_rep = MBEDTLS_MPI_MOD_REP_INVALID;
+ N->p = NULL;
+ N->limbs = 0;
+ N->bits = 0;
+ N->int_rep = MBEDTLS_MPI_MOD_REP_INVALID;
}
static int set_mont_const_square(const mbedtls_mpi_uint **X,
diff --git a/library/bignum_mod.h b/library/bignum_mod.h
index d295522..ad8a1dd 100644
--- a/library/bignum_mod.h
+++ b/library/bignum_mod.h
@@ -216,9 +216,9 @@
* mbedtls_mpi_mod_modulus_setup() only removes the reference to it,
* making it safe to free or to use it again.
*
- * \param[in,out] m The address of the modulus structure to free.
+ * \param[in,out] N The address of the modulus structure to free.
*/
-void mbedtls_mpi_mod_modulus_free(mbedtls_mpi_mod_modulus *m);
+void mbedtls_mpi_mod_modulus_free( mbedtls_mpi_mod_modulus *N );
/* BEGIN MERGE SLOT 1 */