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
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
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']
def test_ecdsa_raw_verify(backend, label, d): assert backend.ecdsa_raw_verify(MSGHASH, decode_signature(d['sig']), decode_public_key(d['pubkey']))
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)