The following code is given (source).
from fielddef import FQFac
q = 115792089210356248762697446949407573529996955224135760342422259061068512044369
GF = FQFac(q)
G = (GF(68001253697693959505385166418825921216879992913338607518506263877231417389309), GF(32956869957026046537418079256725634934468928549809562050419661008417397548252))
P = (GF(78682525735928631168497251673563130650852315793053792730195256219768651938341), GF(84795375029059674300362179151585264542663827440804066060768991521034056440120))
d = 1 #??? This is TARGET. P = dG
SuperP = (GF(78682525735928631168497251673563130650852315793053792730195256219768651938341), GF(40426504872605514126813907278243558543227238540609187742567326172940715852589))
# Super Elliptic Curve 1 + 3 x + 4 x^2 + 4 x^3 + 3 x^4 + x^5
The goal of this problem is to find
First, we see that it seems that nothing can proceed without knowing the parameters of the elliptic curve. From the parameters of the superelliptic curve, it can be guessed that the parameters of the elliptic curve might be small. Brute-forcing gives
This curve can be transformed into
and is singular with the cusp
It is well known that a discrete logarithm problem of a singular elliptic curve with a cusp can be reduced to a discrete logarithm problem on the additive group
The following is a brief description of why it is reducible.
Let
Theorem: Let
is a group isomorphism between
■
For this problem, it is sufficient to show that it is isomorphic in the case
Proof: Let
This means that every point over
We first prove
The formula for the addition of elliptic curves yields
In these two equations, replacing
(This transformation is straightforward but a bit annoying.)
These two equations yield
We can also prove
by the same simple transformation as above. It is omitted here.
Therefore, the map of the theorem is isomorphic for
By using the map, we can move the points
q = 115792089210356248762697446949407573529996955224135760342422259061068512044369
F = GF(q)
G = (F(68001253697693959505385166418825921216879992913338607518506263877231417389309), F(32956869957026046537418079256725634934468928549809562050419661008417397548252))
P = (F(78682525735928631168497251673563130650852315793053792730195256219768651938341), F(84795375029059674300362179151585264542663827440804066060768991521034056440120))
G_prime = (G[0] + 1, G[1])
P_prime = (P[0] + 1, P[1])
g = G_prime[0] / G_prime[1]
h = P_prime[0] / P_prime[1]
n = h * g**-1
print(hex(n)[2:].zfill(64))
Private Key: 0000000000000057c469555f618b593aa933215974569cf5189d643c0e9b834f