vsbox

Vector S-Box

vsbox vD, vA

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

Details

The vsbox instruction applies the AES SubBytes transformation to the contents of VSR[VRA+32] and stores the result in VSR[VRT+32].

Pseudocode Operation

if MSR.VEC=0 then
    Vector_Unavailable()
State ← VSR[VRA+32]
VSR[VRT+32] ← SubBytes(State)

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