X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/0f00dc4c8eb47e67bc0f148c2dd109f73a451e0a..416b88692ad45dca8b3ae4800916dd8b3e9c2551:/math/mpmont-exp.c diff --git a/math/mpmont-exp.c b/math/mpmont-exp.c index 0ea554ea..ff15b2dc 100644 --- a/math/mpmont-exp.c +++ b/math/mpmont-exp.c @@ -35,7 +35,7 @@ /* --- @mpmont_expr@ --- * * - * Arguments: @mpmont *mm@ = pointer to Montgomery reduction context + * Arguments: @const mpmont *mm@ = pointer to Montgomery reduction context * @mp *d@ = fake destination * @mp *a@ = base * @mp *e@ = exponent @@ -43,7 +43,7 @@ * Returns: Result, %$(a R^{-1})^e R \bmod m$%. */ -mp *mpmont_expr(mpmont *mm, mp *d, mp *a, mp *e) +mp *mpmont_expr(const mpmont *mm, mp *d, mp *a, mp *e) { mp *x = MP_COPY(mm->r); mp *spare = (e->f & MP_BURN) ? MP_NEWSEC : MP_NEW; @@ -71,7 +71,7 @@ mp *mpmont_expr(mpmont *mm, mp *d, mp *a, mp *e) /* --- @mpmont_exp@ --- * * - * Arguments: @mpmont *mm@ = pointer to Montgomery reduction context + * Arguments: @const mpmont *mm@ = pointer to Montgomery reduction context * @mp *d@ = fake destination * @mp *a@ = base * @mp *e@ = exponent @@ -79,7 +79,7 @@ mp *mpmont_expr(mpmont *mm, mp *d, mp *a, mp *e) * Returns: Result, %$a^e \bmod m$%. */ -mp *mpmont_exp(mpmont *mm, mp *d, mp *a, mp *e) +mp *mpmont_exp(const mpmont *mm, mp *d, mp *a, mp *e) { e = MP_COPY(e); d = mpmont_mul(mm, d, a, mm->r2); @@ -93,6 +93,10 @@ mp *mpmont_exp(mpmont *mm, mp *d, mp *a, mp *e) #ifdef TEST_RIG +#ifdef ENABLE_ASM_DEBUG +# include "regdump.h" +#endif + static int texp(dstr *v) { mp *m = *(mp **)v[0].buf; @@ -136,6 +140,9 @@ static test_chunk tests[] = { int main(int argc, char *argv[]) { sub_init(); +#ifdef ENABLE_ASM_DEBUG + regdump_init(); +#endif test_run(argc, argv, tests, SRCDIR "/t/mpmont"); return (0); }