Home GnuPG

mpi: Constant time mpi_inv with some conditions.

Description

mpi: Constant time mpi_inv with some conditions.

* mpi/mpi-inv.c (mpih_add_n_cond, mpih_sub_n_cond, mpih_swap_cond)
(mpih_abs_cond): New.
(mpi_invm_odd): New.
(mpi_invm_generic): Rename from _gcry_mpi_invm.
(_gcry_mpi_invm): Use mpi_invm_odd for usual odd cases.

Cherry-pick master commit of:
20082ca965eab5665af60956c4ed72709836b1ed

  • GnuPG-bug-id: T4869
  • Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

Details

Provenance
gniibeAuthored on Mar 18 2020, 1:03 AM
Parents
rCffbc5702ab16: mpi: Abort on division by zero also in _gcry_mpi_tdiv_qr.
Branches
Unknown
Tags
Unknown
Tasks
T4869: constant-time mpi_invm