Add external padding, pad_to structure#40
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds “structure” descriptors and pad_to APIs to normalize long pseudonyms/attributes/records (and JSON values) to a consistent block shape, enabling batch transcryption without leaking length/shape differences (unlinkability). It also introduces JSON structure unification helpers for computing a common target shape across multiple values.
Changes:
- Add
pad_to(...)andstructure()forLongPseudonym,LongAttribute, andLongRecord(plus WASM + Python bindings). - Add
PEPJSONValue::{structure, pad_to}and exposeunify_structuresthrough WASM/Python. - Add
LongRecordStructure/ wrapper classes and a macro entry point for standalonepep_json!(pseudonym(...)).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/lib/data/long.rs |
Implements external-padding pad_to, updates decoding to try to strip external padding, adds tests. |
src/lib/data/records.rs |
Adds LongRecordStructure, plus LongRecord::{structure, pad_to}. |
src/lib/data/json/structure.rs |
Introduces UnifyError and unify_structures for JSON structure descriptors, with tests. |
src/lib/data/json/data.rs |
Adds PEPJSONValue::{structure, pad_to} + new JSON padding-related errors and tests. |
src/lib/data/json/macros.rs |
Adds standalone pep_json!(pseudonym(...)) macro arm. |
src/lib/data/wasm/long.rs |
Exposes padTo for long pseudonyms/attributes in WASM. |
src/lib/data/wasm/records.rs |
Exposes LongRecordStructure, LongRecord.structure(), and LongRecord.padTo() in WASM. |
src/lib/data/wasm/json.rs |
Exposes structure(), padTo(), and unifyStructures() in WASM. |
src/lib/data/py/long.rs |
Exposes pad_to for long pseudonyms/attributes in Python. |
src/lib/data/py/records.rs |
Exposes LongRecordStructure, LongRecord.structure(), and LongRecord.pad_to() in Python. |
src/lib/data/py/json.rs |
Exposes structure(), pad_to(), and unify_structures() in Python. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.