arkworks-rs / groth16

A Rust implementation of the Groth16 zkSNARK
https://www.arkworks.rs
Apache License 2.0
242 stars 97 forks source link

An FFT may be saved #41

Open swasilyev opened 1 year ago

swasilyev commented 1 year ago

We can save 1 FFT (of 7) if we compute the h_query points in the evaluation form during the setup. We can similarly avoid the division when computing h by normalizing these points by g^n - 1 (evaluations of the vanishing polynomial on the coset). See the PoC here: https://github.com/achimcc/groth16/pull/1/files

These changes break existing proving keys, though I believe they can be updated. Does it worth the burden?


For Admin Use

Pratyush commented 1 year ago

I believe this is the R1CS-to-QAP reduction used in Circom, right? If so, then we've added partial support for this in #34. The remaining TODO to support this would be to (a) actually implement the new reduction, and (b) generalize the Groth16 struct to allow using different reduction strategies, via the idea in https://github.com/arkworks-rs/groth16/pull/34#issuecomment-883633375