Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def tweak_mul(point, scalar):
"""Temporary hack because Windows binding had a bug in tweak_mul.
Can be removed when Windows binding is updated.
"""
return secp256k1._tweak_public(point,
secp256k1.lib.secp256k1_ec_pubkey_tweak_mul,
scalar)
class PoDLEError(Exception):
def multiply(s, pub, usehex, rawpub=True):
'''Input binary compressed pubkey P(33 bytes)
and scalar s(32 bytes), return s*P.
The return value is a binary compressed public key.
Note that the called function does the type checking
of the scalar s.
('raw' options passed in)
'''
newpub = secp256k1.PublicKey(pub, raw=rawpub, ctx=ctx)
#see note to "tweak_mul" function in podle.py
res = secp256k1._tweak_public(newpub,
secp256k1.lib.secp256k1_ec_pubkey_tweak_mul,
s)
return res.serialize()