Daniel Holth  committed 37719c5 Draft

use relative imports, per-implementation Keypair()

  • Participants
  • Parent commits 9dba08a

Comments (0)

Files changed (1)

File ed25519ll/

 import warnings
 import os
-import ed25519ll
-from ed25519ll import djbec
+from collections import namedtuple
+from . import djbec
 __all__ = ['crypto_sign', 'crypto_sign_open', 'crypto_sign_keypair', 'Keypair',
+Keypair = namedtuple('Keypair', ('vk', 'sk')) # verifying key, secret key
 def crypto_sign_keypair(seed=None):
     """Return (verifying, secret) key from a given seed, or os.urandom(32)"""    
     if seed is None:
     # XXX should seed be constrained to be less than 2**255-19?
     skbytes = seed
     vkbytes = djbec.publickey(skbytes)
-    return ed25519ll.Keypair(vkbytes, skbytes+vkbytes)
+    return Keypair(vkbytes, skbytes+vkbytes)
 def crypto_sign(msg, sk):