Fix prime test for 2 and lower and add check command to mpicalc.
authorWerner Koch <wk@gnupg.org>
Wed, 8 Oct 2014 12:41:21 +0000 (14:41 +0200)
committerWerner Koch <wk@gnupg.org>
Wed, 8 Oct 2014 12:46:06 +0000 (14:46 +0200)
commit5c906e2cdb14e93fb4915fdc69c7353a5fa35709
tree6e251dabcdb3df2a7eb7ea25275ec8d7741cd5cd
parentde0ccd4dce7ec185a678d78878d4538dd609ca0f
Fix prime test for 2 and lower and add check command to mpicalc.

* cipher/primegen.c (check_prime): Return true for the small primes.
(_gcry_prime_check): Return correct values for 2 and lower numbers.

* src/mpicalc.c (do_primecheck): New.
(main): Add command 'P'.
(main): Allow for larger input data.
cipher/primegen.c
src/mpicalc.c