Esempio n. 1
0
class EC(object):
    def __init__(self, A, C=None):
        """
        Cy² = Cx³ + Ax + Cx
        """

        # Internally, we represent it as a Sage elliptic curve.
        a = A / C if C is not None else A
        self.ec = EllipticCurve([0, a._sage(), 0, 1, 0])

    def j(self):
        j = self.ec.j_invariant()
        return GF(j.parent().characteristic(), *j.polynomial().list())

    def point(self, x):
        return Point(self, x)

    def four_isogeny(self, gen):
        pass

    def three_isogeny(self, gen):
        pass

    def secret_isogeny(self, gen):
        pass

    def __repr__(self):
        return repr(self.ec)

    def _sage(self):
        return self.ec
Esempio n. 2
0
def test_semi_stable_frobenius_polynomial_t():
    # an example where the frobenius polynomial depends on the purely ramified extension
    # we make
    x = polygen(QQ)
    K = QQ.extension(x - 1, "one")
    E = EllipticCurve(K, [49, 343])
    assert E.discriminant() == -(2**4) * 31 * 7**6
    assert E.j_invariant() == K(2**8 * 3**3) / 31
    f1 = semi_stable_frobenius_polynomial(E, K * 7, 1)
    f2 = semi_stable_frobenius_polynomial(E, K * 7, -1)(x=-x)
    assert f1 == f2