Home/Instructions/SHA512 Sigma0 High
SHA512SIG0H

RISC-V SHA512SIG0H Instruction Details

Instruction ManualR-type

High 32 bits of SHA-512 σ0 (RV32): compute σ0 from 64-bit input (rs1=hi, rs2=lo) and return bits[63:32]

Instruction Syntax

sha512sig0h rd, rs1, rs2
Operand Breakdown
Destination rd: register receiving the operation result.
Source rs1: register holding the first operand.
Source rs2: register holding the second operand.
ZknhCrypto & Security

Instruction Encoding

31..25
funct7
24..20
rs2
19..15
rs1
14..12
funct3
11..7
rd
6..0
opcode

SHA512SIG0H uses opcode 0110011 (0x33), funct3 110, funct7 0101110. The rs1 and rs2 fields select the two source registers, and rd selects the destination register.

Format: R-type
opcode: 0110011 (0x33)
funct3: 110 (0x6)
funct7: 0101110 (0x2e)

Instruction Behavior

sha512sig0h is the Zknh SHA-512 σ0 high-half instruction (RV32 only). Concatenates rs1 (upper 32 bits) and rs2 (lower 32 bits) as a 64-bit input, computes σ0(x) = ROTR(x, 1) ^ ROTR(x, 8) ^ SHR(x, 7), and returns bits[63:32] to rd. Paired with sha512sig0l for full 64-bit SHA-512 σ0 on RV32.

Quick Understanding & Search Notes

SHA512SIG0H is a Zknh scalar cryptography instruction for SHA-512 RV32 split transform. This page is checked against the official scalar crypto extension, avoiding confusion among round functions, key schedule steps, and operand sources.

sha512sig0h computes one half of a SHA-512 64-bit sigma result on RV32 and must be paired with the matching h/l instruction.
Scalar crypto instructions use integer X registers, and the official spec requires the relevant crypto instructions to be implemented with data-independent execution latency.
RV32 SHA-512 split forms need the official h/l or reversed-source sequence to assemble the full 64-bit result.

Common Usage Scenarios

Crypto & Security

Understand this scenario with real code like «sha512sig0h a0, a1, a2».

Hash Algorithms

Understand this scenario with real code like «sha512sig0h a0, a1, a2».

Pre-Use Checklist

Syntax Check
  • Confirm the current instruction format is R-type.
  • Confirm the operand order matches the example.
Semantic Check
  • Ensure the destination register usage is compatible with the calling convention.
  • Confirm this is not the lower-level form of a pseudo-instruction expansion.

Pitfalls / Common Confusions

RV32 only. rs1=upper 32 bits, rs2=lower 32 bits (ordering may be confusing).
Must be paired with sha512sig0l for the complete 64-bit σ0 result.
h=high, l=low suffix mapping; do not swap.

FAQ

Does SHA512SIG0H use floating-point or vector registers?

No. These scalar crypto extension instructions use integer X registers.

Is SHA512SIG0H a complete algorithm implementation?

No. It is a low-level step from AES, SHA, SM3, or SM4; software still combines instructions with the algorithm schedule, round constants, or round keys.