Skip to content

Commit

Permalink
fix: promise check in range statement (#48)
Browse files Browse the repository at this point in the history
Range statement initialization requires the number of minimum value
promises to match the number of commitments. There's currently a logic
error that renders this check incorrect.

This PR fixes the logic. A test will be included in a [broader test
PR](#47), but the
logic change is here for scope.
  • Loading branch information
AaronFeickert committed Jul 21, 2023
1 parent d495fb2 commit 3e0008e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/range_statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl<P: Compressable + FromUniformBytes + Clone + Precomputable> RangeStatement<
"Number of commitments must be a power of two".to_string(),
));
}
if !minimum_value_promises.len() == commitments.len() {
if minimum_value_promises.len() != commitments.len() {
return Err(ProofError::InvalidArgument(
"Incorrect number of minimum value promises".to_string(),
));
Expand Down

0 comments on commit 3e0008e

Please sign in to comment.