threadpanic/rustpg
1
0
Fork
You've already forked rustpg
0

refactor: typed wire-format structs — replace byte-offset indexing in decrypt.rs #30

Open
opened 2026年05月18日 07:41:54 +02:00 by threadsafety · 0 comments

The decrypt path works with raw byte slices and magic offsets (data[27..39], data[11..27], etc.). Parsing the binary envelope into a strongly-typed Envelope { algo_id, kdf_id, salt, nonce, ciphertext } at the I/O boundary and propagating the struct through the call stack would eliminate this indexing, make the parsing logic auditable in one place, and produce better error messages when a header field is out of range.

The decrypt path works with raw byte slices and magic offsets (`data[27..39]`, `data[11..27]`, etc.). Parsing the binary envelope into a strongly-typed `Envelope { algo_id, kdf_id, salt, nonce, ciphertext }` at the I/O boundary and propagating the struct through the call stack would eliminate this indexing, make the parsing logic auditable in one place, and produce better error messages when a header field is out of range.
Sign in to join this conversation.
No Branch/Tag specified
main
alpha-0.4.1
alpha-0.4.0
alpha-0.3.3
alpha-0.3.2
alpha-0.3.1
v0.3.1
alpha-1
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
threadpanic/rustpg#30
Reference in a new issue
threadpanic/rustpg
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?