Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/key.py
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | def _check_result(val, func, args): | ||||
else: | else: | ||||
return ctypes.c_void_p(val) | return ctypes.c_void_p(val) | ||||
ssl.EC_KEY_new_by_curve_name.restype = ctypes.c_void_p | ssl.EC_KEY_new_by_curve_name.restype = ctypes.c_void_p | ||||
ssl.EC_KEY_new_by_curve_name.errcheck = _check_result | ssl.EC_KEY_new_by_curve_name.errcheck = _check_result | ||||
class CECKey(object): | class CECKey(): | ||||
"""Wrapper around OpenSSL's EC_KEY""" | """Wrapper around OpenSSL's EC_KEY""" | ||||
POINT_CONVERSION_COMPRESSED = 2 | POINT_CONVERSION_COMPRESSED = 2 | ||||
POINT_CONVERSION_UNCOMPRESSED = 4 | POINT_CONVERSION_UNCOMPRESSED = 4 | ||||
def __init__(self): | def __init__(self): | ||||
self.k = ssl.EC_KEY_new_by_curve_name(NID_secp256k1) | self.k = ssl.EC_KEY_new_by_curve_name(NID_secp256k1) | ||||
▲ Show 20 Lines • Show All 141 Lines • Show Last 20 Lines |