v0.0.7: Chunked encrypted file transfer

Protocol:
- WireMessage::FileHeader { id, sender_fp, filename, file_size, total_chunks, sha256 }
- WireMessage::FileChunk { id, sender_fp, filename, chunk_index, total_chunks, data }
- 64KB chunks, SHA-256 integrity verification

CLI TUI:
- /file <path> command: reads file, chunks, encrypts each with ratchet, sends
- Progress display: "Sending file.pdf [3/10]..."
- Incoming file reassembly with chunk tracking
- SHA-256 verification on complete
- Saves to data_dir/downloads/
- Max file size: 10MB

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-03-27 10:26:05 +04:00
parent b168ecc609
commit 708080f7be
7 changed files with 431 additions and 11 deletions

View File

@@ -66,4 +66,22 @@ pub enum WireMessage {
message_id: String,
receipt_type: ReceiptType,
},
/// File transfer header: announces an incoming chunked file.
FileHeader {
id: String,
sender_fingerprint: String,
filename: String,
file_size: u64,
total_chunks: u32,
sha256: String,
},
/// A single chunk of a file transfer (data is ratchet-encrypted).
FileChunk {
id: String,
sender_fingerprint: String,
filename: String,
chunk_index: u32,
total_chunks: u32,
data: Vec<u8>,
},
}