In this tweet, Paulo Barreto proposes the following elliptic curve over $\mathbb{F}_{2^{255}-19}$:
$$ E_\mathrm{PB} : y^2 = x^3 - 3x + 13318 $$
with $G_\mathrm{PB} = (-7, 114)$. Now I would like to try to verify the curve by trying to generate it over some sensible domain. For this I am using this algorithm from this website.
I also require that $n$ (the order of $E_\mathrm{PB}$) is prime, and that the cofactor $h$ is 1. After programming for some time I have come up with the following algorithm for generating elliptic curves:
#!/usr/bin/env sage
F = GF(2^255 - 19)
for i in range(15000):
if i % 100 == 0:
print('Progress: {}'.format(i))
try:
E = EllipticCurve(F, [-3, i])
except ArithmeticError:
# Curve probably has a singularity
continue
n = E.order()
# Only accept curves of prime order
if not is_prime(n): continue
# Start selecting random points for the rest of the search
for x in range(-256, 256):
for y in range(256):
try:
G = E(x, y)
except TypeError: # (x, y) is not a valid point
continue
t = G.order()
# Cofactor MUST be 1
if n == t:
bits = int(log(float(E.order()))/log(2.0))
print('Found prime order for a_6 = {} ({} bits)'.format(i, bits))
print('Generator G = {}'.format(G))
After a short time it gives me the following curve:
$$ E_{DS} : y^2 = x^3 - 3x + 101 $$
with $G_\mathrm{DS} = (-4, 7)$, which is not Paulo's curve. I expect that Paulo did not make a mistake, so my question is:
What is wrong with my generated elliptic curve $E_\mathrm{DS}$?