Repository navigation
Conversation
… arkworks, registry and malformed-input tests
The syscall takes all-zero bytes as the identity and hands anything else to arkworks' uncompressed decoding, which reads serialization flags from the top two bits of `y` before looking at the coordinates: `0x40` yields the identity whatever `x` holds, `0x80` is stripped and the point decodes normally. So a key whose α (or −β, −γ, −δ) carries the infinity flag is not all-zero, passes the identity test in `validate_for_publish`, and is then accepted by the pairing syscall as the identity; and every point has a second encoding, giving one key two bodies and two addresses. The strict converter already rejected all of these, so converter-generated test inputs never reached them. Both flag bits put the coordinate above 2^254 > p, so requiring every coordinate to be < p rejects both and leaves each point one encoding. `Proof::from_bytes` now checks A, B and C (eight 32-byte compares, about 80 CU, with their own error code 9) and `validate_for_publish` checks the whole body ahead of the identity tests. Regression tests at every layer: the point module, proof construction, publish validation, the converter agreeing with the verifier on canonicity, and the program's Publish and Verify paths under Mollusk. CU tables re-measured. Fixes solana-program#6
# Conflicts: # README.md # docs/cu-budget.md # docs/design.md # groth16-verify/src/constants.rs # groth16-verify/src/error.rs # groth16-verify/src/lib.rs # groth16-verify/src/proof.rs # groth16-verify/src/validation.rs # program/src/error.rs # program/tests/common/mod.rs # program/tests/malformed.rs # program/tests/registry.rs # tools/convert/src/wire.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.