From 626c6b2b27138b00084edcfde811dde4d41a7753 Mon Sep 17 00:00:00 2001 From: Timofey Luin Date: Fri, 10 May 2024 15:54:02 +0200 Subject: [PATCH] disallow unassigned witness --- halo2-ecc/src/ecc/hash_to_curve.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/halo2-ecc/src/ecc/hash_to_curve.rs b/halo2-ecc/src/ecc/hash_to_curve.rs index 998c465e..d4fc3587 100644 --- a/halo2-ecc/src/ecc/hash_to_curve.rs +++ b/halo2-ecc/src/ecc/hash_to_curve.rs @@ -392,9 +392,8 @@ impl ExpandMessageChip for ExpandMsgXmd { let assigned_msg = msg .map(|cell| match cell { QuantumCell::Existing(v) => v, - QuantumCell::Witness(v) => thread_pool.main().load_witness(v), QuantumCell::Constant(v) => thread_pool.main().load_constant(v), - _ => unreachable!(), + _ => panic!("passing unassigned witness to this function is insecure"), }) .collect_vec();