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

Cleanup golang curves #430

Closed jeremyfelder closed 5 months ago

jeremyfelder commented 7 months ago

Describe the changes

This PR moves non-curve specific functionality to the core package for MSM, NTT, and VecOps.

jeremyfelder commented 6 months ago

I like the use of generics, my only concern is that golang generics come at performance costs in some cases. I have never benchmarked this and im not sure if this change will effect performance.

This is a good point, not sure what the performance cost is either. I'll measure it and see if it makes sense. I have other ideas on how to reduce the amount of templating that is needed but also not sure how those ideas affect perfomance.

Also regarding scalarsPointer = unsafe.Pointer(&scalars.(HostSlice[S])[0]) is this casting ?

Technically its type assertion on an interface type and not casting but essentially its the same

jeremyfelder commented 5 months ago

Superseded by #473 and #457