Esempio n. 1
0
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)
Esempio n. 2
0
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)
Esempio n. 3
0
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()
Esempio n. 4
0
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()