From 3e95bfad2765b90abc48986af37372e7b389dee5 Mon Sep 17 00:00:00 2001 From: samkim-crypto Date: Sun, 19 Nov 2023 10:37:00 +0900 Subject: [PATCH] forbid 0-bit range proof verification --- zk-token-sdk/src/range_proof/inner_product.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zk-token-sdk/src/range_proof/inner_product.rs b/zk-token-sdk/src/range_proof/inner_product.rs index 535d8d96335cc9..baecef78d7b076 100644 --- a/zk-token-sdk/src/range_proof/inner_product.rs +++ b/zk-token-sdk/src/range_proof/inner_product.rs @@ -205,7 +205,7 @@ impl InnerProductProof { transcript: &mut Transcript, ) -> Result<(Vec, Vec, Vec), RangeProofVerificationError> { let lg_n = self.L_vec.len(); - if lg_n >= 32 { + if lg_n == 0 || lg_n >= 32 { // 4 billion multiplications should be enough for anyone // and this check prevents overflow in 1<