Currently the div method of the Felt class implements an integer division of bigint, when it should perform a proper felt division.
Implement felt division (modular multiplicative inverse). Many methods exist +/- easy to comprehend/performant. To keep things simple, either use the Extended Euclidean Algorithm or Binary Exponentation with Euler's totient function and Fermat's little theorem.
I'd lean towards Euler's totient function as the modulus $p$ is prime, it is pretty straightforward: $\forall a \in \mathbb{F}_p \text{, } a^{-1} \equiv a^{p-2} \bmod p$
Add test cases
Refactor logic of methods using the current division
Currently the
div
method of the Felt class implements an integer division of bigint, when it should perform a proper felt division.I'd lean towards Euler's totient function as the modulus $p$ is prime, it is pretty straightforward: $\forall a \in \mathbb{F}_p \text{, } a^{-1} \equiv a^{p-2} \bmod p$