Skip to content
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

Add short range check to lookup_range_check util #132

Merged
merged 3 commits into from
Jun 29, 2021

Conversation

therealyingtong
Copy link
Contributor

@therealyingtong therealyingtong commented Jun 25, 2021

This PR introduces a range check for field elements <= K bits, using two lookups in a K-bit table.

This also introduces a strict mode for the full-length lookup (for field elements greater than K bits) to constrain the final running sum to 0.

Also introduce a "strict" mode for the full-length lookup, where
"true" requires the field element to be within num_words * K bits,
whereas "false" does not.
@therealyingtong therealyingtong force-pushed the patch-lookup-range-check branch from 6450edf to c43c91b Compare June 25, 2021 07:07
Copy link
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

Copy link
Contributor

@daira daira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

Copy link
Contributor

@daira daira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, meant to approve :-)

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: str4d <jack@electriccoin.co>
@codecov-commenter
Copy link

Codecov Report

Merging #132 (209e6a1) into main (b85c520) will increase coverage by 2.30%.
The diff coverage is 80.70%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #132      +/-   ##
==========================================
+ Coverage   81.44%   83.74%   +2.30%     
==========================================
  Files          38       51      +13     
  Lines        2430     4299    +1869     
==========================================
+ Hits         1979     3600    +1621     
- Misses        451      699     +248     
Impacted Files Coverage Δ
src/circuit/gadget/poseidon.rs 67.34% <0.00%> (-2.05%) ⬇️
src/circuit/gadget/utilities.rs 85.00% <ø> (+20.00%) ⬆️
src/constants/load.rs 0.00% <0.00%> (ø)
src/primitives/poseidon.rs 79.64% <0.00%> (-0.89%) ⬇️
src/test_vectors/note_encryption.rs 100.00% <ø> (ø)
src/bundle.rs 42.50% <5.88%> (-2.27%) ⬇️
src/circuit.rs 87.83% <33.33%> (-2.44%) ⬇️
src/primitives/redpallas.rs 61.11% <33.33%> (-5.56%) ⬇️
src/tree.rs 78.16% <58.90%> (+28.16%) ⬆️
src/builder.rs 66.28% <63.15%> (+0.02%) ⬆️
... and 56 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update af335ff...209e6a1. Read the comment docs.

@str4d str4d merged commit 3ecd0a1 into main Jun 29, 2021
@str4d str4d deleted the patch-lookup-range-check branch June 29, 2021 09:38
@str4d str4d restored the patch-lookup-range-check branch June 29, 2021 09:40
@str4d str4d deleted the patch-lookup-range-check branch June 29, 2021 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants