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: constraint count regression introduced in commit 53f652b #53

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

iAmMichaelConnor
Copy link
Collaborator

Changes in #44 inadvertently increased gate counts. This seems to fix it.

@iAmMichaelConnor iAmMichaelConnor changed the title Mc/reduce gate counts fix: constraint count regression introduced in commit 53f652b Nov 14, 2024
@@ -212,18 +212,17 @@ where
unconstrained fn __batch_invert<let M: u32>(x: [Self; M]) -> [Self; M] {
let params = Params::get_params();
assert(params.has_multiplicative_inverse);
__batch_invert::<_, MOD_BITS, _>(params, x.map(|bn| Self::get_limbs_slice(bn).as_array()))
.map(|limbs| Self { limbs })
__batch_invert::<_, MOD_BITS, _>(params, x.map(|bn: Self| bn.limbs)).map(|limbs| {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I hadn't appreciated you could put type annotations inside the closure |bn: T|. Pretty cool.

Copy link
Contributor

@kashbrti kashbrti left a comment

Choose a reason for hiding this comment

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

lgtm

@kashbrti kashbrti merged commit d81d5fa into main Nov 15, 2024
5 checks passed
@github-actions github-actions bot mentioned this pull request Nov 15, 2024
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.

2 participants