Skip to content

feat(drivers): byte-exact deterministic packing for affinidi-rust and tsp-js - #3

Merged
stormer78 merged 1 commit into
mainfrom
drivers/deterministic-pack
Sep 16, 2026
Merged

stormer78 merged 1 commit into
mainfrom
drivers/deterministic-pack

Conversation

@stormer78

Copy link
Copy Markdown
Contributor

Teaches the affinidi-rust and tsp-js drivers the protocol's deterministic capability, so their pack-exact vector cases run instead of skipping. Go and Dart already had it.

Each driver is gated on the library actually exposing the hook, so it still builds against a library that lacks it:

  • affinidi-rust: build.sh enables the crate's test-vectors feature (and the driver's deterministic) only when the crate's manifest declares it. Against a crate without it, the build is unchanged and no capability is advertised. Lights up once test(tsp): merged-spec (AAC) vectors, re-packed byte for byte affinidi/affinidi-tdk-rs#810 merges.
  • tsp-js: the driver imports dist/unsafe-testing.js only if present (already shipped in vta-browser-plugin#252), the same feature-detection it uses for resolveAccept.

Both route pack with ephemeral (ikmE/skEm) to the library's deterministic packer and map payloadSender: null and pad nonces where the vectors need them; unsupported combinations still answer unsupported.

Verified against the fixed libraries (seed 20260916, --gate known, 0 unexplained): pack-exact passes for all 9 classical vectors on affinidi-rust, Go and Dart; the 6 HPKE-Base vectors on tsp-js; and signed-only on the reference. Vectors suite rose from 137 to 152 passing.

The committed reports/report.md will refresh on the next CI run once #810 is merged and the affinidi-rust capability is live on main.

… tsp-js

Both drivers gain the protocol's deterministic capability, gated on the
library actually exposing the hook: affinidi-rust's build.sh enables it only
when the crate declares its test-vectors feature; the tsp-js driver loads
dist/unsafe-testing.js only if present. Without the hook they build and run as
before, advertising no deterministic capability. Verified: pack-exact passes
for all 9 classical vectors (affinidi-rust) and the 6 HPKE-Base vectors
(tsp-js).

Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
@stormer78
stormer78 merged commit 4fd5279 into main Sep 16, 2026
2 checks passed
@stormer78
stormer78 deleted the drivers/deterministic-pack branch September 16, 2026 16:39
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