From 65640bae25ed4b2b30d3b9defb7008759deb3985 Mon Sep 17 00:00:00 2001 From: HaoXuan40404 <444649358@qq.com> Date: Fri, 18 Sep 2020 17:09:46 +0800 Subject: [PATCH] catch false in range proof --- crypto/src/zkp.rs | 13 ++----------- solution/verifiable_confidential_ledger/src/main.rs | 2 +- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/crypto/src/zkp.rs b/crypto/src/zkp.rs index caac841..a6426f8 100644 --- a/crypto/src/zkp.rs +++ b/crypto/src/zkp.rs @@ -135,13 +135,7 @@ pub fn verify_value_range_with_blinding_basepoint( RANGE_SIZE_IN_BITS, ) { Ok(_) => true, - Err(e) => { - wedpr_println!( - "RangeProof verify_single failed!, result = {:?}", - e - ); - return false; - }, + Err(_) => false, } } @@ -225,10 +219,7 @@ pub fn verify_value_range_in_batch( RANGE_SIZE_IN_BITS, ) { Ok(_) => true, - Err(_) => { - wedpr_println!("RangeProof verify_multiple failed"); - return false; - }, + Err(_) => false, } } diff --git a/solution/verifiable_confidential_ledger/src/main.rs b/solution/verifiable_confidential_ledger/src/main.rs index 2ca7c36..1cd85e4 100644 --- a/solution/verifiable_confidential_ledger/src/main.rs +++ b/solution/verifiable_confidential_ledger/src/main.rs @@ -454,7 +454,7 @@ fn wait_for_input() -> String { std::io::stdin() .read_line(&mut input) .expect("Failed to read line."); - input.trim().to_string() + input.trim().to_string() } // In this demo, we set the upper limit of input value to 10000.