aesd

AES Decrypt (A32)

AESD.8 <Qd>, <Qm>

Performs one round of AES decryption (AArch32).

Details

Performs a single round of AES decryption (InvShiftRows, InvSubBytes, AddRoundKey, and InvMixColumns stages) on the 128-bit data block in Qd using the 128-bit round key in Qm. The result is written back to Qd. This instruction does not modify the condition flags. Available in A32/T32 with Crypto extension and requires AES feature.

Pseudocode Operation

state ← Qd
round_key ← Qm
state ← InvShiftRows(state)
state ← InvSubBytes(state)
state ← AddRoundKey(state, round_key)
state ← InvMixColumns(state)
Qd ← state

Example

AESD.8 q0, q2

Encoding

Binary Layout
11110011
1
D
11
00
00
Vd
00111
Q
M
0
Vm
 
Format Crypto 2-Reg
Opcode 0xF3B00340
Extension Crypto

Operands

  • Qd
    Data
  • Qm
    Key

Reference (Arm A64 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0x4E285800 AESD <Vd>.16B, <Vn>.16B A64 01001110 | 00 | 101000010 | 1 | 10 | Rn | Rd
0x4522E400 AESD <Zdn>.B, <Zdn>.B, <Zm>.B A64 01000101 | 0 | 0 | 10001 | 0 | 11100 | 1 | Zm | Zdn

Description

AES single round decryption.

Operation

AArch64.CheckFPAdvSIMDEnabled();

bits(128) operand1 = V[d, 128];
bits(128) operand2 = V[n, 128];
bits(128) result;
result = operand1 EOR operand2;
result = AESInvSubBytes(AESInvShiftRows(result));
V[d, 128] = result;