mpi: Same computation for square and multiply for mpi_pow.
authorNIIBE Yutaka <gniibe@fsij.org>
Fri, 7 Jul 2017 05:38:19 +0000 (14:38 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Fri, 7 Jul 2017 05:38:19 +0000 (14:38 +0900)
commit12029f83fd0ab3e8ad524f6c9135854662fddfd1
tree42581256e9e2088d4cab21d2da2bb07122ade93b
parentb38f4489f75e6e435886aa885807738a22c7ff60
mpi: Same computation for square and multiply for mpi_pow.

* mpi/mpi-pow.c (_gcry_mpi_powm): Compare msize for max_u_size.  Move
the assignment to base_u into the loop.  Copy content refered by RP to
BASE_U except the last of the loop.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(backport commit of libgcrypt master:
78130828e9a140a9de4dafadbc844dbb64cb709a)
mpi/mpi-pow.c