You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can see the connection between $f$ and a $2 \times 2$ matrix, so we can compute
$$
M^{-n}
\begin{bmatrix}
\text{target} \\
1
\end{bmatrix} =
\begin{bmatrix}
u \\
v
\end{bmatrix}
$$
And $r = uv^{-1} \pmod{p}$.
But the $n=2^{2^{1337}}$ is really big, even using a fast modular exponentiation algorithm $\log(n)=2^{1337}$ is still not feasible.
The trick is to notice that $M$ is in $GL_2(F_p)$, so the group order is $\text{od} = (p^2-1)(p^2-p)$ and we have $M^n = M^{n \mod{od}}$. Since $\text{od}$ isn't much larger than $p$, we can easily get the $r$ now.