# Path: subspace/pyelliptic/openssl.py
# class CipherName:
# class _OpenSSL:
#     def __init__(self, name, pointer, blocksize):
#     def __str__(self):
#     def get_pointer(self):
#     def get_name(self):
#     def get_blocksize(self):
#     def __init__(self, library):
#     def _set_ciphers(self):
#     def _set_curves(self):
#     def BN_num_bytes(self, x):
#     def get_cipher(self, name):
#     def get_curve(self, name):
#     def get_curve_by_id(self, id):
#     def rand(self, size):
#     def malloc(self, data, size):


from .openssl import OpenSSL
            raise Exception("RTFM ...")

    @staticmethod
    def get_all_cipher():
        """
        static method, returns all ciphers available
        """
        return OpenSSL.cipher_algo.keys()

    @staticmethod
    def get_blocksize(ciphername):
        cipher = OpenSSL.get_cipher(ciphername)
        return cipher.get_blocksize()

    @staticmethod
    def gen_IV(ciphername):
        cipher = OpenSSL.get_cipher(ciphername)
        return OpenSSL.rand(cipher.get_blocksize())

    def update(self, input):
        i = OpenSSL.c_int(0)
        buffer = OpenSSL.malloc(b"", len(input) + self.cipher.get_blocksize())
        inp = OpenSSL.malloc(input, len(input))
        if OpenSSL.EVP_CipherUpdate(self.ctx, OpenSSL.byref(buffer),
                                    OpenSSL.byref(i), inp, len(input)) == 0:
            raise Exception("[OpenSSL] EVP_CipherUpdate FAIL ...")
        return buffer.raw[0:i.value]

    def final(self):
        i = OpenSSL.c_int(0)

# Path: subspace/pyelliptic/openssl.py
# class CipherName:
# class _OpenSSL:
#     def __init__(self, name, pointer, blocksize):
#     def __str__(self):
#     def get_pointer(self):
#     def get_name(self):
#     def get_blocksize(self):
#     def __init__(self, library):
#     def _set_ciphers(self):
#     def _set_curves(self):
#     def BN_num_bytes(self, x):
#     def get_cipher(self, name):
#     def get_curve(self, name):
#     def get_curve_by_id(self, id):
#     def rand(self, size):
#     def malloc(self, data, size):


# Path: subspace/pyelliptic/cipher.py
from .openssl import OpenSSL

            raise Exception("RTFM ...")

    @staticmethod
    def get_all_cipher():
        """
        static method, returns all ciphers available
        """
        return OpenSSL.cipher_algo.keys()

    @staticmethod
    def get_blocksize(ciphername):
        cipher = OpenSSL.get_cipher(ciphername)
        return cipher.get_blocksize()

    @staticmethod
    def gen_IV(ciphername):
        cipher = OpenSSL.get_cipher(ciphername)
        return OpenSSL.rand(cipher.get_blocksize())

    def update(self, input):
        i = OpenSSL.c_int(0)
        buffer = OpenSSL.malloc(b"", len(input) + self.cipher.get_blocksize())
        inp = OpenSSL.malloc(input, len(input))
        if OpenSSL.EVP_CipherUpdate(self.ctx, OpenSSL.byref(buffer),
                                    OpenSSL.byref(i), inp, len(input)) == 0:
            raise Exception("[OpenSSL] EVP_CipherUpdate FAIL ...")
        return buffer.raw[0:i.value]

    def final(self):
        i = OpenSSL.c_int(0)

        buffer = OpenSSL.malloc(b"", self.cipher.get_blocksize())