Commit 065e3eaa authored by John-Mark Gurney's avatar John-Mark Gurney

add this builds the library and copies it over to the

build dir so it will get installed...  Also update the library finding
code to look in the modules install directory.
parent 84b7976f
#!/usr/bin/env python
'''This is a wrapper around the Goldilocks libdecaf library.
Currently only the ed448 code is wrapped. It is available in the
submodule ed448.
......@@ -40,17 +40,22 @@ __status__ = 'alpha'
import array
import os
import os.path
import sys
import unittest
import warnings
import sys
from ctypes import *
decaf = CDLL('../build/lib/')
_dname = os.path.dirname(__file__)
if not _dname:
_dname = '.'
_path = os.path.join(_dname, '')
decaf = CDLL(_path)
except OSError as e: # pragma: no cover
import warnings
warnings.warn(' not installed.')
warnings.warn(' not installed.')
raise ImportError(str(e))
......@@ -232,6 +237,8 @@ class TestEd448(unittest.TestCase):
key3 = EDDSA448(pub=pubkey)
key3.verify(sig, message)
self.assertRaises(ValueError, key.export_key, 'PEM')
def test_keyimportexport(self):
privkey = b'1' * DECAF_EDDSA_448_PRIVATE_BYTES
key = EDDSA448(privkey)
#!/usr/bin/env python
from import build
from distutils.core import setup
import os
class my_build(build):
def run(self):
if not self.dry_run:
os.spawnlp(os.P_WAIT, 'sh', 'sh', '-c', 'cd .. && gmake lib')
self.copy_file(os.path.join('..', 'build', 'lib', ''), os.path.join(self.build_lib, 'edgold'))
cmdclass = {}
cmdclass['build'] = my_build
description='The Ed ECC Goldilocks Python wrapper',
author='John-Mark Gurney',
packages=['edgold', ],
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment