MCPcopy Create free account
hub / github.com/chain/txvm / Sub

Method Sub

crypto/ed25519/ecmath/point.go:30–39  ·  view source on GitHub ↗

Sub subtracts y from x, storing the result in z and returning that. Any or all of x, y, and z may be the same pointers.

(x, y *Point)

Source from the content-addressed store, hash-verified

28// Sub subtracts y from x, storing the result in z and
29// returning that. Any or all of x, y, and z may be the same pointers.
30func (z *Point) Sub(x, y *Point) *Point {
31 var y2 edwards25519.CachedGroupElement
32 (*edwards25519.ExtendedGroupElement)(y).ToCached(&y2)
33
34 var z2 edwards25519.CompletedGroupElement
35 edwards25519.GeSub(&z2, (*edwards25519.ExtendedGroupElement)(x), &y2)
36
37 z2.ToExtended((*edwards25519.ExtendedGroupElement)(z))
38 return z
39}
40
41// ScMul multiplies the EC point x by the scalar y, placing the result
42// in z and returning that. X and z may be the same pointer.

Callers 1

measureProgramFunction · 0.45

Calls 2

ToExtendedMethod · 0.95
ToCachedMethod · 0.80

Tested by 1

measureProgramFunction · 0.36