Skip to content
Merged
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
14 changes: 7 additions & 7 deletions acvm-repo/acvm/src/pwg/arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ impl ExpressionSolver {
/// Derives the rest of the witness in the provided expression based on the known witness values
/// 1. Fist we simplify the expression based on the known values and try to reduce the multiplication and linear terms
/// 2. If we end up with only the constant term;
/// - if it is 0 then the opcode is solved, if not,
/// - the assert_zero opcode is not satisfied and we return an error
/// - if it is 0 then the opcode is solved, if not,
/// - the assert_zero opcode is not satisfied and we return an error
/// 3. If we end up with only linear terms on the same witness 'w',
/// we can regroup them and solve 'a*w+c = 0':
/// If 'a' is zero in the above expression;
/// - if c is also 0 then the opcode is solved
/// - if not that means the assert_zero opcode is not satisfied and we return an error
/// If 'a' is not zero, we can solve it by setting the value of w: 'w = -c/a'
/// we can regroup them and solve 'a*w+c = 0':
/// - If 'a' is zero in the above expression;
/// - if c is also 0 then the opcode is solved
/// - if not that means the assert_zero opcode is not satisfied and we return an error
/// - If 'a' is not zero, we can solve it by setting the value of w: 'w = -c/a'
pub(crate) fn solve<F: AcirField>(
initial_witness: &mut WitnessMap<F>,
opcode: &Expression<F>,
Expand Down
2 changes: 1 addition & 1 deletion acvm-repo/acvm/src/pwg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
RequiresForeignCall(ForeignCallWaitInfo<F>),

/// The ACVM has encountered a request for an ACIR [call][acir::circuit::Opcode]
/// to execute a separate ACVM instance. The result of the ACIR call must be passd back to the ACVM.

Check warning on line 59 in acvm-repo/acvm/src/pwg/mod.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (passd)
///
/// Once this is done, the ACVM can be restarted to solve the remaining opcodes.
RequiresAcirCall(AcirCallWaitInfo<F>),
Expand Down Expand Up @@ -677,7 +677,7 @@
/// Defer execution of the ACIR call opcode to the caller, or finalize the execution.
/// 1. It first handles the predicate and return zero values if the predicate is false.
/// 2. If the results of the execution are not available, it issues a 'AcirCallWaitInfo'
/// to notify the caller that it (the caller) needs to execute the ACIR function.
/// to notify the caller that it (the caller) needs to execute the ACIR function.
/// 3. If the results are available, it updates the witness map and indicates that the opcode is solved.
pub fn solve_call_opcode(
&mut self,
Expand Down
4 changes: 2 additions & 2 deletions acvm-repo/brillig_vm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@
/// Execute a single opcode:
/// 1. Retrieve the current opcode using the program counter
/// 2. Execute the opcode.
/// For instance a binary 'result = lhs+rhs' opcode will read the VM memory at the lhs and rhs addresses,
/// compute the sum and write it to the 'result' memory address.
/// - For instance a binary 'result = lhs+rhs' opcode will read the VM memory at the lhs and rhs addresses,
/// compute the sum and write it to the 'result' memory address.
/// 3. Update the program counter, usually by incrementing it.
///
/// - Control flow opcodes jump around the bytecode by setting the program counter.
Expand Down Expand Up @@ -585,7 +585,7 @@
self.set_program_counter(*location)
}
Opcode::Const { destination, value, bit_size } => {
// Consts are not checked in runtime to fit in the bit size, since they can safely be checked statically.

Check warning on line 588 in acvm-repo/brillig_vm/src/lib.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (Consts)
self.memory.write(*destination, MemoryValue::new_from_field(*value, *bit_size));
self.increment_program_counter()
}
Expand Down Expand Up @@ -1121,7 +1121,7 @@
}

#[test]
fn jmpifnot_opcode() {

Check warning on line 1124 in acvm-repo/brillig_vm/src/lib.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (jmpifnot)
let calldata: Vec<FieldElement> = vec![1u128.into(), 2u128.into()];

let opcodes = vec![
Expand Down Expand Up @@ -1370,7 +1370,7 @@
}

#[test]
fn cmov_opcode() {

Check warning on line 1373 in acvm-repo/brillig_vm/src/lib.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (cmov)
let calldata: Vec<FieldElement> =
vec![(0u128).into(), (1u128).into(), (2u128).into(), (3u128).into()];

Expand Down Expand Up @@ -1627,7 +1627,7 @@
}

#[test]
fn iconst_opcode() {

Check warning on line 1630 in acvm-repo/brillig_vm/src/lib.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (iconst)
let opcodes = &[
Opcode::Const {
destination: MemoryAddress::direct(0),
Expand Down
Loading