hardening: share-guard byte-value and key matching; shared vectors v3 - #13
Merged
Merged
Conversation
…uard; shared vectors v3 - Byte values may be whole-number floats and signed values (-128..255), including inside JSON strings. - The Buffer JSON shape matches on type == "Buffer" plus a data list, whatever other keys are present. - x/X and y/Y are all checked. - The shared vectors file is v3 (sha256 pinned), byte-identical in citrate-sdk-js. - README and CHANGELOG say that the guard is a safety net against accidental inclusion and that the SDK never places key shares in metadata itself. Hand mutants: all 6 killed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.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.
Summary
Hardening follow-up to #11 for the metadata key-share guard. Version stays at 0.6.3 (unpublished).
_is_byte_intnow accepts whole-number floats and signed values in -128..255, matching_share_x. This also applies inside JSON strings (171.0,1.71e2).{"type": "Buffer", "data": [...]}is matched whatever other keys are present.x/Xandy/Yare checked. A benign value under one case no longer masks the other.674d35d7…) is pinned in both repos.deploy_modelnever places key shares in metadata itself.Evidence
crypto.pyfails 12 tests.uv sync --frozen --all-extras): ruff ok; mypy clean (84 files);uv lock --checkok; pip-audit found no known vulnerabilities; slugs ok; tests 753 passed / 43 skipped (non-economics); wheel tripwire passed for 0.6.3.Details are in the private audit record.
🤖 Generated with Claude Code
https://claude.ai/code/session_012cD3fDq5vhh2YWZPU2SV6H