Skip to content

Avoid unexpected infinity when aggregating pub keys - #65

Merged
nulltea merged 3 commits into
mainfrom
nulltea/pk_aggr_avoid_infinity
Mar 5, 2024
Merged

Avoid unexpected infinity when aggregating pub keys #65
nulltea merged 3 commits into
mainfrom
nulltea/pk_aggr_avoid_infinity

Conversation

@nulltea

@nulltea nulltea commented Feb 27, 2024

Copy link
Copy Markdown
Member

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

ec2 commented Mar 4, 2024

Copy link
Copy Markdown
Contributor

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
@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