Skip to main content

Module sha512

Module sha512 

Source
Expand description

SHA2-512 precompile for the Miden VM.

This mirrors the Keccak256 precompile flow but targets SHA2-512. Execution-time handlers read packed bytes from memory, compute the digest, extend the advice stack with the 512-bit hash, and record calldata for deferred verification. Verification-time logic recomputes the digest and commits to both input and output using Poseidon2 hashing.

Structs§

Sha512FeltDigest
SHA2-512 digest represented as 16 field elements (u32-packed).
Sha512Precompile
Sha512Preimage
Wrapped preimage bytes along with helpers for commitments and digest computation.

Constants§

SHA512_HASH_BYTES_EVENT_NAME
Event name for the SHA512 hash_bytes operation.