1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-11-12 21:58:50 +01:00

mpi: Minor fix for mpi_pow.

* mpi/mpi-pow.c (mpi_powm): Fix allocation size.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2017-07-07 15:12:00 +09:00
parent 12029f83fd
commit 554ded4854

View File

@ -162,7 +162,7 @@ mpi_powm( MPI res, MPI base, MPI exponent, MPI mod)
{
mpi_size_t i;
mpi_ptr_t xp = xp_marker = mpi_alloc_limb_space( 2 * (msize + 1), msec );
mpi_ptr_t xp = xp_marker = mpi_alloc_limb_space( size, msec );
int c;
mpi_limb_t e;
mpi_limb_t carry_limb;
@ -499,7 +499,7 @@ mpi_powm (MPI res, MPI base, MPI expo, MPI mod)
struct karatsuba_ctx karactx;
mpi_ptr_t tp;
xp = xp_marker = mpi_alloc_limb_space( 2 * (msize + 1), msec );
xp = xp_marker = mpi_alloc_limb_space( size, msec );
memset( &karactx, 0, sizeof karactx );
negative_result = (ep[0] & 1) && bsign;