-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: range check arbitrary size columns #473
base: main
Are you sure you want to change the base?
Conversation
@@ -5,6 +5,7 @@ use bitwise_verification::{verify_constant_abs_decomposition, verify_constant_si | |||
mod bitwise_verification_test; | |||
mod sign_expr; | |||
pub(crate) use sign_expr::{prover_evaluate_sign, result_evaluate_sign, verifier_evaluate_sign}; | |||
#[allow(clippy::needless_range_loop)] // keep the loop for readability for now, refactor later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change this back immediately in the next PR, this was super important to keep for now so that we can understand the loops in the range check functions
@@ -137,8 +146,28 @@ mod tests { | |||
} | |||
|
|||
#[test] | |||
fn we_can_prove_a_range_check_with_range_0_to_256() { | |||
let data = owned_table([scalar("a", 0..256)]); | |||
#[allow(clippy::cast_sign_loss)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is added because the range used to index the scalars while creating the owned table can be negative but here it doesnt matter because its testing positive ranges only and we cant create a Scalar from but Uints
Rationale for this change
Currently, it is possible to argue the correct ranges of scalars up to the word value size, but anything below or beyond this value (currently 256 for byte sized words) will fail to verify. This PR expands range check on a scalar column to arbitrary lengths.
What changes are included in this PR?
Are these changes tested?