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

fix(emulated): enforce widths of packed limbs #368

Merged
merged 2 commits into from
Sep 14, 2022
Merged

Conversation

ivokub
Copy link
Collaborator

@ivokub ivokub commented Sep 13, 2022

When constructing a new emulated element using PackLimbs, we manually checked that the whole width of the constructed element corresponds to the modulus. However, PackLimbs was only used in contexts where we constructed an element from a single limb. Then it makes more sense to check only that it is constructed from a limb which is in range.

@ivokub ivokub added the bug Something isn't working label Sep 13, 2022
@ivokub ivokub added this to the v0.8.0 milestone Sep 13, 2022
@ivokub ivokub requested a review from gbotrel September 13, 2022 22:29
@ivokub ivokub self-assigned this Sep 13, 2022
@ivokub
Copy link
Collaborator Author

ivokub commented Sep 13, 2022

The tests failed due to stats difference. It seems that this fix increases the number of internal variables and constraints for field emulation stats circuit. But after reviewing it seems that it is correct as previously the limbs output by hints were not width-constrained. Now they are implicitly constrained by the PackLimbs function.

@ivokub ivokub merged commit f7c7a85 into develop Sep 14, 2022
@ivokub ivokub deleted the fix/enforce-limbs branch September 14, 2022 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants