move secp256k1 extension module to proto.secp256k1
This commit is contained in:
parent
4e546030fa
commit
d646099a37
4 changed files with 5 additions and 5 deletions
|
|
@ -20,7 +20,7 @@ class backend:
|
||||||
class libsecp256k1(keygen_base):
|
class libsecp256k1(keygen_base):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
from ...secp256k1 import priv2pub
|
from .secp256k1 import priv2pub
|
||||||
self.priv2pub = priv2pub
|
self.priv2pub = priv2pub
|
||||||
|
|
||||||
def to_pubkey(self,privkey):
|
def to_pubkey(self,privkey):
|
||||||
|
|
@ -31,7 +31,7 @@ class backend:
|
||||||
@classmethod
|
@classmethod
|
||||||
def test_avail(cls,silent=False):
|
def test_avail(cls,silent=False):
|
||||||
try:
|
try:
|
||||||
from ...secp256k1 import priv2pub
|
from .secp256k1 import priv2pub
|
||||||
if not priv2pub(bytes.fromhex('deadbeef'*8),1):
|
if not priv2pub(bytes.fromhex('deadbeef'*8),1):
|
||||||
from ...util import die
|
from ...util import die
|
||||||
die( 'ExtensionModuleError',
|
die( 'ExtensionModuleError',
|
||||||
|
|
|
||||||
2
setup.py
2
setup.py
|
|
@ -46,7 +46,7 @@ class my_build_ext(build_ext):
|
||||||
setup(
|
setup(
|
||||||
cmdclass = { 'build_ext': my_build_ext },
|
cmdclass = { 'build_ext': my_build_ext },
|
||||||
ext_modules = [Extension(
|
ext_modules = [Extension(
|
||||||
name = 'mmgen.secp256k1',
|
name = 'mmgen.proto.secp256k1.secp256k1',
|
||||||
sources = ['extmod/secp256k1mod.c'],
|
sources = ['extmod/secp256k1mod.c'],
|
||||||
libraries = ([],['gmp'])[have_msys2],
|
libraries = ([],['gmp'])[have_msys2],
|
||||||
extra_objects = [os.path.join(ext_path,'.libs/libsecp256k1.a')],
|
extra_objects = [os.path.join(ext_path,'.libs/libsecp256k1.a')],
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ def overlay_setup(repo_root):
|
||||||
if (
|
if (
|
||||||
fn.endswith('.py') or
|
fn.endswith('.py') or
|
||||||
d == 'mmgen.data' or
|
d == 'mmgen.data' or
|
||||||
d == 'mmgen' and fn.startswith('secp256k1')
|
d == 'mmgen.proto.secp256k1' and fn.startswith('secp256k1')
|
||||||
):
|
):
|
||||||
if os.path.exists(os.path.join(fakemod_dir,fn)):
|
if os.path.exists(os.path.join(fakemod_dir,fn)):
|
||||||
make_link(
|
make_link(
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ class unit_tests:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def secp256k1(self,name,ut):
|
def secp256k1(self,name,ut):
|
||||||
from mmgen.secp256k1 import priv2pub
|
from mmgen.proto.secp256k1.secp256k1 import priv2pub
|
||||||
priv2pub(bytes.fromhex('deadbeef'*8),1)
|
priv2pub(bytes.fromhex('deadbeef'*8),1)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue