feat(097-M5): bind document metadata as AES-GCM AAD#5
Merged
Conversation
ValidPay-io
force-pushed
the
fix/commitment-hash-ciphertext
branch
from
June 15, 2026 00:52
3cfe23f to
51f622b
Compare
ValidPay-io
force-pushed
the
fix/gcm-aad-binding
branch
from
June 15, 2026 00:56
47beff7 to
39a4d69
Compare
encrypt/decrypt take an optional aad string; build_aad() produces the
canonical AAD: compact JSON {document_type, valid_from, valid_until} with
timestamps normalized to epoch milliseconds (NOT raw ISO strings — the
server reformats those, which would break verification of time-locked docs).
This is byte-identical to the JS SDKs / website verifier so blobs stay
interoperable.
create_intent / create_split_key_intent / create_intent_batch bind the AAD
and send encryption_version=2; verify reconstructs the AAD from the server's
returned metadata for v2 intents (a server that altered document_type or the
window fails the GCM tag check). Selective disclosure stays v1 for now
(per-field encryption has no single GCM op to bind). Tests added/updated.
Stacked on the C-1 commitment branch.
Co-authored-by: Mike <mtn.mh1.inv@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
ValidPay-io
force-pushed
the
fix/gcm-aad-binding
branch
from
June 15, 2026 01:10
39a4d69 to
bff7c38
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prompt 097 — Fix 5 (M-5). Python SDK. Stacked on PR #4 (C-1) — base is `fix/commitment-hash-ciphertext`; retarget to `main` after #4 merges.
encrypt/decrypt take an optional aad; `build_aad()` produces the canonical AAD — compact JSON {document_type, valid_from, valid_until} with epoch-ms timestamps (NOT raw ISO; the server reformats those, which would break time-locked verification). Byte-identical to the Node/RN SDKs and website verifier.
create / create_split_key / create_intent_batch bind the AAD + send `encryption_version=2`; verify reconstructs it from server metadata for v2 intents. Selective disclosure stays v1 (per-field encryption has no single GCM op). Tests added/updated — 84 pass.
🤖 Generated with Claude Code