# Koblitz curve

how to write sage code to find point on koblitz curve. how to write equation on koblitz curve.

edit retag close merge delete

Sort by » oldest newest most voted

Some examples may be enough to answer the two dot-ending questions.

There are two elliptic {\scshape Koblitz} curves over $\mathbb F_2$, the equations are $y^2 + xy = x^3 +ax^2+1$, $a$ is either zero or one. In sage, one can simply declare them and investigate points defined over bigger fields as follows:

F = GF(2)    # general field with two elements, 0, 1
a = 0        # or we set a = 1 here, the following lines can be copied...
E = EllipticCurve( F, [ 1, a, 0, 0, 1 ] )

K.<u> = GF( 2^3 )
EK = EllipticCurve( K, [ 1, a, 0, 0, 1 ] )
# instead we may use EK = E.base_extend( K )

print "K  :: %s" % K
print "EK :: %s" % EK
print "EK( K ) has %s elements" % EK.order()
print "The K-rational points of E are:"
for P in EK.points():
print P


This gives:

K  :: Finite Field in u of size 2^3
EK :: Elliptic Curve defined by y^2 + x*y = x^3 + 1 over Finite Field in u of size 2^3
EK( K ) has 4 elements
The K-rational points of E are:
(0 : 1 : 0)
(0 : 1 : 1)
(1 : 0 : 1)
(1 : 1 : 1)


We may also work with bigger fields, for instance:

L.<v> = GF(2^37)
EL = E.base_extend( L )
print "ORDER %s for %s" % ( EL.order().factor(), EL )
P = EL.gens()    # pythonically first and only generator
# print "Generator:\n%s" % P


And we get:

ORDER 2^2 * 149 * 230603167 for Elliptic Curve defined by y^2 + x*y = x^3 + 1 over Finite Field in v of size 2^37


(The point P may also be printed by decommenting.)

The very first lines for the next genus would be in an example, dialog with the interpreter:

sage: K.<a> = GF(2^3)
sage: K
Finite Field in a of size 2^3
sage: R.<x> = PolynomialRing( K )
sage: C = HyperellipticCurve( x^5+1, x )
sage: C
Hyperelliptic Curve over Finite Field in a of size 2^3 defined by y^2 + x*y = x^5 + 1
sage: C.points()
[(0 : 1 : 0),
(0 : 1 : 1),
(a : a^2 + 1 : 1),
(a : a^2 + a + 1 : 1),
(a^2 : a^2 + a + 1 : 1),
(a^2 : a + 1 : 1),
(a + 1 : a^2 + 1 : 1),
(a + 1 : a^2 + a : 1),
(a^2 + a : a + 1 : 1),
(a^2 + a : a^2 + 1 : 1),
(a^2 + a + 1 : a + 1 : 1),
(a^2 + a + 1 : a^2 : 1),
(a^2 + 1 : a^2 + a + 1 : 1),
(a^2 + 1 : a : 1),
(1 : 1 : 1),
(1 : 0 : 1)]

more