GFNI instruction set

Last updated

Galois Field New Instructions is a subset extension from Intel to accelerate cryptographic applications. However its instructions have additional unexpected beneficial purposes in bit manipulation, and the instructions can be present in other ISAs

Contents

Description

The GFNI extension comprises three instructions, VGF2P8AFFINEINVQB, VGF2P8AFFINEQB and VGF2P8MULB. They are useful for cryptography, [1] as they can be used to implement Rijndael-style S-boxes such as those used in AES, Camellia, and SM4. These instructions are also used for bit manipulation in networking and signal processing: bits can be arbitrarily reordered, copied, inverted, cleared, or set with them. [1]

GFNI is a standalone instruction set extension and can be enabled separately from AVX or AVX-512. Depending on whether AVX and AVX-512F support is indicated by the CPU, GFNI support enables legacy (SSE), VEX or EVEX-coded instructions operating on 128, 256 or 512-bit vectors.

InstructionDescription
VGF2P8AFFINEINVQBGalois field affine transformation inverse
VGF2P8AFFINEQBGalois field affine transformation
VGF2P8MULBGalois field multiply bytes

Additional uses

GNFI was originally intended to help accelerate for example Rijndael (AES) GF(2^8) arithmetic: Rijndael has an explicit GF(2^8) reducing polynomial of 0x11B. However surprising number of additional uses have emerged:

See also

References

Intel AVX 10.1 (PDF) (3.0 ed.). Intel. July 2024. 355989-003US. Retrieved August 8, 2025.