stoffel-vm 0.1.1

Register-based virtual machine runtime and MPC execution engine for Stoffel programs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::foreign_functions::{ForeignFunctionCallbackResult, ForeignFunctionContext};
use stoffel_vm_types::core_types::{ShareData, ShareType, Value};

pub(super) fn create_result_share_object(
    ctx: &mut ForeignFunctionContext<'_>,
    share_type: ShareType,
    share_data: ShareData,
) -> ForeignFunctionCallbackResult<Value> {
    ctx.create_share_object(share_type, share_data)
}

pub(super) fn create_result_share_value(
    share_type: ShareType,
    share_data: ShareData,
) -> ForeignFunctionCallbackResult<Value> {
    Ok(Value::Share(share_type, share_data))
}