ARM / OFFLINE REFERENCE

On this page
← Home

SHA1M

SHA1 hash update (majority)

This instruction reads the five 32-bit words of the SHA-1 working state from the first and second source vectors, together with four 32-bit values from the third source vector, each containing the sum of a message schedule word and the corresponding round constant. The working state undergoes four rounds of the SHA-1 hash computation, applying the majority function and additions defined by the SHA-1 standard. The updated first four words of the working state are destructively placed in the first source vector.

Advanced SIMD class
(FEAT_SHA1)

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 1 0 1 1 1 1 0 0 0 0 Rm 0 0 1 0 0 0 Rn Rd
size opcode

Encoding

SHA1M <Qd>, <Sn>, <Vm>.4S

Decode

if !IsFeatureImplemented(FEAT_SHA1) then EndOfDecode(Decode_UNDEF); end;
let d : integer{} = UInt(Rd);
let n : integer{} = UInt(Rn);
let m : integer{} = UInt(Rm);

Assembler Symbols

<Qd>

Is the 128-bit name of the SIMD&FP source and destination, encoded in the "Rd" field.

<Sn>

Is the 32-bit name of the second SIMD&FP source register, encoded in the "Rn" field.

<Vm>

Is the name of the third SIMD&FP source register, encoded in the "Rm" field.

Operation

AArch64_CheckFPAdvSIMDEnabled();

var x : bits(128) = V{}(d);
var y : bits(32) = V{}(n);    // Note: 32 not 128 bits wide
let w : bits(128) = V{}(m);

for e = 0 to 3 do
    let t : bits(32) = SHAmajority{32}(x[63:32], x[95:64], x[127:96]);
    y = y + ROL(x[31:0], 5) + t + w[e*:32];
    x[63:32] = ROL(x[63:32], 30);
    let yx : bits(160) = ROL(y::x, 32);
    (y, x) = (yx[159:128], yx[127:0]);
end;
V{128}(d) = x;

Operational information

This instruction is a data-independent-time instruction as described in About PSTATE.DIT.


Version 2026.09 — Copyright © 2010-2026 Arm Limited or its affiliates.

This site is provided as a community resource and is NOT affiliated with nor endorsed by Arm Limited.