[PATCH 6/6] rsa: clarify the RSA secret parameters
NIIBE Yutaka
gniibe at fsij.org
Thu Jul 16 06:57:17 CEST 2015
Hello,
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:
http://pkgs.fedoraproject.org/cgit/libgcrypt.git/diff/?id=376991d05a1a0e2911242061c41ca5c5a915e339&id2=f56a95f03b711eac70ddc8673b6417a93a45c2bd
That's was same mistake.
--
More information about the Gcrypt-devel
mailing list