Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
c47c208
Scaffolding for the rust python package
Zikithezikit Feb 20, 2026
1846068
Working hints
Zikithezikit Feb 20, 2026
54a0d98
Better file struct + Makefile
Zikithezikit Feb 20, 2026
730f83f
working kyber
Zikithezikit Feb 20, 2026
cd46c3c
added tests.
Zikithezikit Feb 20, 2026
23e87c2
More verbose funcion and var names
Zikithezikit Feb 20, 2026
c1b5a23
changed public api
Zikithezikit Feb 20, 2026
0a52dc6
changed public api again
Zikithezikit Feb 20, 2026
9e16c47
changed public api again v2
Zikithezikit Feb 20, 2026
febab8a
Added 512, 1024 support
Zikithezikit Feb 20, 2026
1ff3274
Better rust testing
Zikithezikit Feb 20, 2026
fca21b1
Better README.md
Zikithezikit Feb 20, 2026
f8736cc
Ready for PyPI
Zikithezikit Feb 20, 2026
0e71ae1
Add Python 3.8+ support with abi3
Zikithezikit Feb 21, 2026
611722a
v0.1.2 - Add Python 3.8+ support and Termux (aarch64, armv7)
Zikithezikit Feb 21, 2026
03e0d08
lsp syntax support
Zikithezikit Feb 22, 2026
857fcf1
initial proper error handling in python
Zikithezikit Feb 22, 2026
e445d4d
more panic tests and error handling
Zikithezikit Feb 22, 2026
2780216
more verbose errors
Zikithezikit Feb 22, 2026
0cc07ae
Better python file structure
Zikithezikit Feb 22, 2026
36b5fe0
Bump version to 0.1.4
Zikithezikit Feb 22, 2026
80c0411
Add error handling section to README
Zikithezikit Feb 22, 2026
6a7228b
Bump version to 0.1.5
Zikithezikit Feb 22, 2026
f886d70
Added new decapsulate feature
Zikithezikit Feb 23, 2026
f726e39
Added stress tests and grpahs from it
Zikithezikit Feb 23, 2026
1cb2743
Added backwards compatibility
Zikithezikit Feb 25, 2026
1a50225
version bump
Zikithezikit Feb 25, 2026
e26d2a3
version bump
Zikithezikit Feb 25, 2026
c439291
feat: add deterministic key generation and serialization utilities
Zikithezikit Mar 10, 2026
ab9bd57
docs: add invalid seed size to common error cases in README
Zikithezikit Mar 10, 2026
0e495e1
security: implement memory zeroing and harden cryptographic primitives
Zikithezikit Mar 10, 2026
8a6de50
feat: implement comprehensive security hardening and compliance fixes
Zikithezikit Mar 10, 2026
0fe47e5
Merge pull request #2 from Zikithezikit/feature/deterministic-keys-se…
Zikithezikit Mar 10, 2026
6a4de71
Bump version to 0.2.0
Zikithezikit Mar 10, 2026
2703cac
Release v1.0.0
Zikithezikit Jun 6, 2026
2b0b422
v1.0.1: fix PyPI classifier for Unlicense
Zikithezikit Jun 6, 2026
fee06d9
v1.0.2: bump version
Zikithezikit Jun 6, 2026
f0d2687
v1.0.3: restore PyPy wheels in CI
Zikithezikit Jun 6, 2026
f451353
v1.0.5: add Android armv7 + multi-version Python wheels
Zikithezikit Jun 6, 2026
7597bb1
fix: bump linux-pypy manylinux to 2_34, remove _PYTHON_SYSCONFIGDATA_…
Zikithezikit Jun 6, 2026
23cfb7a
fix: use target-prefixed clang (NDK r27d removed generic clang)
Zikithezikit Jun 6, 2026
583ab88
fix: use versioned clang binary directly (NDK r27d wrappers still ref…
Zikithezikit Jun 6, 2026
05ee55d
fix: search for clang-* (versioned) with hyphen; NDK r27d clang binar…
Zikithezikit Jun 6, 2026
a6bae76
fix: add --ld-path for clang (NDK r27d removed ld.lld symlink)
Zikithezikit Jun 6, 2026
07b125f
fix: recreate ld.lld symlink (removed in NDK r27d); lld needs argv[0]…
Zikithezikit Jun 6, 2026
c5fa21c
fix: restore clang/clang++/ld.lld symlinks removed in NDK r27d
Zikithezikit Jun 6, 2026
284cc05
fix: add libpython3.so symlink for pyo3's -lpython3 linker flag
Zikithezikit Jun 6, 2026
e065e8d
fix: set ANDROID_API_LEVEL env var for maturin
Zikithezikit Jun 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
319 changes: 319 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,319 @@
# This file is autogenerated by maturin v1.12.3
# To update, run
#
# maturin generate-ci github
#
name: CI

on:
push:
branches:
- main
tags:
- '*'
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
linux:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-22.04
target: x86_64
- runner: ubuntu-22.04
target: x86
- runner: ubuntu-22.04
target: aarch64
- runner: ubuntu-22.04
target: armv7
- runner: ubuntu-22.04
target: s390x
- runner: ubuntu-22.04
target: ppc64le
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v5
with:
name: wheels-linux-${{ matrix.platform.target }}
path: dist

linux-pypy:
runs-on: ubuntu-22.04
strategy:
matrix:
target:
- x86_64
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: 'pypy-3.11'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --interpreter pypy3.11
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: 2_34
container: off
- name: Upload wheels
uses: actions/upload-artifact@v5
with:
name: wheels-linux-pypy-${{ matrix.target }}
path: dist

musllinux:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-22.04
target: x86_64
- runner: ubuntu-22.04
target: x86
- runner: ubuntu-22.04
target: aarch64
- runner: ubuntu-22.04
target: armv7
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: musllinux_1_2
- name: Upload wheels
uses: actions/upload-artifact@v5
with:
name: wheels-musllinux-${{ matrix.platform.target }}
path: dist

windows:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: windows-latest
target: x64
python_arch: x64
- runner: windows-latest
target: x86
python_arch: x86
- runner: windows-11-arm
target: aarch64
python_arch: arm64
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.12'
architecture: ${{ matrix.platform.python_arch }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
- name: Upload wheels
uses: actions/upload-artifact@v5
with:
name: wheels-windows-${{ matrix.platform.target }}
path: dist

macos:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: macos-15-intel
target: x86_64
- runner: macos-latest
target: aarch64
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}

android:
runs-on: ubuntu-22.04
strategy:
matrix:
target:
- aarch64-linux-android
- armv7-linux-androideabi
- x86_64-linux-android
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
steps:
- uses: actions/checkout@v6
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r27d
local-cache: true
- name: Prepare PYO3_CROSS_LIB_DIR
run: |
NDK="$ANDROID_NDK_ROOT"
TOOLCHAIN="$NDK/toolchains/llvm/prebuilt/linux-x86_64"
ANDROID_API=24
PYVER="${{ matrix.python-version }}"
MOCK_DIR="${{ github.workspace }}/android_python_${{ matrix.target }}_${{ matrix.python-version }}"
mkdir -p "$MOCK_DIR"

case "${{ matrix.target }}" in
aarch64-linux-android) CLANG_TARGET="aarch64-linux-android${ANDROID_API}" ;;
armv7-linux-androideabi) CLANG_TARGET="armv7a-linux-androideabi${ANDROID_API}" ;;
x86_64-linux-android) CLANG_TARGET="x86_64-linux-android${ANDROID_API}" ;;
esac

# NDK r27d removed generic clang/ld.lld symlinks; restore them so
# maturin-action's target-prefixed wrappers (${TARGET}-clang) can work.
CLANG=$(ls "$TOOLCHAIN/bin/clang-"[0-9]* 2>/dev/null | head -1)
if [ -z "$CLANG" ]; then
CLANG="$TOOLCHAIN/bin/clang"
if [ ! -f "$CLANG" ]; then
echo "ERROR: no clang found in $TOOLCHAIN/bin/"
ls -la "$TOOLCHAIN/bin/" | head -30
exit 1
fi
else
CLANG_BASE=$(basename "$CLANG")
ln -sf "$CLANG_BASE" "$TOOLCHAIN/bin/clang"
ln -sf "$CLANG_BASE" "$TOOLCHAIN/bin/clang++"
fi
ln -sf lld "$TOOLCHAIN/bin/ld.lld"
"$CLANG" --target="$CLANG_TARGET" -shared \
-Wl,-soname,"libpython${PYVER}.so" \
-o "$MOCK_DIR/libpython${PYVER}.so" -xc /dev/null
# pyo3 also links -lpython3 (versionless); provide it as a symlink
ln -sf "libpython${PYVER}.so" "$MOCK_DIR/libpython3.so"

case "${{ matrix.target }}" in
aarch64-linux-android) LIBDL_ARCH="aarch64-linux-android" ;;
armv7-linux-androideabi) LIBDL_ARCH="arm-linux-androideabi" ;;
x86_64-linux-android) LIBDL_ARCH="x86_64-linux-android" ;;
esac
LIBDL=$(find "$TOOLCHAIN/sysroot/usr/lib/$LIBDL_ARCH" -name libdl.so | head -1)
[ -n "$LIBDL" ] && cp "$LIBDL" "$MOCK_DIR/"

SYSCONFIG_NAME="_sysconfigdata__linux_${{ matrix.target }}"
cat > "$MOCK_DIR/${SYSCONFIG_NAME}.py" << EOF
build_time_vars = {
'abiflags': '',
'ABIFLAGS': '',
'SO': '.so',
'SOABI': 'cpython-${PYVER}',
'EXT_SUFFIX': '.so',
'LIBDIR': '$MOCK_DIR',
'LDLIBRARY': 'libpython${PYVER}.so',
'Py_ENABLE_SHARED': 1,
'CC': 'clang',
'CXX': 'clang++',
'VERSION': '${PYVER}',
'LDSHARED': 'clang -shared',
'LDFLAGS': '-L$MOCK_DIR',
'CCSHARED': '-fPIC',
'GNULD': 'yes',
'Py_DEBUG': 0,
'WITH_PYMALLOC': 1,
}
EOF

echo "PYO3_CROSS_LIB_DIR=$MOCK_DIR" >> "$GITHUB_ENV"
echo "PYO3_CROSS_PYTHON_VERSION=$PYVER" >> "$GITHUB_ENV"
echo "ANDROID_API_LEVEL=$ANDROID_API" >> "$GITHUB_ENV"

RFLAGS_VAR="CARGO_TARGET_$(echo "${{ matrix.target }}" | tr '[:lower:]-' '[:upper:]_')_RUSTFLAGS"
echo "$RFLAGS_VAR=-C link-arg=-Wl,--no-as-needed -C link-arg=-lpython${PYVER} -C link-arg=-Wl,--unresolved-symbols=ignore-all" >> "$GITHUB_ENV"
env:
ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: off
env:
ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
- name: Upload wheels
uses: actions/upload-artifact@v5
with:
name: wheels-android-${{ matrix.target }}-${{ matrix.python-version }}
path: dist

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v5
with:
name: wheels-sdist
path: dist

release:
name: Release
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
needs: [linux, linux-pypy, musllinux, windows, macos, android, sdist]
permissions:
# Use to sign the release artifacts
id-token: write
# Used to upload release artifacts
contents: write
# Used to generate artifact attestation
attestations: write
steps:
- uses: actions/download-artifact@v6
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v3
with:
subject-path: 'wheels-*/*'
- name: Install uv
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: astral-sh/setup-uv@v7
- name: Publish to PyPI
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: uv publish 'wheels-*/*'
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.venv/
target/
__pycache__/
.vscode/
*.so
*.pyi
.pytest_cache/

# Opencode
.opencode/
Loading
Loading