libtom/libtomcrypt — pull request #23 by sjaeckel (2014-05-09 16:23:09+00:00)
Title: dsa_make_key + dsa_sign_hash not checking '< q'

Originally reported by Dana Jacobsen https://rt.cpan.org/Public/Bug/Display.html?id=89308

In short:

FIPS 186-4: "4. DSA parameters" page 15:
> x = the private key that must remain secret;
> x is a randomly or pseudorandomly generated integer, such that 0 < x < q

However we are not testing '< q' part. Similar problem is with 'k' in dsa_sign_hash

Here is how I have fixed it:
https://github.com/DCIT/perl-CryptX/commit/4b5f4ef0f0dcde2714769de769cfd727a9a7caef
https://github.com/DCIT/perl-CryptX/commit/734fefd8ee201f836b3d7b7aba91ffe983b5bd8e
https://github.com/DCIT/perl-CryptX/commit/8fa072727eb6eef5963ee1aa47c174fa032f5ba4