-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
74 lines (54 loc) · 1.96 KB
/
setup.py
File metadata and controls
74 lines (54 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# setup.py based on https://github.com/himbeles/ctypes-example
# https://stackoverflow.com/questions/4529555/building-a-ctypes-based-c-library-with-distutils
from setuptools import setup, Extension, find_packages
from distutils.command.build_ext import build_ext as build_ext_orig
class CTypesExtension(Extension):
pass
class build_ext(build_ext_orig):
def build_extension(self, ext):
self._ctypes = isinstance(ext, CTypesExtension)
return super().build_extension(ext)
def get_export_symbols(self, ext):
if self._ctypes:
return ext.export_symbols
return super().get_export_symbols(ext)
def get_ext_filename(self, ext_name):
if self._ctypes:
return ext_name + '.so'
return super().get_ext_filename(ext_name)
setup(
name='wboxkit',
version='0.4.3',
description='White-box Design & Cryptanalyis Kit',
keywords='white-box cryptography design cryptanalyis circuits',
author='Aleksei Udovenko',
author_email='aleksei@affine.group',
url='https://github.com/hellman/wboxkit',
license='MIT',
packages=find_packages("src"),
package_dir={'': 'src'},
python_requires='>=3',
install_requires=['bitarray', 'circkit', 'binteger'],
ext_modules=[
CTypesExtension(
'wboxkit.libfastcircuit',
sources=['src/wboxkit/fastcircuit.c'],
depends=['src/wboxkit/fastcircuit.h'],
)
],
cmdclass={'build_ext': build_ext},
entry_points = {
'console_scripts': [
'wboxkit.trace=wboxkit.attacks.trace:main',
'wboxkit.exact=wboxkit.attacks.exact:main',
'wboxkit.lda=wboxkit.attacks.lda:main',
],
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Science/Research',
'Topic :: Security :: Cryptography',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
],
)