Home/Instructions/SHA512SIG0
SHA512SIG0

RISC-V SHA512SIG0 Instruction Details

Instruction ManualI-type

SHA-512 σ0 function (RV64): ROTR(rs1,1) ^ ROTR(rs1,8) ^ SHR(rs1,7)

Instruction Syntax

sha512sig0 rd, rs1
Operand Breakdown
Destination rd: general-purpose register receiving the result.
Source rs1: register holding the first operand.
Immediate imm: 12-bit signed value, sign-extended before operation with rs1.
ZknhCrypto & Security

Instruction Behavior

sha512sig0 is the Zknh SHA-512 σ0 function (RV64 only): σ0(x) = ROTR(x, 1) ^ ROTR(x, 8) ^ SHR(x, 7). Reads 64-bit rs1, computes σ0, writes to rd. For SHA-512 message schedule W_t expansion. On RV32, sha512sig0h/sha512sig0l provide the same function split across 32-bit halves.

SHA512SIG0 Decode And Execute Animation

Bounded teaching inputs execute the official SHA-512 fixed-width bit operations; this does not model a complete algorithm or microarchitecture.

rd
rs1
sha512sig0
,

SHA512SIG0 is defined only for RV64 and operates on the complete 64-bit X(rs1).

fixed selector
source
fixed
destination
OP-IMM
31..20
000100000110
19..15
rs1=x11
14..12
001
11..7
rd=x10
6..0
0010011
Execution Data Path
inb
0x0123456789ABCDEF
ror64(inb, 1)
0x8091A2B3C4D5E6F7
ror64(inb, 8)
0xEF0123456789ABCD
inb >> 7
0x0002468ACF13579B
result
0x6F92C77C6C4F1AA1
Architectural Result
a0(x10) = 0x6F92C77C6C4F1AA1

This animation shows only official ISA fields and architectural state; it does not model a complete hash algorithm, pipeline, cache, or timing implementation.

Quick Understanding & Search Notes

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

sha512sig0 is the RV64 SHA-512 lowercase sigma message-schedule transform.
Scalar crypto instructions use integer X registers, and the official spec requires the relevant crypto instructions to be implemented with data-independent execution latency.

Common Usage Scenarios

Crypto & Security

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

Hash Algorithms

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

Pre-Use Checklist

Syntax Check
  • Verify the immediate field is within the valid range.
  • Confirm source register rs1 points to the correct operand.
Semantic Check
  • Check if the immediate sign-extension matches expectations.
  • Ensure the result register rd has a clear purpose.

Pitfalls / Common Confusions

RV64 only. On RV32 use sha512sig0h + sha512sig0l instruction pair.
Rotate/shift amounts: SHA-512 uses (1, 8, 7), different from SHA-256 σ0 (7, 18, 3).
Uses logical right shift (SHR), not arithmetic.

FAQ

Does SHA512SIG0 use floating-point or vector registers?

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

Is SHA512SIG0 a complete algorithm implementation?

No. It implements one SHA-2 Sigma transform; software still schedules the remaining SHA-2 computation.