-
Notifications
You must be signed in to change notification settings - Fork 600
Expand file tree
/
Copy pathbrillig.rs
More file actions
31 lines (28 loc) · 1.04 KB
/
brillig.rs
File metadata and controls
31 lines (28 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use crate::native_types::{Expression, Witness};
use brillig::Opcode as BrilligOpcode;
use serde::{Deserialize, Serialize};
use super::opcodes::BlockId;
/// Inputs for the Brillig VM. These are the initial inputs
/// that the Brillig VM will use to start.
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Debug)]
pub enum BrilligInputs {
Single(Expression),
Array(Vec<Expression>),
MemoryArray(BlockId)
}
/// Outputs for the Brillig VM. Once the VM has completed
/// execution, this will be the object that is returned.
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Debug)]
pub enum BrilligOutputs {
Simple(Witness),
Array(Vec<Witness>),
}
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Debug)]
pub struct Brillig {
pub inputs: Vec<BrilligInputs>,
pub outputs: Vec<BrilligOutputs>,
/// The Brillig VM bytecode to be executed by this ACIR opcode.
pub bytecode: Vec<BrilligOpcode>,
/// Predicate of the Brillig execution - indicates if it should be skipped
pub predicate: Option<Expression>,
}