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 91372b05f09e..77a8c7cfa65b 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 @@ -745,4 +745,20 @@ TEST_F(native_private_kernel_inner_tests, native_logs_are_hashed_as_expected) ASSERT_EQ(public_inputs.end.unencrypted_logs_hash, expected_unencrypted_logs_hash); } +TEST_F(native_private_kernel_inner_tests, 0th_nullifier_zero_fails) +{ + auto private_inputs = do_private_call_get_kernel_inputs_inner(false, deposit, standard_test_args()); + + // Change the 0th nullifier to be zero. + private_inputs.previous_kernel.public_inputs.end.new_nullifiers[0] = 0; + + // Invoke the native private kernel circuit + DummyBuilder builder = DummyBuilder("private_kernel_tests__0th_nullifier_zero_fails"); + native_private_kernel_circuit_inner(builder, private_inputs); + + // Assertion checks + EXPECT_TRUE(builder.failed()); + EXPECT_EQ(builder.get_first_failure().code, CircuitErrorCode::PRIVATE_KERNEL__0TH_NULLLIFIER_IS_ZERO); +} + } // namespace aztec3::circuits::kernel::private_kernel 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 829366423c8e..3af7fcfd34c2 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 @@ -367,4 +367,21 @@ TEST_F(native_private_kernel_ordering_tests, native_empty_nullified_commitment_m ASSERT_TRUE(array_length(public_inputs.end.new_nullifiers) == 1); } +TEST_F(native_private_kernel_ordering_tests, 0th_nullifier_zero_fails) +{ + auto private_inputs_inner = do_private_call_get_kernel_inputs_inner(false, deposit, standard_test_args()); + + std::array new_nullifiers{}; + auto& previous_kernel = private_inputs_inner.previous_kernel; + previous_kernel.public_inputs.end.new_nullifiers = new_nullifiers; + PrivateKernelInputsOrdering private_inputs{ .previous_kernel = previous_kernel }; + + DummyBuilder builder = DummyBuilder("native_private_kernel_ordering_tests__0th_nullifier_zero_fails"); + auto public_inputs = native_private_kernel_circuit_ordering(builder, private_inputs); + + ASSERT_TRUE(builder.failed()); + auto failure = builder.get_first_failure(); + ASSERT_EQ(failure.code, CircuitErrorCode::PRIVATE_KERNEL__0TH_NULLLIFIER_IS_ZERO); +} + } // namespace aztec3::circuits::kernel::private_kernel