feat: implement INT-11 AES-256-GCM encryption, INT-12 Ed25519 signing, INT-13 HNSW batch insert

INT-11 (clawhdf5-agent/src/encryption.rs):
- AES-256-GCM seal/open with PBKDF2-HMAC-SHA256 key derivation (200k iters)
- Passphrase-based and raw-key APIs; envelope format with magic+version+salt+nonce
- `encryption` feature gate (ring 0.17); 9 unit tests covering roundtrips,
  wrong-key, tampered-data, malformed-envelope, and empty-plaintext cases

INT-12 (clawhdf5-agent/src/signing.rs):
- Ed25519 keypair generation, in-memory sign/verify, and file-level sidecar API
- `.sig` sidecar format: magic + version + public-key + signature
- `sign_file` / `verify_file` helpers for .brain file trust verification
- `signing` feature gate (ring 0.17); 8 unit tests including file-level tamper detection

INT-13 (clawhdf5-ann/src/hnsw.rs):
- `HnswIndex::batch_insert`: parallel neighbor search (rayon) + serial edge wiring
- `find_neighbors_for` standalone helper (also used by the `parallel` cfg path)
- Parallelism via existing `parallel` feature; degrades to serial without it
- 5 new tests: empty noop, sequential IDs, existing-index append, quality, save/load

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
ClawHDF5 Planner
2026-08-12 12:15:22 +00:00
co-authored by Claude Sonnet 4.6
parent fdd8901c37
commit 87039e926c
5 changed files with 808 additions and 0 deletions
+3
View File
@@ -23,6 +23,7 @@ rayon = { version = "1", optional = true }
matrixmultiply = { version = "0.3", optional = true }
cblas-sys = { version = "0.1", optional = true }
tokio = { version = "1", features = ["rt", "sync", "macros", "time"], optional = true }
ring = { version = "0.17", optional = true }
[target.'cfg(target_os = "macos")'.dependencies]
accelerate-src = { version = "0.3", optional = true }
@@ -60,3 +61,5 @@ fast-math = ["matrixmultiply"]
accelerate = ["accelerate-src", "cblas-sys"]
openblas = ["openblas-src", "cblas-sys"]
async = ["tokio"]
encryption = ["ring"]
signing = ["ring"]