mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-23 03:05:43 +01:00
Explicitly cast down from mbedtls_mpi_uint to unsigned char
Let code analyzers know that this is deliberate. For example MSVC warns about the conversion if it's implicit. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
d55bfe962a
commit
026f555df3
@ -2051,7 +2051,7 @@ static void mpi_montmul( mbedtls_mpi *A, const mbedtls_mpi *B, const mbedtls_mpi
|
|||||||
/* Now d - (2^biL)^n = A - N so d >= (2^biL)^n iff A >= N.
|
/* Now d - (2^biL)^n = A - N so d >= (2^biL)^n iff A >= N.
|
||||||
* So we want to copy the result of the subtraction iff d->p[n] != 0.
|
* So we want to copy the result of the subtraction iff d->p[n] != 0.
|
||||||
* Note that d->p[n] is either 0 or 1 since A - N <= N <= (2^biL)^n. */
|
* Note that d->p[n] is either 0 or 1 since A - N <= N <= (2^biL)^n. */
|
||||||
mpi_safe_cond_assign( n + 1, A->p, d, d[n] );
|
mpi_safe_cond_assign( n + 1, A->p, d, (unsigned char) d[n] );
|
||||||
A->p[n] = 0;
|
A->p[n] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user