[Gnuk-users] Fix for Bignum

NIIBE Yutaka gniibe at fsij.org
Tue Feb 9 06:26:02 UTC 2016


Hello,

I changed polarssl/library/bignum.c.  There are two changes.

(1) Fix adding the line:

        MPI_CHK( mpi_grow( &RR, N->n ) );

    which make sure RR has N->n limbs.

    This fixes our local change of bignum.c.

(2) Fix of mpi_div_mpi, by introducing int_div_int from upstream.


Those changes is to master.  1.0 branch doesn't need this change of
(1), because it is master we introduced the change.

The change (2) is not required for Gnuk, because our use of
mpi_div_mpi is only for RSA (and in its computation, MSB is always 1).

For the correctness of the routine itself, I applied (2) to master.

The failure rate of the bug which was fixed by (1) is rare (all 32-bit
of the limb becomes zero), but still it's wrong.
-- 



More information about the gnuk-users mailing list