# Revision history [back]

The question amount to substituting given $x$ in the elliptic curve equation, and solving the resulting quadratic equation for $y$. Here is a sample code:

def compute_y(E,x):
R = E.base_ring()
x = R(x)
a = E.a_invariants()
c = (a*x + a)/2
b = x^3 + a*x^2 + a*x + a + c^2
if not is_square(b):
return None
return sqrt(b)-c

E = EllipticCurve(GF(43),[2,8]);
print( compute_y(E,1) )


For a given curve and $x=1$, it computes $y=21$. It is easy to verify that $21^2 = 1^3 + 2\cdot 1 + 8$ in GF(43).

The question amount to substituting given $x$ in the elliptic curve equation, and solving the resulting quadratic equation for $y$. Here is a sample code:

def compute_y(E,x):
R = E.base_ring()
x = R(x)
a = E.a_invariants()
c = (a*x + a)/2
b = x^3 + a*x^2 + a*x + a + c^2
r = is_square(b,True)
if not is_square(b):
r:
return r-c
else:
return None
return sqrt(b)-c

E = EllipticCurve(GF(43),[2,8]);
print( compute_y(E,1) )


For a given curve and $x=1$, it computes $y=21$. It is easy to verify that $21^2 = 1^3 + 2\cdot 1 + 8$ in GF(43).

The question amount to substituting given $x$ in the elliptic curve equation, and solving the resulting quadratic equation for $y$. Here is a sample code:

def compute_y(E,x):
R = E.base_ring()
x = R(x)
a = E.a_invariants()
c = (a*x + a)/2
b = x^3 + a*x^2 + a*x + a + c^2
r = is_square(b,True)
if r:
return r-c
else:
return None

E = EllipticCurve(GF(43),[2,8]);
EllipticCurve(GF(43),[2,8])
print( compute_y(E,1) )


For a given curve and $x=1$, it computes $y=21$. It is easy to verify that $21^2 = 1^3 + 2\cdot 1 + 8$ in GF(43).

The question amount amounts to substituting given $x$ in the elliptic curve equation, and solving the resulting quadratic equation for $y$. Here is a sample code:

def compute_y(E,x):
R = E.base_ring()
x = R(x)
a = E.a_invariants()
c = (a*x + a)/2
b = x^3 + a*x^2 + a*x + a + c^2
r = is_square(b,True)
if r:
return r-c
else:
return None

E = EllipticCurve(GF(43),[2,8])
print( compute_y(E,1) )


For a given curve and $x=1$, it computes $y=21$. It is easy to verify that $21^2 = 1^3 + 2\cdot 1 + 8$ in GF(43).

The question amounts to substituting given $x$ in the elliptic curve equation, and solving the resulting quadratic equation for $y$. Here is a sample code:

def compute_y(E,x):
R = E.base_ring()
x = R(x)
a = E.a_invariants()
c = (a*x + a)/2
b = x^3 + a*x^2 + a*x + a + c^2
r = is_square(b,True)
if r:
return r-c
else:
return None

E = EllipticCurve(GF(43),[2,8])
print( compute_y(E,1) )


For a given curve and $x=1$, it computes $y=21$. It is easy to verify that $21^2 = 1^3 + 2\cdot 1 + 8$ in GF(43).

P.S. The code above does not work if 2 is not invertible in the in the base ring (e.g., if it's a filed of characteristic 2) since it involves division by 2. Although, when a=a=0, we can avoid division and simply set c=0.

The question amounts to substituting given $x$ in the elliptic curve equation, and solving the resulting quadratic equation for $y$. Here is a sample code:

def compute_y(E,x):
R = E.base_ring()
x = R(x)
a = E.a_invariants()
c = (a*x + a)/2
b = x^3 + a*x^2 + a*x + a + c^2
r = is_square(b,True)
if r:
return r-c
else:
return None

E = EllipticCurve(GF(43),[2,8])
print( compute_y(E,1) )


For a given curve and $x=1$, it computes $y=21$. It is easy to verify that $21^2 = 1^3 + 2\cdot 1 + 8$ in GF(43).

P.S. The code above does not work if 2 is not invertible in the in the base ring (e.g., if it's a filed of characteristic 2) since it involves division by 2. Although, when a=a=0, we can avoid division and simply set c=0.

The question amounts to substituting given $x$ in the elliptic curve equation, and solving the resulting quadratic equation for $y$. Here is a sample code:

def compute_y(E,x):
R = E.base_ring()
x = R(x)
a = E.a_invariants()
c = (a*x + a)/2
b = x^3 + a*x^2 + a*x + a + c^2
r = is_square(b,True)
if r:
return r-c
else:
return None

E = EllipticCurve(GF(43),[2,8])
print( compute_y(E,1) )


For a given curve and $x=1$, it computes $y=21$. It is easy to verify that $21^2 = 1^3 + 2\cdot 1 + 8$ in GF(43).

P.S. The code above does not work if 2 is not invertible in the base ring (e.g., if it's a filed field of characteristic 2) since it involves division by 2. Although, when a=a=0, we can avoid division and simply set c=0.

The question amounts to substituting given $x$ in the elliptic curve equation, and solving the resulting quadratic equation for $y$. Here is a sample code:

def compute_y(E,x):
R R.<y> = E.base_ring()
x = R(x)
PolynomialRing(E.base_ring())
a = E.a_invariants()
c L = (y^2 + (a*x + a)/2
b = x^3 a)*y - (x^3 + a*x^2 + a*x + a + c^2
r = is_square(b,True)
if r:
a)).roots()
return r-c
else:
return None
{l for l in L}

E = EllipticCurve(GF(43),[2,8])
print( compute_y(E,1) )


For a given curve and $x=1$, it computes $y=21$. that $y\in \{21,22\}$. It is easy to verify that $21^2 = 22^2 = 1^3 + 2\cdot 1 + 8$ and in GF(43).

P.S. The code above does not work if 2 is not invertible in the base ring (e.g., if it's a field of characteristic 2) since it involves division by 2. Although, when a=a=0, we can avoid division and simply set c=0.