vsbox

Vector S-Box

vsbox vD, vA

Performs the SubBytes operation (S-Box lookup) on a vector.

Details

Performs the SubBytes operation (S-Box lookup) on all 16 bytes of a 128-bit vector, applying the AES S-box transformation to each byte independently. This instruction is part of the Vector Crypto extension and is used during AES encryption and decryption. No status flags are affected.

Pseudocode Operation

for i = 0 to 15 do vD[8*i:8*i+7] ← AES_SBOX[vA[8*i:8*i+7]]

Programming Note

The vsbox instruction applies the AES SubBytes transformation to a vector register, requiring the Vector Facility to be enabled (MSR.VEC=1). Ensure that the input vector is correctly aligned and that the destination register is properly set to avoid data corruption. This instruction operates at user privilege level but will raise an exception if the Vector Facility is not available.

Example

vsbox vd, va

Encoding

Binary Layout
4
6
vD
11
0
16
vA
1480
 
Format VX-form
Opcode 0x100005C8
Extension Vector Crypto
Registers Altered MSR

Operands

  • vD
    Target
  • vA
    Source
  • VRT
    Target Vector Register
  • VRA
    Source Vector Register