Skip to content

feat(097-M5): bind document metadata as AES-GCM AAD#5

Merged
ValidPay-io merged 1 commit into
mainfrom
fix/gcm-aad-binding
Jun 15, 2026
Merged

feat(097-M5): bind document metadata as AES-GCM AAD#5
ValidPay-io merged 1 commit into
mainfrom
fix/gcm-aad-binding

Conversation

@ValidPay-io

Copy link
Copy Markdown
Owner

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

@ValidPay-io
ValidPay-io force-pushed the fix/commitment-hash-ciphertext branch from 3cfe23f to 51f622b Compare June 15, 2026 00:52
@ValidPay-io
ValidPay-io force-pushed the fix/gcm-aad-binding branch from 47beff7 to 39a4d69 Compare June 15, 2026 00:56
@ValidPay-io
ValidPay-io changed the base branch from fix/commitment-hash-ciphertext to main June 15, 2026 01:10
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
ValidPay-io force-pushed the fix/gcm-aad-binding branch from 39a4d69 to bff7c38 Compare June 15, 2026 01:10
@ValidPay-io
ValidPay-io merged commit dec1623 into main Jun 15, 2026
4 checks passed
@ValidPay-io
ValidPay-io deleted the fix/gcm-aad-binding branch June 15, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant