aeg.raf: StreamStorage adapter; accept io.BytesIO directly

StreamStorage wraps any seek-based file-like object using the same
lock + seek/read/write pattern as FileStorage's fallback for platforms
without pread/pwrite. create()/open() auto-wrap io.BytesIO, so in-memory
use no longer requires the explicit BytesIOStorage wrapper. The caller
keeps ownership of the stream (Raf does not close it).
This commit is contained in:
LeoVasanko committed 2026-10-04 14:30:59 +00:00
1 parent f2a21856b3
commit 32954c4eba
3 files changed
+86 -3

No files matched your search

+1 -1
View File
@@ -135,7 +135,7 @@ Seeded once from the OS, then a deterministic AEGIS keystream: each call increme
### Random-access encrypted files (aeg.raf)
pread/pwrite-style access to files split into independently encrypted chunks, with optional Merkle tree integrity. Storage is pluggable (file path, aeg.raf.FileStorage, aeg.raf.BytesIOStorage, or a custom Storage).
pread/pwrite-style access to files split into independently encrypted chunks, with optional Merkle tree integrity. Storage is pluggable: a file path, io.BytesIO, aeg.raf.FileStorage / BytesIOStorage / StreamStorage, or a custom Storage.
- raf.create(path_or_storage, key, cipher, chunk_size=65536, merkle=False) / raf.open(...)
- f.read(size, offset), f.pread(size, offset), f.write(data, offset), f.pwrite(data, offset)