Home GnuPG
Diffusion GnuPG 9dc6dd057210

Fix bug in mpi_tdiv_q_2exp.
9dc6dd057210Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Fix bug in mpi_tdiv_q_2exp.

* mpi/mpi-internal.h (MPN_COPY_INCR): Make it work.

This bug has been with us since the version 0.0.0 of GnuPG.
Fortunately it only affects an optimized code path which is rarely
used in practice: If the shift size matches the size of a
limb (i.e.. 32 or 64); this is is_prime in primegen.c. Over there the
Rabin-Miller test may fail with a probability of 2^-31 (that is if the
to be tested prime - 1 has the low 32 bits cleared). In practice the
probability is even much less because we first do a Fermat test on the
randomly generated candidates which sorts out the majority of
composite numbers.

The bug in MPN_COPY_INCR was found by Sven Bjorn.

(back ported from Libgcrypt
commit 7f7a5ef59962ae1a819b5060f9b781469bfe27d5)

  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Sep 16 2013, 3:57 PM
Parents
rG45efde955766: mpicalc: Change copyright notice.
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rG9dc6dd057210: Fix bug in mpi_tdiv_q_2exp. (authored by Werner Koch <wk@gnupg.org>).Sep 16 2013, 3:57 PM