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

Mismatch between to_field_elements on curve points and AllocVar implementation #705

Open
paberr opened this issue Nov 23, 2023 · 0 comments

Comments

@paberr
Copy link
Contributor

paberr commented Nov 23, 2023

I've noticed that to_field_elements() will always return an affine representation of the point:

Affine::from(*self).to_field_elements()

However, this is in contrast to how I can allocate a curve point. AllocVar is only implemented for ProjectiveVar and also requires the input representation to be as such:
https://github.com/arkworks-rs/r1cs-std/blob/61640099e6532d1fb26df290e3db6a38d3c32457/src/groups/curves/short_weierstrass/mod.rs#L232-L234

Thus, a simple circuit, which allocates a public ProjectiveVar input will fail to verify when populating the public inputs as follows:
Groth16::verify(&vk, &point.to_field_elements().unwrap(), &proof)

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

No branches or pull requests

1 participant