我是 NTL 库的新手,因为它的GF2X
, GF2E
,GF2EX
等。现在,我想在 Galois 域上执行乘法GF(2^8)
。问题如下:
Rijndael (standardised as AES) uses the characteristic 2 finite field with 256 elements,
which can also be called the Galois field GF(2^8).
It employs the following reducing polynomial for multiplication:
x^8 + x^4 + x^3 + x^1 + 1.
例如,{53} • {CA} = {01} 在 Rijndael 的字段中,因为
(x^6 + x^4 + x + 1)(x^7 + x^6 + x^3 + x)
= (x^13 + x^12 + x^9 + x^7) + (x^11 + x^10 + x^7 + x^5) + (x^8 + x^7 + x^4 + x^2) + (x^7 + x^6 + x^3 + x)
= x^13 + x^12 + x^9 + x^11 + x^10 + x^5 + x^8 + x^4 + x^2 + x^6 + x^3 + x
= x^13 + x^12 + x^11 + x^10 + x^9 + x^8 + x^6 + x^5 + x^4 + x^3 + x^2 + x
and
x^13 + x^12 + x^11 + x^10 + x^9 + x^8 + x^6 + x^5 + x^4 + x^3 + x^2 + x modulo x^8 + x^4 + x^3 + x^1 + 1
= (11111101111110 mod 100011011)
= {3F7E mod 11B} = {01}
= 1 (decimal)
我的问题是如何表示约简多项式x^8 + x^4 + x^3 + x^1 + 1
和多项式x^6 + x^4 + x + 1
,x^7 + x^6 + x^3 + x
在NTL
. 然后对这些多项式进行乘法运算,得到结果{01}
。
这是我使用这个库的一个很好的例子。