예제 #1
0
def test_signature_encoding_and_decoding():
    signature = encode_signature(V, R, S)
    v, r, s, = decode_signature(signature)
    assert v == V
    assert r == R
    assert s == S
예제 #2
0
def create_transaction_signature(unsigned_txn, private_key):
    signature = ecdsa_sign(rlp.encode(unsigned_txn), private_key)
    v, r, s = decode_signature(signature)
    return v, r, s
예제 #3
0
def test_signature_encoding_and_decoding(label, d):
    v, r, s, = decode_signature(d['sig'])
    assert (v, r, s) == d['raw_sig']
    assert encode_signature(v, r, s) == d['sig']
예제 #4
0
def test_ecdsa_raw_verify(backend, label, d):
    assert backend.ecdsa_raw_verify(MSGHASH, decode_signature(d['sig']),
                                    decode_public_key(d['pubkey']))
예제 #5
0
파일: coincurve.py 프로젝트: ccniuj/py-evm
 def ecdsa_raw_sign(self, msg_hash, private_key):
     signature = self.keys.PrivateKey(private_key).sign_recoverable(msg_hash, hasher=None)
     return decode_signature(signature)