[PATCH 6/6] rsa: clarify the RSA secret parameters

NIIBE Yutaka gniibe at fsij.org
Thu Jul 16 06:57:17 CEST 2015


Thank you for the patch.

On 07/10/2015 12:11 AM, Peter Wu wrote:
> * cipher/rsa.c: Clarify meaning of the 'u' parameter. Fix error in
>   comments.

For the first part, I think that it's correctly described in the
documentation: (gcrypt)RSA key parameters

Even it has an example as:

       Note that OpenSSL uses slighly different parameters: q < p and u =
    q^{-1} \bmod p.  To use these parameters you will need to swap the
    values and recompute u.  Here is example code to do this:

       if (gcry_mpi_cmp (p, q) > 0)
           gcry_mpi_swap (p, q);
           gcry_mpi_invm (u, p, q);

I'm not sure (and wondering) if we need more.

I know that it's a pitfall of libgcrypt (something common).  For your
reference, I know this one in Fedora:


That's was same mistake.

More information about the Gcrypt-devel mailing list