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, 22 Dec 2020 10:24:27 +0100How to create GF(2^8) and multiply by 8 by 8 matrix?https://ask.sagemath.org/question/54776/how-to-create-gf28-and-multiply-by-8-by-8-matrix/How i can create GF(2^8) and Multiplication with matrix 8 by 8 and Multiplication with matrix 1 by 8?Sun, 20 Dec 2020 16:50:58 +0100https://ask.sagemath.org/question/54776/how-to-create-gf28-and-multiply-by-8-by-8-matrix/Comment by slelievre for <p>How i can create GF(2^8) and Multiplication with matrix 8 by 8 and Multiplication with matrix 1 by 8?</p>
https://ask.sagemath.org/question/54776/how-to-create-gf28-and-multiply-by-8-by-8-matrix/?comment=54827#post-id-54827Was the answer helpful? Did it answer the question you had in mind?Tue, 22 Dec 2020 10:00:30 +0100https://ask.sagemath.org/question/54776/how-to-create-gf28-and-multiply-by-8-by-8-matrix/?comment=54827#post-id-54827Comment by slelievre for <p>How i can create GF(2^8) and Multiplication with matrix 8 by 8 and Multiplication with matrix 1 by 8?</p>
https://ask.sagemath.org/question/54776/how-to-create-gf28-and-multiply-by-8-by-8-matrix/?comment=54829#post-id-54829Follow-up question at
- [Ask Sage question 54826](https://ask.sagemath.org/question/54826)Tue, 22 Dec 2020 10:04:28 +0100https://ask.sagemath.org/question/54776/how-to-create-gf28-and-multiply-by-8-by-8-matrix/?comment=54829#post-id-54829Answer by slelievre for <p>How i can create GF(2^8) and Multiplication with matrix 8 by 8 and Multiplication with matrix 1 by 8?</p>
https://ask.sagemath.org/question/54776/how-to-create-gf28-and-multiply-by-8-by-8-matrix/?answer=54780#post-id-54780The question seems to be asking
- how to create the finite field (or "Galois field") $F$ with $2^8$ elements
- how to view an element in $F$ as a vector with 8 coordinates
describing it as a linear combination of the generator's first 8 powers
- how to associate an 8 by 8 matrix to the operator of multiplication by an element in $F$
Sage allows to compute with elements in $F$ either via field algebra
or via linear algebra.
Examples of how to go back and forth, and how the results match:
sage: F.<a> = GF(2^8)
sage: a
a
sage: va = vector(a)
sage: va
(0, 1, 0, 0, 0, 0, 0, 0)
sage: ma = a.matrix()
sage: ma
[0 0 0 0 0 0 0 1]
[1 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 1]
[0 0 1 0 0 0 0 1]
[0 0 0 1 0 0 0 1]
[0 0 0 0 1 0 0 0]
[0 0 0 0 0 1 0 0]
[0 0 0 0 0 0 1 0]
sage: a_a = a * a
sage: a_a
a^2
sage: vaa = vector(a_a)
sage: vaa
(0, 0, 1, 0, 0, 0, 0, 0)
sage: ma_va = ma * va
sage: ma_va
(0, 0, 1, 0, 0, 0, 0, 0)
sage: F(ma_va)
a^2Sun, 20 Dec 2020 18:48:42 +0100https://ask.sagemath.org/question/54776/how-to-create-gf28-and-multiply-by-8-by-8-matrix/?answer=54780#post-id-54780Comment by koroz91 for <p>The question seems to be asking</p>
<ul>
<li>how to create the finite field (or "Galois field") $F$ with $2^8$ elements</li>
<li>how to view an element in $F$ as a vector with 8 coordinates
describing it as a linear combination of the generator's first 8 powers</li>
<li>how to associate an 8 by 8 matrix to the operator of multiplication by an element in $F$</li>
</ul>
<p>Sage allows to compute with elements in $F$ either via field algebra
or via linear algebra.</p>
<p>Examples of how to go back and forth, and how the results match:</p>
<pre><code>sage: F.<a> = GF(2^8)
sage: a
a
sage: va = vector(a)
sage: va
(0, 1, 0, 0, 0, 0, 0, 0)
sage: ma = a.matrix()
sage: ma
[0 0 0 0 0 0 0 1]
[1 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 1]
[0 0 1 0 0 0 0 1]
[0 0 0 1 0 0 0 1]
[0 0 0 0 1 0 0 0]
[0 0 0 0 0 1 0 0]
[0 0 0 0 0 0 1 0]
sage: a_a = a * a
sage: a_a
a^2
sage: vaa = vector(a_a)
sage: vaa
(0, 0, 1, 0, 0, 0, 0, 0)
sage: ma_va = ma * va
sage: ma_va
(0, 0, 1, 0, 0, 0, 0, 0)
sage: F(ma_va)
a^2
</code></pre>
https://ask.sagemath.org/question/54776/how-to-create-gf28-and-multiply-by-8-by-8-matrix/?comment=54833#post-id-54833i can't computing inverse GF(2^8) and Multiplication whith matrix 8 by 8Tue, 22 Dec 2020 10:24:27 +0100https://ask.sagemath.org/question/54776/how-to-create-gf28-and-multiply-by-8-by-8-matrix/?comment=54833#post-id-54833