# how to generate elliptic curve over Extension field GF(2^m) where m=113 using sagemath This post is a wiki. Anyone with karma >750 is welcome to improve it.

field is F(2^m) where m=113 E:y^2+xy=x^3+ax^2+b a=003088250CA6E7C7FE649CE85820F7 b=00E8BEE4D3E2260744188BE0E9C723

edit retag close merge delete

Tip: don't tick the "community wiki" checkbox when posting questions.

The "community wiki" tag is for questions that are not about Sage, but about Ask Sage itself.

Also, with the "community wiki" checkbox ticked, upvotes to your post don't earn you karma.

You need karma to be able to post links, to upvote questions and answers by others, etc.

To display inline code, use backticks. To display blocks of code or error messages, separate them by a blank line from the rest of the text, and indent them with 4 spaces, or select code lines and click the "code" button (the icon with '101 010').

For instance, typing

If we define f by

def f(x, y):
return (x, y)

then f(2, 3) returns (2, 3) but f(2) gives:

TypeError: f() takes exactly 2 arguments (1 given)


will produce:

If we define f by

def f(x, y):
return (x, y)


then f(2, 3) returns (2, 3) but f(2) gives:

TypeError: f() takes exactly 2 arguments (1 given)


Can you edit your question to do that?

Sort by » oldest newest most voted

As in 39628...

The modulus is also a big important part of the data, so i suppose the curve is the one displayed in:

http://www.secg.org/SEC2-Ver-1.0.pdf, page 24, label sect113r1 .

R.<T> = PolynomialRing( GF(2) )
F.<t> = GF( 2**113, modulus=X^113 + X^9 + 1 )

a = F.fetch_int( 0x003088250CA6E7C7FE649CE85820F7 )
b = F.fetch_int( 0x00E8BEE4D3E2260744188BE0E9C723 )

E = EllipticCurve( F, [ 1, a, 0, 0, b ] )


Comment:

We also have the order of the curve, from the reference, it is the value of the variable n below:

P = E.random_point()
n = 2*ZZ( 0x0100000000000000D9CCEC8A39E56F )
print n*P
print "Order: %s" % factor(n)


This gives (for "all random points"):

(0 : 1 : 0)
Order: 2 * 5192296858534827689835882578830703
sage: bool( (sqrt(q)-1)^2 < n )
True
sage: bool( n < (sqrt(q)+1)^2 )
True

more