diff --git a/acvm-repo/acvm/src/pwg/blackbox/signature/ecdsa.rs b/acvm-repo/acvm/src/pwg/blackbox/signature/ecdsa.rs index 4b53316e88f..228550e9fbb 100644 --- a/acvm-repo/acvm/src/pwg/blackbox/signature/ecdsa.rs +++ b/acvm-repo/acvm/src/pwg/blackbox/signature/ecdsa.rs @@ -7,10 +7,7 @@ use acvm_blackbox_solver::{ecdsa_secp256k1_verify, ecdsa_secp256r1_verify}; use crate::{ OpcodeResolutionError, - pwg::{ - blackbox::utils::{to_u8_array, to_u8_vec}, - insert_value, - }, + pwg::{blackbox::utils::to_u8_array, insert_value}, }; pub(crate) fn secp256k1_prehashed( @@ -18,14 +15,13 @@ pub(crate) fn secp256k1_prehashed( public_key_x_inputs: &[FunctionInput; 32], public_key_y_inputs: &[FunctionInput; 32], signature_inputs: &[FunctionInput; 64], - hashed_message_inputs: &[FunctionInput], + hashed_message_inputs: &[FunctionInput; 32], output: Witness, ) -> Result<(), OpcodeResolutionError> { - let hashed_message = to_u8_vec(initial_witness, hashed_message_inputs)?; - let pub_key_x: [u8; 32] = to_u8_array(initial_witness, public_key_x_inputs)?; let pub_key_y: [u8; 32] = to_u8_array(initial_witness, public_key_y_inputs)?; let signature: [u8; 64] = to_u8_array(initial_witness, signature_inputs)?; + let hashed_message: [u8; 32] = to_u8_array(initial_witness, hashed_message_inputs)?; let is_valid = ecdsa_secp256k1_verify(&hashed_message, &pub_key_x, &pub_key_y, &signature)?; @@ -37,14 +33,13 @@ pub(crate) fn secp256r1_prehashed( public_key_x_inputs: &[FunctionInput; 32], public_key_y_inputs: &[FunctionInput; 32], signature_inputs: &[FunctionInput; 64], - hashed_message_inputs: &[FunctionInput], + hashed_message_inputs: &[FunctionInput; 32], output: Witness, ) -> Result<(), OpcodeResolutionError> { - let hashed_message = to_u8_vec(initial_witness, hashed_message_inputs)?; - let pub_key_x: [u8; 32] = to_u8_array(initial_witness, public_key_x_inputs)?; let pub_key_y: [u8; 32] = to_u8_array(initial_witness, public_key_y_inputs)?; let signature: [u8; 64] = to_u8_array(initial_witness, signature_inputs)?; + let hashed_message: [u8; 32] = to_u8_array(initial_witness, hashed_message_inputs)?; let is_valid = ecdsa_secp256r1_verify(&hashed_message, &pub_key_x, &pub_key_y, &signature)?; diff --git a/acvm-repo/acvm_js/src/black_box_solvers.rs b/acvm-repo/acvm_js/src/black_box_solvers.rs index 02c026cd26f..57a53ac4758 100644 --- a/acvm-repo/acvm_js/src/black_box_solvers.rs +++ b/acvm-repo/acvm_js/src/black_box_solvers.rs @@ -45,6 +45,7 @@ pub fn ecdsa_secp256k1_verify( public_key_y_bytes: &[u8], signature: &[u8], ) -> bool { + let hashed_msg: &[u8; 32] = hashed_msg.try_into().unwrap(); let public_key_x_bytes: &[u8; 32] = public_key_x_bytes.try_into().unwrap(); let public_key_y_bytes: &[u8; 32] = public_key_y_bytes.try_into().unwrap(); let signature: &[u8; 64] = signature.try_into().unwrap(); @@ -66,6 +67,7 @@ pub fn ecdsa_secp256r1_verify( public_key_y_bytes: &[u8], signature: &[u8], ) -> bool { + let hashed_msg: &[u8; 32] = hashed_msg.try_into().unwrap(); let public_key_x_bytes: &[u8; 32] = public_key_x_bytes.try_into().unwrap(); let public_key_y_bytes: &[u8; 32] = public_key_y_bytes.try_into().unwrap(); let signature: &[u8; 64] = signature.try_into().unwrap(); diff --git a/acvm-repo/blackbox_solver/src/ecdsa/mod.rs b/acvm-repo/blackbox_solver/src/ecdsa/mod.rs index cb3134bf0ab..9c617fc1483 100644 --- a/acvm-repo/blackbox_solver/src/ecdsa/mod.rs +++ b/acvm-repo/blackbox_solver/src/ecdsa/mod.rs @@ -4,7 +4,7 @@ mod secp256k1; mod secp256r1; pub fn ecdsa_secp256k1_verify( - hashed_msg: &[u8], + hashed_msg: &[u8; 32], public_key_x: &[u8; 32], public_key_y: &[u8; 32], signature: &[u8; 64], @@ -13,7 +13,7 @@ pub fn ecdsa_secp256k1_verify( } pub fn ecdsa_secp256r1_verify( - hashed_msg: &[u8], + hashed_msg: &[u8; 32], public_key_x: &[u8; 32], public_key_y: &[u8; 32], signature: &[u8; 64], diff --git a/acvm-repo/blackbox_solver/src/ecdsa/secp256k1.rs b/acvm-repo/blackbox_solver/src/ecdsa/secp256k1.rs index 0f171b7d8ff..64651147ebc 100644 --- a/acvm-repo/blackbox_solver/src/ecdsa/secp256k1.rs +++ b/acvm-repo/blackbox_solver/src/ecdsa/secp256k1.rs @@ -12,7 +12,7 @@ use k256::{ use k256::{Scalar, ecdsa::Signature}; pub(super) fn verify_signature( - hashed_msg: &[u8], + hashed_msg: &[u8; 32], public_key_x_bytes: &[u8; 32], public_key_y_bytes: &[u8; 32], signature: &[u8; 64], @@ -137,15 +137,4 @@ mod secp256k1_tests { assert!(!valid); } - - #[test] - #[ignore = "ECDSA verification does not currently handle long hashes correctly"] - fn trims_overly_long_hashes_to_correct_length() { - let mut long_hashed_message = HASHED_MESSAGE.to_vec(); - long_hashed_message.push(0xff); - - let valid = verify_signature(&long_hashed_message, &PUB_KEY_X, &PUB_KEY_Y, &SIGNATURE); - - assert!(valid); - } } diff --git a/acvm-repo/brillig_vm/src/black_box.rs b/acvm-repo/brillig_vm/src/black_box.rs index 7f239f92c5f..2547cf80a98 100644 --- a/acvm-repo/brillig_vm/src/black_box.rs +++ b/acvm-repo/brillig_vm/src/black_box.rs @@ -150,12 +150,18 @@ pub(crate) fn evaluate_black_box let hashed_msg = to_u8_vec(read_heap_vector(memory, hashed_msg)); let result = match op { - BlackBoxOp::EcdsaSecp256k1 { .. } => { - ecdsa_secp256k1_verify(&hashed_msg, &public_key_x, &public_key_y, &signature)? - } - BlackBoxOp::EcdsaSecp256r1 { .. } => { - ecdsa_secp256r1_verify(&hashed_msg, &public_key_x, &public_key_y, &signature)? - } + BlackBoxOp::EcdsaSecp256k1 { .. } => ecdsa_secp256k1_verify( + &hashed_msg.try_into().unwrap(), + &public_key_x, + &public_key_y, + &signature, + )?, + BlackBoxOp::EcdsaSecp256r1 { .. } => ecdsa_secp256r1_verify( + &hashed_msg.try_into().unwrap(), + &public_key_x, + &public_key_y, + &signature, + )?, _ => unreachable!("`BlackBoxOp` is guarded against being a non-ecdsa operation"), }; diff --git a/compiler/noirc_evaluator/src/acir/acir_context/generated_acir/mod.rs b/compiler/noirc_evaluator/src/acir/acir_context/generated_acir/mod.rs index 9e0bfb2e6b2..662e7b61d31 100644 --- a/compiler/noirc_evaluator/src/acir/acir_context/generated_acir/mod.rs +++ b/compiler/noirc_evaluator/src/acir/acir_context/generated_acir/mod.rs @@ -695,9 +695,9 @@ fn black_box_func_expected_input_size(name: BlackBoxFunc) -> Option { // witness at a time. BlackBoxFunc::RANGE => Some(1), - // Signature verification algorithms will take in a variable - // number of inputs, since the message/hashed-message can vary in size. - BlackBoxFunc::EcdsaSecp256k1 | BlackBoxFunc::EcdsaSecp256r1 => None, + // 64 bytes for the signature, 32 bytes for the hashed message, + // and 32 bytes each for the x and y coordinates of the public key, plus a predicate. + BlackBoxFunc::EcdsaSecp256k1 | BlackBoxFunc::EcdsaSecp256r1 => Some(161), // Inputs for multi scalar multiplication is an arbitrary number of [point, scalar] pairs. BlackBoxFunc::MultiScalarMul => None, diff --git a/compiler/noirc_evaluator/src/ssa/interpreter/intrinsics.rs b/compiler/noirc_evaluator/src/ssa/interpreter/intrinsics.rs index 9858e276c91..4e24312b50e 100644 --- a/compiler/noirc_evaluator/src/ssa/interpreter/intrinsics.rs +++ b/compiler/noirc_evaluator/src/ssa/interpreter/intrinsics.rs @@ -191,9 +191,18 @@ impl Interpreter<'_, W> { size: s_len, }) })?; + let m_len = m.len(); + let m_array: &[u8; 32] = &m.try_into().map_err(|_| { + InterpreterError::Internal(InternalError::InvalidInputSize { + expected_size: 32, + size: m_len, + }) + })?; let result = if predicate { - acvm::blackbox_solver::ecdsa_secp256k1_verify(&m, x_array, y_array, s_array) - .map_err(Self::convert_error)? + acvm::blackbox_solver::ecdsa_secp256k1_verify( + m_array, x_array, y_array, s_array, + ) + .map_err(Self::convert_error)? } else { true }; @@ -230,10 +239,19 @@ impl Interpreter<'_, W> { size: s_len, }) })?; + let m_len = m.len(); + let m_array: &[u8; 32] = &m.try_into().map_err(|_| { + InterpreterError::Internal(InternalError::InvalidInputSize { + expected_size: 32, + size: m_len, + }) + })?; let result = if predicate { - acvm::blackbox_solver::ecdsa_secp256r1_verify(&m, x_array, y_array, s_array) - .map_err(Self::convert_error)? + acvm::blackbox_solver::ecdsa_secp256r1_verify( + m_array, x_array, y_array, s_array, + ) + .map_err(Self::convert_error)? } else { true }; diff --git a/compiler/noirc_evaluator/src/ssa/ir/dfg/simplify/call/blackbox.rs b/compiler/noirc_evaluator/src/ssa/ir/dfg/simplify/call/blackbox.rs index 829599f10ce..1b824702dba 100644 --- a/compiler/noirc_evaluator/src/ssa/ir/dfg/simplify/call/blackbox.rs +++ b/compiler/noirc_evaluator/src/ssa/ir/dfg/simplify/call/blackbox.rs @@ -309,7 +309,7 @@ pub(super) fn simplify_hash( } type ECDSASignatureVerifier = fn( - hashed_msg: &[u8], + hashed_msg: &[u8; 32], public_key_x: &[u8; 32], public_key_y: &[u8; 32], signature: &[u8; 64], @@ -350,7 +350,9 @@ pub(super) fn simplify_signature( .expect("ECDSA public key fields are 32 bytes"); let signature: [u8; 64] = to_u8_vec(dfg, signature).try_into().expect("ECDSA signatures are 64 bytes"); - let hashed_message: Vec = to_u8_vec(dfg, hashed_message); + let hashed_message: [u8; 32] = to_u8_vec(dfg, hashed_message) + .try_into() + .expect("ECDSA message hashes are 32 bytes"); let valid_signature = signature_verifier(&hashed_message, &public_key_x, &public_key_y, &signature) diff --git a/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin/builtin_helpers.rs b/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin/builtin_helpers.rs index 1aa1987b955..159faf5ce8b 100644 --- a/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin/builtin_helpers.rs +++ b/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin/builtin_helpers.rs @@ -166,18 +166,6 @@ pub(crate) fn get_slice( } } -/// Interpret the input as a slice, then map each element. -/// Returns the values in the slice and the original type. -pub(crate) fn get_slice_map( - interner: &NodeInterner, - (value, location): (Value, Location), - f: impl Fn((Value, Location)) -> IResult, -) -> IResult<(Vec, Type)> { - let (values, typ) = get_slice(interner, (value, location))?; - let values = try_vecmap(values, |value| f((value, location)))?; - Ok((values, typ)) -} - /// Interpret the input as an array, then map each element. /// Returns the values in the array and the original array type. pub(crate) fn get_array_map( diff --git a/compiler/noirc_frontend/src/hir/comptime/interpreter/foreign.rs b/compiler/noirc_frontend/src/hir/comptime/interpreter/foreign.rs index 6c9089cb121..ea8c096e4c3 100644 --- a/compiler/noirc_frontend/src/hir/comptime/interpreter/foreign.rs +++ b/compiler/noirc_frontend/src/hir/comptime/interpreter/foreign.rs @@ -21,7 +21,7 @@ use super::{ Interpreter, builtin::builtin_helpers::{ check_arguments, check_one_argument, check_three_arguments, check_two_arguments, - get_array_map, get_bool, get_field, get_fixed_array_map, get_slice_map, get_struct_field, + get_array_map, get_bool, get_field, get_fixed_array_map, get_struct_field, get_struct_fields, get_u8, get_u32, get_u64, to_byte_slice, to_struct, }, }; @@ -170,7 +170,7 @@ fn ecdsa_secp256_verify( interner: &mut NodeInterner, arguments: Vec<(Value, Location)>, location: Location, - f: impl Fn(&[u8], &[u8; 32], &[u8; 32], &[u8; 64]) -> Result, + f: impl Fn(&[u8; 32], &[u8; 32], &[u8; 32], &[u8; 64]) -> Result, ) -> IResult { let [pub_key_x, pub_key_y, sig, msg_hash, predicate] = check_arguments(arguments, location)?; assert_eq!(predicate.0, Value::Bool(true), "verify_signature predicate should be true"); @@ -178,13 +178,7 @@ fn ecdsa_secp256_verify( let (pub_key_x, _) = get_fixed_array_map(interner, pub_key_x, get_u8)?; let (pub_key_y, _) = get_fixed_array_map(interner, pub_key_y, get_u8)?; let (sig, _) = get_fixed_array_map(interner, sig, get_u8)?; - - // Hash can be an array or slice. - let (msg_hash, _) = if matches!(msg_hash.0.get_type().as_ref(), Type::Array(_, _)) { - get_array_map(interner, msg_hash.clone(), get_u8)? - } else { - get_slice_map(interner, msg_hash, get_u8)? - }; + let (msg_hash, _) = get_fixed_array_map(interner, msg_hash.clone(), get_u8)?; let is_valid = f(&msg_hash, &pub_key_x, &pub_key_y, &sig) .map_err(|e| InterpreterError::BlackBoxError(e, location))?; diff --git a/noir_stdlib/src/ecdsa_secp256k1.nr b/noir_stdlib/src/ecdsa_secp256k1.nr index d19f7ba6322..4f4f240f216 100644 --- a/noir_stdlib/src/ecdsa_secp256k1.nr +++ b/noir_stdlib/src/ecdsa_secp256k1.nr @@ -14,11 +14,11 @@ /// For more context regarding malleability you can reference BIP 0062. /// - the hash of the message, as a vector of bytes /// - output: false for failure and true for success -pub fn verify_signature( +pub fn verify_signature( public_key_x: [u8; 32], public_key_y: [u8; 32], signature: [u8; 64], - message_hash: [u8; N], + message_hash: [u8; 32], ) -> bool // docs:end:ecdsa_secp256k1 { @@ -26,10 +26,10 @@ pub fn verify_signature( } #[foreign(ecdsa_secp256k1)] -pub fn _verify_signature( +pub fn _verify_signature( public_key_x: [u8; 32], public_key_y: [u8; 32], signature: [u8; 64], - message_hash: [u8; N], + message_hash: [u8; 32], predicate: bool, ) -> bool {} diff --git a/noir_stdlib/src/ecdsa_secp256r1.nr b/noir_stdlib/src/ecdsa_secp256r1.nr index fc130a03b37..efedb8cd3e8 100644 --- a/noir_stdlib/src/ecdsa_secp256r1.nr +++ b/noir_stdlib/src/ecdsa_secp256r1.nr @@ -1,9 +1,9 @@ // docs:start:ecdsa_secp256r1 -pub fn verify_signature( +pub fn verify_signature( public_key_x: [u8; 32], public_key_y: [u8; 32], signature: [u8; 64], - message_hash: [u8; N], + message_hash: [u8; 32], ) -> bool // docs:end:ecdsa_secp256r1 { @@ -11,10 +11,10 @@ pub fn verify_signature( } #[foreign(ecdsa_secp256r1)] -pub fn _verify_signature( +pub fn _verify_signature( public_key_x: [u8; 32], public_key_y: [u8; 32], signature: [u8; 64], - message_hash: [u8; N], + message_hash: [u8; 32], predicate: bool, ) -> bool {} diff --git a/tooling/nargo_cli/tests/snapshots/compile_success_empty/arithmetic_generics/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/compile_success_empty/arithmetic_generics/execute__tests__expanded.snap index 718ef96fdd3..085b9526af1 100644 --- a/tooling/nargo_cli/tests/snapshots/compile_success_empty/arithmetic_generics/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/compile_success_empty/arithmetic_generics/execute__tests__expanded.snap @@ -24,8 +24,8 @@ fn split_first(array: [T; N]) -> (T, [T; N - 1]) { fn push(array: [Field; N], element: Field) -> [Field; N + 1] { let mut result: [Field; N + 1] = std::mem::zeroed(); { - let i_4460: u32 = array.len(); - result[i_4460] = element; + let i_4456: u32 = array.len(); + result[i_4456] = element; }; for i in 0_u32..array.len() { result[i] = array[i]; diff --git a/tooling/nargo_cli/tests/snapshots/compile_success_empty/assign_mutation_in_lvalue/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/compile_success_empty/assign_mutation_in_lvalue/execute__tests__expanded.snap index 77f613de13c..62c8036c4ec 100644 --- a/tooling/nargo_cli/tests/snapshots/compile_success_empty/assign_mutation_in_lvalue/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/compile_success_empty/assign_mutation_in_lvalue/execute__tests__expanded.snap @@ -10,11 +10,11 @@ fn main() { fn bug() { let mut a: ([Field; 2], Field) = ([1_Field, 2_Field], 3_Field); { - let i_4429: u32 = { + let i_4425: u32 = { a = ([4_Field, 5_Field], 6_Field); 1_u32 }; - a.0[i_4429] = 7_Field; + a.0[i_4425] = 7_Field; }; assert(a == ([4_Field, 7_Field], 6_Field)); } diff --git a/tooling/nargo_cli/tests/snapshots/compile_success_empty/numeric_generics/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/compile_success_empty/numeric_generics/execute__tests__expanded.snap index d3034413045..c4b892958d0 100644 --- a/tooling/nargo_cli/tests/snapshots/compile_success_empty/numeric_generics/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/compile_success_empty/numeric_generics/execute__tests__expanded.snap @@ -27,8 +27,8 @@ impl MyStruct { fn insert(mut self, index: Field, elem: Field) -> Self { assert((index as u64) < (S as u64)); { - let i_4443: u32 = index as u32; - self.data[i_4443] = elem; + let i_4439: u32 = index as u32; + self.data[i_4439] = elem; }; self } diff --git a/tooling/nargo_cli/tests/snapshots/compile_success_empty/numeric_generics_explicit/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/compile_success_empty/numeric_generics_explicit/execute__tests__expanded.snap index e3d51048fec..0655907ff59 100644 --- a/tooling/nargo_cli/tests/snapshots/compile_success_empty/numeric_generics_explicit/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/compile_success_empty/numeric_generics_explicit/execute__tests__expanded.snap @@ -36,8 +36,8 @@ impl MyStruct { fn insert(mut self, index: Field, elem: Field) -> Self { assert((index as u32) < S); { - let i_4461: u32 = index as u32; - self.data[i_4461] = elem; + let i_4457: u32 = index as u32; + self.data[i_4457] = elem; }; self } diff --git a/tooling/nargo_cli/tests/snapshots/compile_success_empty/regression_bignum/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/compile_success_empty/regression_bignum/execute__tests__expanded.snap index 3decec736b5..4fff1b61e2b 100644 --- a/tooling/nargo_cli/tests/snapshots/compile_success_empty/regression_bignum/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/compile_success_empty/regression_bignum/execute__tests__expanded.snap @@ -53,8 +53,8 @@ unconstrained fn shl(shift: u32) -> [u64; 6] { result[num_shifted_limbs] = 1_u64 << limb_shift; for i in 1_u32..6_u32 - num_shifted_limbs { { - let i_4450: u32 = i + num_shifted_limbs; - result[i_4450] = 0_u64; + let i_4446: u32 = i + num_shifted_limbs; + result[i_4446] = 0_u64; } } result diff --git a/tooling/nargo_cli/tests/snapshots/compile_success_empty/serialize_1/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/compile_success_empty/serialize_1/execute__tests__expanded.snap index b4c4d128076..c19592a77d1 100644 --- a/tooling/nargo_cli/tests/snapshots/compile_success_empty/serialize_1/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/compile_success_empty/serialize_1/execute__tests__expanded.snap @@ -25,8 +25,8 @@ where } for i in 0_u32..b.len() { { - let i_4452: u32 = i + a.len(); - array[i_4452] = b[i]; + let i_4448: u32 = i + a.len(); + array[i_4448] = b[i]; } } array diff --git a/tooling/nargo_cli/tests/snapshots/compile_success_empty/serialize_4/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/compile_success_empty/serialize_4/execute__tests__expanded.snap index e1944b4a31c..dd9915f597e 100644 --- a/tooling/nargo_cli/tests/snapshots/compile_success_empty/serialize_4/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/compile_success_empty/serialize_4/execute__tests__expanded.snap @@ -25,8 +25,8 @@ where } for i in 0_u32..b.len() { { - let i_4452: u32 = i + a.len(); - array[i_4452] = b[i]; + let i_4448: u32 = i + a.len(); + array[i_4448] = b[i]; } } array diff --git a/tooling/nargo_cli/tests/snapshots/compile_success_no_bug/ram_blowup_regression/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/compile_success_no_bug/ram_blowup_regression/execute__tests__expanded.snap index 42afc534c48..d81483d30f3 100644 --- a/tooling/nargo_cli/tests/snapshots/compile_success_no_bug/ram_blowup_regression/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/compile_success_no_bug/ram_blowup_regression/execute__tests__expanded.snap @@ -29,8 +29,8 @@ fn main(tx_effects_hash_input: [Field; 256]) -> pub Field { let input_as_bytes: [u8; 32] = tx_effects_hash_input[offset].to_be_bytes(); for byte_index in 0_u32..32_u32 { { - let i_4444: u32 = (offset * 32_u32) + byte_index; - hash_input_flattened[i_4444] = input_as_bytes[byte_index]; + let i_4440: u32 = (offset * 32_u32) + byte_index; + hash_input_flattened[i_4440] = input_as_bytes[byte_index]; } } } diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/aes128_encrypt/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/aes128_encrypt/execute__tests__expanded.snap index 48ef0dea484..b8a50c7a79a 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/aes128_encrypt/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/aes128_encrypt/execute__tests__expanded.snap @@ -18,8 +18,8 @@ unconstrained fn decode_hex(s: str) -> [u8; M] { for i in 0_u32..N { if (i % 2_u32) != 0_u32 { continue; }; { - let i_4444: u32 = i / 2_u32; - result[i_4444] = + let i_4440: u32 = i / 2_u32; + result[i_4440] = (decode_ascii(as_bytes[i]) * 16_u8) + decode_ascii(as_bytes[i + 1_u32]); } } diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/array_dedup_regression/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/array_dedup_regression/execute__tests__expanded.snap index 6ea4702449d..35b2698af82 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/array_dedup_regression/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/array_dedup_regression/execute__tests__expanded.snap @@ -7,8 +7,8 @@ unconstrained fn main(x: u32) { for i in 0_u32..5_u32 { let mut a2: [Field; 5] = [1_Field, 2_Field, 3_Field, 4_Field, 5_Field]; { - let i_4431: u32 = x + i; - a2[i_4431] = 128_Field; + let i_4427: u32 = x + i; + a2[i_4427] = 128_Field; }; println(a2); if i != 0_u32 { diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/array_dynamic_blackbox_input/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/array_dynamic_blackbox_input/execute__tests__expanded.snap index f0b9d8247f8..8010f0087bc 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/array_dynamic_blackbox_input/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/array_dynamic_blackbox_input/execute__tests__expanded.snap @@ -17,12 +17,12 @@ fn compute_root(leaf: [u8; 32], path: [u8; 64], _index: u32, root: [u8; 32]) { let b: u32 = if is_right { 0_u32 } else { 32_u32 }; for j in 0_u32..32_u32 { { - let i_4445: u32 = j + a; - hash_input[i_4445] = current[j]; + let i_4441: u32 = j + a; + hash_input[i_4441] = current[j]; }; { - let i_4446: u32 = j + b; - hash_input[i_4446] = path[offset + j]; + let i_4442: u32 = j + b; + hash_input[i_4442] = path[offset + j]; } } current = std::hash::blake3(hash_input); diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/array_dynamic_nested_blackbox_input/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/array_dynamic_nested_blackbox_input/execute__tests__expanded.snap index 10177244d23..aea9a0be239 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/array_dynamic_nested_blackbox_input/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/array_dynamic_nested_blackbox_input/execute__tests__expanded.snap @@ -14,13 +14,13 @@ struct Foo { fn main(mut x: [Foo; 3], y: pub u32, hash_result: pub [u8; 32]) { { - let i_4430: u32 = y - 1_u32; - x[i_4430].bar.inner = [106_u8, 107_u8, 10_u8]; + let i_4426: u32 = y - 1_u32; + x[i_4426].bar.inner = [106_u8, 107_u8, 10_u8]; }; let mut hash_input: [u8; 3] = x[y - 1_u32].bar.inner; { - let i_4432: u32 = y - 1_u32; - hash_input[i_4432] = 0_u8; + let i_4428: u32 = y - 1_u32; + hash_input[i_4428] = 0_u8; }; let hash: [u8; 32] = std::hash::blake3(hash_input); assert(hash == hash_result); diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/brillig_cow/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/brillig_cow/execute__tests__expanded.snap index a8ce24cba92..e2c4fdfee7b 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/brillig_cow/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/brillig_cow/execute__tests__expanded.snap @@ -22,8 +22,8 @@ fn modify_in_inlined_constrained(original: [Field; 5], index: u32) -> ExecutionR modified[index] = 27_Field; let modified_once: [Field; 5] = modified; { - let i_4442: u32 = index + 1_u32; - modified[i_4442] = 27_Field; + let i_4438: u32 = index + 1_u32; + modified[i_4438] = 27_Field; }; ExecutionResult { original: original, modified_once: modified_once, modified_twice: modified } } @@ -33,8 +33,8 @@ unconstrained fn modify_in_unconstrained(original: [Field; 5], index: u32) -> Ex modified[index] = 27_Field; let modified_once: [Field; 5] = modified; { - let i_4445: u32 = index + 1_u32; - modified[i_4445] = 27_Field; + let i_4441: u32 = index + 1_u32; + modified[i_4441] = 27_Field; }; ExecutionResult { original: original, modified_once: modified_once, modified_twice: modified } } diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/brillig_cow_regression/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/brillig_cow_regression/execute__tests__expanded.snap index 4835807dbb1..c440cf6d7cb 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/brillig_cow_regression/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/brillig_cow_regression/execute__tests__expanded.snap @@ -155,33 +155,33 @@ unconstrained fn main(kernel_data: DataToHash) -> pub [Field; 2] { let mut offset: u32 = 0_u32; for j in 0_u32..MAX_NOTE_HASHES_PER_TX { { - let i_4454: u32 = offset + j; - tx_effects_hash_inputs[i_4454] = new_note_hashes[j]; + let i_4450: u32 = offset + j; + tx_effects_hash_inputs[i_4450] = new_note_hashes[j]; } } offset = offset + MAX_NOTE_HASHES_PER_TX; for j in 0_u32..MAX_NULLIFIERS_PER_TX { { - let i_4456: u32 = offset + j; - tx_effects_hash_inputs[i_4456] = new_nullifiers[j]; + let i_4452: u32 = offset + j; + tx_effects_hash_inputs[i_4452] = new_nullifiers[j]; } } offset = offset + MAX_NULLIFIERS_PER_TX; for j in 0_u32..MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX { { - let i_4458: u32 = offset + (j * 2_u32); - tx_effects_hash_inputs[i_4458] = public_data_update_requests[j].leaf_slot; + let i_4454: u32 = offset + (j * 2_u32); + tx_effects_hash_inputs[i_4454] = public_data_update_requests[j].leaf_slot; }; { - let i_4459: u32 = (offset + (j * 2_u32)) + 1_u32; - tx_effects_hash_inputs[i_4459] = public_data_update_requests[j].new_value; + let i_4455: u32 = (offset + (j * 2_u32)) + 1_u32; + tx_effects_hash_inputs[i_4455] = public_data_update_requests[j].new_value; } } offset = offset + (MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX * 2_u32); for j in 0_u32..MAX_L2_TO_L1_MSGS_PER_TX { { - let i_4461: u32 = offset + j; - tx_effects_hash_inputs[i_4461] = l2ToL1Msgs[j]; + let i_4457: u32 = offset + j; + tx_effects_hash_inputs[i_4457] = l2ToL1Msgs[j]; } } offset = offset + MAX_L2_TO_L1_MSGS_PER_TX; @@ -191,21 +191,21 @@ unconstrained fn main(kernel_data: DataToHash) -> pub [Field; 2] { let new_contracts: [NewContractData; 1] = kernel_data.new_contracts; tx_effects_hash_inputs[offset] = new_contracts[0_u32].contract_address; { - let i_4464: u32 = offset + 1_u32; - tx_effects_hash_inputs[i_4464] = new_contracts[0_u32].portal_contract_address; + let i_4460: u32 = offset + 1_u32; + tx_effects_hash_inputs[i_4460] = new_contracts[0_u32].portal_contract_address; }; offset = offset + (MAX_NEW_CONTRACTS_PER_TX * 2_u32); for j in 0_u32..NUM_FIELDS_PER_SHA256 { { - let i_4466: u32 = offset + j; - tx_effects_hash_inputs[i_4466] = encryptedLogsHash[j]; + let i_4462: u32 = offset + j; + tx_effects_hash_inputs[i_4462] = encryptedLogsHash[j]; } } offset = offset + (NUM_ENCRYPTED_LOGS_HASHES_PER_TX * NUM_FIELDS_PER_SHA256); for j in 0_u32..NUM_FIELDS_PER_SHA256 { { - let i_4468: u32 = offset + j; - tx_effects_hash_inputs[i_4468] = unencryptedLogsHash[j]; + let i_4464: u32 = offset + j; + tx_effects_hash_inputs[i_4464] = unencryptedLogsHash[j]; } } offset = offset + (NUM_UNENCRYPTED_LOGS_HASHES_PER_TX * NUM_FIELDS_PER_SHA256); @@ -215,8 +215,8 @@ unconstrained fn main(kernel_data: DataToHash) -> pub [Field; 2] { let input_as_bytes: [u8; 32] = tx_effects_hash_inputs[offset].to_be_bytes(); for byte_index in 0_u32..32_u32 { { - let i_4473: u32 = (offset * 32_u32) + byte_index; - hash_input_flattened[i_4473] = input_as_bytes[byte_index]; + let i_4469: u32 = (offset * 32_u32) + byte_index; + hash_input_flattened[i_4469] = input_as_bytes[byte_index]; } } } @@ -225,11 +225,11 @@ unconstrained fn main(kernel_data: DataToHash) -> pub [Field; 2] { tx_effects_hash_inputs[TX_EFFECT_HASH_FULL_FIELDS + log_field_index].to_be_bytes(); for byte_index in 0_u32..16_u32 { { - let i_4477: u32 = ( + let i_4473: u32 = ( (TX_EFFECT_HASH_FULL_FIELDS * 32_u32) + (log_field_index * 16_u32) ) + byte_index; - hash_input_flattened[i_4477] = input_as_bytes[byte_index]; + hash_input_flattened[i_4473] = input_as_bytes[byte_index]; } } } diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/conditional_1/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/conditional_1/execute__tests__expanded.snap index 44c78ce8691..6049d258089 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/conditional_1/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/conditional_1/execute__tests__expanded.snap @@ -27,8 +27,8 @@ fn main(a: u32, mut c: [u32; 4], x: [u8; 5], result: pub [u8; 32]) { if i_u32 == a { for j in 0_u32..4_u32 { { - let i_4443: u32 = i + j; - data[i_4443] = c[(4_u32 - 1_u32) - j]; + let i_4439: u32 = i + j; + data[i_4439] = c[(4_u32 - 1_u32) - j]; }; for k in 0_u32..4_u32 { ba = ba + data[k]; diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/databus_two_calldata/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/databus_two_calldata/execute__tests__expanded.snap index 5a082100d99..345bbd3adac 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/databus_two_calldata/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/databus_two_calldata/execute__tests__expanded.snap @@ -9,8 +9,8 @@ fn main(mut x: [u32; 4], y: [u32; 3], z: [u32; 4]) -> return_data [u32; 4] { result[idx] = y[idx] + z[idx]; } { - let i_4433: u32 = x[3_u32]; - result[i_4433] = z[x[3_u32]]; + let i_4429: u32 = x[3_u32]; + result[i_4429] = z[x[3_u32]]; }; result } diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/encrypted_log_regression/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/encrypted_log_regression/execute__tests__expanded.snap index 83e226159a5..0f6d6554547 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/encrypted_log_regression/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/encrypted_log_regression/execute__tests__expanded.snap @@ -39,15 +39,15 @@ fn compute_encrypted_log( if flag { for i in 0_u32..EPH_PK_SIZE { { - let i_4446: u32 = offset + i; - encrypted_bytes[i_4446] = eph_pk_bytes[i]; + let i_4442: u32 = offset + i; + encrypted_bytes[i_4442] = eph_pk_bytes[i]; } } offset = offset + EPH_PK_SIZE; for i in 0_u32..HEADER_SIZE { { - let i_4448: u32 = offset + i; - encrypted_bytes[i_4448] = incoming_header_ciphertext[i]; + let i_4444: u32 = offset + i; + encrypted_bytes[i_4444] = incoming_header_ciphertext[i]; } } offset = offset + HEADER_SIZE; @@ -56,8 +56,8 @@ fn compute_encrypted_log( assert(size == incoming_body_ciphertext.len(), "ciphertext length mismatch"); for i in 0_u32..size { { - let i_4451: u32 = offset + i; - encrypted_bytes[i_4451] = incoming_body_ciphertext[i]; + let i_4447: u32 = offset + i; + encrypted_bytes[i_4447] = incoming_body_ciphertext[i]; } } }; diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/nested_array_dynamic/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/nested_array_dynamic/execute__tests__expanded.snap index a8d78865dec..58c8d661d6a 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/nested_array_dynamic/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/nested_array_dynamic/execute__tests__expanded.snap @@ -35,13 +35,13 @@ fn main(mut x: [Foo; 4], y: pub u32) { assert(x[3_u32].a == 50_Field); if y == 2_u32 { { - let i_4429: u32 = y - 1_u32; - x[i_4429].b = [50_Field, 51_Field, 52_Field]; + let i_4425: u32 = y - 1_u32; + x[i_4425].b = [50_Field, 51_Field, 52_Field]; } } else { { - let i_4430: u32 = y - 1_u32; - x[i_4430].b = [100_Field, 101_Field, 102_Field]; + let i_4426: u32 = y - 1_u32; + x[i_4426].b = [100_Field, 101_Field, 102_Field]; } }; assert(x[2_u32].b == [100_Field, 101_Field, 102_Field]); @@ -60,39 +60,39 @@ fn main(mut x: [Foo; 4], y: pub u32) { assert(foo_parents[1_u32].foos[1_u32].b == [5_Field, 6_Field, 21_Field]); if y == 2_u32 { { - let i_4434: u32 = y - 2_u32; - let i_4435: u32 = y - 2_u32; - foo_parents[i_4434].foos[i_4435].b = [10_Field, 9_Field, 8_Field]; + let i_4430: u32 = y - 2_u32; + let i_4431: u32 = y - 2_u32; + foo_parents[i_4430].foos[i_4431].b = [10_Field, 9_Field, 8_Field]; } } else { { - let i_4436: u32 = y - 2_u32; - let i_4437: u32 = y - 2_u32; - foo_parents[i_4436].foos[i_4437].b = [20_Field, 19_Field, 18_Field]; + let i_4432: u32 = y - 2_u32; + let i_4433: u32 = y - 2_u32; + foo_parents[i_4432].foos[i_4433].b = [20_Field, 19_Field, 18_Field]; } }; assert(foo_parents[1_u32].foos[1_u32].b == [20_Field, 19_Field, 18_Field]); assert(foo_parents[1_u32].foos[1_u32].b[2_u32] == 18_Field); if y == 3_u32 { { - let i_4438: u32 = y - 2_u32; - let i_4439: u32 = y - 2_u32; - let i_4440: u32 = y - 1_u32; - foo_parents[i_4438].foos[i_4439].b[i_4440] = 5000_Field; + let i_4434: u32 = y - 2_u32; + let i_4435: u32 = y - 2_u32; + let i_4436: u32 = y - 1_u32; + foo_parents[i_4434].foos[i_4435].b[i_4436] = 5000_Field; } } else { { - let i_4441: u32 = y - 2_u32; - let i_4442: u32 = y - 2_u32; - let i_4443: u32 = y - 1_u32; - foo_parents[i_4441].foos[i_4442].b[i_4443] = 1000_Field; + let i_4437: u32 = y - 2_u32; + let i_4438: u32 = y - 2_u32; + let i_4439: u32 = y - 1_u32; + foo_parents[i_4437].foos[i_4438].b[i_4439] = 1000_Field; } }; assert(foo_parents[1_u32].foos[1_u32].b[2_u32] == 5000_Field); { - let i_4444: u32 = y - 2_u32; - let i_4445: u32 = y - 3_u32; - foo_parents[i_4444].foos[i_4445].b = foo_parents[y - 2_u32].foos[y - 2_u32].b; + let i_4440: u32 = y - 2_u32; + let i_4441: u32 = y - 3_u32; + foo_parents[i_4440].foos[i_4441].b = foo_parents[y - 2_u32].foos[y - 2_u32].b; }; assert(foo_parents[1_u32].foos[0_u32].b == [20_Field, 19_Field, 5000_Field]); } diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/nested_array_in_slice/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/nested_array_in_slice/execute__tests__expanded.snap index 5176452e67a..55a0738fc67 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/nested_array_in_slice/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/nested_array_in_slice/execute__tests__expanded.snap @@ -48,25 +48,25 @@ fn main(y: u32) { assert(x[y].bar.inner == [109_Field, 110_Field, 111_Field]); if y != 2_u32 { { - let i_4433: u32 = y - 2_u32; - x[i_4433].a = 50_Field; + let i_4429: u32 = y - 2_u32; + x[i_4429].a = 50_Field; } } else { { - let i_4434: u32 = y - 2_u32; - x[i_4434].a = 100_Field; + let i_4430: u32 = y - 2_u32; + x[i_4430].a = 100_Field; } }; assert(x[y - 2_u32].a == 50_Field); if y == 2_u32 { { - let i_4435: u32 = y - 1_u32; - x[i_4435].b = [50_Field, 51_Field, 52_Field]; + let i_4431: u32 = y - 1_u32; + x[i_4431].b = [50_Field, 51_Field, 52_Field]; } } else { { - let i_4436: u32 = y - 1_u32; - x[i_4436].b = [100_Field, 101_Field, 102_Field]; + let i_4432: u32 = y - 1_u32; + x[i_4432].b = [100_Field, 101_Field, 102_Field]; } }; assert(x[2_u32].b == [100_Field, 101_Field, 102_Field]); diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_1144_1169_2399_6609/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_1144_1169_2399_6609/execute__tests__expanded.snap index 9d104661151..d3501daa23d 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/regression_1144_1169_2399_6609/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_1144_1169_2399_6609/execute__tests__expanded.snap @@ -36,12 +36,12 @@ fn compact_decode(input: [u8; N], length: Field) -> ([U4; 16], Field if (i as u32) < (length as u32) { let x: u8 = input[i]; { - let i_4455: u32 = (2_u32 * i) - 1_u32; - nibble[i_4455] = U4::from_u8(x >> 4_u8); + let i_4451: u32 = (2_u32 * i) - 1_u32; + nibble[i_4451] = U4::from_u8(x >> 4_u8); }; { - let i_4456: u32 = 2_u32 * i; - nibble[i_4456] = U4::from_u8(x & 15_u8); + let i_4452: u32 = 2_u32 * i; + nibble[i_4452] = U4::from_u8(x & 15_u8); } } } @@ -50,12 +50,12 @@ fn compact_decode(input: [u8; N], length: Field) -> ([U4; 16], Field if (i as u32) < ((length as u32) - 1_u32) { let x: u8 = input[i + 1_u32]; { - let i_4459: u32 = 2_u32 * i; - nibble[i_4459] = U4::from_u8(x >> 4_u8); + let i_4455: u32 = 2_u32 * i; + nibble[i_4455] = U4::from_u8(x >> 4_u8); }; { - let i_4460: u32 = (2_u32 * i) + 1_u32; - nibble[i_4460] = U4::from_u8(x & 15_u8); + let i_4456: u32 = (2_u32 * i) + 1_u32; + nibble[i_4456] = U4::from_u8(x & 15_u8); } } } diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_6674_1/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_6674_1/execute__tests__expanded.snap index 36a21c1faeb..37f96b254d0 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/regression_6674_1/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_6674_1/execute__tests__expanded.snap @@ -16,8 +16,8 @@ impl BoundedVec4 { pub fn push(&mut self, elem: Field) { { - let i_4449: u32 = self.len; - self.storage[i_4449] = elem; + let i_4445: u32 = self.len; + self.storage[i_4445] = elem; }; self.len = self.len + 1_u32; } diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_6674_2/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_6674_2/execute__tests__expanded.snap index 71117d05b62..a53c11d4529 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/regression_6674_2/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_6674_2/execute__tests__expanded.snap @@ -16,8 +16,8 @@ impl BoundedVec4 { pub fn push(&mut self, elem: Field) { { - let i_4449: u32 = self.len; - self.storage[i_4449] = elem; + let i_4445: u32 = self.len; + self.storage[i_4445] = elem; }; self.len = self.len + 1_u32; } diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/regression_capacity_tracker/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/regression_capacity_tracker/execute__tests__expanded.snap index e3799f772cc..3925801ed69 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/regression_capacity_tracker/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/regression_capacity_tracker/execute__tests__expanded.snap @@ -8,13 +8,13 @@ fn main(expected: pub Field, first: Field, input: [Field; 20]) { assert(hasher_slice[0_u32] == expected); if (expected as u32) > 10_u32 { { - let i_4431: u32 = (expected - 10_Field) as u32; - hasher_slice[i_4431] = 100_Field; + let i_4427: u32 = (expected - 10_Field) as u32; + hasher_slice[i_4427] = 100_Field; } } else { { - let i_4432: u32 = expected as u32; - hasher_slice[i_4432] = 100_Field; + let i_4428: u32 = expected as u32; + hasher_slice[i_4428] = 100_Field; } }; assert(hasher_slice[0_u32] == expected); diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/slice_dynamic_index/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/slice_dynamic_index/execute__tests__expanded.snap index 70c52a982d4..feb1d8b63f8 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/slice_dynamic_index/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/slice_dynamic_index/execute__tests__expanded.snap @@ -36,8 +36,8 @@ fn dynamic_slice_index_set_if(mut slice: [Field], x: u32, y: u32) { assert(slice[x] == 4_Field); slice[x] = slice[x] - 2_Field; { - let i_4475: u32 = x - 1_u32; - slice[i_4475] = slice[x]; + let i_4471: u32 = x - 1_u32; + slice[i_4471] = slice[x]; } } else { slice[x] = 0_Field; @@ -56,8 +56,8 @@ fn dynamic_slice_index_set_else(mut slice: [Field], x: u32, y: u32) { assert(slice[x] == 4_Field); slice[x] = slice[x] - 2_Field; { - let i_4476: u32 = x - 1_u32; - slice[i_4476] = slice[x]; + let i_4472: u32 = x - 1_u32; + slice[i_4472] = slice[x]; } } else { slice[x] = 0_Field; diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/slice_dynamic_insert/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/execution_success/slice_dynamic_insert/execute__tests__expanded.snap index 91130e90993..5c592bd81d5 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/slice_dynamic_insert/execute__tests__expanded.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/slice_dynamic_insert/execute__tests__expanded.snap @@ -21,8 +21,8 @@ fn insert(x: u32, array: [Field; 5]) { fn insert_dynamic_array(x: u32, array: [Field; 5]) { let mut value_to_insert: [Field; 5] = array; { - let i_4439: u32 = x - 1_u32; - value_to_insert[i_4439] = 10_Field; + let i_4435: u32 = x - 1_u32; + value_to_insert[i_4435] = 10_Field; }; let mut slice: [[Field; 5]] = &[array, array, array]; slice = slice.insert(x - 3_u32, value_to_insert);