Ask Your Question
1

What does the 'a' and x^254 in code means?

asked 2019-04-29 14:24:34 +0100

athulan gravatar image

updated 2019-04-29 19:11:21 +0100

vdelecroix gravatar image
sage: R.<x>=GF(2^8,'a')[]
sage: from sage.crypto.boolean_function import BooleanFunction
sage: B = BooleanFunction( x^254 ) # the Boolean function Tr(x^254)
sage: B
edit retag flag offensive close merge delete

Comments

Note: this is an excerpt of the

slelievre gravatar imageslelievre ( 2019-04-30 16:03:26 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-04-30 15:59:55 +0100

slelievre gravatar image

updated 2019-05-08 14:06:57 +0100

When defining a finite field of non-prime order, it is useful to give a name to the generator.

Likewise, when defining a polynomial ring, it is useful to give a name to the polynomial variable.

In the example, GF(2^8, 'a') returns the finite field with $2^8$ elements, with a as the display name of its generator.

And R.<x> = K[] simultaneously defines R as a polynomial ring over the field K, with a polynomial variable that displays as 'x', and defines x as its generator, i.e., the polynomial variable.

So x^254 is the monic monomial of degree 254 in this polynomial ring.

For more, read the documentation or/and the source code for GF:

sage: GF?
sage: GF??

and for PolynomialRing:

sage: PolynomialRing?
sage: PolynomialRing??

Note that R.<x> = K[] is transformed by the Sage preparser into:

sage: preparse("R.<x> = K[]")
"R = K['x']; (x,) = R._first_ngens(1)"
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-04-29 14:24:34 +0100

Seen: 358 times

Last updated: May 08 '19