From c5b9a29839667c46e2e4dcab36f63ee868de9a10 Mon Sep 17 00:00:00 2001 From: jeanmon Date: Mon, 2 Oct 2023 10:14:07 +0000 Subject: [PATCH 1/3] 2612 - add validation in native private kernel circuit of arrays in accumulated data --- .../aztec3/circuits/kernel/private/common.cpp | 40 +++++++++++++++---- .../aztec3/circuits/kernel/private/common.hpp | 2 + .../native_private_kernel_circuit_inner.cpp | 4 +- ...native_private_kernel_circuit_ordering.cpp | 2 + 4 files changed, 38 insertions(+), 10 deletions(-) diff --git a/circuits/cpp/src/aztec3/circuits/kernel/private/common.cpp b/circuits/cpp/src/aztec3/circuits/kernel/private/common.cpp index ea3ee298746..92b066d05ea 100644 --- a/circuits/cpp/src/aztec3/circuits/kernel/private/common.cpp +++ b/circuits/cpp/src/aztec3/circuits/kernel/private/common.cpp @@ -128,17 +128,35 @@ void common_validate_arrays(DummyBuilder& builder, PrivateCircuitPublicInputs const& end) +{ + // Each of the following arrays is expected to be zero-padded. + validate_array(builder, end.read_requests, "Accumulated data - Read Requests"); + validate_array(builder, end.new_commitments, "Accumulated data - New commitments"); + validate_array(builder, end.new_nullifiers, "Accumulated data - New nullifiers"); + validate_array(builder, end.nullified_commitments, "Accumulated data - Nullified commitments"); + validate_array(builder, end.private_call_stack, "Accumulated data - Private call stack"); + validate_array(builder, end.public_call_stack, "Accumulated data - Public call stack"); + validate_array(builder, end.new_l2_to_l1_msgs, "Accumulated data - New L2 to L1 messages"); +} + void common_validate_0th_nullifier(DummyBuilder& builder, CombinedAccumulatedData const& end) { builder.do_assert(end.new_nullifiers[0] != 0, @@ -146,6 +164,12 @@ void common_validate_0th_nullifier(DummyBuilder& builder, CombinedAccumulatedDat CircuitErrorCode::PRIVATE_KERNEL__0TH_NULLLIFIER_IS_ZERO); } +void common_validate_end_values(DummyBuilder& builder, CombinedAccumulatedData const& end) +{ + common_validate_end_arrays(builder, end); + common_validate_0th_nullifier(builder, end); +} + void common_update_end_values(DummyBuilder& builder, PrivateCallData const& private_call, KernelCircuitPublicInputs& public_inputs) diff --git a/circuits/cpp/src/aztec3/circuits/kernel/private/common.hpp b/circuits/cpp/src/aztec3/circuits/kernel/private/common.hpp index 97f3de0843c..755ff4ce5a0 100644 --- a/circuits/cpp/src/aztec3/circuits/kernel/private/common.hpp +++ b/circuits/cpp/src/aztec3/circuits/kernel/private/common.hpp @@ -37,6 +37,8 @@ void common_validate_read_requests(DummyBuilder& builder, MAX_READ_REQUESTS_PER_CALL> const& read_request_membership_witnesses); void common_validate_arrays(DummyBuilder& builder, PrivateCircuitPublicInputs const& app_public_inputs); +void common_validate_end_arrays(DummyBuilder& builder, CombinedAccumulatedData const& end); +void common_validate_end_values(DummyBuilder& builder, CombinedAccumulatedData const& end); void common_validate_0th_nullifier(DummyBuilder& builder, CombinedAccumulatedData const& end); void common_update_end_values(DummyBuilder& builder, diff --git a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_inner.cpp b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_inner.cpp index aac28a78a1c..62e84102dab 100644 --- a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_inner.cpp +++ b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_inner.cpp @@ -91,8 +91,6 @@ void validate_inputs(DummyCircuitBuilder& builder, PrivateKernelInputsInner builder.do_assert(start_private_call_stack_length != 0, "Cannot execute private kernel circuit with an empty private call stack", CircuitErrorCode::PRIVATE_KERNEL__PRIVATE_CALL_STACK_EMPTY); - - common_validate_0th_nullifier(builder, private_inputs.previous_kernel.public_inputs.end); } KernelCircuitPublicInputs native_private_kernel_circuit_inner(DummyCircuitBuilder& builder, @@ -101,6 +99,8 @@ KernelCircuitPublicInputs native_private_kernel_circuit_inner(DummyCircuitBu // We'll be pushing data to this during execution of this circuit. KernelCircuitPublicInputs public_inputs{}; + common_validate_end_values(builder, private_inputs.previous_kernel.public_inputs.end); + // Do this before any functions can modify the inputs. initialise_end_values(private_inputs.previous_kernel, public_inputs); diff --git a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_ordering.cpp b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_ordering.cpp index 91d8a9e3381..4d490082290 100644 --- a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_ordering.cpp +++ b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_ordering.cpp @@ -154,6 +154,8 @@ KernelCircuitPublicInputsFinal native_private_kernel_circuit_ordering( // We'll be pushing data to this during execution of this circuit. KernelCircuitPublicInputsFinal public_inputs{}; + common_validate_end_values(builder, private_inputs.previous_kernel.public_inputs.end); + // Do this before any functions can modify the inputs. initialise_end_values(private_inputs.previous_kernel, public_inputs); From d38de9f6be4f746274b8af93f1780f4e92844508 Mon Sep 17 00:00:00 2001 From: jeanmon Date: Mon, 2 Oct 2023 11:19:54 +0000 Subject: [PATCH 2/3] 2612 - add unit tests for inner and ordering private kernel circuit --- ...tive_private_kernel_circuit_inner.test.cpp | 105 +++++++++++++++ ...e_private_kernel_circuit_ordering.test.cpp | 123 ++++++++++++++++++ 2 files changed, 228 insertions(+) diff --git a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_inner.test.cpp b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_inner.test.cpp index b27ad2ebe69..16988f38d10 100644 --- a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_inner.test.cpp +++ b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_inner.test.cpp @@ -323,6 +323,111 @@ TEST_F(native_private_kernel_inner_tests, input_validation_malformed_arrays_new_ EXPECT_EQ(builder.get_first_failure().code, CircuitErrorCode::ARRAY_NOT_ZERO_RIGHT_PADDED); } +TEST_F(native_private_kernel_inner_tests, input_validation_malformed_end_arrays_read_requests) +{ + auto private_inputs = do_private_call_get_kernel_inputs_inner(false, deposit, standard_test_args()); + + std::array malformed_read_requests{ fr(0), fr(9123), fr(0), fr(12) }; + private_inputs.previous_kernel.public_inputs.end.read_requests = malformed_read_requests; + + DummyBuilder builder = DummyBuilder("private_kernel_tests__input_validation_malformed_end_arrays_read_requests"); + native_private_kernel_circuit_inner(builder, private_inputs); + + EXPECT_EQ(builder.failed(), true); + EXPECT_EQ(builder.get_first_failure().code, CircuitErrorCode::ARRAY_NOT_ZERO_RIGHT_PADDED); +} + +TEST_F(native_private_kernel_inner_tests, input_validation_malformed_end_arrays_commitments) +{ + auto private_inputs = do_private_call_get_kernel_inputs_inner(false, deposit, standard_test_args()); + + std::array malformed_commitments{ fr(0), fr(9123) }; + private_inputs.previous_kernel.public_inputs.end.new_commitments = malformed_commitments; + + DummyBuilder builder = DummyBuilder("private_kernel_tests__input_validation_malformed_end_arrays_commitments"); + native_private_kernel_circuit_inner(builder, private_inputs); + + EXPECT_EQ(builder.failed(), true); + EXPECT_EQ(builder.get_first_failure().code, CircuitErrorCode::ARRAY_NOT_ZERO_RIGHT_PADDED); +} + +TEST_F(native_private_kernel_inner_tests, input_validation_malformed_end_arrays_nullifiers) +{ + auto private_inputs = do_private_call_get_kernel_inputs_inner(false, deposit, standard_test_args()); + + std::array malformed_nullifiers{}; + malformed_nullifiers[MAX_NEW_NULLIFIERS_PER_TX - 1] = fr(12); + private_inputs.previous_kernel.public_inputs.end.new_nullifiers = malformed_nullifiers; + + DummyBuilder builder = DummyBuilder("private_kernel_tests__input_validation_malformed_end_arrays_nullifiers"); + native_private_kernel_circuit_inner(builder, private_inputs); + + EXPECT_EQ(builder.failed(), true); + EXPECT_EQ(builder.get_first_failure().code, CircuitErrorCode::ARRAY_NOT_ZERO_RIGHT_PADDED); +} + +TEST_F(native_private_kernel_inner_tests, input_validation_malformed_end_arrays_nullified_commitments) +{ + auto private_inputs = do_private_call_get_kernel_inputs_inner(false, deposit, standard_test_args()); + + std::array malformed_nullified_commitments{ fr(0), + fr(0), + EMPTY_NULLIFIED_COMMITMENT }; + private_inputs.previous_kernel.public_inputs.end.nullified_commitments = malformed_nullified_commitments; + + DummyBuilder builder = + DummyBuilder("private_kernel_tests__input_validation_malformed_arrays_end_nullified_commitments"); + native_private_kernel_circuit_inner(builder, private_inputs); + + EXPECT_EQ(builder.failed(), true); + EXPECT_EQ(builder.get_first_failure().code, CircuitErrorCode::ARRAY_NOT_ZERO_RIGHT_PADDED); +} + +TEST_F(native_private_kernel_inner_tests, input_validation_malformed_end_arrays_private_call_stack) +{ + auto private_inputs = do_private_call_get_kernel_inputs_inner(false, deposit, standard_test_args()); + + std::array malformed_private_call_stack{ fr(0), fr(888) }; + private_inputs.previous_kernel.public_inputs.end.private_call_stack = malformed_private_call_stack; + + DummyBuilder builder = + DummyBuilder("private_kernel_tests__input_validation_malformed_end_arrays_private_call_stack"); + native_private_kernel_circuit_inner(builder, private_inputs); + + EXPECT_EQ(builder.failed(), true); + EXPECT_EQ(builder.get_first_failure().code, CircuitErrorCode::ARRAY_NOT_ZERO_RIGHT_PADDED); +} + +TEST_F(native_private_kernel_inner_tests, input_validation_malformed_end_arrays_public_call_stack) +{ + auto private_inputs = do_private_call_get_kernel_inputs_inner(false, deposit, standard_test_args()); + + std::array malformed_public_call_stack{ fr(0), fr(888) }; + private_inputs.previous_kernel.public_inputs.end.public_call_stack = malformed_public_call_stack; + + DummyBuilder builder = + DummyBuilder("private_kernel_tests__input_validation_malformed_end_arrays_public_call_stack"); + native_private_kernel_circuit_inner(builder, private_inputs); + + EXPECT_EQ(builder.failed(), true); + EXPECT_EQ(builder.get_first_failure().code, CircuitErrorCode::ARRAY_NOT_ZERO_RIGHT_PADDED); +} + +TEST_F(native_private_kernel_inner_tests, input_validation_malformed_end_arrays_l2_to_l1_msgs) +{ + auto private_inputs = do_private_call_get_kernel_inputs_inner(false, deposit, standard_test_args()); + + std::array malformed_l2_to_l1_msgs{}; + malformed_l2_to_l1_msgs[MAX_NEW_L2_TO_L1_MSGS_PER_TX - 1] = fr(1); + private_inputs.previous_kernel.public_inputs.end.new_l2_to_l1_msgs = malformed_l2_to_l1_msgs; + + DummyBuilder builder = DummyBuilder("private_kernel_tests__input_validation_malformed_end_arrays_l2_to_l1_msgs"); + native_private_kernel_circuit_inner(builder, private_inputs); + + EXPECT_EQ(builder.failed(), true); + EXPECT_EQ(builder.get_first_failure().code, CircuitErrorCode::ARRAY_NOT_ZERO_RIGHT_PADDED); +} + TEST_F(native_private_kernel_inner_tests, private_kernel_should_fail_if_aggregating_too_many_commitments) { // Negative test to check if push_array_to_array fails if two many commitments are merged together diff --git a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_ordering.test.cpp b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_ordering.test.cpp index 3af7fcfd34c..e0fa73e550a 100644 --- a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_ordering.test.cpp +++ b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_ordering.test.cpp @@ -384,4 +384,127 @@ TEST_F(native_private_kernel_ordering_tests, 0th_nullifier_zero_fails) ASSERT_EQ(failure.code, CircuitErrorCode::PRIVATE_KERNEL__0TH_NULLLIFIER_IS_ZERO); } +TEST_F(native_private_kernel_ordering_tests, input_validation_malformed_end_arrays_read_requests) +{ + auto private_inputs_inner = do_private_call_get_kernel_inputs_inner(false, deposit, standard_test_args()); + + std::array malformed_read_requests{ fr(0), fr(9123), fr(0), fr(12) }; + auto& previous_kernel = private_inputs_inner.previous_kernel; + previous_kernel.public_inputs.end.read_requests = malformed_read_requests; + PrivateKernelInputsOrdering private_inputs{ .previous_kernel = previous_kernel }; + + DummyBuilder builder = + DummyBuilder("native_private_kernel_ordering_tests__input_validation_malformed_end_arrays_read_requests"); + native_private_kernel_circuit_ordering(builder, private_inputs); + + EXPECT_EQ(builder.failed(), true); + EXPECT_EQ(builder.get_first_failure().code, CircuitErrorCode::ARRAY_NOT_ZERO_RIGHT_PADDED); +} + +TEST_F(native_private_kernel_ordering_tests, input_validation_malformed_end_arrays_commitments) +{ + auto private_inputs_inner = do_private_call_get_kernel_inputs_inner(false, deposit, standard_test_args()); + + std::array malformed_commitments{ fr(0), fr(9123) }; + auto& previous_kernel = private_inputs_inner.previous_kernel; + previous_kernel.public_inputs.end.new_commitments = malformed_commitments; + PrivateKernelInputsOrdering private_inputs{ .previous_kernel = previous_kernel }; + + DummyBuilder builder = + DummyBuilder("native_private_kernel_ordering_tests__input_validation_malformed_end_arrays_commitments"); + native_private_kernel_circuit_ordering(builder, private_inputs); + + EXPECT_EQ(builder.failed(), true); + EXPECT_EQ(builder.get_first_failure().code, CircuitErrorCode::ARRAY_NOT_ZERO_RIGHT_PADDED); +} + +TEST_F(native_private_kernel_ordering_tests, input_validation_malformed_end_arrays_nullifiers) +{ + auto private_inputs_inner = do_private_call_get_kernel_inputs_inner(false, deposit, standard_test_args()); + + std::array malformed_nullifiers{}; + malformed_nullifiers[MAX_NEW_NULLIFIERS_PER_TX - 1] = fr(12); + auto& previous_kernel = private_inputs_inner.previous_kernel; + previous_kernel.public_inputs.end.new_nullifiers = malformed_nullifiers; + PrivateKernelInputsOrdering private_inputs{ .previous_kernel = previous_kernel }; + + DummyBuilder builder = + DummyBuilder("native_private_kernel_ordering_tests__input_validation_malformed_end_arrays_nullifiers"); + native_private_kernel_circuit_ordering(builder, private_inputs); + + EXPECT_EQ(builder.failed(), true); + EXPECT_EQ(builder.get_first_failure().code, CircuitErrorCode::ARRAY_NOT_ZERO_RIGHT_PADDED); +} + +TEST_F(native_private_kernel_ordering_tests, input_validation_malformed_end_arrays_nullified_commitments) +{ + auto private_inputs_inner = do_private_call_get_kernel_inputs_inner(false, deposit, standard_test_args()); + + std::array malformed_nullified_commitments{ fr(0), + fr(0), + EMPTY_NULLIFIED_COMMITMENT }; + auto& previous_kernel = private_inputs_inner.previous_kernel; + previous_kernel.public_inputs.end.nullified_commitments = malformed_nullified_commitments; + PrivateKernelInputsOrdering private_inputs{ .previous_kernel = previous_kernel }; + + DummyBuilder builder = DummyBuilder( + "native_private_kernel_ordering_tests__input_validation_malformed_end_arrays_nullified_commitments"); + native_private_kernel_circuit_ordering(builder, private_inputs); + + EXPECT_EQ(builder.failed(), true); + EXPECT_EQ(builder.get_first_failure().code, CircuitErrorCode::ARRAY_NOT_ZERO_RIGHT_PADDED); +} + +TEST_F(native_private_kernel_ordering_tests, input_validation_malformed_end_arrays_private_call_stack) +{ + auto private_inputs_inner = do_private_call_get_kernel_inputs_inner(false, deposit, standard_test_args()); + + std::array malformed_private_call_stack{ fr(0), fr(888) }; + auto& previous_kernel = private_inputs_inner.previous_kernel; + previous_kernel.public_inputs.end.private_call_stack = malformed_private_call_stack; + PrivateKernelInputsOrdering private_inputs{ .previous_kernel = previous_kernel }; + + DummyBuilder builder = + DummyBuilder("native_private_kernel_ordering_tests__input_validation_malformed_end_arrays_private_call_stack"); + native_private_kernel_circuit_ordering(builder, private_inputs); + + EXPECT_EQ(builder.failed(), true); + EXPECT_EQ(builder.get_first_failure().code, CircuitErrorCode::ARRAY_NOT_ZERO_RIGHT_PADDED); +} + +TEST_F(native_private_kernel_ordering_tests, input_validation_malformed_end_arrays_public_call_stack) +{ + auto private_inputs_inner = do_private_call_get_kernel_inputs_inner(false, deposit, standard_test_args()); + + std::array malformed_public_call_stack{ fr(0), fr(888) }; + auto& previous_kernel = private_inputs_inner.previous_kernel; + previous_kernel.public_inputs.end.public_call_stack = malformed_public_call_stack; + PrivateKernelInputsOrdering private_inputs{ .previous_kernel = previous_kernel }; + + DummyBuilder builder = + DummyBuilder("native_private_kernel_ordering_tests__input_validation_malformed_end_arrays_public_call_stack"); + native_private_kernel_circuit_ordering(builder, private_inputs); + + EXPECT_EQ(builder.failed(), true); + EXPECT_EQ(builder.get_first_failure().code, CircuitErrorCode::ARRAY_NOT_ZERO_RIGHT_PADDED); +} + +TEST_F(native_private_kernel_ordering_tests, input_validation_malformed_end_arrays_l2_to_l1_msgs) +{ + auto private_inputs_inner = do_private_call_get_kernel_inputs_inner(false, deposit, standard_test_args()); + + std::array malformed_l2_to_l1_msgs{}; + malformed_l2_to_l1_msgs[MAX_NEW_L2_TO_L1_MSGS_PER_TX - 1] = fr(1); + auto& previous_kernel = private_inputs_inner.previous_kernel; + previous_kernel.public_inputs.end.new_l2_to_l1_msgs = malformed_l2_to_l1_msgs; + PrivateKernelInputsOrdering private_inputs{ .previous_kernel = previous_kernel }; + + DummyBuilder builder = + DummyBuilder("native_private_kernel_ordering_tests__input_validation_malformed_end_arrays_l2_to_l1_msgs"); + native_private_kernel_circuit_ordering(builder, private_inputs); + + EXPECT_EQ(builder.failed(), true); + EXPECT_EQ(builder.get_first_failure().code, CircuitErrorCode::ARRAY_NOT_ZERO_RIGHT_PADDED); +} + } // namespace aztec3::circuits::kernel::private_kernel From c237251e574c1ef882550a706c0e754d182bcf3f Mon Sep 17 00:00:00 2001 From: jeanmon Date: Mon, 2 Oct 2023 15:34:14 +0000 Subject: [PATCH 3/3] 2612 - review comments --- .../cpp/src/aztec3/circuits/kernel/private/common.cpp | 10 +++++----- .../cpp/src/aztec3/circuits/kernel/private/common.hpp | 6 +++--- .../private/native_private_kernel_circuit_inner.cpp | 2 +- .../private/native_private_kernel_circuit_ordering.cpp | 4 +--- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/circuits/cpp/src/aztec3/circuits/kernel/private/common.cpp b/circuits/cpp/src/aztec3/circuits/kernel/private/common.cpp index 92b066d05ea..29d1d020a2d 100644 --- a/circuits/cpp/src/aztec3/circuits/kernel/private/common.cpp +++ b/circuits/cpp/src/aztec3/circuits/kernel/private/common.cpp @@ -145,7 +145,7 @@ void common_validate_arrays(DummyBuilder& builder, PrivateCircuitPublicInputs const& end) +void common_validate_previous_kernel_arrays(DummyBuilder& builder, CombinedAccumulatedData const& end) { // Each of the following arrays is expected to be zero-padded. validate_array(builder, end.read_requests, "Accumulated data - Read Requests"); @@ -157,17 +157,17 @@ void common_validate_end_arrays(DummyBuilder& builder, CombinedAccumulatedData const& end) +void common_validate_previous_kernel_0th_nullifier(DummyBuilder& builder, CombinedAccumulatedData const& end) { builder.do_assert(end.new_nullifiers[0] != 0, "The 0th nullifier in the accumulated nullifier array is zero", CircuitErrorCode::PRIVATE_KERNEL__0TH_NULLLIFIER_IS_ZERO); } -void common_validate_end_values(DummyBuilder& builder, CombinedAccumulatedData const& end) +void common_validate_previous_kernel_values(DummyBuilder& builder, CombinedAccumulatedData const& end) { - common_validate_end_arrays(builder, end); - common_validate_0th_nullifier(builder, end); + common_validate_previous_kernel_arrays(builder, end); + common_validate_previous_kernel_0th_nullifier(builder, end); } void common_update_end_values(DummyBuilder& builder, diff --git a/circuits/cpp/src/aztec3/circuits/kernel/private/common.hpp b/circuits/cpp/src/aztec3/circuits/kernel/private/common.hpp index 755ff4ce5a0..4cd4a1793f8 100644 --- a/circuits/cpp/src/aztec3/circuits/kernel/private/common.hpp +++ b/circuits/cpp/src/aztec3/circuits/kernel/private/common.hpp @@ -37,9 +37,9 @@ void common_validate_read_requests(DummyBuilder& builder, MAX_READ_REQUESTS_PER_CALL> const& read_request_membership_witnesses); void common_validate_arrays(DummyBuilder& builder, PrivateCircuitPublicInputs const& app_public_inputs); -void common_validate_end_arrays(DummyBuilder& builder, CombinedAccumulatedData const& end); -void common_validate_end_values(DummyBuilder& builder, CombinedAccumulatedData const& end); -void common_validate_0th_nullifier(DummyBuilder& builder, CombinedAccumulatedData const& end); +void common_validate_previous_kernel_arrays(DummyBuilder& builder, CombinedAccumulatedData const& end); +void common_validate_previous_kernel_values(DummyBuilder& builder, CombinedAccumulatedData const& end); +void common_validate_previous_kernel_0th_nullifier(DummyBuilder& builder, CombinedAccumulatedData const& end); void common_update_end_values(DummyBuilder& builder, PrivateCallData const& private_call, diff --git a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_inner.cpp b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_inner.cpp index 62e84102dab..9d3268e7d6f 100644 --- a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_inner.cpp +++ b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_inner.cpp @@ -99,7 +99,7 @@ KernelCircuitPublicInputs native_private_kernel_circuit_inner(DummyCircuitBu // We'll be pushing data to this during execution of this circuit. KernelCircuitPublicInputs public_inputs{}; - common_validate_end_values(builder, private_inputs.previous_kernel.public_inputs.end); + common_validate_previous_kernel_values(builder, private_inputs.previous_kernel.public_inputs.end); // Do this before any functions can modify the inputs. initialise_end_values(private_inputs.previous_kernel, public_inputs); diff --git a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_ordering.cpp b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_ordering.cpp index 4d490082290..3576b59e1c7 100644 --- a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_ordering.cpp +++ b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit_ordering.cpp @@ -154,13 +154,11 @@ KernelCircuitPublicInputsFinal native_private_kernel_circuit_ordering( // We'll be pushing data to this during execution of this circuit. KernelCircuitPublicInputsFinal public_inputs{}; - common_validate_end_values(builder, private_inputs.previous_kernel.public_inputs.end); + common_validate_previous_kernel_values(builder, private_inputs.previous_kernel.public_inputs.end); // Do this before any functions can modify the inputs. initialise_end_values(private_inputs.previous_kernel, public_inputs); - common_validate_0th_nullifier(builder, private_inputs.previous_kernel.public_inputs.end); - // TODO(https://github.com/AztecProtocol/aztec-packages/issues/1486): validate that `len(new_nullifiers) == // len(nullified_commitments)`