_mm512_gf2p8mul_epi8
Classification
Other, Arithmetic, CPUID Test: GFNI
Header File
Instruction
VGF2P8MULB zmm, zmm, zmm
Synopsis
_mm512_gf2p8mul_epi8(__m512i a, __m512i b);
Description
Multiply the packed 8-bit integers in "a" and "b" in the finite field GF(2^8), and store the results in "dst". The field GF(2^8) is represented in polynomial representation with the reduction polynomial x^8 + x^4 + x^3 + x + 1.
Operation
DEFINE gf2p8mul_byte(src1byte, src2byte) {
tword := 0
FOR i := 0 to 7
IF src2byte.bit[i]
tword := tword XOR (src1byte << i)
FI
ENDFOR
FOR i := 14 downto 8
p := 0x11B << (i-8)
IF tword.bit[i]
tword := tword XOR p
FI
ENDFOR
RETURN tword.byte[0]
}
FOR j := 0 TO 63
dst.byte[j] := gf2p8mul_byte(a.byte[j], b.byte[j])
ENDFOR
dst[MAX:512] := 0