Apply naming convention for p224
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
diff --git a/library/ecp_curves.c b/library/ecp_curves.c
index 977f140..ee211af 100644
--- a/library/ecp_curves.c
+++ b/library/ecp_curves.c
@@ -4974,32 +4974,32 @@
#if defined(MBEDTLS_HAVE_INT32) /* 32 bit */
-#define MAX32 Nn
-#define A(j) Np[j]
-#define STORE32 Np[i] = cur;
-#define STORE0 Np[i] = 0;
+#define MAX32 X_limbs
+#define A(j) X[j]
+#define STORE32 X[i] = cur;
+#define STORE0 X[i] = 0;
#else /* 64 bit */
-#define MAX32 Nn * 2
+#define MAX32 X_limbs * 2
#define A(j) \
(j) % 2 ? \
- (uint32_t) (Np[(j) / 2] >> 32) : \
- (uint32_t) (Np[(j) / 2])
+ (uint32_t) (X[(j) / 2] >> 32) : \
+ (uint32_t) (X[(j) / 2])
#define STORE32 \
if (i % 2) { \
- Np[i/2] &= 0x00000000FFFFFFFF; \
- Np[i/2] |= (uint64_t) (cur) << 32; \
+ X[i/2] &= 0x00000000FFFFFFFF; \
+ X[i/2] |= (uint64_t) (cur) << 32; \
} else { \
- Np[i/2] &= 0xFFFFFFFF00000000; \
- Np[i/2] |= (uint32_t) cur; \
+ X[i/2] &= 0xFFFFFFFF00000000; \
+ X[i/2] |= (uint32_t) cur; \
}
#define STORE0 \
if (i % 2) { \
- Np[i/2] &= 0x00000000FFFFFFFF; \
+ X[i/2] &= 0x00000000FFFFFFFF; \
} else { \
- Np[i/2] &= 0xFFFFFFFF00000000; \
+ X[i/2] &= 0xFFFFFFFF00000000; \
}
#endif
@@ -5061,9 +5061,9 @@
}
MBEDTLS_STATIC_TESTABLE
-int mbedtls_ecp_mod_p224_raw(mbedtls_mpi_uint *Np, size_t Nn)
+int mbedtls_ecp_mod_p224_raw(mbedtls_mpi_uint *X, size_t X_limbs)
{
- if (Nn != 2 * 224 / biL) {
+ if (X_limbs != 2 * 224 / biL) {
return MBEDTLS_ERR_ECP_BAD_INPUT_DATA;
}
diff --git a/library/ecp_invasive.h b/library/ecp_invasive.h
index 8ea6ece..be9b399 100644
--- a/library/ecp_invasive.h
+++ b/library/ecp_invasive.h
@@ -98,21 +98,21 @@
/** Fast quasi-reduction modulo p224 (FIPS 186-3 D.2.2)
*
- * \param[in,out] Np The address of the MPI to be converted.
- * Must have exact limb size that stores a 448-bit MPI
- * (double the bitlength of the modulus).
- * Upon return holds the reduced value which is
- * in range `0 <= X < 2 * N` (where N is the modulus).
- * The bitlength of the reduced value is the same as
- * that of the modulus (224 bits).
- * \param[in] Nn The length of \p Nn in limbs.
+ * \param[in,out] X The address of the MPI to be converted.
+ * Must have exact limb size that stores a 448-bit MPI
+ * (double the bitlength of the modulus).
+ * Upon return holds the reduced value which is
+ * in range `0 <= X < 2 * N` (where N is the modulus).
+ * The bitlength of the reduced value is the same as
+ * that of the modulus (224 bits).
+ * \param[in] X_limbs The length of \p X in limbs.
*
* \return \c 0 on success.
- * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if \p Nn is not the limb
- * size that sores a 448-bit MPI.
+ * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if \p X_limbs is not the
+ * limb size that sores a 448-bit MPI.
*/
MBEDTLS_STATIC_TESTABLE
-int mbedtls_ecp_mod_p224_raw(mbedtls_mpi_uint *Np, size_t Nn);
+int mbedtls_ecp_mod_p224_raw(mbedtls_mpi_uint *X, size_t X_limbs);
#endif /* MBEDTLS_ECP_DP_SECP224R1_ENABLED */