Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow nested arrays and vectors in Brillig foreign calls #4404

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,332 changes: 784 additions & 548 deletions barretenberg/cpp/src/barretenberg/dsl/acir_format/serde/acir.hpp

Large diffs are not rendered by default.

1,256 changes: 727 additions & 529 deletions noir/acvm-repo/acir/codegen/acir.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion noir/acvm-repo/acir/src/circuit/black_box_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl BlackBoxFunc {
BlackBoxFunc::RecursiveAggregation => "recursive_aggregation",
BlackBoxFunc::EcdsaSecp256r1 => "ecdsa_secp256r1",
BlackBoxFunc::BigIntAdd => "bigint_add",
BlackBoxFunc::BigIntSub => "bigint_neg",
BlackBoxFunc::BigIntSub => "bigint_sub",
BlackBoxFunc::BigIntMul => "bigint_mul",
BlackBoxFunc::BigIntDiv => "bigint_div",
BlackBoxFunc::BigIntFromLeBytes => "bigint_from_le_bytes",
Expand Down
4 changes: 2 additions & 2 deletions noir/acvm-repo/acir/src/circuit/brillig.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
use super::opcodes::BlockId;
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)
MemoryArray(BlockId),
}

/// Outputs for the Brillig VM. Once the VM has completed
Expand Down
6 changes: 5 additions & 1 deletion noir/acvm-repo/acir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ mod reflection {
path::{Path, PathBuf},
};

use brillig::{BinaryFieldOp, BinaryIntOp, BlackBoxOp, Opcode as BrilligOpcode, ValueOrArray};
use brillig::{
BinaryFieldOp, BinaryIntOp, BlackBoxOp, HeapValueType, Opcode as BrilligOpcode,
ValueOrArray,
};
use serde_reflection::{Tracer, TracerConfig};

use crate::{
Expand Down Expand Up @@ -69,6 +72,7 @@ mod reflection {
tracer.trace_simple_type::<BlackBoxOp>().unwrap();
tracer.trace_simple_type::<Directive>().unwrap();
tracer.trace_simple_type::<ValueOrArray>().unwrap();
tracer.trace_simple_type::<HeapValueType>().unwrap();

let registry = tracer.registry().unwrap();

Expand Down
105 changes: 58 additions & 47 deletions noir/acvm-repo/acir/tests/test_program_serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use acir::{
native_types::{Expression, Witness},
};
use acir_field::FieldElement;
use brillig::{HeapArray, MemoryAddress, ValueOrArray};
use brillig::{HeapArray, HeapValueType, MemoryAddress, ValueOrArray};

#[test]
fn addition_circuit() {
Expand All @@ -45,12 +45,12 @@ fn addition_circuit() {
let bytes = Circuit::serialize_circuit(&circuit);

let expected_serialization: Vec<u8> = vec![
31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 173, 144, 59, 18, 128, 32, 12, 68, 249, 120, 160, 132,
36, 144, 116, 94, 69, 70, 184, 255, 17, 28, 29, 10, 70, 75, 121, 205, 118, 111, 118, 119,
115, 206, 121, 247, 37, 142, 220, 71, 194, 63, 208, 47, 116, 133, 201, 69, 144, 153, 91,
73, 13, 9, 15, 72, 86, 85, 128, 165, 102, 69, 69, 81, 57, 147, 18, 53, 101, 45, 86, 173,
128, 33, 83, 195, 46, 70, 125, 200, 226, 186, 94, 16, 134, 231, 222, 26, 166, 47, 253, 235,
211, 135, 11, 47, 121, 122, 165, 121, 1, 0, 0,
31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 173, 208, 49, 14, 192, 32, 8, 5, 80, 212, 30, 8, 4, 20,
182, 94, 165, 166, 122, 255, 35, 52, 77, 28, 76, 58, 214, 191, 124, 166, 23, 242, 15, 0, 8,
240, 77, 154, 125, 206, 198, 127, 161, 176, 209, 138, 139, 197, 88, 68, 122, 205, 157, 152,
46, 204, 222, 76, 81, 180, 21, 35, 35, 53, 189, 179, 49, 119, 19, 171, 222, 188, 162, 147,
112, 167, 161, 206, 99, 98, 105, 223, 95, 248, 26, 113, 90, 97, 185, 97, 217, 56, 173, 35,
63, 243, 81, 87, 163, 125, 1, 0, 0,
];

assert_eq!(bytes, expected_serialization)
Expand All @@ -75,9 +75,9 @@ fn fixed_base_scalar_mul_circuit() {
let bytes = Circuit::serialize_circuit(&circuit);

let expected_serialization: Vec<u8> = vec![
31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 77, 138, 91, 10, 0, 32, 12, 195, 226, 235, 203, 75, 123,
116, 39, 182, 99, 133, 146, 22, 178, 128, 198, 207, 227, 22, 79, 180, 139, 35, 58, 245,
237, 121, 83, 182, 189, 204, 5, 167, 198, 147, 98, 93, 0, 0, 0,
31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 77, 138, 91, 10, 0, 32, 16, 2, 109, 171, 175, 46, 221,
209, 247, 229, 130, 130, 140, 200, 92, 0, 11, 157, 228, 35, 127, 212, 200, 29, 61, 116, 76,
220, 217, 250, 171, 91, 113, 160, 66, 104, 242, 97, 0, 0, 0,
];

assert_eq!(bytes, expected_serialization)
Expand All @@ -102,9 +102,9 @@ fn pedersen_circuit() {
let bytes = Circuit::serialize_circuit(&circuit);

let expected_serialization: Vec<u8> = vec![
31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 93, 138, 9, 10, 0, 64, 8, 2, 103, 15, 232, 255, 31, 142,
138, 34, 34, 65, 84, 198, 15, 28, 82, 145, 178, 182, 86, 191, 238, 183, 24, 131, 205, 79,
203, 0, 162, 119, 234, 237, 93, 0, 0, 0,
31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 93, 74, 135, 9, 0, 48, 8, 75, 171, 224, 255, 15, 139,
27, 196, 64, 200, 100, 0, 15, 133, 80, 57, 89, 219, 127, 39, 173, 126, 235, 236, 247, 151,
48, 224, 71, 90, 33, 97, 0, 0, 0,
];

assert_eq!(bytes, expected_serialization)
Expand Down Expand Up @@ -143,22 +143,22 @@ fn schnorr_verify_circuit() {
let bytes = Circuit::serialize_circuit(&circuit);

let expected_serialization: Vec<u8> = vec![
31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 77, 210, 233, 50, 66, 1, 24, 199, 225, 99, 223, 247,
125, 223, 146, 36, 73, 146, 36, 73, 146, 132, 187, 112, 255, 151, 96, 244, 78, 79, 198,
153, 57, 243, 212, 244, 165, 121, 255, 191, 239, 36, 73, 134, 146, 254, 19, 142, 243, 167,
247, 14, 179, 225, 247, 145, 222, 59, 217, 123, 71, 57, 198, 113, 78, 112, 240, 78, 113,
154, 51, 156, 229, 28, 231, 185, 192, 69, 46, 113, 153, 43, 92, 229, 26, 215, 185, 193, 77,
110, 113, 155, 59, 220, 229, 30, 247, 121, 192, 67, 30, 241, 152, 39, 76, 241, 148, 105,
158, 49, 195, 115, 102, 121, 193, 28, 47, 153, 231, 21, 11, 188, 102, 145, 55, 44, 241,
150, 101, 222, 177, 194, 123, 86, 249, 192, 26, 31, 89, 231, 19, 27, 124, 102, 243, 223,
142, 241, 188, 248, 222, 226, 43, 219, 124, 99, 135, 239, 236, 242, 131, 159, 252, 242, 57,
158, 104, 47, 186, 139, 214, 162, 179, 104, 44, 250, 26, 180, 53, 229, 127, 68, 75, 209,
81, 52, 20, 253, 68, 59, 209, 77, 52, 19, 189, 68, 43, 209, 73, 52, 18, 125, 68, 27, 209,
69, 52, 17, 61, 68, 11, 209, 65, 52, 16, 251, 199, 246, 135, 73, 127, 243, 216, 59, 182,
78, 217, 56, 109, 219, 140, 77, 179, 182, 204, 217, 48, 111, 187, 130, 205, 138, 182, 42,
217, 168, 108, 155, 138, 77, 170, 182, 168, 217, 160, 238, 246, 13, 55, 111, 186, 113, 203,
109, 219, 110, 218, 113, 203, 174, 27, 14, 110, 54, 184, 91, 226, 150, 127, 207, 47, 78,
22, 245, 106, 221, 3, 0, 0,
31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 77, 210, 7, 74, 3, 1, 20, 69, 209, 177, 247, 222, 123,
239, 189, 119, 141, 93, 99, 220, 133, 251, 95, 130, 152, 103, 78, 32, 3, 195, 33, 4, 66,
248, 239, 254, 20, 69, 209, 84, 212, 158, 216, 206, 223, 234, 219, 204, 146, 239, 91, 170,
111, 103, 245, 109, 101, 27, 219, 217, 193, 250, 219, 197, 110, 246, 176, 151, 125, 236,
231, 0, 7, 57, 196, 97, 142, 112, 148, 99, 28, 231, 4, 39, 57, 197, 105, 206, 112, 150,
115, 156, 231, 2, 23, 185, 196, 101, 174, 112, 149, 107, 92, 231, 6, 55, 185, 197, 109,
238, 112, 151, 123, 220, 231, 1, 15, 121, 196, 99, 158, 240, 148, 103, 60, 231, 5, 47, 121,
197, 107, 222, 240, 150, 119, 188, 231, 3, 75, 124, 228, 83, 195, 142, 121, 158, 125, 126,
225, 43, 223, 248, 206, 15, 126, 178, 204, 47, 86, 248, 237, 119, 43, 76, 127, 105, 47,
189, 165, 181, 116, 150, 198, 234, 125, 117, 249, 47, 233, 41, 45, 165, 163, 52, 148, 126,
210, 78, 186, 73, 51, 233, 37, 173, 164, 147, 52, 146, 62, 210, 70, 186, 72, 19, 233, 33,
45, 164, 131, 52, 144, 253, 23, 139, 218, 238, 217, 60, 123, 103, 235, 236, 156, 141, 179,
239, 166, 93, 183, 237, 185, 107, 199, 125, 251, 29, 218, 237, 216, 94, 167, 118, 58, 183,
207, 165, 93, 174, 237, 113, 107, 135, 123, 247, 47, 185, 251, 147, 59, 191, 184, 239, 155,
187, 126, 184, 103, 217, 29, 235, 55, 171, 223, 173, 104, 184, 231, 255, 243, 7, 236, 52,
239, 128, 225, 3, 0, 0,
];

assert_eq!(bytes, expected_serialization)
Expand Down Expand Up @@ -186,7 +186,9 @@ fn simple_brillig_foreign_call() {
brillig::Opcode::ForeignCall {
function: "invert".into(),
destinations: vec![ValueOrArray::MemoryAddress(MemoryAddress::from(0))],
destination_value_types: vec![HeapValueType::Simple],
inputs: vec![ValueOrArray::MemoryAddress(MemoryAddress::from(0))],
input_value_types: vec![HeapValueType::Simple],
},
brillig::Opcode::Stop { return_data_offset: 0, return_data_size: 1 },
],
Expand All @@ -204,11 +206,11 @@ fn simple_brillig_foreign_call() {
let bytes = Circuit::serialize_circuit(&circuit);

let expected_serialization: Vec<u8> = vec![
31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 173, 143, 177, 10, 192, 32, 12, 68, 207, 148, 150, 118,
234, 175, 216, 63, 232, 207, 116, 232, 226, 32, 226, 247, 171, 24, 225, 6, 113, 209, 7, 33,
199, 5, 194, 221, 9, 192, 160, 178, 145, 102, 154, 247, 234, 182, 115, 60, 102, 221, 47,
203, 121, 69, 59, 20, 246, 78, 254, 198, 149, 231, 80, 253, 187, 248, 249, 48, 106, 205,
220, 189, 187, 144, 33, 24, 144, 0, 93, 119, 243, 238, 108, 1, 0, 0,
31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 173, 143, 65, 10, 192, 32, 12, 4, 215, 148, 150, 246,
212, 175, 216, 31, 244, 51, 61, 244, 226, 65, 196, 247, 171, 24, 33, 136, 122, 209, 129,
144, 176, 132, 101, 247, 4, 160, 144, 217, 196, 45, 41, 218, 203, 91, 207, 241, 168, 117,
94, 90, 230, 37, 238, 144, 216, 27, 249, 11, 87, 156, 131, 239, 223, 248, 207, 186, 81,
235, 150, 67, 173, 221, 189, 95, 18, 34, 97, 64, 0, 116, 135, 40, 214, 136, 1, 0, 0,
];

assert_eq!(bytes, expected_serialization)
Expand Down Expand Up @@ -272,11 +274,20 @@ fn complex_brillig_foreign_call() {
ValueOrArray::HeapArray(HeapArray { pointer: 0.into(), size: 3 }),
ValueOrArray::MemoryAddress(MemoryAddress::from(1)),
],
input_value_types: vec![
HeapValueType::Array { size: 3, value_types: vec![HeapValueType::Simple] },
HeapValueType::Simple,
],
destinations: vec![
ValueOrArray::HeapArray(HeapArray { pointer: 0.into(), size: 3 }),
ValueOrArray::MemoryAddress(MemoryAddress::from(35)),
ValueOrArray::MemoryAddress(MemoryAddress::from(36)),
],
destination_value_types: vec![
HeapValueType::Array { size: 3, value_types: vec![HeapValueType::Simple] },
HeapValueType::Simple,
HeapValueType::Simple,
],
},
brillig::Opcode::Stop { return_data_offset: 32, return_data_size: 5 },
],
Expand All @@ -294,14 +305,15 @@ fn complex_brillig_foreign_call() {
let bytes = Circuit::serialize_circuit(&circuit);

let expected_serialization: Vec<u8> = vec![
31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 213, 83, 81, 10, 131, 48, 12, 125, 105, 215, 205, 125,
237, 10, 131, 237, 0, 221, 78, 224, 93, 196, 63, 69, 63, 61, 190, 5, 95, 177, 6, 193, 15,
43, 104, 32, 164, 9, 175, 201, 107, 146, 22, 0, 4, 147, 216, 160, 134, 103, 161, 159, 74,
196, 149, 180, 126, 159, 252, 36, 95, 46, 127, 20, 71, 115, 1, 142, 246, 0, 142, 113, 31,
78, 58, 239, 156, 115, 201, 218, 63, 187, 242, 127, 110, 65, 93, 208, 59, 253, 7, 109, 193,
56, 104, 223, 170, 239, 80, 120, 16, 83, 102, 225, 250, 247, 14, 243, 46, 138, 170, 253,
76, 234, 86, 93, 219, 55, 245, 96, 21, 84, 83, 253, 36, 231, 47, 173, 217, 184, 19, 227,
47, 204, 207, 119, 26, 40, 76, 164, 251, 178, 144, 17, 127, 189, 34, 151, 201, 4, 0, 0,
31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 213, 84, 73, 14, 131, 48, 12, 28, 147, 166, 165, 167,
126, 161, 82, 251, 128, 180, 47, 224, 47, 85, 111, 32, 56, 242, 124, 130, 24, 68, 176, 2,
23, 130, 4, 35, 89, 206, 50, 137, 71, 182, 147, 28, 128, 96, 128, 241, 150, 113, 44, 156,
135, 24, 121, 5, 189, 219, 134, 143, 164, 187, 203, 237, 165, 49, 59, 129, 70, 179, 131,
198, 177, 31, 14, 90, 239, 148, 117, 73, 154, 63, 19, 121, 63, 23, 111, 214, 219, 149, 243,
27, 125, 206, 117, 208, 63, 85, 222, 161, 248, 32, 167, 72, 162, 245, 235, 44, 166, 94, 20,
21, 251, 30, 196, 253, 213, 85, 83, 254, 91, 163, 168, 90, 234, 43, 24, 191, 213, 190, 172,
156, 235, 17, 126, 59, 49, 142, 68, 120, 75, 220, 7, 166, 84, 90, 68, 72, 194, 139, 180,
136, 25, 58, 46, 103, 45, 188, 25, 5, 0, 0,
];

assert_eq!(bytes, expected_serialization)
Expand Down Expand Up @@ -333,11 +345,10 @@ fn memory_op_circuit() {
let bytes = Circuit::serialize_circuit(&circuit);

let expected_serialization: Vec<u8> = vec![
31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 213, 146, 193, 13, 0, 32, 8, 3, 171, 192, 62, 184, 129,
251, 79, 101, 140, 152, 96, 226, 79, 120, 216, 79, 121, 53, 229, 64, 0, 16, 150, 196, 188,
154, 23, 155, 25, 119, 117, 115, 125, 83, 203, 206, 45, 193, 185, 20, 151, 165, 217, 112,
245, 55, 184, 28, 185, 59, 185, 146, 243, 147, 201, 129, 216, 197, 143, 3, 12, 77, 66, 200,
219, 15, 3, 0, 0,
31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 213, 145, 187, 17, 0, 32, 8, 67, 195, 111, 31, 220, 192,
253, 167, 178, 144, 2, 239, 236, 132, 194, 52, 129, 230, 93, 8, 6, 64, 176, 101, 225, 28,
78, 49, 43, 238, 154, 225, 254, 166, 209, 205, 165, 98, 174, 212, 177, 188, 187, 92, 255,
173, 92, 173, 190, 93, 82, 80, 78, 123, 14, 127, 60, 97, 1, 210, 144, 46, 242, 19, 3, 0, 0,
];

assert_eq!(bytes, expected_serialization)
Expand Down
15 changes: 11 additions & 4 deletions noir/acvm-repo/acvm/src/pwg/brillig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ use std::collections::HashMap;
use acir::{
brillig::{ForeignCallParam, ForeignCallResult, Value},
circuit::{
brillig::{Brillig, BrilligInputs, BrilligOutputs}, opcodes::BlockId, OpcodeLocation
brillig::{Brillig, BrilligInputs, BrilligOutputs},
opcodes::BlockId,
OpcodeLocation,
},
native_types::WitnessMap,
FieldElement,
Expand Down Expand Up @@ -98,11 +100,16 @@ impl<'b, B: BlackBoxFunctionSolver> BrilligSolver<'b, B> {
}
}
}
},
}
BrilligInputs::MemoryArray(block_id) => {
let memory_block = memory.get(block_id).ok_or(OpcodeNotSolvable::MissingMemoryBlock(block_id.0))?;
let memory_block = memory
.get(block_id)
.ok_or(OpcodeNotSolvable::MissingMemoryBlock(block_id.0))?;
for memory_index in 0..memory_block.block_len {
let memory_value = memory_block.block_value.get(&memory_index).expect("All memory is initialized on creation");
let memory_value = memory_block
.block_value
.get(&memory_index)
.expect("All memory is initialized on creation");
calldata.push((*memory_value).into());
}
}
Expand Down
16 changes: 14 additions & 2 deletions noir/acvm-repo/acvm/src/pwg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,13 @@ impl<'a, B: BlackBoxFunctionSolver> ACVM<'a, B> {
// there will be a cached `BrilligSolver` to avoid recomputation.
let mut solver: BrilligSolver<'_, B> = match self.brillig_solver.take() {
Some(solver) => solver,
None => BrilligSolver::new(witness, &self.block_solvers, brillig, self.backend, self.instruction_pointer)?,
None => BrilligSolver::new(
witness,
&self.block_solvers,
brillig,
self.backend,
self.instruction_pointer,
)?,
};
match solver.solve()? {
BrilligSolverStatus::ForeignCallWait(foreign_call) => {
Expand Down Expand Up @@ -373,7 +379,13 @@ impl<'a, B: BlackBoxFunctionSolver> ACVM<'a, B> {
return StepResult::Status(self.handle_opcode_resolution(resolution));
}

let solver = BrilligSolver::new(witness, &self.block_solvers, brillig, self.backend, self.instruction_pointer);
let solver = BrilligSolver::new(
witness,
&self.block_solvers,
brillig,
self.backend,
self.instruction_pointer,
);
match solver {
Ok(solver) => StepResult::IntoBrillig(solver),
Err(..) => StepResult::Status(self.handle_opcode_resolution(solver.map(|_| ()))),
Expand Down
13 changes: 13 additions & 0 deletions noir/acvm-repo/acvm/tests/solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use acir::{

use acvm::pwg::{ACVMStatus, ErrorLocation, ForeignCallWaitInfo, OpcodeResolutionError, ACVM};
use acvm_blackbox_solver::StubbedBlackBoxSolver;
use brillig_vm::brillig::HeapValueType;

// Reenable these test cases once we move the brillig implementation of inversion down into the acvm stdlib.

Expand Down Expand Up @@ -69,7 +70,9 @@ fn inversion_brillig_oracle_equivalence() {
BrilligOpcode::ForeignCall {
function: "invert".into(),
destinations: vec![ValueOrArray::MemoryAddress(MemoryAddress::from(1))],
destination_value_types: vec![HeapValueType::Simple],
inputs: vec![ValueOrArray::MemoryAddress(MemoryAddress::from(0))],
input_value_types: vec![HeapValueType::Simple],
},
BrilligOpcode::Stop { return_data_offset: 0, return_data_size: 3 },
],
Expand Down Expand Up @@ -196,12 +199,16 @@ fn double_inversion_brillig_oracle() {
BrilligOpcode::ForeignCall {
function: "invert".into(),
destinations: vec![ValueOrArray::MemoryAddress(MemoryAddress::from(1))],
destination_value_types: vec![HeapValueType::Simple],
inputs: vec![ValueOrArray::MemoryAddress(MemoryAddress::from(0))],
input_value_types: vec![HeapValueType::Simple],
},
BrilligOpcode::ForeignCall {
function: "invert".into(),
destinations: vec![ValueOrArray::MemoryAddress(MemoryAddress::from(3))],
destination_value_types: vec![HeapValueType::Simple],
inputs: vec![ValueOrArray::MemoryAddress(MemoryAddress::from(2))],
input_value_types: vec![HeapValueType::Simple],
},
BrilligOpcode::Stop { return_data_offset: 0, return_data_size: 5 },
],
Expand Down Expand Up @@ -327,12 +334,16 @@ fn oracle_dependent_execution() {
BrilligOpcode::ForeignCall {
function: "invert".into(),
destinations: vec![ValueOrArray::MemoryAddress(MemoryAddress::from(1))],
destination_value_types: vec![HeapValueType::Simple],
inputs: vec![ValueOrArray::MemoryAddress(MemoryAddress::from(0))],
input_value_types: vec![HeapValueType::Simple],
},
BrilligOpcode::ForeignCall {
function: "invert".into(),
destinations: vec![ValueOrArray::MemoryAddress(MemoryAddress::from(3))],
destination_value_types: vec![HeapValueType::Simple],
inputs: vec![ValueOrArray::MemoryAddress(MemoryAddress::from(2))],
input_value_types: vec![HeapValueType::Simple],
},
BrilligOpcode::Stop { return_data_offset: 0, return_data_size: 4 },
],
Expand Down Expand Up @@ -453,7 +464,9 @@ fn brillig_oracle_predicate() {
BrilligOpcode::ForeignCall {
function: "invert".into(),
destinations: vec![ValueOrArray::MemoryAddress(MemoryAddress::from(1))],
destination_value_types: vec![HeapValueType::Simple],
inputs: vec![ValueOrArray::MemoryAddress(MemoryAddress::from(0))],
input_value_types: vec![HeapValueType::Simple],
},
],
predicate: Some(Expression::default()),
Expand Down
Loading
Loading