Trace of an elliptic-curve endomorphism (source code)

= Trace of an elliptic-curve endomorphism
{title2=$\operatorname{tr}(\phi)$}

For $\phi\in\operatorname{End}(E)$, its trace is the integer characterized by
$$
\phi+\widehat\phi=[\operatorname{tr}(\phi)].
$$
Equivalently, $\operatorname{tr}(\phi)=1+\deg\phi-\deg(1-\phi)$.