mirror of
https://github.com/cuberite/polarssl.git
synced 2025-09-29 00:18:06 -04:00
Fix the type cast(size_t to unsigned short) warning
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
This commit is contained in:
parent
b903f4ecb6
commit
796500e751
@ -5352,9 +5352,9 @@ static inline int ecp_mod_koblitz(mbedtls_mpi *N, mbedtls_mpi_uint *Rp, size_t p
|
|||||||
M.p = Mp;
|
M.p = Mp;
|
||||||
|
|
||||||
/* M = A1 */
|
/* M = A1 */
|
||||||
M.n = N->n - (p_limbs - adjust);
|
M.n = (unsigned short) (N->n - (p_limbs - adjust));
|
||||||
if (M.n > p_limbs + adjust) {
|
if (M.n > p_limbs + adjust) {
|
||||||
M.n = p_limbs + adjust;
|
M.n = (unsigned short) (p_limbs + adjust);
|
||||||
}
|
}
|
||||||
memset(Mp, 0, sizeof(Mp));
|
memset(Mp, 0, sizeof(Mp));
|
||||||
memcpy(Mp, N->p + p_limbs - adjust, M.n * sizeof(mbedtls_mpi_uint));
|
memcpy(Mp, N->p + p_limbs - adjust, M.n * sizeof(mbedtls_mpi_uint));
|
||||||
@ -5378,9 +5378,9 @@ static inline int ecp_mod_koblitz(mbedtls_mpi *N, mbedtls_mpi_uint *Rp, size_t p
|
|||||||
/* Second pass */
|
/* Second pass */
|
||||||
|
|
||||||
/* M = A1 */
|
/* M = A1 */
|
||||||
M.n = N->n - (p_limbs - adjust);
|
M.n = (unsigned short) (N->n - (p_limbs - adjust));
|
||||||
if (M.n > p_limbs + adjust) {
|
if (M.n > p_limbs + adjust) {
|
||||||
M.n = p_limbs + adjust;
|
M.n = (unsigned short) (p_limbs + adjust);
|
||||||
}
|
}
|
||||||
memset(Mp, 0, sizeof(Mp));
|
memset(Mp, 0, sizeof(Mp));
|
||||||
memcpy(Mp, N->p + p_limbs - adjust, M.n * sizeof(mbedtls_mpi_uint));
|
memcpy(Mp, N->p + p_limbs - adjust, M.n * sizeof(mbedtls_mpi_uint));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user