addm/subm/mulm: fix case when destination is same MPI as divider
* mpi/mpi-add.c (_gcry_mpi_addm, _gcry_mpi_subm): Take copy of M when W and M are the same MPI. * mpi/mpi-mul.c (_gcry_mpi_mulm): Likewise. * tests/mpitests.c (test_addm_subm_mulm): New. (main): Run addm/subm/mulm test.
- Reported-by: Guido Vranken <guidovranken@gmail.com>
- Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>