sha1p

SHA1 Parity (A32)

SHA1P.32 <Qd>, <Qn>, <Qm>

SHA1 hash update (Parity).

Details

SHA1 Parity function: updates SHA1 hash state by computing the Parity operation on 32-bit elements. This instruction performs a cryptographic hash round step specific to SHA1 and is part of the ARM Cryptographic Extension. No condition flags are affected. Available in A32 and T32 with Crypto extension support.

Pseudocode Operation

Qd[127:96] ← SHA1_PARITY(Qd[127:96], Qn[127:96], Qm[127:96])
Qd[95:64] ← SHA1_PARITY(Qd[95:64], Qn[95:64], Qm[95:64])
Qd[63:32] ← SHA1_PARITY(Qd[63:32], Qn[63:32], Qm[63:32])
Qd[31:0] ← SHA1_PARITY(Qd[31:0], Qn[31:0], Qm[31:0])

Example

SHA1P.32 q0, q1, q2

Encoding

Binary Layout
11110010
0
0
01
Vn
Vd
0011
N
Q
M
0
Vm
 
Format Crypto 3-Reg
Opcode 0xF2100C00
Extension Crypto

Operands

  • Qd
    State
  • Qn
    Hash
  • Qm
    Data

Reference (Arm A64 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0x5E001000 SHA1P <Qd>, <Sn>, <Vm>.4S A64 01011110 | 00 | 0 | Rm | 0 | 001 | 00 | Rn | Rd

Description

SHA1 hash update (parity).

Operation

AArch64.CheckFPAdvSIMDEnabled();

bits(128) x = V[d, 128];
bits(32) y = V[n, 32];    // Note: 32 not 128 bits wide
bits(128) w = V[m, 128];
bits(32) t;

for e = 0 to 3
    t = SHAparity(x<63:32>, x<95:64>, x<127:96>);
    y = y + ROL(x<31:0>, 5) + t + Elem[w, e, 32];
    x<63:32> = ROL(x<63:32>, 30);
    <y, x> = ROL(y:x, 32);
V[d, 128] = x;