vcipherlast

Vector Cipher Last

vcipherlast vD, vA, vB

Performs the final round of AES encryption (SubBytes, ShiftRows, AddRoundKey). No MixColumns.

Details

The vcipherlast instruction performs the last round of the AES encryption algorithm on a vector of data. It takes three operands: VRT (destination), VRA (round key), and VRB (input data). The instruction processes each element of the input data using the corresponding round key to produce the final encrypted output.

Pseudocode Operation

if MSR.VEC=0 then Vector_Unavailable()
do i = 0 to 3
   src ←VSR[VRB+32].word[i]
   key ←VSR[VRA+32].word[i]
   VSR[VRT+32].word[i] ← AES_last_round(src, key)
end

Programming Note

The vcipherlast instruction is used to perform the final round of AES encryption on a vector of data. Ensure that the Vector Facility (MSR.VEC) is enabled before using this instruction; otherwise, a Vector_Unavailable exception will be raised. This instruction processes each 32-bit word of the input data with the corresponding round key from the VRA register to produce the encrypted output in the VRT register.

Example

vcipherlast vd, va, vb

Encoding

Binary Layout
4
0
vD
6
vA
11
vB
16
1289
21
 
Format VX-form
Opcode 0x10000509
Extension Vector Crypto
Registers Altered MSR

Operands

  • vD
    Target
  • vA
    State
  • vB
    Round Key