Created
May 2, 2015 08:48
-
-
Save tsusanka/96dc60e20d65174073cf to your computer and use it in GitHub Desktop.
Mathematica GF multiplication
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
X = 16^^00000000331100002201; | |
Y = 16^^0000000000223811f321; | |
m = 79; | |
f = \[Alpha]^79 + \[Alpha]^9 + 1; | |
polynomialBasis = Table[\[Alpha]^i, {i, m - 1, 0, -1}]; | |
Print["X = ", BaseForm[X, 16]]; | |
Print["Y = ", BaseForm[Y, 16]]; | |
x = IntegerDigits[X, 2, m].polynomialBasis; | |
y = IntegerDigits[Y, 2, m].polynomialBasis; | |
z = PolynomialMod[x*y, {f, 2}]; | |
zx = z /. {\[Alpha] -> 2}; | |
Print["X * Y = ", BaseForm[zx, 16] ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment