-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba70b01
commit 51b71d9
Showing
8 changed files
with
81 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from os import system | ||
from pathlib import Path | ||
|
||
|
||
sources = [] | ||
for pth in Path('slhdsa').glob('**/*.py'): | ||
if pth.name!='__init__.py': | ||
sources.append(pth.as_posix().replace('/', '\\')) | ||
system(' '.join(['mypyc']+sources)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[project] | ||
name = "SLH-DSA" | ||
version = "0.1.3" | ||
description = "The pure python impl of the slh-das algorithm(based on fips205)." | ||
description = "The pure python implement of the slh-dsa algorithm(based on fips205)." | ||
authors = [ | ||
{name = "Colinxu2020", email = "[email protected]"}, | ||
] | ||
|
@@ -37,9 +37,8 @@ keywords = ['fips205', 'slhdsa', 'sphincs', 'sphincsplus', 'crypto', 'cryptograp | |
"Bug Tracker" = "https://github.com/colinxu2020/slhdsa/issues" | ||
|
||
[build-system] | ||
requires = ["pdm-backend"] | ||
build-backend = "pdm.backend" | ||
|
||
requires = ["setuptools>=61", "wheel", "mypy>=1.10.1", "tomli>=1.1.0; python_version<'3.11'"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.pdm] | ||
distribution = true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/env python | ||
|
||
import glob | ||
import os | ||
from pathlib import Path | ||
import sys | ||
|
||
if sys.version_info < (3, 9, 0): | ||
sys.stderr.write("ERROR: You need Python 3.9 or later to use slh-dsa yet.\n") | ||
exit(1) | ||
|
||
from setuptools import Extension, find_packages, setup | ||
from setuptools.command.build_py import build_py | ||
|
||
try: | ||
import tomllib | ||
except ModuleNotFoundError: | ||
import tomli as tomllib | ||
|
||
|
||
if os.getenv('SLHDSA_BUILD_OPTIMIZED', '0') == '1': | ||
mypyc_targets = [] | ||
print('Building Optimized Library') | ||
|
||
for pth in Path('slhdsa').glob('**/*.py'): | ||
if pth.name != '__init__.py': | ||
mypyc_targets.append(pth.as_posix().replace('/', os.sep)) | ||
|
||
from mypyc.build import mypycify | ||
|
||
ext_modules = mypycify( | ||
mypyc_targets, | ||
opt_level = "3", | ||
debug_level = "1" | ||
) | ||
else: | ||
ext_modules = [] | ||
|
||
|
||
metadata = tomllib.load(open('pyproject.toml', 'rb'))['project'] | ||
setup( | ||
name = "slhdsa", | ||
version = metadata['version'], | ||
description = metadata['description'], | ||
long_description = open('README.md', encoding='utf8').read(), | ||
author = metadata["authors"][0]["name"], | ||
author_email = metadata["authors"][0]["email"], | ||
url = metadata["urls"]["Homepage"], | ||
license = metadata["license"], | ||
py_modules = [], | ||
ext_modules = ext_modules, | ||
packages = find_packages(), | ||
classifiers = metadata["classifiers"], | ||
install_requires = metadata["dependencies"], | ||
python_requires = metadata["requires-python"], | ||
include_package_data = True, | ||
project_urls = metadata["urls"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters