# Path: axolotl/ecc/eckeypair.py
# class ECKeyPair():
#     def __init__(self, publicKey, privateKey):
#         """
#         :type publicKey: ECPublicKey
#         :type privateKey: ECPrivateKey
#         """
#         self.publicKey = publicKey
#         self.privateKey = privateKey
# 
#     def getPrivateKey(self):
#         return self.privateKey
# 
#     def getPublicKey(self):
#         return self.publicKey
# 
# Path: axolotl/invalidkeyexception.py
# class InvalidKeyException(Exception):
#     pass


import os
import axolotl_curve25519 as _curve
from .eckeypair import ECKeyPair
from ..invalidkeyexception import InvalidKeyException
        from .djbec import DjbECPublicKey, DjbECPrivateKey
            from .djbec import DjbECPublicKey
        from .djbec import DjbECPrivateKey




class Curve:
    DJB_TYPE = 5
    # always DJB curve25519 keys

    @staticmethod
    def generatePrivateKey():
        rand = os.urandom(32)
        return _curve.generatePrivateKey(rand)

    @staticmethod
    def generatePublicKey(privateKey):
        return _curve.generatePublicKey(privateKey)

    @staticmethod
    def generateKeyPair():

        privateKey = Curve.generatePrivateKey()
        publicKey = Curve.generatePublicKey(privateKey)
        return ECKeyPair(DjbECPublicKey(publicKey), DjbECPrivateKey(privateKey))

    @staticmethod
    def decodePoint(_bytes, offset=0):
        type = _bytes[0]  # byte appears to be automatically converted to an integer??

        if type == Curve.DJB_TYPE:


# Path: axolotl/ecc/eckeypair.py
# class ECKeyPair():
#     def __init__(self, publicKey, privateKey):
#         """
#         :type publicKey: ECPublicKey
#         :type privateKey: ECPrivateKey
#         """
#         self.publicKey = publicKey
#         self.privateKey = privateKey
# 
#     def getPrivateKey(self):
#         return self.privateKey
# 
#     def getPublicKey(self):
#         return self.publicKey
# 
# Path: axolotl/invalidkeyexception.py
# class InvalidKeyException(Exception):
#     pass


# Path: axolotl/ecc/curve.py
import os
import axolotl_curve25519 as _curve
from .eckeypair import ECKeyPair
from ..invalidkeyexception import InvalidKeyException
        from .djbec import DjbECPublicKey, DjbECPrivateKey
            from .djbec import DjbECPublicKey
        from .djbec import DjbECPrivateKey





class Curve:
    DJB_TYPE = 5
    # always DJB curve25519 keys

    @staticmethod
    def generatePrivateKey():
        rand = os.urandom(32)
        return _curve.generatePrivateKey(rand)

    @staticmethod
    def generatePublicKey(privateKey):
        return _curve.generatePublicKey(privateKey)

    @staticmethod
    def generateKeyPair():

        privateKey = Curve.generatePrivateKey()
        publicKey = Curve.generatePublicKey(privateKey)
        return ECKeyPair(DjbECPublicKey(publicKey), DjbECPrivateKey(privateKey))

    @staticmethod
    def decodePoint(_bytes, offset=0):
        type = _bytes[0]  # byte appears to be automatically converted to an integer??

        if type == Curve.DJB_TYPE:


            type = _bytes[offset] & 0xFF