MCPcopy Create free account
hub / github.com/ElementsProject/elements / mul

Method mul

test/functional/test_framework/key.py:202–213  ·  view source on GitHub ↗

Compute a (multi) point multiplication ps is a list of (Jacobian tuple, scalar) pairs.

(self, ps)

Source from the content-addressed store, hash-verified

200 return (x3, y3, z3)
201
202 def mul(self, ps):
203 """Compute a (multi) point multiplication
204
205 ps is a list of (Jacobian tuple, scalar) pairs.
206 """
207 r = (0, 1, 0)
208 for i in range(255, -1, -1):
209 r = self.double(r)
210 for (p, n) in ps:
211 if ((n >> i) & 1):
212 r = self.add(r, p)
213 return r
214
215SECP256K1_FIELD_SIZE = 2**256 - 2**32 - 977
216SECP256K1 = EllipticCurve(SECP256K1_FIELD_SIZE, 0, 7)

Callers 8

verify_ecdsaMethod · 0.45
get_pubkeyMethod · 0.45
sign_ecdsaMethod · 0.45
compute_xonly_pubkeyFunction · 0.45
tweak_add_privkeyFunction · 0.45
tweak_add_pubkeyFunction · 0.45
verify_schnorrFunction · 0.45
sign_schnorrFunction · 0.45

Calls 2

doubleMethod · 0.95
addMethod · 0.95

Tested by

no test coverage detected