pax_global_header00006660000000000000000000000064147452130240014514gustar00rootroot0000000000000052 comment=c0f61be47de8763da07423b1d55554c58e5c5dd0 python-mceliece-20241009.1/000077500000000000000000000000001474521302400152035ustar00rootroot00000000000000python-mceliece-20241009.1/LICENSE000066400000000000000000000156101474521302400162130ustar00rootroot00000000000000Creative Commons Legal Code CC0 1.0 Universal CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER. Statement of Purpose The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work"). Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others. For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights. 1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following: i. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work; ii. moral rights retained by the original author(s) and/or performer(s); iii. publicity and privacy rights pertaining to a person's image or likeness depicted in a Work; iv. rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below; v. rights protecting the extraction, dissemination, use and reuse of data in a Work; vi. database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and vii. other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof. 2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose. 3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose. 4. Limitations and Disclaimers. a. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document. b. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law. c. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work. d. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work. python-mceliece-20241009.1/README.md000066400000000000000000000014041474521302400164610ustar00rootroot00000000000000Python wrapper around implementation of the Classic McEliece cryptosystem. To access the Python functions provided by mceliece, import the library (for, e.g., mceliece6960119): from mceliece import mceliece6960119 To generate a key pair: pk,sk = mceliece6960119.keypair() To generate a ciphertext c encapsulating a randomly generated session key k: c,k = mceliece6960119.enc(pk) To recover a session key from a ciphertext: k = mceliece6960119.dec(c,sk) As a larger example, the following test script creates a key pair, creates a ciphertext and session key, and then recovers the session key from the ciphertext: import mceliece kem = mceliece.mceliece6960119 pk,sk = kem.keypair() c,k = kem.enc(pk) assert k == kem.dec(c,sk) python-mceliece-20241009.1/autogen/000077500000000000000000000000001474521302400166455ustar00rootroot00000000000000python-mceliece-20241009.1/autogen/init000077500000000000000000000007571474521302400175470ustar00rootroot00000000000000#!/usr/bin/env python3 project='mceliece' primitives = [] for size in '6960119', '6688128', '8192128', '460896', '348864': for suffix in '', 'f', 'pc', 'pcf': primitives.append(f'mceliece{size}{suffix}') helpstr = "'''\n" with open('README.md') as f: helpstr += f.read() helpstr += "'''\n" with open(f'src/{project}/__init__.py', 'w') as f: f.write(helpstr) f.write('\n') for primitive in primitives: f.write(f'from .kem import {primitive}\n') python-mceliece-20241009.1/autogen/kem000077500000000000000000000075111474521302400173530ustar00rootroot00000000000000#!/usr/bin/env python3 project='mceliece' _primitives = { 'mceliece6960119': {'name': '6960119', 'pkbytes': 1047319, 'skbytes': 13948, 'cbytes': 194}, 'mceliece6688128': {'name': '6688128', 'pkbytes': 1044992, 'skbytes': 13932, 'cbytes': 208}, 'mceliece8192128': {'name': '8192128', 'pkbytes': 1357824, 'skbytes': 14120, 'cbytes': 208}, 'mceliece460896': {'name': '460896', 'pkbytes': 524160, 'skbytes': 13608, 'cbytes': 156}, 'mceliece348864': {'name': '348864', 'pkbytes': 261120, 'skbytes': 6492, 'cbytes': 96}, } primitives = {} for primitive in _primitives: for variant in ['', 'f', 'pc', 'pcf']: primitives[f'{primitive}{variant}'] = _primitives[primitive].copy() primitives[f'{primitive}{variant}']['name'] = _primitives[primitive]['name'] + variant if variant.startswith('pc'): primitives[f'{primitive}{variant}']['cbytes'] += 32 kem="""from typing import Tuple as _Tuple import ctypes as _ct from ._lib import _lib, _check_input class _KEM: def __init__(self) -> None: ''' ''' self._c_keypair = getattr(_lib, '%s_keypair' % self._prefix) self._c_keypair.argtypes = [_ct.c_char_p, _ct.c_char_p] self._c_keypair.restype = None self._c_enc = getattr(_lib, '%s_enc' % self._prefix) self._c_enc.argtypes = [_ct.c_char_p, _ct.c_char_p, _ct.c_char_p] self._c_enc.restype = _ct.c_int self._c_dec = getattr(_lib, '%s_dec' % self._prefix) self._c_dec.argtypes = [_ct.c_char_p, _ct.c_char_p, _ct.c_char_p] self._c_dec.restype = _ct.c_int def keypair(self) -> _Tuple[bytes, bytes]: ''' Keypair - randomly generates secret key 'sk' and corresponding public key 'pk'. Returns: pk (bytes): public key sk (bytes): secret key ''' pk = _ct.create_string_buffer(self.PUBLICKEYBYTES) sk = _ct.create_string_buffer(self.SECRETKEYBYTES) self._c_keypair(pk, sk) return pk.raw, sk.raw def enc(self, pk: bytes) -> _Tuple[bytes, bytes]: ''' Encapsulation - randomly generates a ciphertext 'c' and the corresponding session key 'k' given Alice's public key 'pk'. Parameters: pk (bytes): public key Returns: c (bytes): ciphertext k (bytes): session key ''' _check_input(pk, self.PUBLICKEYBYTES, 'pk') c = _ct.create_string_buffer(self.CIPHERTEXTBYTES) k = _ct.create_string_buffer(self.BYTES) pk = _ct.create_string_buffer(pk) if self._c_enc(c, k, pk): raise Exception('enc failed') return c.raw, k.raw def dec(self, c: bytes, sk: bytes) -> bytes: ''' Decapsulation - given Alice's secret key 'sk' computes the session key 'k' corresponding to a ciphertext 'c'. Parameters: c (bytes): ciphertext sk (bytes): secret key Returns: k (bytes): session key ''' _check_input(c, self.CIPHERTEXTBYTES, 'c') _check_input(sk, self.SECRETKEYBYTES, 'sk') k = _ct.create_string_buffer(self.BYTES) c = _ct.create_string_buffer(c) sk = _ct.create_string_buffer(sk) if self._c_dec(k, c, sk): raise Exception('dec failed') return k.raw """ with open(f'src/{project}/kem.py', 'w') as f: f.write(kem) for primitive in primitives: f.write('\n\n') f.write(f'class {primitive}(_KEM):\n') f.write(f' PUBLICKEYBYTES = {primitives[primitive]["pkbytes"]}\n') f.write(f' SECRETKEYBYTES = {primitives[primitive]["skbytes"]}\n') f.write(f' CIPHERTEXTBYTES = {primitives[primitive]["cbytes"]}\n') f.write(f' BYTES = 32\n') f.write(f' _prefix = "{project}_kem_{primitives[primitive]["name"]}"\n\n\n') f.write(f'{primitive} = {primitive}()\n') python-mceliece-20241009.1/autogen/lib000066400000000000000000000011221474521302400173320ustar00rootroot00000000000000#!/usr/bin/env python3 project='mceliece' lib="""from ctypes.util import find_library as _find_library from ctypes import CDLL as _CDLL _libname = _find_library('%s') if _libname is None: raise FileNotFoundError("unable to locate library '%s'") _lib = _CDLL(_libname) def _check_input(x, xlen, name): if not isinstance(x, bytes): raise TypeError(f'{name} must be bytes') if xlen != -1 and xlen != len(x): raise ValueError(f'{name} length must have exactly {xlen} bytes') """ % (project, project) with open(f'src/{project}/_lib.py', 'w') as f: f.write(lib) python-mceliece-20241009.1/autogen/tests000077500000000000000000000007571474521302400177460ustar00rootroot00000000000000#!/usr/bin/env python3 for size in '6960119', '6688128', '8192128', '460896', '348864': for suffix in '', 'pc', 'f', 'pcf': with open(f'tests/test_mceliece{size}{suffix}.py', 'w') as f: template = f'''from mceliece import mceliece{size}{suffix} def test_mceliece{size}{suffix}(): pk, sk = mceliece{size}{suffix}.keypair() c, k1 = mceliece{size}{suffix}.enc(pk) k2 = mceliece{size}{suffix}.dec(c, sk) assert (k1 == k2) ''' f.write(template) python-mceliece-20241009.1/pyproject.toml000066400000000000000000000007261474521302400201240ustar00rootroot00000000000000[build-system] requires = ['setuptools'] build-backend = 'setuptools.build_meta' [project] name = 'mceliece' description = 'Python wrapper around implementation of the Classic Mceliece cryptosystems' readme = 'README.md' requires-python = '>=3.7' license = {file = 'LICENSE'} authors = [ {name = 'Jan Mojžíš', email = 'jan.mojzis@gmail.com'}, ] version = '20241009.1' [tool.pytest.ini_options] minversion = '6.0' addopts = '-ra -v' testpaths = [ 'tests', ] python-mceliece-20241009.1/src/000077500000000000000000000000001474521302400157725ustar00rootroot00000000000000python-mceliece-20241009.1/src/mceliece/000077500000000000000000000000001474521302400175405ustar00rootroot00000000000000python-mceliece-20241009.1/src/mceliece/__init__.py000066400000000000000000000026671474521302400216640ustar00rootroot00000000000000''' Python wrapper around implementation of the Classic McEliece cryptosystem. To access the Python functions provided by mceliece, import the library (for, e.g., mceliece6960119): from mceliece import mceliece6960119 To generate a key pair: pk,sk = mceliece6960119.keypair() To generate a ciphertext c encapsulating a randomly generated session key k: c,k = mceliece6960119.enc(pk) To recover a session key from a ciphertext: k = mceliece6960119.dec(c,sk) As a larger example, the following test script creates a key pair, creates a ciphertext and session key, and then recovers the session key from the ciphertext: import mceliece kem = mceliece.mceliece6960119 pk,sk = kem.keypair() c,k = kem.enc(pk) assert k == kem.dec(c,sk) ''' from .kem import mceliece6960119 from .kem import mceliece6960119f from .kem import mceliece6960119pc from .kem import mceliece6960119pcf from .kem import mceliece6688128 from .kem import mceliece6688128f from .kem import mceliece6688128pc from .kem import mceliece6688128pcf from .kem import mceliece8192128 from .kem import mceliece8192128f from .kem import mceliece8192128pc from .kem import mceliece8192128pcf from .kem import mceliece460896 from .kem import mceliece460896f from .kem import mceliece460896pc from .kem import mceliece460896pcf from .kem import mceliece348864 from .kem import mceliece348864f from .kem import mceliece348864pc from .kem import mceliece348864pcf python-mceliece-20241009.1/src/mceliece/_lib.py000066400000000000000000000007211474521302400210170ustar00rootroot00000000000000from ctypes.util import find_library as _find_library from ctypes import CDLL as _CDLL _libname = _find_library('mceliece') if _libname is None: raise FileNotFoundError("unable to locate library 'mceliece'") _lib = _CDLL(_libname) def _check_input(x, xlen, name): if not isinstance(x, bytes): raise TypeError(f'{name} must be bytes') if xlen != -1 and xlen != len(x): raise ValueError(f'{name} length must have exactly {xlen} bytes') python-mceliece-20241009.1/src/mceliece/kem.py000066400000000000000000000146451474521302400207000ustar00rootroot00000000000000from typing import Tuple as _Tuple import ctypes as _ct from ._lib import _lib, _check_input class _KEM: def __init__(self) -> None: ''' ''' self._c_keypair = getattr(_lib, '%s_keypair' % self._prefix) self._c_keypair.argtypes = [_ct.c_char_p, _ct.c_char_p] self._c_keypair.restype = None self._c_enc = getattr(_lib, '%s_enc' % self._prefix) self._c_enc.argtypes = [_ct.c_char_p, _ct.c_char_p, _ct.c_char_p] self._c_enc.restype = _ct.c_int self._c_dec = getattr(_lib, '%s_dec' % self._prefix) self._c_dec.argtypes = [_ct.c_char_p, _ct.c_char_p, _ct.c_char_p] self._c_dec.restype = _ct.c_int def keypair(self) -> _Tuple[bytes, bytes]: ''' Keypair - randomly generates secret key 'sk' and corresponding public key 'pk'. Returns: pk (bytes): public key sk (bytes): secret key ''' pk = _ct.create_string_buffer(self.PUBLICKEYBYTES) sk = _ct.create_string_buffer(self.SECRETKEYBYTES) self._c_keypair(pk, sk) return pk.raw, sk.raw def enc(self, pk: bytes) -> _Tuple[bytes, bytes]: ''' Encapsulation - randomly generates a ciphertext 'c' and the corresponding session key 'k' given Alice's public key 'pk'. Parameters: pk (bytes): public key Returns: c (bytes): ciphertext k (bytes): session key ''' _check_input(pk, self.PUBLICKEYBYTES, 'pk') c = _ct.create_string_buffer(self.CIPHERTEXTBYTES) k = _ct.create_string_buffer(self.BYTES) pk = _ct.create_string_buffer(pk) if self._c_enc(c, k, pk): raise Exception('enc failed') return c.raw, k.raw def dec(self, c: bytes, sk: bytes) -> bytes: ''' Decapsulation - given Alice's secret key 'sk' computes the session key 'k' corresponding to a ciphertext 'c'. Parameters: c (bytes): ciphertext sk (bytes): secret key Returns: k (bytes): session key ''' _check_input(c, self.CIPHERTEXTBYTES, 'c') _check_input(sk, self.SECRETKEYBYTES, 'sk') k = _ct.create_string_buffer(self.BYTES) c = _ct.create_string_buffer(c) sk = _ct.create_string_buffer(sk) if self._c_dec(k, c, sk): raise Exception('dec failed') return k.raw class mceliece6960119(_KEM): PUBLICKEYBYTES = 1047319 SECRETKEYBYTES = 13948 CIPHERTEXTBYTES = 194 BYTES = 32 _prefix = "mceliece_kem_6960119" mceliece6960119 = mceliece6960119() class mceliece6960119f(_KEM): PUBLICKEYBYTES = 1047319 SECRETKEYBYTES = 13948 CIPHERTEXTBYTES = 194 BYTES = 32 _prefix = "mceliece_kem_6960119f" mceliece6960119f = mceliece6960119f() class mceliece6960119pc(_KEM): PUBLICKEYBYTES = 1047319 SECRETKEYBYTES = 13948 CIPHERTEXTBYTES = 226 BYTES = 32 _prefix = "mceliece_kem_6960119pc" mceliece6960119pc = mceliece6960119pc() class mceliece6960119pcf(_KEM): PUBLICKEYBYTES = 1047319 SECRETKEYBYTES = 13948 CIPHERTEXTBYTES = 226 BYTES = 32 _prefix = "mceliece_kem_6960119pcf" mceliece6960119pcf = mceliece6960119pcf() class mceliece6688128(_KEM): PUBLICKEYBYTES = 1044992 SECRETKEYBYTES = 13932 CIPHERTEXTBYTES = 208 BYTES = 32 _prefix = "mceliece_kem_6688128" mceliece6688128 = mceliece6688128() class mceliece6688128f(_KEM): PUBLICKEYBYTES = 1044992 SECRETKEYBYTES = 13932 CIPHERTEXTBYTES = 208 BYTES = 32 _prefix = "mceliece_kem_6688128f" mceliece6688128f = mceliece6688128f() class mceliece6688128pc(_KEM): PUBLICKEYBYTES = 1044992 SECRETKEYBYTES = 13932 CIPHERTEXTBYTES = 240 BYTES = 32 _prefix = "mceliece_kem_6688128pc" mceliece6688128pc = mceliece6688128pc() class mceliece6688128pcf(_KEM): PUBLICKEYBYTES = 1044992 SECRETKEYBYTES = 13932 CIPHERTEXTBYTES = 240 BYTES = 32 _prefix = "mceliece_kem_6688128pcf" mceliece6688128pcf = mceliece6688128pcf() class mceliece8192128(_KEM): PUBLICKEYBYTES = 1357824 SECRETKEYBYTES = 14120 CIPHERTEXTBYTES = 208 BYTES = 32 _prefix = "mceliece_kem_8192128" mceliece8192128 = mceliece8192128() class mceliece8192128f(_KEM): PUBLICKEYBYTES = 1357824 SECRETKEYBYTES = 14120 CIPHERTEXTBYTES = 208 BYTES = 32 _prefix = "mceliece_kem_8192128f" mceliece8192128f = mceliece8192128f() class mceliece8192128pc(_KEM): PUBLICKEYBYTES = 1357824 SECRETKEYBYTES = 14120 CIPHERTEXTBYTES = 240 BYTES = 32 _prefix = "mceliece_kem_8192128pc" mceliece8192128pc = mceliece8192128pc() class mceliece8192128pcf(_KEM): PUBLICKEYBYTES = 1357824 SECRETKEYBYTES = 14120 CIPHERTEXTBYTES = 240 BYTES = 32 _prefix = "mceliece_kem_8192128pcf" mceliece8192128pcf = mceliece8192128pcf() class mceliece460896(_KEM): PUBLICKEYBYTES = 524160 SECRETKEYBYTES = 13608 CIPHERTEXTBYTES = 156 BYTES = 32 _prefix = "mceliece_kem_460896" mceliece460896 = mceliece460896() class mceliece460896f(_KEM): PUBLICKEYBYTES = 524160 SECRETKEYBYTES = 13608 CIPHERTEXTBYTES = 156 BYTES = 32 _prefix = "mceliece_kem_460896f" mceliece460896f = mceliece460896f() class mceliece460896pc(_KEM): PUBLICKEYBYTES = 524160 SECRETKEYBYTES = 13608 CIPHERTEXTBYTES = 188 BYTES = 32 _prefix = "mceliece_kem_460896pc" mceliece460896pc = mceliece460896pc() class mceliece460896pcf(_KEM): PUBLICKEYBYTES = 524160 SECRETKEYBYTES = 13608 CIPHERTEXTBYTES = 188 BYTES = 32 _prefix = "mceliece_kem_460896pcf" mceliece460896pcf = mceliece460896pcf() class mceliece348864(_KEM): PUBLICKEYBYTES = 261120 SECRETKEYBYTES = 6492 CIPHERTEXTBYTES = 96 BYTES = 32 _prefix = "mceliece_kem_348864" mceliece348864 = mceliece348864() class mceliece348864f(_KEM): PUBLICKEYBYTES = 261120 SECRETKEYBYTES = 6492 CIPHERTEXTBYTES = 96 BYTES = 32 _prefix = "mceliece_kem_348864f" mceliece348864f = mceliece348864f() class mceliece348864pc(_KEM): PUBLICKEYBYTES = 261120 SECRETKEYBYTES = 6492 CIPHERTEXTBYTES = 128 BYTES = 32 _prefix = "mceliece_kem_348864pc" mceliece348864pc = mceliece348864pc() class mceliece348864pcf(_KEM): PUBLICKEYBYTES = 261120 SECRETKEYBYTES = 6492 CIPHERTEXTBYTES = 128 BYTES = 32 _prefix = "mceliece_kem_348864pcf" mceliece348864pcf = mceliece348864pcf() python-mceliece-20241009.1/tests/000077500000000000000000000000001474521302400163455ustar00rootroot00000000000000python-mceliece-20241009.1/tests/test_mceliece348864.py000066400000000000000000000003031474521302400222210ustar00rootroot00000000000000from mceliece import mceliece348864 def test_mceliece348864(): pk, sk = mceliece348864.keypair() c, k1 = mceliece348864.enc(pk) k2 = mceliece348864.dec(c, sk) assert (k1 == k2) python-mceliece-20241009.1/tests/test_mceliece348864f.py000066400000000000000000000003101474521302400223650ustar00rootroot00000000000000from mceliece import mceliece348864f def test_mceliece348864f(): pk, sk = mceliece348864f.keypair() c, k1 = mceliece348864f.enc(pk) k2 = mceliece348864f.dec(c, sk) assert (k1 == k2) python-mceliece-20241009.1/tests/test_mceliece348864pc.py000066400000000000000000000003151474521302400225470ustar00rootroot00000000000000from mceliece import mceliece348864pc def test_mceliece348864pc(): pk, sk = mceliece348864pc.keypair() c, k1 = mceliece348864pc.enc(pk) k2 = mceliece348864pc.dec(c, sk) assert (k1 == k2) python-mceliece-20241009.1/tests/test_mceliece348864pcf.py000066400000000000000000000003221474521302400227130ustar00rootroot00000000000000from mceliece import mceliece348864pcf def test_mceliece348864pcf(): pk, sk = mceliece348864pcf.keypair() c, k1 = mceliece348864pcf.enc(pk) k2 = mceliece348864pcf.dec(c, sk) assert (k1 == k2) python-mceliece-20241009.1/tests/test_mceliece460896.py000066400000000000000000000003031474521302400222210ustar00rootroot00000000000000from mceliece import mceliece460896 def test_mceliece460896(): pk, sk = mceliece460896.keypair() c, k1 = mceliece460896.enc(pk) k2 = mceliece460896.dec(c, sk) assert (k1 == k2) python-mceliece-20241009.1/tests/test_mceliece460896f.py000066400000000000000000000003101474521302400223650ustar00rootroot00000000000000from mceliece import mceliece460896f def test_mceliece460896f(): pk, sk = mceliece460896f.keypair() c, k1 = mceliece460896f.enc(pk) k2 = mceliece460896f.dec(c, sk) assert (k1 == k2) python-mceliece-20241009.1/tests/test_mceliece460896pc.py000066400000000000000000000003151474521302400225470ustar00rootroot00000000000000from mceliece import mceliece460896pc def test_mceliece460896pc(): pk, sk = mceliece460896pc.keypair() c, k1 = mceliece460896pc.enc(pk) k2 = mceliece460896pc.dec(c, sk) assert (k1 == k2) python-mceliece-20241009.1/tests/test_mceliece460896pcf.py000066400000000000000000000003221474521302400227130ustar00rootroot00000000000000from mceliece import mceliece460896pcf def test_mceliece460896pcf(): pk, sk = mceliece460896pcf.keypair() c, k1 = mceliece460896pcf.enc(pk) k2 = mceliece460896pcf.dec(c, sk) assert (k1 == k2) python-mceliece-20241009.1/tests/test_mceliece6688128.py000066400000000000000000000003101474521302400223050ustar00rootroot00000000000000from mceliece import mceliece6688128 def test_mceliece6688128(): pk, sk = mceliece6688128.keypair() c, k1 = mceliece6688128.enc(pk) k2 = mceliece6688128.dec(c, sk) assert (k1 == k2) python-mceliece-20241009.1/tests/test_mceliece6688128f.py000066400000000000000000000003151474521302400224600ustar00rootroot00000000000000from mceliece import mceliece6688128f def test_mceliece6688128f(): pk, sk = mceliece6688128f.keypair() c, k1 = mceliece6688128f.enc(pk) k2 = mceliece6688128f.dec(c, sk) assert (k1 == k2) python-mceliece-20241009.1/tests/test_mceliece6688128pc.py000066400000000000000000000003221474521302400226330ustar00rootroot00000000000000from mceliece import mceliece6688128pc def test_mceliece6688128pc(): pk, sk = mceliece6688128pc.keypair() c, k1 = mceliece6688128pc.enc(pk) k2 = mceliece6688128pc.dec(c, sk) assert (k1 == k2) python-mceliece-20241009.1/tests/test_mceliece6688128pcf.py000066400000000000000000000003271474521302400230060ustar00rootroot00000000000000from mceliece import mceliece6688128pcf def test_mceliece6688128pcf(): pk, sk = mceliece6688128pcf.keypair() c, k1 = mceliece6688128pcf.enc(pk) k2 = mceliece6688128pcf.dec(c, sk) assert (k1 == k2) python-mceliece-20241009.1/tests/test_mceliece6960119.py000066400000000000000000000003101474521302400222760ustar00rootroot00000000000000from mceliece import mceliece6960119 def test_mceliece6960119(): pk, sk = mceliece6960119.keypair() c, k1 = mceliece6960119.enc(pk) k2 = mceliece6960119.dec(c, sk) assert (k1 == k2) python-mceliece-20241009.1/tests/test_mceliece6960119f.py000066400000000000000000000003151474521302400224510ustar00rootroot00000000000000from mceliece import mceliece6960119f def test_mceliece6960119f(): pk, sk = mceliece6960119f.keypair() c, k1 = mceliece6960119f.enc(pk) k2 = mceliece6960119f.dec(c, sk) assert (k1 == k2) python-mceliece-20241009.1/tests/test_mceliece6960119pc.py000066400000000000000000000003221474521302400226240ustar00rootroot00000000000000from mceliece import mceliece6960119pc def test_mceliece6960119pc(): pk, sk = mceliece6960119pc.keypair() c, k1 = mceliece6960119pc.enc(pk) k2 = mceliece6960119pc.dec(c, sk) assert (k1 == k2) python-mceliece-20241009.1/tests/test_mceliece6960119pcf.py000066400000000000000000000003271474521302400227770ustar00rootroot00000000000000from mceliece import mceliece6960119pcf def test_mceliece6960119pcf(): pk, sk = mceliece6960119pcf.keypair() c, k1 = mceliece6960119pcf.enc(pk) k2 = mceliece6960119pcf.dec(c, sk) assert (k1 == k2) python-mceliece-20241009.1/tests/test_mceliece8192128.py000066400000000000000000000003101474521302400222750ustar00rootroot00000000000000from mceliece import mceliece8192128 def test_mceliece8192128(): pk, sk = mceliece8192128.keypair() c, k1 = mceliece8192128.enc(pk) k2 = mceliece8192128.dec(c, sk) assert (k1 == k2) python-mceliece-20241009.1/tests/test_mceliece8192128f.py000066400000000000000000000003151474521302400224500ustar00rootroot00000000000000from mceliece import mceliece8192128f def test_mceliece8192128f(): pk, sk = mceliece8192128f.keypair() c, k1 = mceliece8192128f.enc(pk) k2 = mceliece8192128f.dec(c, sk) assert (k1 == k2) python-mceliece-20241009.1/tests/test_mceliece8192128pc.py000066400000000000000000000003221474521302400226230ustar00rootroot00000000000000from mceliece import mceliece8192128pc def test_mceliece8192128pc(): pk, sk = mceliece8192128pc.keypair() c, k1 = mceliece8192128pc.enc(pk) k2 = mceliece8192128pc.dec(c, sk) assert (k1 == k2) python-mceliece-20241009.1/tests/test_mceliece8192128pcf.py000066400000000000000000000003271474521302400227760ustar00rootroot00000000000000from mceliece import mceliece8192128pcf def test_mceliece8192128pcf(): pk, sk = mceliece8192128pcf.keypair() c, k1 = mceliece8192128pcf.enc(pk) k2 = mceliece8192128pcf.dec(c, sk) assert (k1 == k2)