vncipherlast

Vector Inverse Cipher Last

vncipherlast vD, vA, vB

Performs the final round of AES decryption.

Details

The vncipherlast instruction performs the final round of the AES inverse cipher operation on the intermediate State array. It applies the InvShiftRows, InvSubBytes, and AddRoundKey transformations, followed by InvMixColumns, and places the result into VSR[VRT+32].

Pseudocode Operation

if MSR.VEC=0 then Vector_Unavailable()
State ← VSR[VRA+32]
RoundKey ← VSR[VRB+32]
vtemp1 ← InvShiftRows(State)
vtemp2 ← InvSubBytes(vtemp1)
vtemp3 ← vtemp2 ⊕ RoundKey
VSR[VRT+32] ← InvMixColumns(vtemp3)

Programming Note

The vncipherlast instruction is used to complete the AES inverse cipher process by applying the final transformations. Ensure that the Vector Facility (MSR.VEC) is enabled before using this instruction; otherwise, a Vector_Unavailable exception will be raised. The input State and RoundKey must be correctly loaded into VSR registers VRA+32 and VRB+32, respectively, to avoid incorrect results.

Example

vncipherlast vd, va, vb

Encoding

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

Operands

  • vD
    Target
  • vA
    State
  • vB
    Round Key