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

NIIBE Yutaka gniibe at fsij.org
Fri Jul 17 02:31:36 CEST 2015

On 07/17/2015 04:40 AM, Peter Wu wrote:
> That is documented in a different place. Repeating the same does not
> hurt, especially when noting why it differs from other common RSA
> implementations (presumably due to the origin from OpenPGP).
>> 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.
> Given this mistake, why not add the comment to save some hours from
> other reviewers?
> In my case it was an unexpected user error where $u = q^{-1} mod p$ was
> used. Maybe the function that imports the RSA parameters should first
> check for u * p == 1 mod q as a sanity check?

For myself, I support your opinion toward better/meaningful comments.
Well, I have such a tendency to look into the code directly (instead
of documentation), too.

Currently, I'm not sure how we can improve the comment.  Every code
has its context.  It would be better to describe its important

Let us wait to ask Werner's opinion.

More information about the Gcrypt-devel mailing list