Fix: edge cases in std/algebra elliptic curve arithmetic circuit (emulated and 2-chains)#1023
Conversation
std elliptic curve arithmetic circuit (emulated and 2-chains)std/algebra elliptic curve arithmetic circuit (emulated and 2-chains)
ivokub
left a comment
There was a problem hiding this comment.
Looks good, however I think for scalarmul by constant we can have fast paths which do not perform computations.
Dunno about PLONK verifier options though - I think they are good to have but not essential. I think we can implement them later (but creating an issue for tracking), it is up to you.
Applied fast path for |
ivokub
left a comment
There was a problem hiding this comment.
Applied fast path for constScalarMul when s==0. For the case s==1 I didn't do it since we never use this method anyway and we can also specialize paths for s==2 and so on.. but s==0 is just to have the exposed method working for all cases even if it's never used in our use-cases. For the plonk option I will create an issue and close this PR. Wdyt?
Yep, I agree - lets only handle s==0 in the fast path and everything else in regular path. Your changes look good 👍 !
And I also agree with handling PLONK verifier options in separate PR. It is nice to have but nothing critical.
Description
std/algebrainvolving scalars0and points(0,0)using theUseSafeoption.1inscalarMulGeneric,scalarBitsMulGenericand related methods.appi.Committhat we use in Linea)Type of change
How has this been tested?
How has this been benchmarked?
Constraints count doesn't change when
UseSafeoption is not used (except forscalarMulGeneric), which is what interests us the most for our use-cases. The option is to capture all edge cases in all use-cases.Best thing forward is to add relevant emulated circuits to
internal/stats.Checklist:
golangci-lintdoes not output errors locally