Closed xanthe-cat closed 5 months ago
I’ve added in the Fermat documentation (and some small tweaks to the config script) from issue #1 as this is now ready to be added to the repository, whatever final disposition we reach on the status of whatever modification is desirable to mi64.c
.
I made a simplification to the config-fermat.sh
script in 4341a7e3a51b81d0e9ee493047647214972fa7f9, so avoid duplicating the Mlucas command.
For future reference, when you are just updating the documentation or code comments and do not need to run the CI to test the changes, you can add [skip ci]
(or one of these other strings) to your commit message to skip it.
The change looks good to me.
Just note that you would need to check the "Approve" radio button when writing the review to allow @xanthe-cat to merge this. Each PR needs at least one approving review.
Just note that you would need to check the "Approve" radio button when writing the review to allow @xanthe-cat to merge this. Each PR needs at least one approving review.
I would if I could see it :-) Sorry, I'm a newbie.
EDIT: finally found it, sorry again...
This is in a section of the code I am not familiar with. So I will trust Cathy's changes!
Small fix, for PRP bases other than 3, to ensure the modular division by the square of the base at the end of a PRP test is not subject to a rounding error (bases 7, 14, 27, 28, and 29 are susceptible among the possible PRP bases less than 32). The rounding error for these bases appears in the
mi64_div_by_scalar64
function ofmi64.c
. We also modify theMlucas.c
code to permit PRP bases other than 3 by disabling theASSERT
at line 698 (which would apply to both Mersenne and Fermat exponents) and instituting a similar check later, but only for Fermat numbers (since Mlucas always uses base 3 for the Pépin test). This fixes #18, fixes #27, as well as committing the Fermat testing documentation to the repository which fixes #1.