X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/0f00dc4c8eb47e67bc0f148c2dd109f73a451e0a..HEAD:/math/pgen.h diff --git a/math/pgen.h b/math/pgen.h index b103c30e..eef91414 100644 --- a/math/pgen.h +++ b/math/pgen.h @@ -270,6 +270,29 @@ extern mp *pgen(const char */*name*/, mp */*d*/, mp */*m*/, unsigned /*steps*/, pgen_proc */*step*/, void */*sctx*/, unsigned /*tests*/, pgen_proc */*test*/, void */*tctx*/); +/* --- @pgen_granfrob@ --- * + * + * Arguments: @mp *n@ = an integer to test + * @int a, b@ = coefficients; if @a@ is zero then choose + * automatically + * + * Returns: One of the @PGEN_...@ codes. + * + * Use: Performs a quadratic version of Grantham's Frobenius + * primality test, which is a simple extension of the standard + * Lucas test. + * + * If %$a^2 - 4 b$% is a perfect square then the test can't + * work; this function returns @PGEN_ABORT@ under these + * circumstances. + * + * If @a@ is zero on entry, then the function will choose + * suitable parameters deterministically -- i.e., it always + * chooses the same parameters for a given %$n$%. + */ + +extern int pgen_granfrob(mp */*n*/, int /*a*/, int /*b*/); + /* --- @pgen_primep@ --- * * * Arguments: @mp *p@ = a number to check