There is a heuristic primality test which combine the Fermat test and the Fibonacci test
(with an offer $620 for a counterexample):
$(1)\quad 2^{p−1} \equiv 1 \pmod p$
$(2)\quad f_{p+1} \equiv 0 \pmod p$, where $f_n$ is the $n$-th Fibonacci number.
If $(1)\;\&\;(2)$ are true for a number of the form $p \equiv \pm2 \pmod 5$ then $p$ is supposed to be prime. Due to Wikipedia the test is very efficient, but how to implement $(2)$ efficiently for very big numbers?
Also due to Wikipedia there is a method suitable for recursive calculation of $f_n$:
$(3)\quad f_{2n-1}=f_n^2+f_{n-1}^2$
$(4)\quad f_{2n}=f_n\cdot(f_n+2f_{n-1})$
This could be reformulated to calculate $f_n \pmod m$ but is very slow for big numbers.
My question:
Is there an efficient way to implement $(2)$?