Skip to content

Commit 26587a1

Browse files
authored
Merge origin/main into feature/gui-professional-interface, resolving conflicts
2 parents cbfe440 + 5e5b0b4 commit 26587a1

105 files changed

Lines changed: 23980 additions & 169 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM ubuntu:24.04
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
RUN apt-get update && apt-get install -y --no-install-recommends \
6+
build-essential cmake git ca-certificates wget curl pkg-config \
7+
python3 python3-pip python3-venv python3-dev ca-certificates \
8+
libssl-dev libffi-dev && \
9+
rm -rf /var/lib/apt/lists/*
10+
11+
# Install liboqs from source
12+
WORKDIR /opt
13+
RUN git clone --depth 1 https://github.com/open-quantum-safe/liboqs.git && \
14+
mkdir -p liboqs/build && cd liboqs/build && \
15+
cmake -DCMAKE_BUILD_TYPE=Release .. && \
16+
make -j"$(nproc)" && make install
17+
18+
# Ensure pip is upgraded and install Python oqs wrapper
19+
RUN python3 -m pip install --upgrade pip setuptools wheel && \
20+
python3 -m pip install oqs
21+
22+
WORKDIR /workspace

.devcontainer/devcontainer.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "Mohawk Inference Devcontainer",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"workspaceFolder": "/workspace",
7+
"settings": {},
8+
"extensions": [],
9+
"forwardPorts": [8003],
10+
"postCreateCommand": "./.devcontainer/post_create.sh"
11+
}

.devcontainer/post_create.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
echo "Running devcontainer post-create: install build deps and liboqs"
5+
# install system deps (attempt apt, then apk)
6+
if command -v apt-get >/dev/null 2>&1; then
7+
sudo apt-get update
8+
sudo apt-get install -y build-essential cmake git python3-dev python3-pip pkg-config
9+
elif command -v apk >/dev/null 2>&1; then
10+
sudo apk add --no-cache build-base cmake git python3 python3-dev py3-pip pkgconfig
11+
else
12+
echo "Unknown package manager; please install build tools (cmake, make, git, python3-dev) manually"
13+
fi
14+
15+
CACHE_DIR="$HOME/.cache/liboqs"
16+
mkdir -p "$CACHE_DIR"
17+
if [ ! -d "$CACHE_DIR/liboqs" ]; then
18+
git clone --depth 1 https://github.com/open-quantum-safe/liboqs.git "$CACHE_DIR/liboqs"
19+
fi
20+
21+
pushd "$CACHE_DIR/liboqs"
22+
mkdir -p build && cd build
23+
cmake -DCMAKE_BUILD_TYPE=Release ..
24+
make -j"$(nproc)"
25+
if command -v sudo >/dev/null 2>&1; then
26+
sudo make install
27+
else
28+
make install
29+
fi
30+
popd
31+
32+
# ensure pip and install oqs python package
33+
python3 -m pip install --upgrade pip || true
34+
python3 -m pip install oqs || true
35+
36+
echo "post-create complete"

.github/workflows/ci.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, feat/* ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
inputs:
10+
build_liboqs:
11+
description: Build liboqs from source before running tests
12+
required: false
13+
default: false
14+
type: boolean
15+
16+
jobs:
17+
test:
18+
runs-on: ubuntu-latest
19+
env:
20+
OQS_INSTALL_PATH: /usr/local
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v4
27+
with:
28+
python-version: '3.12'
29+
30+
- name: Install system deps
31+
run: |
32+
sudo apt-get update
33+
sudo apt-get install -y build-essential cmake libssl-dev pkg-config
34+
35+
- name: Optionally build liboqs
36+
if: github.event_name == 'workflow_dispatch' && inputs.build_liboqs || vars.BUILD_LIBOQS == 'true'
37+
run: |
38+
git clone --depth 1 https://github.com/open-quantum-safe/liboqs.git /tmp/liboqs
39+
mkdir -p /tmp/liboqs/build && cd /tmp/liboqs/build
40+
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local ..
41+
make -j$(nproc)
42+
sudo make install
43+
sudo ldconfig
44+
python -m pip install liboqs-python
45+
46+
- name: Install Python deps
47+
run: |
48+
python -m pip install --upgrade pip
49+
pip install -r prototype/requirements.txt
50+
pip install bandit safety pre-commit
51+
52+
- name: Run security scan (Bandit)
53+
run: |
54+
bandit -r prototype/ --exit-zero -f json -o bandit-report.json
55+
echo "Bandit report saved to bandit-report.json"
56+
57+
- name: Check for vulnerable dependencies (Safety)
58+
run: |
59+
safety check --json > security-report.json || true
60+
echo "Safety report saved to security-report.json"
61+
62+
- name: Run repository hygiene hooks
63+
run: |
64+
pre-commit run check-yaml --all-files
65+
pre-commit run check-json --all-files
66+
pre-commit run check-added-large-files --all-files
67+
68+
- name: Run tests
69+
run: |
70+
pytest -q prototype/test_security_fixes.py prototype/test_oqs_hybrid.py prototype/test_secure_hybrid_integration.py prototype/test_concurrency_smoke.py prototype/test_secure_run.py -v
71+
72+
- name: Upload security reports
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: security-reports
76+
path: |
77+
bandit-report.json
78+
security-report.json
79+
80+
build:
81+
needs: test
82+
runs-on: ubuntu-latest
83+
steps:
84+
- uses: actions/checkout@v4
85+
86+
- name: Build Docker images
87+
run: |
88+
docker compose -f docker-compose.dev.yml build

.gitignore

Lines changed: 33 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
```
21
# Python
32
__pycache__/
43
*.py[cod]
@@ -25,59 +24,48 @@ wheels/
2524
venv/
2625
ENV/
2726
env/
28-
.venv/
29-
env.bak/
30-
venv.bak/
31-
32-
# Testing
33-
.pytest_cache/
34-
.coverage
35-
htmlcov/
36-
.coverage.*
37-
.noserc
38-
.testing_data
27+
.venv
3928

4029
# IDE
4130
.vscode/
4231
.idea/
4332
*.swp
4433
*.swo
45-
*.tmp
46-
47-
# Logs
48-
*.log
49-
50-
# Environment variables
51-
.env
52-
.env.local
53-
*.env.*
34+
*~
35+
.project
36+
.pydevproject
37+
.settings/
5438

55-
# Coverage
56-
coverage/
39+
# Testing
40+
.pytest_cache/
41+
.coverage
5742
htmlcov/
58-
59-
# Distribution / packaging
60-
.Python
61-
build/
62-
develop-eggs/
63-
dist/
64-
downloads/
65-
eggs/
66-
.eggs/
67-
lib/
68-
lib64/
69-
parts/
70-
sdist/
71-
var/
72-
wheels/
73-
pip-wheel-metadata/
74-
share/python-wheels/
43+
.tox/
44+
.nox/
45+
.coverage.*
7546
*.egg-info/
76-
.installed.cfg
77-
*.egg
78-
MANIFEST
7947

80-
# System
48+
# Environment
49+
.env
50+
.venv
51+
env/
52+
ENV/
53+
54+
# OS files
8155
.DS_Store
8256
Thumbs.db
83-
```
57+
*.log
58+
59+
# Mohawk-specific
60+
__pycache__/
61+
*.pkl
62+
*.pickle
63+
*.pt
64+
*.pth
65+
66+
# Docker volumes (if any)
67+
.docker-volume/
68+
69+
# Local configuration
70+
.local/
71+
.cache/

.pre-commit-config.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-json
9+
- id: check-added-large-files
10+
args: [--maxkb=512000]
11+
12+
- repo: https://github.com/psf/black
13+
rev: 23.12.1
14+
hooks:
15+
- id: black
16+
language_version: python3
17+
18+
- repo: https://github.com/pycqa/isort
19+
rev: 5.12.0
20+
hooks:
21+
- id: isort
22+
args: [--profile=black]
23+
24+
- repo: https://github.com/pycqa/flake8
25+
rev: 6.1.0
26+
hooks:
27+
- id: flake8
28+
additional_dependencies:
29+
- flake8-bugbear
30+
- flake8-comprehensions
31+
- flake8-import-order
32+
33+
- repo: https://github.com/pre-commit/mirrors-mypy
34+
rev: v1.7.1
35+
hooks:
36+
- id: mypy
37+
additional_dependencies:
38+
- numpy
39+
- types-requests
40+
args: [--ignore-missing-imports]

0 commit comments

Comments
 (0)