Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/schnorr.py
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | if not group: | ||||
raise RuntimeError("Cannot get secp256k1 group!") | raise RuntimeError("Cannot get secp256k1 group!") | ||||
class CTX: | class CTX: | ||||
"""Wrapper for a bignum context""" | """Wrapper for a bignum context""" | ||||
def __init__(self): | def __init__(self): | ||||
self.ptr = ssl.BN_CTX_new() | self.ptr = ssl.BN_CTX_new() | ||||
assert(self.ptr) | assert self.ptr | ||||
def __del__(self): | def __del__(self): | ||||
ssl.BN_CTX_free(self.ptr) | ssl.BN_CTX_free(self.ptr) | ||||
_threadlocal = threading.local() | _threadlocal = threading.local() | ||||
@classmethod | @classmethod | ||||
def ptr_for_this_thread(cls): | def ptr_for_this_thread(cls): | ||||
▲ Show 20 Lines • Show All 172 Lines • Show Last 20 Lines |