Skip to content

Commit 5f42431

Browse files
committed
docs: substantive CRG C annotation (EXPLAINME.adoc)
1 parent 9dc6dc6 commit 5f42431

1 file changed

Lines changed: 76 additions & 20 deletions

File tree

EXPLAINME.adoc

Lines changed: 76 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,97 @@
33
:toc:
44
:icons: font
55

6-
The README makes claims. This file backs them up.
6+
The README makes claims. This file backs them up with evidence from real code.
77

8-
[quote, README]
8+
== Core Claims & Evidence
9+
10+
=== Claim 1: "Cryptographic Protocol Suite: NIST Post-Quantum Standards"
11+
12+
**From README** (line 56):
913
____
10-
See `EXPORT-CONTROL.md` for full compliance requirements.
14+
* **Cryptography:** Kyber1024, Dilithium5, SPHINCS+ (NIST PQC standards)
1115
____
1216

13-
== Technology Choices
17+
**Evidence**: `/var/mnt/eclipse/repos/robodog-ecm/src/crypto.rs` implements Kyber1024 (ML-KEM-1024), Dilithium5 (ML-DSA-87), SPHINCS+ via liboqs-rust bindings. Integration tests in `/var/mnt/eclipse/repos/robodog-ecm/tests/crypto_integration_test.rs` verify key exchange, signature generation, and serialization roundtrips.
1418

15-
[cols="1,2"]
16-
|===
17-
| Technology | Learn More
19+
**Caveat**: Crypto implementations are *thin bindings* to liboqs (C library). No formal proofs of cryptographic correctness—only type-safe Rust wrappers around NIST reference implementations.
1820

19-
| **Zig** | https://ziglang.org
20-
| **Idris2 ABI** | https://www.idris-lang.org
21-
|===
21+
=== Claim 2: "Idris2 ABI + Zig FFI for Formal Verification"
22+
23+
**From README** (lines 51-52):
24+
____
25+
| ABI | **Idris2** | Dependent-type interface proofs
26+
| FFI | **Zig** | C-ABI bridge between ABI and core
27+
____
28+
29+
**Evidence**: `/var/mnt/eclipse/repos/robodog-ecm/src/abi/` contains Idris2 type definitions for ECM signal classification (Types.idr), formation geometry (Formation.idr), and cryptographic operations (Crypto.idr). `/var/mnt/eclipse/repos/robodog-ecm/ffi/zig/src/main.zig` implements the Zig FFI layer exposing C-ABI functions that call into Rust core.
30+
31+
**Caveat**: ABI proofs are *interface contracts only*. The Rust implementation (`src/ecm.rs`, `src/crypto.rs`) is NOT mechanically verified to match those contracts—correspondence is manual and property-tested via `/var/mnt/eclipse/repos/robodog-ecm/tests/` only.
32+
33+
=== Claim 3: "Export Control Compliance: Defensive Use Only"
34+
35+
**From README** (lines 77-86):
36+
____
37+
This project follows strict export control policies:
38+
1. **No offensive capabilities** - Defensive technologies only
39+
2. **No unauthorized export** - Compliance with ITAR/EAR regulations
40+
3. **Documented use cases** - All implementations have defensive justification
41+
4. **Access control** - Contributors must acknowledge export restrictions
42+
____
43+
44+
**Evidence**: `/var/mnt/eclipse/repos/robodog-ecm/EXPORT-CONTROL.md` documents compliance framework. `/var/mnt/eclipse/repos/robodog-ecm/Trustfile` (780 lines, 18 operational checks) enforces defensive-use constraints at build and runtime.
45+
46+
**Caveat**: Export control compliance depends on users *not* circumventing the code. Access control is voluntary (contributor acknowledgment). No cryptographic binding enforcement of "defensive use only" at execution time.
2247

2348
== Dogfooded Across The Account
2449

25-
Uses the hyperpolymath ABI/FFI standard (Idris2 + Zig). Same pattern used across
26-
https://github.com/hyperpolymath/proven[proven],
27-
https://github.com/hyperpolymath/burble[burble], and
28-
https://github.com/hyperpolymath/gossamer[gossamer].
50+
Uses the hyperpolymath ABI/FFI standard (Idris2 ABI + Zig FFI + V API). Same architectural pattern across:
51+
- https://github.com/hyperpolymath/proven-servers[proven-servers] — Protocol verification
52+
- https://github.com/hyperpolymath/burble[burble] — Telecom control plane
53+
- https://github.com/hyperpolymath/stapeln[stapeln] — Container validation
54+
- https://github.com/hyperpolymath/valence-shell[valence-shell] — Reversible operations
55+
56+
All share: *Formal verification at boundaries, high-performance Rust inside, safe FFI exposed via Zig.*
2957

3058
== File Map
3159

32-
[cols="1,2"]
60+
[cols="1,3"]
3361
|===
34-
| Path | What's There
62+
| Path | Contents & Purpose
63+
64+
| `src/ecm.rs` | ECM signal analysis: FFT spectrum computation, signal detection, interference classification. No formal proofs—empirical algorithms.
65+
66+
| `src/crypto.rs` | Post-quantum cryptography: Kyber1024 key encapsulation, Dilithium5 digital signatures, SPHINCS+ hash-based fallback. Thin bindings to liboqs.
67+
68+
| `src/formation.rs` | Formation control: 5 shapes (line, wedge, diamond, circle, grid), separation distance calculations, collision avoidance logic. Geometry functions but no formal proofs of safety.
69+
70+
| `src/autonomy.rs` | Defensive autonomy: safe-state transitions, threat detection, comms-loss recovery. State machines without formal model checking.
71+
72+
| `src/abi/Types.idr` | Idris2 dependent types: ECMSignal (frequency, power, classification), Formation (shape, spacing, orientation), CryptoKey (algorithm, parameter witnesses). Interfaces only.
73+
74+
| `src/abi/ECM.idr` | Idris2 ECM classification interface proving signal type correctness.
75+
76+
| `src/abi/Formation.idr` | Idris2 formation geometry proofs: separation distance bounds, collision impossibility proofs.
77+
78+
| `src/abi/Crypto.idr` | Idris2 key exchange and signature interface contracts.
79+
80+
| `src/abi/Foreign.idr` | FFI boundary specification: C function declarations, parameter/return type contracts.
81+
82+
| `ffi/zig/src/main.zig` | Zig FFI bridge: C-ABI compatible runtime exposing signal classification, distance checks, formation validation. Calls into Rust implementations.
83+
84+
| `api/v-lang/` | V-language public API: type mirrors of Idris2 ABI, query functions for classification and recommendations.
85+
86+
| `spark/` | Ada/SPARK safety specs: formal specifications (not proofs) of ECM, formation, and autonomy safety invariants.
87+
88+
| `tests/crypto_integration_test.rs` | Crypto roundtrip tests: key generation, encapsulation/decapsulation, signature generation/verification.
89+
90+
| `tests/formation_test.rs` | Formation geometry validation: separation distance calculations, collision detection.
91+
92+
| `EXPORT-CONTROL.md` | Compliance framework: ITAR/EAR/Wassenaar categories, defensive justification, access control policy.
3593

36-
| `src/` | Source code
37-
| `ffi/` | Foreign function interface
38-
| `test(s)/` | Test suite
94+
| `Trustfile` | Comprehensive trust boundary specification (780 lines, 18 operational checks).
3995
|===
4096

4197
== Questions?
4298

43-
Open an issue or reach out directly — happy to explain anything in more detail.
99+
Open an issue or reach out at j.d.a.jewell@open.ac.uk — happy to explain the ECM architecture, formal verification boundaries, and export control design.

0 commit comments

Comments
 (0)