zkcrypto / pairing

Pairing-friendly elliptic curve library.
Other
341 stars 120 forks source link

Make it possible to use multi miller loop without explicit preparation #131

Open ebfull opened 2 years ago

ebfull commented 2 years ago

Right now the MultiMillerLoop API requires you to provide pre-prepared G2 elements. However, if you have a use case where you need to use the multi miller loop but over just-in-time G2 elements then the current API wastes a ton of memory caching things that will just be discarded during the miller loop.

This happened partly because I was conflating "I have access to an allocator" (which G2Prepared needs) with "I need to use the multi miller loop" (which only allowed G2Prepared at the time).