Add hash plus proof input encryption support#262
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
🦋 Changeset detectedLatest commit: 56a4e85 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 602fa42. Configure here.
2b11c29 to
f5c5327
Compare
|
Tests will fail until new cofhe-contracts version deployed with |

Add support for "hash plus proof" input encryption for CTA compliance.
cofhe-contracts corresponding PR which adds bytes32 aliases for each encrypted input hash: FhenixProtocol/cofhe-contracts#69
.asHashPlusProof()encrypt inputs builder method..execute()return type based on if.asHashPlusProof()chained.[hashA, ..., hashN, proof]format.externalE*andprooftypes, create map types.cofhe-contractsversion.integration-matrixtest.Note
Medium Risk
Changes how encrypted inputs are shaped for on-chain submission; mixing HPP vs
InE*or ABI mismatches will revert, though coverage is broad across SDK, Foundry, and integration tests.Overview
Adds hash plus proof (HPP) as an optional encryption output path for CTA-style contracts that take
externalE*+bytes proofinstead ofInE*structs.On
@cofhe/sdk,EncryptInputsBuildergains.asHashPlusProof(), which flips a type parameter so.execute()returnsHashPlusProofResult<T>: per-input0xhashes (fromctHash) plus one concatenated proof blob. New brandedExternal*Hash/ExternalHashProoftypes and tuple mappers are exported; compile-time and unit tests lock in the shape.Foundry
CofheClientmirrors this withcreateInE*_asHashPlusProoffor bool/uint8–128/address; plugin andSimpleTesttests store viaFHE.asE*(hash, proof).Test harness:
SimpleTest.setValueHashPlusProof, autogeneratedsimpleTestAbi, redeployed fixture addresses, and HPP flows in Hardhat 3, Hardhat plugin, and integration-matrix tests. Docs cover SDK, contract writes, and Foundry APIs.Reviewed by Cursor Bugbot for commit 56a4e85. Bugbot is set up for automated code reviews on this repo. Configure here.