From 9d72df8e6d7742741bc66f51e89d7ee65368ca33 Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Thu, 15 Aug 2024 16:06:19 +0100 Subject: [PATCH] Optimise public RSA operations Signed-off-by: Janos Follath --- library/rsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/rsa.c b/library/rsa.c index 7eb4a259ea..d0a2695f17 100644 --- a/library/rsa.c +++ b/library/rsa.c @@ -1259,7 +1259,7 @@ int mbedtls_rsa_public(mbedtls_rsa_context *ctx, } olen = ctx->len; - MBEDTLS_MPI_CHK(mbedtls_mpi_exp_mod(&T, &T, &ctx->E, &ctx->N, &ctx->RN)); + MBEDTLS_MPI_CHK(mbedtls_mpi_exp_mod_unsafe(&T, &T, &ctx->E, &ctx->N, &ctx->RN)); MBEDTLS_MPI_CHK(mbedtls_mpi_write_binary(&T, output, olen)); cleanup: