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, 30 Apr 2019 16:03:26 +0200What does the 'a' and x^254 in code means?https://ask.sagemath.org/question/46401/what-does-the-a-and-x254-in-code-means/
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: BMon, 29 Apr 2019 14:24:34 +0200https://ask.sagemath.org/question/46401/what-does-the-a-and-x254-in-code-means/Comment by slelievre for <pre><code>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
</code></pre>
https://ask.sagemath.org/question/46401/what-does-the-a-and-x254-in-code-means/?comment=46414#post-id-46414Note: this is an excerpt of the
- [SageMath documentation on Boolean functions](http://doc.sagemath.org/html/en/reference/cryptography/sage/crypto/boolean_function.html)Tue, 30 Apr 2019 16:03:26 +0200https://ask.sagemath.org/question/46401/what-does-the-a-and-x254-in-code-means/?comment=46414#post-id-46414Answer by slelievre for <pre><code>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
</code></pre>
https://ask.sagemath.org/question/46401/what-does-the-a-and-x254-in-code-means/?answer=46413#post-id-46413When 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)"Tue, 30 Apr 2019 15:59:55 +0200https://ask.sagemath.org/question/46401/what-does-the-a-and-x254-in-code-means/?answer=46413#post-id-46413