Disclaimer: This documentation was written on September, 2021. It is intended to give readers a high-level understanding. The codebase is the canonical source of truth, and over time this document might fall behind the implementation details of the code.
Emulated Field
We want to evaluate a modular multiplication of $\mathbb{F}_p$ elements a, b, using constraints over $\mathbb{F}_n$ ($p,n$ are prime). In particular we allow for the case where $n < p$.
We will choose integer $t$ such that $2^t\cdot n> p^2$. And also leverage operations mod $2^t$ together with the CRT.
In more detail:
We will check that as positive integers
$$a\cdot b = q\cdot p +r $$
The way we do this at a high level is