X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/fa17e5dc48bf2961e5a99c83ed3d8018b329d037..6a024d24d97cb5d42c0091571735475b849f59f4:/math/mpmont.h diff --git a/math/mpmont.h b/math/mpmont.h index b0c119af..cd1d3999 100644 --- a/math/mpmont.h +++ b/math/mpmont.h @@ -126,29 +126,29 @@ extern void mpmont_destroy(mpmont */*mm*/); /* --- @mpmont_reduce@ --- * * - * Arguments: @mpmont *mm@ = pointer to Montgomery reduction context + * Arguments: @const mpmont *mm@ = pointer to Montgomery reduction context * @mp *d@ = destination * @mp *a@ = source, assumed positive * * Returns: Result, %$a R^{-1} \bmod m$%. */ -extern mp *mpmont_reduce(mpmont */*mm*/, mp */*d*/, mp */*a*/); +extern mp *mpmont_reduce(const mpmont */*mm*/, mp */*d*/, mp */*a*/); /* --- @mpmont_mul@ --- * * - * Arguments: @mpmont *mm@ = pointer to Montgomery reduction context + * Arguments: @const mpmont *mm@ = pointer to Montgomery reduction context * @mp *d@ = destination * @mp *a, *b@ = sources, assumed positive * * Returns: Result, %$a b R^{-1} \bmod m$%. */ -extern mp *mpmont_mul(mpmont */*mm*/, mp */*d*/, mp */*a*/, mp */*b*/); +extern mp *mpmont_mul(const mpmont */*mm*/, mp */*d*/, mp */*a*/, mp */*b*/); /* --- @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 @@ -157,11 +157,12 @@ extern mp *mpmont_mul(mpmont */*mm*/, mp */*d*/, mp */*a*/, mp */*b*/); * further modular arithmetic is to be performed on the result. */ -extern mp *mpmont_expr(mpmont */*mm*/, mp */*d*/, mp */*a*/, mp */*e*/); +extern mp *mpmont_expr(const 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 @@ -169,11 +170,11 @@ extern mp *mpmont_expr(mpmont */*mm*/, mp */*d*/, mp */*a*/, mp */*e*/); * Returns: Result, %$a^e \bmod m$%. */ -extern mp *mpmont_exp(mpmont */*mm*/, mp */*d*/, mp */*a*/, mp */*e*/); +extern mp *mpmont_exp(const mpmont */*mm*/, mp */*d*/, mp */*a*/, mp */*e*/); /* --- @mpmont_mexpr@ --- * * - * Arguments: @mpmont *mm@ = pointer to Montgomery reduction context + * Arguments: @const mpmont *mm@ = pointer to Montgomery reduction context * @mp *d@ = fake destination * @const mp_expfactor *f@ = pointer to array of factors * @size_t n@ = number of factors supplied @@ -188,12 +189,12 @@ extern mp *mpmont_exp(mpmont */*mm*/, mp */*d*/, mp */*a*/, mp */*e*/); * except that the %$g_i$% and result are in Montgomery form. */ -extern mp *mpmont_mexpr(mpmont */*mm*/, mp */*d*/, +extern mp *mpmont_mexpr(const mpmont */*mm*/, mp */*d*/, const mp_expfactor */*f*/, size_t /*n*/); /* --- @mpmont_mexp@ --- * * - * Arguments: @mpmont *mm@ = pointer to Montgomery reduction context + * Arguments: @const mpmont *mm@ = pointer to Montgomery reduction context * @mp *d@ = fake destination * @const mp_expfactor *f@ = pointer to array of factors * @size_t n@ = number of factors supplied @@ -203,7 +204,7 @@ extern mp *mpmont_mexpr(mpmont */*mm*/, mp */*d*/, * Use: Convenient interface over @mpmont_mexpr@. */ -extern mp *mpmont_mexp(mpmont */*mm*/, mp */*d*/, +extern mp *mpmont_mexp(const mpmont */*mm*/, mp */*d*/, const mp_expfactor */*f*/, size_t /*n*/); /*----- That's all, folks -------------------------------------------------*/