コード例 #1
0
ファイル: podle.py プロジェクト: JoinMarket-Org/joinmarket
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)
コード例 #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)
コード例 #3
0
ファイル: secp256k1_main.py プロジェクト: AlexCato/joinmarket
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()
コード例 #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()