feat: add per-peer ratchet session manager with disk persistence

- Create mesh/session.rs: SessionManager for Double Ratchet state lifecycle
  - Lazy-loads sessions from disk on first message
  - Saves after every encrypt/decrypt (chain key advancement)
  - Per-DID storage at {data_dir}/ratchet/{sha256(did)}.json
  - Session info API for RPC status reporting
  - Zeroize on drop for all key material
- Tests: store+load roundtrip, encrypt/decrypt through manager, session removal

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-17 01:54:26 +00:00
parent e60ac99b12
commit 6c23360522
2 changed files with 287 additions and 0 deletions

View File

@@ -17,6 +17,8 @@ pub mod types;
#[allow(dead_code)]
pub mod ratchet;
#[allow(dead_code)]
pub mod session;
#[allow(dead_code)]
pub mod x3dh;
pub use types::*;