ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 28 Feb 2017 12:57:38 +0100Koblitz curvehttps://ask.sagemath.org/question/36628/koblitz-curve/ how to write sage code to find point on koblitz curve.
how to write equation on koblitz curve.Wed, 15 Feb 2017 17:30:19 +0100https://ask.sagemath.org/question/36628/koblitz-curve/Answer by dan_fulea for <p>how to write sage code to find point on koblitz curve.
how to write equation on koblitz curve.</p>
https://ask.sagemath.org/question/36628/koblitz-curve/?answer=36760#post-id-36760Some 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()[0] # 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)]
Tue, 28 Feb 2017 12:57:38 +0100https://ask.sagemath.org/question/36628/koblitz-curve/?answer=36760#post-id-36760