1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

mbedtls_mpi_core_get_mont_R2_unsafe: Removed NULL input checking

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
This commit is contained in:
Minos Galanakis
2022-10-20 10:47:26 +01:00
parent e1913a8da8
commit ae4fb671b4
3 changed files with 1 additions and 12 deletions

View File

@ -516,8 +516,6 @@ int mbedtls_mpi_core_get_mont_R2_unsafe( mbedtls_mpi *X,
{
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
if ( X == NULL || N == NULL ) goto cleanup;
MBEDTLS_MPI_CHK( mbedtls_mpi_lset( X, 1 ) );
MBEDTLS_MPI_CHK( mbedtls_mpi_shift_l( X, N->n * 2 * biL ) );
MBEDTLS_MPI_CHK( mbedtls_mpi_mod_mpi( X, X, N ) );

View File

@ -426,8 +426,7 @@ void mbedtls_mpi_core_montmul( mbedtls_mpi_uint *X,
* to store the value of Montgomery constant squared.
* \return #MBEDTLS_ERR_MPI_DIVISION_BY_ZERO if \p N modulus is zero.
* \return #MBEDTLS_ERR_MPI_NEGATIVE_VALUE if \p N modulus is negative.
* \return #MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED \p N, \p X are NULL
* or other operations fail.
* \return #MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED if other operations fail.
*/
int mbedtls_mpi_core_get_mont_R2_unsafe( mbedtls_mpi *X,
mbedtls_mpi const *N );