refactor: plonk.Setup takes kzg srs in canonical and lagrange form#953
refactor: plonk.Setup takes kzg srs in canonical and lagrange form#953
Conversation
|
Couldn't we use an option to pass the kzg SRS in Lagrange form to the Setup ? When using |
ivokub
left a comment
There was a problem hiding this comment.
Looks good. A few comments though but they are not blocking.
internal/generator/backend/template/zkpschemes/plonk/plonk.setup.go.tmpl
Show resolved
Hide resolved
|
Imo on thing we could consider in the future is to have a lazy SRS. We can store it on disk and only when we actually we read it to memory (using mmap). Or more better, because the key is very structured we can have method a la |
@ThomasPiellard yes good idea but it changes the PlonK prover code too a bit so will do it in another PR |
This PR changes the signature of
plonk.Setup(...)and adds an additional parameter; thekzg.SRSin Lagrange form.In production, this can be computed using
gnark-cryptoToLagrangeG1helper from a canonical SRS.For test purposes when we know the
tauused for generating the canonical srs, we can take a quicker path (seetest/unsafekzgpackage which offers a convenient api to generate and cache in memory / on disk srs for test purposes).