Ask Your Question
0

Why GF(256) matrix only have zero and one number?

asked 2019-08-04 13:27:35 +0100

helica gravatar image

like this

sage: matrix(GF(2**8), [1, 2, 3, 4])
[1 0 1 0]

I just want do some matrix calculate mod 256, can any help me, please?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2019-08-05 14:34:46 +0100

tmonteil gravatar image

This is not a matrix issue. The field K=GF(256) has characteristic 2, which result do you expect for K(3) ?

edit flag offensive delete link more
2

answered 2019-08-05 20:23:17 +0100

updated 2019-08-06 20:07:32 +0100

If you want to work mod 256, you should work with Integers(256), not GF(256). (The first of these is the ring Z/256, the second is the field with 256 elements.)

sage: matrix(Integers(256), [1,2,3,4])
[1 2 3 4]
sage: matrix(Integers(256), [254, 255, 256, 257])
[254 255   0   1]

(edited to add the second example)

IntegerModRing(256) is a synonym for Integers(256), by the way.

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

Stats

Asked: 2019-08-04 13:27:35 +0100

Seen: 378 times

Last updated: Aug 06 '19