Skip to content

Conversation

@davidnevadoc
Copy link

@davidnevadoc davidnevadoc commented Dec 15, 2023

Description

The desiarlization of a VK involves recovering the circuit log size parameter k. This value is read directly as a u32 without any checks. Its maximum allowed value is then ~2^( 2^32), which can become an issue since it is used later in the desiarliazation to process the selector by initializing vectors of size 2^k:
https://github.com/input-output-hk/halo2/blob/b61d14bc15fd8692415f3dbbaa737a088ea57400/halo2_proofs/src/plonk.rs#L125C36-L125C36

There is a theoretic limitation of this value by the 2-adicity of the scalar field of the curves we use. All of the curves have a 2-adicity <=32.

Changes

Add a check that ensures k <=32.

@davidnevadoc davidnevadoc marked this pull request as ready for review December 15, 2023 17:36
@davidnevadoc davidnevadoc marked this pull request as draft December 15, 2023 17:37
@davidnevadoc davidnevadoc marked this pull request as ready for review December 15, 2023 17:48
@davidnevadoc davidnevadoc changed the title Fix Verifier Key desrialization. Fix Verifier Key deserialization. Jan 3, 2024
@iquerejeta
Copy link

@iquerejeta iquerejeta closed this Mar 12, 2024
iquerejeta added a commit that referenced this pull request May 8, 2024
…codecov/codecov-action-3.1.4

chore(deps): bump codecov/codecov-action from 3.1.0 to 3.1.4
dkaidalov pushed a commit that referenced this pull request Jul 1, 2025
dkaidalov pushed a commit that referenced this pull request Jul 1, 2025
* Compare polynomials and polynomial commitments by reference.
Issue #1

Not permit duplicate queries
Issue #3

* Add Length of PIs to the transcript
Issue #2

* Check trailing bytes
Issue #6

* Panic if two points are equals in lagrange_interpolate.
Issue #10

* Hash the byte representation of the VK in the transcript Issue #5

We do not add the architecture, as the verifier is already parametrised by that.

* Consistency in polynomial multiplication Issue #7

We mutate the polynomial (with all zeroes) to be consistent with the behaviour.

* Make commitment homomorphic, and don't send evals of pieces - Issue#0
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