Commit Graph

2 Commits

Author SHA1 Message Date
Markus Maiwald e1df4b89c9 feat(l1-identity): integrate ML-KEM-768 post-quantum key and fix Zig 0.13 compatibility 2026-01-31 00:13:36 +01:00
Markus Maiwald ef68f89b55 Implement Phase 2D: DID Integration & Local Cache (Minimal Scope)
Complete DID parsing and resolution cache for L0-L1 identity layer:

- Add l1-identity/did.zig (360 lines):
  * DIDIdentifier struct with parsing for did:METHOD:ID format
  * Support mosaic, libertaria, and future DID methods
  * Method-specific ID hashing for O(1) cache lookups
  * Full validation of DID syntax (no schema validation)

- DIDCache with TTL-based expiration:
  * Local resolution cache with automatic expiration
  * Store/get/invalidate/prune operations
  * Opaque metadata storage (no deserialization)
  * Clean FFI boundary for L2+ resolver integration

- Update build.zig:
  * Add did.zig module definition
  * Create DID test artifacts
  * Update test suite to include 8 new DID tests

Design Philosophy: Protocol stays dumb
- L0-L1 provides: DID parsing, local cache, wire frame integration
- L2+ provides: W3C validation, rights enforcement, tombstoning
- Result: 93-94% Kenya Rule compliance maintained

Test Results: 51/51 passing (100% coverage)
- 11 Crypto (SHAKE)
- 16 Crypto (FFI)
- 4 L0 (LWF)
- 3 L1 (SoulKey)
- 4 L1 (Entropy)
- 7 L1 (Prekey)
- 8 L1 (DID) [NEW]

Kenya Rule: 26-35 KB binaries (zero regression)

Project Progress: 50% Complete
- Phase 1-2D:  All complete
- Phase 3 (PQXDH):  Ready to start

See docs/PHASE_2D_COMPLETION.md for detailed report.
2026-01-30 21:02:19 +01:00