In Montgomery representation, an element is
represented by
, where
is a
power of 2 corresponding to the number of machine-words that can
contain
.
Encoding and decoding between classical and Montgomery representation is implemented by the following functions:
void mpfq_TAG_mgy_enc(mpfq_TAG_dst_field, mpfq_TAG_dst_elt, mpfq_TAG_src_elt); void mpfq_TAG_mgy_dec(mpfq_TAG_dst_field, mpfq_TAG_dst_elt, mpfq_TAG_src_elt);