On Fri, Sep 25, 2020 at 3:01 PM Anatol Pomozov <anatol.pomo...@gmail.com> wrote: > Or more precisely it calls this code https://boringssl.googlesource.com/boringssl/+/master/crypto/fipsmodule/ec/felem.c#57 > > But I want to avoid implementing parts of EC encryption myself and looking for a standard Golang way to achieve my goal. > > Shouldn't this inversion operation be part of the standard library? >
My understanding is that the Go standard library prefers that the entire underlying logic of ECC should be hidden from the user, like in "crypto/ed25519". However, they can't get rid of elliptic.CryptoParams due to compatibility. It's not a good idea in a general sense to use CryptoParams because it uses big.Int which is not side-channel resistant. For these reasons I don't think it's likely they'all add point inversion. If you do want to go on... you can "invert" a point ("negate" would be a better term...) by simply setting y = n - y, for example: y := new(big.Int).Sub(curveParams.Params().N, y) Best regards, Conrado -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAHTptW8aoYGPhvR5QGo5M1wyJoSw1s8F2c_oasnsX%2BO%3Dc%2By3%2BA%40mail.gmail.com.