From 359d049f1bbe23df0748687cba6ffa7c4bf5d9c2 Mon Sep 17 00:00:00 2001 From: Daniel Otte Date: Fri, 21 Aug 2020 12:34:29 +0200 Subject: [PATCH] adjusting size of sliding window array to correct size. Probably the `W[2 << MBEDTLS_MPI_WINDOW_SIZE]` notation is based on a transcription of 2**MBEDTLS_MPI_WINDOW_SIZE. Signed-off-by: Daniel Otte --- library/bignum.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/bignum.c b/library/bignum.c index dfe976d64..6d0a67cb8 100644 --- a/library/bignum.c +++ b/library/bignum.c @@ -2044,7 +2044,7 @@ int mbedtls_mpi_exp_mod( mbedtls_mpi *X, const mbedtls_mpi *A, size_t i, j, nblimbs; size_t bufsize, nbits; mbedtls_mpi_uint ei, mm, state; - mbedtls_mpi RR, T, W[ 2 << MBEDTLS_MPI_WINDOW_SIZE ], Apos; + mbedtls_mpi RR, T, W[ 1 << MBEDTLS_MPI_WINDOW_SIZE ], Apos; int neg; MPI_VALIDATE_RET( X != NULL );