Home/Instructions/SHA512SUM0
SHA512SUM0

RISC-V SHA512SUM0 Instruction Details

Instruction ManualI-type

SHA-512 Σ0 function (uppercase, RV64): ROTR(rs1,28) ^ ROTR(rs1,34) ^ ROTR(rs1,39)

Instruction Syntax

sha512sum0 rd, rs1

Syntax is sha512sum0 rd, rs1; operands select integer x0–x31 or ABI names, with no assembly immediate.

32-bit OP-IMM: bits31..20=000100000100, funct3=001, opcode=0010011; the selector is a fixed encoding field.

RV64 Zknh only (also in Zkn/Zk); apply this page's fixed right rotations and XOR to the complete 64-bit source.

An x0 source is zero and writes to x0 are discarded; overlap reads values before writeback and equal sources share one value. Execution latency must be data-independent.

ZknhCrypto & Security

Instruction Behavior

sha512sum0 is defined only for RV64. It computes the SHA2-512 Sum0 transform, ROTR64(X(rs1), 28) ^ ROTR64(X(rs1), 34) ^ ROTR64(X(rs1), 39), and writes the 64-bit result to rd. sha512sum0r is the RV32 split form.

SHA512SUM0 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
sha512sum0
,

Initially rd shares the source value when rd=rs1; otherwise the demo starts rd at 0. An rs1=x0 source always reads 0. SHA512SUM0 is defined only for RV64 and operates on the complete 64-bit X(rs1).

fixed selector
source
fixed
destination
OP-IMM
31..20
000100000100
19..15
rs1=x11
14..12
001
11..7
rd=x10
6..0
0010011
Execution Data Path
inb
0x0123456789ABCDEF
ror64(inb, 28)
0x9ABCDEF012345678
ror64(inb, 34)
0xE26AF37BC048D159
ror64(inb, 39)
0xCF13579BDE02468A
result
0xB7C57A100C7EC1AB
Architectural Result
a0(x10) = 0x0000000000000000

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

sha512sum0 computes SHA-512 Sum0 on a complete 64-bit source and result.

All operands are integer X registers; this instruction must have data-independent execution latency.

Common Usage Scenarios

Crypto & Security

RV64 Zknh, a1=1: the page's formula gives a0=0x0000001042000000.

Hash Algorithms

RV64 Zknh, a1=1: the page's formula gives a0=0x0000001042000000.

Pre-Use Checklist

Syntax Check
  • Syntax is sha512sum0 rd, rs1; operands select integer x0–x31 or ABI names, with no assembly immediate.
  • 32-bit OP-IMM: bits31..20=000100000100, funct3=001, opcode=0010011; the selector is a fixed encoding field.
Semantic Check
  • RV64 Zknh only (also in Zkn/Zk); apply this page's fixed right rotations and XOR to the complete 64-bit source.
  • An x0 source is zero and writes to x0 are discarded; overlap reads values before writeback and equal sources share one value. Execution latency must be data-independent.

Pitfalls / Common Confusions

RV64 only; RV32 uses the two-instruction sha512sum0r sequence.
Bits 31..20 are a fixed selector, with no assembly immediate.

FAQ

Does SHA512SUM0 use floating-point or vector registers?

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

Is SHA512SUM0 a complete algorithm implementation?

No. It implements one SHA2-512 Sum0 transform defined by the manual.