gh-35546: compute traces of elliptic-curve endomorphisms
In this patch, we add a generic method to compute the trace of an
elliptic-curve endomorphism.
The computation uses a variant of Schoof's algorithm, which relies
(only) on evaluating the endomorphism on small-order points, hence the
method is totally independent of the internal representation of the
`EllipticCurveHom`.
Adding this method is yet another step towards implementing endomorphism
rings, especially for supporting the quaternionic (supersingular) case.
I'm sure some speedups are possible, but they can come later.
URL: https://github.com/sagemath/sage/pull/35546
Reported by: Lorenz Panny
Reviewer(s): John Cremona