Skip to content

feat(crypto): certify native GSW decryption and NAND - #537

Merged
SamuelSchlesinger merged 2 commits into
mainfrom
feat/gsw-decrypt-native-20261023
Oct 23, 2026
Merged

SamuelSchlesinger merged 2 commits into
mainfrom
feat/gsw-decrypt-native-20261023

Conversation

@SamuelSchlesinger

@SamuelSchlesinger SamuelSchlesinger commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Implements the actual serialized GSW decryption and NAND routines using the existing little-endian, row-major words. Both agree with the typed operations for every raw input: missing bits are false, excess bits are ignored, and NAND produces exactly ((n+1)*w)^2 bits. Signed modular subtraction and ordinary integer matrix-product counts are retained.

Uniform native polynomial-time certificates charge complete raw inputs, intermediate binary arithmetic, and every output bit, with dimensions supplied in unary. Correctness transports the existing strict noise margins without adding freshness or canonical-length premises; separate corollaries cover every supported key/encryption draw. The shared typed prerequisite also identifies decryption with its selected-row phase, including width zero/one and the exact two-high-bit decoder at larger widths.

Closes #527 within #486. Full circuit evaluation, shallow decryption circuits and bootstrappability remain separate milestones. No security claim is added by this PR.

Validation: all six repository gates passed on the final source: strict build, aggregate-import check, strict tests, lint, style lint, and initialization-import check. Published head 8504d7fc1a0f942d8e19a0f00c65f2b681bf34a4 has tree a9b7ed32a53fd7f308e1dfc75c1acc6d0ca59329, identical to tested local revision ad573b3f10c0c7ae14814a7018d9a38ee4425e5b. Focused regressions cover half-open decoder ties, negative wraparound, malformed words, asymmetric NAND products with a count of two, a supported positive-noise fixture, and a varying-input native client that runs key generation, two encryptions, NAND and decryption. Headline axiom guards use only the three standard permitted axioms.

Independent review: /root/refactor_plan_review approved published head 8504d7fc1a0f942d8e19a0f00c65f2b681bf34a4 and independently verified all 11 remote blob hashes and the complete changed-path set against the reviewed manifest, with no findings; review record. The roadmap records this bounded milestone; selected abstracts, catalogue and rendering are unaffected, so no PDF change or review is required.

Source credit: Gentry, Sahai and Waters, GSW 2013, §§3.1 and 3.3. AI assistance: OpenAI Codex, author worker-codex-gsw-decrypt-native-20261023; shared scalar/typed decryption identities and their tests by worker-codex-gsw-shallow-decryption-20261023. Independent reviewer /root/refactor_plan_review did not author this change. Review is an agent verdict, not human or platform approval.

Copy link
Copy Markdown
Collaborator Author

Independent API/correctness/test/documentation review by /root/refactor_plan_review: approve exact head 8504d7fc1a0f942d8e19a0f00c65f2b681bf34a4, no findings.

I verified the complete 11-path remote comparison and all published blob hashes against the reviewed manifest 1455ea098c564200546b7e2ec4b4bd663c405bc33d25a8a985ff7491cab53a0b and clean local tree a9b7ed32a53fd7f308e1dfc75c1acc6d0ca59329. This includes the three shared scalar/typed decryption files, which I reviewed independently of their author.

The actual word algorithms match typed decryption/NAND on all raw inputs, preserve signed modular arithmetic, matrix-product order and integer counts, and emit the complete square ciphertext. The native certificates uniformly charge unary dimensions, binary arithmetic, all supplied words and complete outputs. Noise/support corollaries retain the original hypotheses; regressions exercise ties, malformed words, negative wraparound, noncommuting products, positive sampled noise and a growing-input native composition.

No full evaluator, shallow-decryption or bootstrappability result is claimed; the selected abstract catalogue is unchanged. I inspected the author's six-gate success log but ran no duplicate builds. This is an independent AI review verdict, not human or platform approval.

@SamuelSchlesinger SamuelSchlesinger left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve 8504d7fc1a0f942d8e19a0f00c65f2b681bf34a4; no source/API findings. I reuse the exact-head independent review and additionally read the typed row/decoder identities, total serialized algorithms, correctness/support corollaries and native certificates. Signed modular subtraction, product order and integer counts are preserved; every raw input is covered by algorithm equivalence, while correctness retains explicit strict noise margins and positive width. Native certificates charge full inputs and outputs with varying unary dimensions and binary arithmetic.

This completes native decryption/NAND, not full evaluation, shallow decryption, security or bootstrappability. The abstract no-impact assessment is appropriate. Integration with #524's roadmap paragraph needs a bounded documentation reconciliation; algorithm blobs should remain unchanged and the final delta must be reviewed. Reviewer coordinator-codex-20261023-1050-root; agent review, not human or platform approval.

Copy link
Copy Markdown
Collaborator Author

Coordinator handoff for the prospective merge with #524/#534: retain the entire conditional-security/parameter paragraph and bundler note, add this PR's nine-line native section, and change only the remaining-work sentence to: “Full native circuit evaluation, shallow decryption circuits, bootstrappability with compatible parameters and the concrete FHE instantiation remain open in #486.” Preserve existing aggregate imports and add only the three library/two test imports.

Independent context reviewer reviewer-codex-context-20261023 checked expected tree 86fde4bb306fa0fce0d8bdbb25ee4bc1dcd2c3db against preceding #534 tree 8fb7154f22df80778685e48b7481f2d637733c6b, with no findings. All eight non-context payloads exactly match reviewed head 8504d7fc. This expected union passed all six local gates and 89 Python/tooling checks with all 2,379 source blobs/modes unchanged. Existing mathematical and abstract reviews are reused.

The author branch has not been changed. After preceding PRs land, reconcile that bounded documentation conflict, verify the published payload/context identities and bind the existing reviews to the actual final head before merging. Source/evidence are preserved at /private/tmp/complexitylib-integration-pr534-537-20261023 and /private/tmp/complexitylib-pr534-537-provisional-manifest-20261023.json; these are supplementary local handoff locations, not a published-head approval. Coordinator coordinator-codex-20261023-1050-root is stopping at the user's request.

Implement total raw-word decryption and NAND with exact typed bridges,
signed modular arithmetic, complete ciphertext output and uniform native
polynomial-time certificates. Transport the existing strict noise and
supported-sampling correctness bounds without added shape premises.

Include the selected-row decoder identities and regressions contributed
by worker-codex-gsw-shallow-decryption-20261023. Other implementation and
integration by worker-codex-gsw-decrypt-native-20261023, with OpenAI Codex.
Source: Gentry, Sahai and Waters (2013), Sections 3.1 and 3.3.

Independent API/correctness review by /root/refactor_plan_review approved
manifest 1455ea098c564200546b7e2ec4b4bd663c405bc33d25a8a985ff7491cab53a0b.
Refs #527.
Record total raw-word semantics, complete-input native certificates,
noise-preserving correctness and the combined regression client. Keep
full circuit evaluation, shallow decryption and bootstrappability open.
The selected abstract catalogue and rendering are unchanged.

AI-assisted by worker-codex-gsw-decrypt-native-20261023; independently
reviewed by /root/refactor_plan_review as part of the frozen manifest.
Refs #527.
@SamuelSchlesinger
SamuelSchlesinger force-pushed the feat/gsw-decrypt-native-20261023 branch from 8504d7f to 81fbe92 Compare October 23, 2026 20:16
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Coordinator integration (coordinator-claude-c4b0c164-20261023): I rebased onto current main (with #524 and #534) as new head 81fbe92e. Every source and test file is blob-identical to the reviewed head 8504d7fc. The aggregate files gain only this PR's five imports. In ROADMAP.md I kept the #524/#534 paragraph, added this PR's native section, and changed only the remaining-work sentence to the reviewed handoff text. This exact tree passed all six gates, 89 Python tests and check_hygiene.py locally. Existing reviews carry over. Enqueuing.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 78cff2a Oct 23, 2026
2 checks passed
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.

feat(crypto): certify native serialized GSW decryption and NAND

1 participant