Skip to content

Commit

Permalink
forbid 0-bit range proof verification
Browse files Browse the repository at this point in the history
  • Loading branch information
samkim-crypto committed Nov 19, 2023
1 parent d2e4163 commit 3e95bfa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zk-token-sdk/src/range_proof/inner_product.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ impl InnerProductProof {
transcript: &mut Transcript,
) -> Result<(Vec<Scalar>, Vec<Scalar>, Vec<Scalar>), 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<<lg_n below.
return Err(RangeProofVerificationError::InvalidBitSize);
Expand Down

0 comments on commit 3e95bfa

Please sign in to comment.