Struct miden_core::code_blocks::Call
source · pub struct Call { /* private fields */ }
Expand description
Block for a function call.
Executes the function referenced by fn_hash
. Fails if the body is unavailable to the VM, or
if the execution of the call fails.
The hash of a call block is computed as:
hash(fn_hash || padding, domain=CALL_DOMAIN) hash(fn_hash || padding, domain=SYSCALL_DOMAIN) # when a syscall is used
Where fn_hash
is 4 field elements (256 bits), and padding
is 4 ZERO elements (256 bits).
Implementations§
source§impl Call
impl Call
sourcepub const CALL_DOMAIN: Felt = _
pub const CALL_DOMAIN: Felt = _
The domain of the call block (used for control block hashing).
sourcepub const SYSCALL_DOMAIN: Felt = _
pub const SYSCALL_DOMAIN: Felt = _
The domain of the syscall block (used for control block hashing).
sourcepub fn new(fn_hash: Digest) -> Self
pub fn new(fn_hash: Digest) -> Self
Returns a new Call block instantiated with the specified function body hash.
sourcepub fn new_syscall(fn_hash: Digest) -> Self
pub fn new_syscall(fn_hash: Digest) -> Self
Returns a new Call block instantiated with the specified function body hash and marked as a kernel call.
sourcepub fn is_syscall(&self) -> bool
pub fn is_syscall(&self) -> bool
Returns true if this call block corresponds to a kernel call.