arkworks-rs / snark

Interfaces for Relations and SNARKs for these relations
https://www.arkworks.rs
Apache License 2.0
776 stars 209 forks source link

Implement `ToConstraintField` for `AffineCurve` #246

Closed weikengchen closed 4 years ago

weikengchen commented 4 years ago

This PR implements ToConstraintField for AffineCurve, which is to facilitate implementations of recursive proofs. To do so, ToConstraintField is now implemented for all fields, in which a field can be represented by the field's BaseRepresentationField, defined as follows:

A few repetitions of requirements are used to make the Rust compiler happy.

This PR has been used (and tested) in the ongoing implementation of Marlin's constraints.

Looking for initial feedback.

weikengchen commented 4 years ago

Ah, the repo from which I made the PR has been tainted.

So I guess it is better for me to apply this to the refactored version instead. Closed for now.