Follow

In my 'baes' :) project I am struggling with Galois Fields and get field-exceeding values properly calculated.

I am home now and suddenly it struck me that probably the solution can be (note-to-self):

After multiplication with the irreducible polynomial, use a mask and a bitwise AND to keep only the lower 7 bits of the final result value.

I.e.:
value=0xA3F
mask=0x7F
result=$(( value & mask ))
So then the result will become: 0b00111111

Hopefully this will work...

codeberg.org/oxo/tool/src/bran

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.