Backends at a glance
| Backend | Implementation | Relative speed | When to use |
|---|---|---|---|
vortex-pqc-native | C extension (compiled) | ~10× faster | Production, benchmarks, services |
vortex-pqc-pure-python | Python reference (schoolbook mul) | Baseline | CI without compiler, education, correctness checks |
Running benchmarks
python
from vortex_pqc import benchmark_throughput, native_backend
print(f"Backend: {native_backend()}")
results = benchmark_throughput(operations=50)
for op, stats in results.items():
ops = stats["mean_ops"]
ci = stats["confidence_interval"]
print(f"{op:8s} {ops:8,.0f} ops/s (± {ci:,.0f})")Example output (native, Apple Silicon — your numbers will vary):
Backend: vortex-pqc-native-aarch64
keygen 1,200 ops/s (± 50)
encaps 1,100 ops/s (± 45)
decaps 1,150 ops/s (± 48)Where time is spent
| Operation | Dominant cost | Notes |
|---|---|---|
| Keygen | 1× poly mul per rotation + XOF | 1 XOF call (vs 4 in Kyber-512) |
| Encaps | K poly muls + hashing | Fresh randomness each call |
| Decaps | K poly muls + re-encryption | FO check adds one full encaps path |
VORTEX vs Kyber-512 efficiency
| Metric | Kyber-512 | VORTEX-256 | Advantage |
|---|---|---|---|
| Key expansion XOF calls | 4 | 1 | VORTEX |
| Frobenius rotations | N/A | K−1 permutations | VORTEX (free vs XOF) |
| Private key size | 1 632 B | 1 248 B | VORTEX |
| Poly mul count (encaps) | Similar | Similar | Tie |
| NTT optimisation | Available | Planned | Kyber (today) |
Optimisation roadmap
| Optimisation | Status | Expected gain |
|---|---|---|
| Schoolbook poly mul (C) | ✅ Shipped | Baseline native |
| NTT-based poly mul | 🔜 Planned | 5–10× on poly operations |
| AVX2 / NEON SIMD | 🔜 Planned | 2–4× on NTT |
ARM64 -mcpu=native | ✅ Shipped | Platform-specific tuning |
Tuning for your deployment
Maximise throughput (servers)
✓ Install with C compiler present (native backend)
✓ Use pip install without --no-binary
✓ Pre-generate key pairs (keygen is amortised)
✓ Batch encapsulations if your protocol allowsMinimise binary size (embedded)
✓ Link only libvortex_pqc.a (no Python)
✓ Strip symbols: cc ... -s
✓ Pre-provision keys offline (skip keygen on device)CI without a compiler
✓ Pure Python backend works everywhere
✓ All 26 tests pass without _native.so
✓ Slower but cryptographically identicalC benchmark
bash
cd c
make lib
# Optional: build and run bench test if available
make -C c test