arkworks-rs / r1cs-std

R1CS constraints for bits, fields, and elliptic curves
https://www.arkworks.rs
Apache License 2.0
137 stars 59 forks source link

Let `query_position_to_coset` return `gen` and `offset` instead of coset elements #85

Closed tsunrise closed 2 years ago

tsunrise commented 2 years ago

Problem Definition

Currently, domain.query_position_to_coset returns all elements in coset. We should make it simply return updated gen and offset instead, because users can use gen and offset to do some custom optimization.

Proposal

    pub fn query_position_to_coset(
        &self,
        query_pos: &[Boolean<F>],
        coset_dim: u64,
-    ) -> Result<Vec<FpVar<F>>, SynthesisError> {
+   ) -> Result<Self, SynthesisError> { 

For Admin Use