penumbra-zone / decaf377

decaf377 is a prime-order group designed for use in SNARKs over BLS12-377
https://protocol.penumbra.zone/main/crypto/decaf377.html
12 stars 12 forks source link

switch back to arkworks field arithmetic for 64-bit backend #101

Closed redshiftzero closed 3 weeks ago

redshiftzero commented 3 months ago

As part of https://github.com/penumbra-zone/penumbra/issues/3526, we added fiat-crypto formally verified field arithmetic implementations to decaf377, moving away from using the Arkworks field arithmetic imlpementation. This unblocked development of Penumbra's ledger app, since the Arkworks field arithmetic allocated.

However, @TalDerei did some very helpful benchmarking here and found that we have a significant performance regression.

This performance regression is blocking migrating downstream crates to the latest stable release (0.9.0, see #93). To move forward without introducing a performance regression we should switch back to Arkworks field arithmetic for the 64-bit backend only. Embedded environments like Ledger development will use the 32-bit backend which will continue to use the formally verified fiat-crypto field arithmetic.