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

Reduce constant values by the modulus #205

Merged
merged 1 commit into from
Dec 17, 2021
Merged

Conversation

ivokub
Copy link
Collaborator

@ivokub ivokub commented Dec 16, 2021

The internal method which computes the constants in the constraint system didn't reduce the integers by the modulus.

Closes #203. Needs to be ported on top of #200.

@ivokub ivokub self-assigned this Dec 16, 2021
@ivokub ivokub linked an issue Dec 16, 2021 that may be closed by this pull request
@ivokub ivokub marked this pull request as draft December 16, 2021 15:56
@ivokub ivokub force-pushed the fix/constant-mod-reduction branch from 1572061 to a64b624 Compare December 17, 2021 10:57
@ivokub ivokub marked this pull request as ready for review December 17, 2021 13:55
@ivokub ivokub force-pushed the fix/constant-mod-reduction branch from a64b624 to b3b6ae2 Compare December 17, 2021 14:14
@ivokub
Copy link
Collaborator Author

ivokub commented Dec 17, 2021

I added modulo reduction to cs.reduce method -- in constructed circuits it results in 10% performance loss and 20% more allocations. However, it is anticipated that we can get it back with generics, when we can use fr.Element for representing coefficients.

@ivokub ivokub merged commit d3169e4 into develop Dec 17, 2021
@ivokub ivokub deleted the fix/constant-mod-reduction branch December 17, 2021 16:27
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.

Unexpected behaviour with api.Select() and api.ToBinary()
2 participants