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

Avoid unexpected infinity when aggregating pub keys #65

Merged
merged 3 commits into from
Mar 5, 2024

Conversation

nulltea
Copy link
Member

@nulltea nulltea commented Feb 27, 2024

Issue

If a bad r is sampled and used to initiate an accumulator, then the resulting agg_pubkey - r could be the point at infinity, which would likely result in the signature validation failing. However, this is a very unlikely scenario.

Fix

Aggregate from PK[0] instead of random point. Though since participation[0] could false we need to set

let acc = CMOV(PK[0], G1::Idenity, participation[0])`

Question

Is it safe to use identity? The halo2lib API actually prohibits implicitly assigning identity as constant, though allows it as a witness.

@ec2
Copy link
Member

ec2 commented Mar 4, 2024

That's actually something I thought about and forgot to ask... Why was it originally a random point? I've seen this done in halo2-lib as well for other stuff.

@nulltea nulltea merged commit 98a9362 into main Mar 5, 2024
2 checks passed
@nulltea nulltea deleted the nulltea/pk_aggr_avoid_infinity branch March 5, 2024 13:31
nulltea added a commit that referenced this pull request Apr 3, 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