ingonyama-zk / icicle

A hardware acceleration library for compute intensive cryptography :ice_cube:
https://dev.ingonyama.com/icicle/overview
MIT License
329 stars 97 forks source link

Field creation automated through macros #551

Closed DmytroTym closed 3 months ago

DmytroTym commented 3 months ago

Describe the changes

Params files for fields now only require modulus specified by the user (also twiddle generator and/or non-residue in case either or both are needed). Everything else gets generated by a macro which seems to be much cleaner and easier than using python scripts / doing it by hand like it used to be before.

Future work

I also tried to do some general cleanup and minor perf improvements of primitives. Spent quite a bit of time trying to create correction-minimising formulas (sort of what Niall does here but for all fields and not just EC formula for a specific base field). This turned out to be much harder than expected and though I think I got it most of the way, the performance gains don't seem to justify the remaining effort considering significant increase in code complexity. If anyone is interested in this direction of work please let me know, I have an (almost) working prototype locally.

Most primitives related improvements I can think of are easier to do so if anything is particularly important to icicle right now, let me know. I can probably work on it in the background. Cheers.