X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/a69a3efddbe1261f55e90d4ff477053ab80663a5..298182ad446aaced14dea7ed0e7c968946787288:/mp.h diff --git a/mp.h b/mp.h index f6fa14f..74b6473 100644 --- a/mp.h +++ b/mp.h @@ -866,6 +866,17 @@ extern mp *mp_sqr(mp */*d*/, mp */*a*/); extern void mp_div(mp **/*qq*/, mp **/*rr*/, mp */*a*/, mp */*b*/); +/* --- @mp_exp@ --- * + * + * Arguments: @mp *d@ = fake destination + * @mp *a@ = base + * @mp *e@ = exponent + * + * Returns: Result, %$a^e$%. + */ + +extern mp *mp_exp(mp */*d*/, mp */*a*/, mp */*e*/); + /* --- @mp_odd@ --- * * * Arguments: @mp *d@ = pointer to destination integer @@ -957,6 +968,9 @@ extern int mp_jacobi(mp */*a*/, mp */*n*/); * work if %$p$% is composite: you must factor the modulus, take * a square root mod each factor, and recombine the results * using the Chinese Remainder Theorem. + * + * We guarantee that the square root returned is the smallest + * one (i.e., the `positive' square root). */ extern mp *mp_modsqrt(mp */*d*/, mp */*a*/, mp */*p*/);