feat(drivers): byte-exact deterministic packing for affinidi-rust and tsp-js - #3
Merged
Merged
Conversation
… 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>
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.
Teaches the affinidi-rust and tsp-js drivers the protocol's
deterministiccapability, so theirpack-exactvector 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:
build.shenables the crate'stest-vectorsfeature (and the driver'sdeterministic) 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.dist/unsafe-testing.jsonly if present (already shipped in vta-browser-plugin#252), the same feature-detection it uses forresolveAccept.Both route
packwithephemeral(ikmE/skEm) to the library's deterministic packer and mappayloadSender: nullandpadnonces where the vectors need them; unsupported combinations still answerunsupported.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.mdwill refresh on the next CI run once #810 is merged and the affinidi-rust capability is live onmain.