@inco/lightning 0.8.0-devnet-5 → 0.8.0-devnet-7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inco/lightning",
3
- "version": "0.8.0-devnet-5",
3
+ "version": "0.8.0-devnet-7",
4
4
  "repository": "https://github.com/Inco-fhevm/inco-monorepo",
5
5
  "files": [
6
6
  "src/",
@@ -14,7 +14,7 @@
14
14
  "generate": "bun run generate:libraries",
15
15
  "generate:libraries": "bun run ../pega/lib/deployment/cmd/generate-libraries.ts",
16
16
  "publish:github": "bun publish --registry=https://npm.pkg.github.com",
17
- "publish:npm": "bun publish --access public"
17
+ "publish:npm": "npm publish --tag ${NPM_DIST_TAG:-alpha} --access public"
18
18
  },
19
19
  "dependencies": {
20
20
  "@inco/shared": "^0.1.0",
@@ -30,6 +30,7 @@
30
30
  "lcov-badge2": "^1.1.2"
31
31
  },
32
32
  "publishConfig": {
33
- "registry": "https://npm.pkg.github.com"
33
+ "access": "public",
34
+ "registry": "https://registry.npmjs.org/"
34
35
  }
35
36
  }
@@ -7,6 +7,7 @@ pragma solidity ^0.8;
7
7
 
8
8
  import { IncoLightning } from "./IncoLightning.sol";
9
9
  import { ebool, euint256, eaddress, ETypes } from "./Types.sol";
10
+ import { DecryptionAttestation } from "./lightning-parts/DecryptionAttester.types.sol";
10
11
 
11
12
  IncoLightning constant inco = IncoLightning(0xc0d693DeEF0A91CE39208676b6da09B822abd199);
12
13
  address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
@@ -823,6 +824,26 @@ library e {
823
824
  inco.reveal(eaddress.unwrap(a));
824
825
  }
825
826
 
827
+ /// @notice Verifies a decryption attestation for a euint256
828
+ /// @param handle The encrypted handle
829
+ /// @param value The claimed decrypted value
830
+ /// @param signatures The covalidator signatures
831
+ /// @return True if the attestation is valid
832
+ function verifyDecryption(euint256 handle, uint256 value, bytes[] memory signatures) internal view returns (bool) {
833
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: euint256.unwrap(handle), value: bytes32(value)});
834
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
835
+ }
836
+
837
+ /// @notice Verifies a decryption attestation for an ebool
838
+ /// @param handle The encrypted handle
839
+ /// @param value The claimed decrypted value
840
+ /// @param signatures The covalidator signatures
841
+ /// @return True if the attestation is valid
842
+ function verifyDecryption(ebool handle, bool value, bytes[] memory signatures) internal view returns (bool) {
843
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: ebool.unwrap(handle), value: value ? bytes32(uint256(1)) : bytes32(0)});
844
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
845
+ }
846
+
826
847
  /// @notice Allows this contract to access an encrypted uint256
827
848
  /// @param a The encrypted uint256
828
849
  function allowThis(euint256 a) internal {
@@ -7,6 +7,7 @@ pragma solidity ^0.8;
7
7
 
8
8
  import { IncoLightning } from "./IncoLightning.sol";
9
9
  import { ebool, euint256, eaddress, ETypes } from "./Types.sol";
10
+ import { DecryptionAttestation } from "./lightning-parts/DecryptionAttester.types.sol";
10
11
 
11
12
  IncoLightning constant inco = IncoLightning(0xA95EAbCE575f5f1e52605358Ee893F6536166378);
12
13
  address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
@@ -823,6 +824,26 @@ library e {
823
824
  inco.reveal(eaddress.unwrap(a));
824
825
  }
825
826
 
827
+ /// @notice Verifies a decryption attestation for a euint256
828
+ /// @param handle The encrypted handle
829
+ /// @param value The claimed decrypted value
830
+ /// @param signatures The covalidator signatures
831
+ /// @return True if the attestation is valid
832
+ function verifyDecryption(euint256 handle, uint256 value, bytes[] memory signatures) internal view returns (bool) {
833
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: euint256.unwrap(handle), value: bytes32(value)});
834
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
835
+ }
836
+
837
+ /// @notice Verifies a decryption attestation for an ebool
838
+ /// @param handle The encrypted handle
839
+ /// @param value The claimed decrypted value
840
+ /// @param signatures The covalidator signatures
841
+ /// @return True if the attestation is valid
842
+ function verifyDecryption(ebool handle, bool value, bytes[] memory signatures) internal view returns (bool) {
843
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: ebool.unwrap(handle), value: value ? bytes32(uint256(1)) : bytes32(0)});
844
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
845
+ }
846
+
826
847
  /// @notice Allows this contract to access an encrypted uint256
827
848
  /// @param a The encrypted uint256
828
849
  function allowThis(euint256 a) internal {
@@ -7,6 +7,7 @@ pragma solidity ^0.8;
7
7
 
8
8
  import { IncoLightning } from "./IncoLightning.sol";
9
9
  import { ebool, euint256, eaddress, ETypes } from "./Types.sol";
10
+ import { DecryptionAttestation } from "./lightning-parts/DecryptionAttester.types.sol";
10
11
 
11
12
  IncoLightning constant inco = IncoLightning(0x4046b737B454b0430FBF29cea070e3337AdE95aD);
12
13
  address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
@@ -823,6 +824,26 @@ library e {
823
824
  inco.reveal(eaddress.unwrap(a));
824
825
  }
825
826
 
827
+ /// @notice Verifies a decryption attestation for a euint256
828
+ /// @param handle The encrypted handle
829
+ /// @param value The claimed decrypted value
830
+ /// @param signatures The covalidator signatures
831
+ /// @return True if the attestation is valid
832
+ function verifyDecryption(euint256 handle, uint256 value, bytes[] memory signatures) internal view returns (bool) {
833
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: euint256.unwrap(handle), value: bytes32(value)});
834
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
835
+ }
836
+
837
+ /// @notice Verifies a decryption attestation for an ebool
838
+ /// @param handle The encrypted handle
839
+ /// @param value The claimed decrypted value
840
+ /// @param signatures The covalidator signatures
841
+ /// @return True if the attestation is valid
842
+ function verifyDecryption(ebool handle, bool value, bytes[] memory signatures) internal view returns (bool) {
843
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: ebool.unwrap(handle), value: value ? bytes32(uint256(1)) : bytes32(0)});
844
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
845
+ }
846
+
826
847
  /// @notice Allows this contract to access an encrypted uint256
827
848
  /// @param a The encrypted uint256
828
849
  function allowThis(euint256 a) internal {
package/src/Lib.sol CHANGED
@@ -7,6 +7,7 @@ pragma solidity ^0.8;
7
7
 
8
8
  import { IncoLightning } from "./IncoLightning.sol";
9
9
  import { ebool, euint256, eaddress, ETypes } from "./Types.sol";
10
+ import { DecryptionAttestation } from "./lightning-parts/DecryptionAttester.types.sol";
10
11
 
11
12
  IncoLightning constant inco = IncoLightning(0x4046b737B454b0430FBF29cea070e3337AdE95aD);
12
13
  address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
@@ -823,6 +824,26 @@ library e {
823
824
  inco.reveal(eaddress.unwrap(a));
824
825
  }
825
826
 
827
+ /// @notice Verifies a decryption attestation for a euint256
828
+ /// @param handle The encrypted handle
829
+ /// @param value The claimed decrypted value
830
+ /// @param signatures The covalidator signatures
831
+ /// @return True if the attestation is valid
832
+ function verifyDecryption(euint256 handle, uint256 value, bytes[] memory signatures) internal view returns (bool) {
833
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: euint256.unwrap(handle), value: bytes32(value)});
834
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
835
+ }
836
+
837
+ /// @notice Verifies a decryption attestation for an ebool
838
+ /// @param handle The encrypted handle
839
+ /// @param value The claimed decrypted value
840
+ /// @param signatures The covalidator signatures
841
+ /// @return True if the attestation is valid
842
+ function verifyDecryption(ebool handle, bool value, bytes[] memory signatures) internal view returns (bool) {
843
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: ebool.unwrap(handle), value: value ? bytes32(uint256(1)) : bytes32(0)});
844
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
845
+ }
846
+
826
847
  /// @notice Allows this contract to access an encrypted uint256
827
848
  /// @param a The encrypted uint256
828
849
  function allowThis(euint256 a) internal {
@@ -4,6 +4,7 @@ pragma solidity ^0.8;
4
4
 
5
5
  import {IncoLightning} from "./IncoLightning.sol";
6
6
  import {ebool, euint256, eaddress, ETypes} from "./Types.sol";
7
+ import {DecryptionAttestation} from "./lightning-parts/DecryptionAttester.types.sol";
7
8
 
8
9
  // forge-lint: disable-next-line(screaming-snake-case-const)
9
10
  IncoLightning constant inco = IncoLightning(0x000000000000000000000000000000000000baBe);
@@ -822,6 +823,28 @@ library e {
822
823
  inco.reveal(eaddress.unwrap(a));
823
824
  }
824
825
 
826
+ /// @notice Verifies a decryption attestation for a euint256
827
+ /// @param handle The encrypted handle
828
+ /// @param value The claimed decrypted value
829
+ /// @param signatures The covalidator signatures
830
+ /// @return True if the attestation is valid
831
+ function verifyDecryption(euint256 handle, uint256 value, bytes[] memory signatures) internal view returns (bool) {
832
+ DecryptionAttestation memory attestation =
833
+ DecryptionAttestation({handle: euint256.unwrap(handle), value: bytes32(value)});
834
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
835
+ }
836
+
837
+ /// @notice Verifies a decryption attestation for an ebool
838
+ /// @param handle The encrypted handle
839
+ /// @param value The claimed decrypted value
840
+ /// @param signatures The covalidator signatures
841
+ /// @return True if the attestation is valid
842
+ function verifyDecryption(ebool handle, bool value, bytes[] memory signatures) internal view returns (bool) {
843
+ DecryptionAttestation memory attestation =
844
+ DecryptionAttestation({handle: ebool.unwrap(handle), value: value ? bytes32(uint256(1)) : bytes32(0)});
845
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
846
+ }
847
+
825
848
  /// @notice Allows this contract to access an encrypted uint256
826
849
  /// @param a The encrypted uint256
827
850
  function allowThis(euint256 a) internal {
@@ -7,6 +7,7 @@ pragma solidity ^0.8;
7
7
 
8
8
  import { IncoLightning } from "./IncoLightning.sol";
9
9
  import { ebool, euint256, eaddress, ETypes } from "./Types.sol";
10
+ import { DecryptionAttestation } from "./lightning-parts/DecryptionAttester.types.sol";
10
11
 
11
12
  IncoLightning constant inco = IncoLightning(0x168FDc3Ae19A5d5b03614578C58974FF30FCBe92);
12
13
  address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
@@ -823,6 +824,26 @@ library e {
823
824
  inco.reveal(eaddress.unwrap(a));
824
825
  }
825
826
 
827
+ /// @notice Verifies a decryption attestation for a euint256
828
+ /// @param handle The encrypted handle
829
+ /// @param value The claimed decrypted value
830
+ /// @param signatures The covalidator signatures
831
+ /// @return True if the attestation is valid
832
+ function verifyDecryption(euint256 handle, uint256 value, bytes[] memory signatures) internal view returns (bool) {
833
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: euint256.unwrap(handle), value: bytes32(value)});
834
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
835
+ }
836
+
837
+ /// @notice Verifies a decryption attestation for an ebool
838
+ /// @param handle The encrypted handle
839
+ /// @param value The claimed decrypted value
840
+ /// @param signatures The covalidator signatures
841
+ /// @return True if the attestation is valid
842
+ function verifyDecryption(ebool handle, bool value, bytes[] memory signatures) internal view returns (bool) {
843
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: ebool.unwrap(handle), value: value ? bytes32(uint256(1)) : bytes32(0)});
844
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
845
+ }
846
+
826
847
  /// @notice Allows this contract to access an encrypted uint256
827
848
  /// @param a The encrypted uint256
828
849
  function allowThis(euint256 a) internal {
@@ -7,6 +7,7 @@ pragma solidity ^0.8;
7
7
 
8
8
  import { IncoLightning } from "../IncoLightning.sol";
9
9
  import { ebool, euint256, eaddress, ETypes } from "../Types.sol";
10
+ import { DecryptionAttestation } from "../lightning-parts/DecryptionAttester.types.sol";
10
11
 
11
12
  IncoLightning constant inco = IncoLightning(0x4651DfD7729aE5568092E7351fAaD872266d4CBd);
12
13
  address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
@@ -823,6 +824,26 @@ library e {
823
824
  inco.reveal(eaddress.unwrap(a));
824
825
  }
825
826
 
827
+ /// @notice Verifies a decryption attestation for a euint256
828
+ /// @param handle The encrypted handle
829
+ /// @param value The claimed decrypted value
830
+ /// @param signatures The covalidator signatures
831
+ /// @return True if the attestation is valid
832
+ function verifyDecryption(euint256 handle, uint256 value, bytes[] memory signatures) internal view returns (bool) {
833
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: euint256.unwrap(handle), value: bytes32(value)});
834
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
835
+ }
836
+
837
+ /// @notice Verifies a decryption attestation for an ebool
838
+ /// @param handle The encrypted handle
839
+ /// @param value The claimed decrypted value
840
+ /// @param signatures The covalidator signatures
841
+ /// @return True if the attestation is valid
842
+ function verifyDecryption(ebool handle, bool value, bytes[] memory signatures) internal view returns (bool) {
843
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: ebool.unwrap(handle), value: value ? bytes32(uint256(1)) : bytes32(0)});
844
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
845
+ }
846
+
826
847
  /// @notice Allows this contract to access an encrypted uint256
827
848
  /// @param a The encrypted uint256
828
849
  function allowThis(euint256 a) internal {
@@ -7,6 +7,7 @@ pragma solidity ^0.8;
7
7
 
8
8
  import { IncoLightning } from "../IncoLightning.sol";
9
9
  import { ebool, euint256, eaddress, ETypes } from "../Types.sol";
10
+ import { DecryptionAttestation } from "../lightning-parts/DecryptionAttester.types.sol";
10
11
 
11
12
  IncoLightning constant inco = IncoLightning(0x28676Cd3b10b03b2FDF105Ba280425b45a674F2A);
12
13
  address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
@@ -823,6 +824,26 @@ library e {
823
824
  inco.reveal(eaddress.unwrap(a));
824
825
  }
825
826
 
827
+ /// @notice Verifies a decryption attestation for a euint256
828
+ /// @param handle The encrypted handle
829
+ /// @param value The claimed decrypted value
830
+ /// @param signatures The covalidator signatures
831
+ /// @return True if the attestation is valid
832
+ function verifyDecryption(euint256 handle, uint256 value, bytes[] memory signatures) internal view returns (bool) {
833
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: euint256.unwrap(handle), value: bytes32(value)});
834
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
835
+ }
836
+
837
+ /// @notice Verifies a decryption attestation for an ebool
838
+ /// @param handle The encrypted handle
839
+ /// @param value The claimed decrypted value
840
+ /// @param signatures The covalidator signatures
841
+ /// @return True if the attestation is valid
842
+ function verifyDecryption(ebool handle, bool value, bytes[] memory signatures) internal view returns (bool) {
843
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: ebool.unwrap(handle), value: value ? bytes32(uint256(1)) : bytes32(0)});
844
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
845
+ }
846
+
826
847
  /// @notice Allows this contract to access an encrypted uint256
827
848
  /// @param a The encrypted uint256
828
849
  function allowThis(euint256 a) internal {
@@ -7,6 +7,7 @@ pragma solidity ^0.8;
7
7
 
8
8
  import { IncoLightning } from "../IncoLightning.sol";
9
9
  import { ebool, euint256, eaddress, ETypes } from "../Types.sol";
10
+ import { DecryptionAttestation } from "../lightning-parts/DecryptionAttester.types.sol";
10
11
 
11
12
  IncoLightning constant inco = IncoLightning(0xc0d693DeEF0A91CE39208676b6da09B822abd199);
12
13
  address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
@@ -823,6 +824,26 @@ library e {
823
824
  inco.reveal(eaddress.unwrap(a));
824
825
  }
825
826
 
827
+ /// @notice Verifies a decryption attestation for a euint256
828
+ /// @param handle The encrypted handle
829
+ /// @param value The claimed decrypted value
830
+ /// @param signatures The covalidator signatures
831
+ /// @return True if the attestation is valid
832
+ function verifyDecryption(euint256 handle, uint256 value, bytes[] memory signatures) internal view returns (bool) {
833
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: euint256.unwrap(handle), value: bytes32(value)});
834
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
835
+ }
836
+
837
+ /// @notice Verifies a decryption attestation for an ebool
838
+ /// @param handle The encrypted handle
839
+ /// @param value The claimed decrypted value
840
+ /// @param signatures The covalidator signatures
841
+ /// @return True if the attestation is valid
842
+ function verifyDecryption(ebool handle, bool value, bytes[] memory signatures) internal view returns (bool) {
843
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: ebool.unwrap(handle), value: value ? bytes32(uint256(1)) : bytes32(0)});
844
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
845
+ }
846
+
826
847
  /// @notice Allows this contract to access an encrypted uint256
827
848
  /// @param a The encrypted uint256
828
849
  function allowThis(euint256 a) internal {
@@ -7,6 +7,7 @@ pragma solidity ^0.8;
7
7
 
8
8
  import { IncoLightning } from "../IncoLightning.sol";
9
9
  import { ebool, euint256, eaddress, ETypes } from "../Types.sol";
10
+ import { DecryptionAttestation } from "../lightning-parts/DecryptionAttester.types.sol";
10
11
 
11
12
  IncoLightning constant inco = IncoLightning(0xeBAFF6D578733E4603b99CBdbb221482F29a78E1);
12
13
  address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
@@ -823,6 +824,26 @@ library e {
823
824
  inco.reveal(eaddress.unwrap(a));
824
825
  }
825
826
 
827
+ /// @notice Verifies a decryption attestation for a euint256
828
+ /// @param handle The encrypted handle
829
+ /// @param value The claimed decrypted value
830
+ /// @param signatures The covalidator signatures
831
+ /// @return True if the attestation is valid
832
+ function verifyDecryption(euint256 handle, uint256 value, bytes[] memory signatures) internal view returns (bool) {
833
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: euint256.unwrap(handle), value: bytes32(value)});
834
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
835
+ }
836
+
837
+ /// @notice Verifies a decryption attestation for an ebool
838
+ /// @param handle The encrypted handle
839
+ /// @param value The claimed decrypted value
840
+ /// @param signatures The covalidator signatures
841
+ /// @return True if the attestation is valid
842
+ function verifyDecryption(ebool handle, bool value, bytes[] memory signatures) internal view returns (bool) {
843
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: ebool.unwrap(handle), value: value ? bytes32(uint256(1)) : bytes32(0)});
844
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
845
+ }
846
+
826
847
  /// @notice Allows this contract to access an encrypted uint256
827
848
  /// @param a The encrypted uint256
828
849
  function allowThis(euint256 a) internal {
@@ -7,6 +7,7 @@ pragma solidity ^0.8;
7
7
 
8
8
  import { IncoLightning } from "../IncoLightning.sol";
9
9
  import { ebool, euint256, eaddress, ETypes } from "../Types.sol";
10
+ import { DecryptionAttestation } from "../lightning-parts/DecryptionAttester.types.sol";
10
11
 
11
12
  IncoLightning constant inco = IncoLightning(0xA95EAbCE575f5f1e52605358Ee893F6536166378);
12
13
  address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
@@ -823,6 +824,26 @@ library e {
823
824
  inco.reveal(eaddress.unwrap(a));
824
825
  }
825
826
 
827
+ /// @notice Verifies a decryption attestation for a euint256
828
+ /// @param handle The encrypted handle
829
+ /// @param value The claimed decrypted value
830
+ /// @param signatures The covalidator signatures
831
+ /// @return True if the attestation is valid
832
+ function verifyDecryption(euint256 handle, uint256 value, bytes[] memory signatures) internal view returns (bool) {
833
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: euint256.unwrap(handle), value: bytes32(value)});
834
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
835
+ }
836
+
837
+ /// @notice Verifies a decryption attestation for an ebool
838
+ /// @param handle The encrypted handle
839
+ /// @param value The claimed decrypted value
840
+ /// @param signatures The covalidator signatures
841
+ /// @return True if the attestation is valid
842
+ function verifyDecryption(ebool handle, bool value, bytes[] memory signatures) internal view returns (bool) {
843
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: ebool.unwrap(handle), value: value ? bytes32(uint256(1)) : bytes32(0)});
844
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
845
+ }
846
+
826
847
  /// @notice Allows this contract to access an encrypted uint256
827
848
  /// @param a The encrypted uint256
828
849
  function allowThis(euint256 a) internal {
@@ -7,6 +7,7 @@ pragma solidity ^0.8;
7
7
 
8
8
  import { IncoLightning } from "../IncoLightning.sol";
9
9
  import { ebool, euint256, eaddress, ETypes } from "../Types.sol";
10
+ import { DecryptionAttestation } from "../lightning-parts/DecryptionAttester.types.sol";
10
11
 
11
12
  IncoLightning constant inco = IncoLightning(0x3B22be60Ae699933959CA3cE147C96caa88Ccd3D);
12
13
  address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
@@ -823,6 +824,26 @@ library e {
823
824
  inco.reveal(eaddress.unwrap(a));
824
825
  }
825
826
 
827
+ /// @notice Verifies a decryption attestation for a euint256
828
+ /// @param handle The encrypted handle
829
+ /// @param value The claimed decrypted value
830
+ /// @param signatures The covalidator signatures
831
+ /// @return True if the attestation is valid
832
+ function verifyDecryption(euint256 handle, uint256 value, bytes[] memory signatures) internal view returns (bool) {
833
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: euint256.unwrap(handle), value: bytes32(value)});
834
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
835
+ }
836
+
837
+ /// @notice Verifies a decryption attestation for an ebool
838
+ /// @param handle The encrypted handle
839
+ /// @param value The claimed decrypted value
840
+ /// @param signatures The covalidator signatures
841
+ /// @return True if the attestation is valid
842
+ function verifyDecryption(ebool handle, bool value, bytes[] memory signatures) internal view returns (bool) {
843
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: ebool.unwrap(handle), value: value ? bytes32(uint256(1)) : bytes32(0)});
844
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
845
+ }
846
+
826
847
  /// @notice Allows this contract to access an encrypted uint256
827
848
  /// @param a The encrypted uint256
828
849
  function allowThis(euint256 a) internal {
@@ -7,6 +7,7 @@ pragma solidity ^0.8;
7
7
 
8
8
  import { IncoLightning } from "../IncoLightning.sol";
9
9
  import { ebool, euint256, eaddress, ETypes } from "../Types.sol";
10
+ import { DecryptionAttestation } from "../lightning-parts/DecryptionAttester.types.sol";
10
11
 
11
12
  IncoLightning constant inco = IncoLightning(0x3473820DcAa71Af8157b93C7f2bf1c676A2A39A6);
12
13
  address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
@@ -823,6 +824,26 @@ library e {
823
824
  inco.reveal(eaddress.unwrap(a));
824
825
  }
825
826
 
827
+ /// @notice Verifies a decryption attestation for a euint256
828
+ /// @param handle The encrypted handle
829
+ /// @param value The claimed decrypted value
830
+ /// @param signatures The covalidator signatures
831
+ /// @return True if the attestation is valid
832
+ function verifyDecryption(euint256 handle, uint256 value, bytes[] memory signatures) internal view returns (bool) {
833
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: euint256.unwrap(handle), value: bytes32(value)});
834
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
835
+ }
836
+
837
+ /// @notice Verifies a decryption attestation for an ebool
838
+ /// @param handle The encrypted handle
839
+ /// @param value The claimed decrypted value
840
+ /// @param signatures The covalidator signatures
841
+ /// @return True if the attestation is valid
842
+ function verifyDecryption(ebool handle, bool value, bytes[] memory signatures) internal view returns (bool) {
843
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: ebool.unwrap(handle), value: value ? bytes32(uint256(1)) : bytes32(0)});
844
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
845
+ }
846
+
826
847
  /// @notice Allows this contract to access an encrypted uint256
827
848
  /// @param a The encrypted uint256
828
849
  function allowThis(euint256 a) internal {
@@ -7,6 +7,7 @@ pragma solidity ^0.8;
7
7
 
8
8
  import { IncoLightning } from "../IncoLightning.sol";
9
9
  import { ebool, euint256, eaddress, ETypes } from "../Types.sol";
10
+ import { DecryptionAttestation } from "../lightning-parts/DecryptionAttester.types.sol";
10
11
 
11
12
  IncoLightning constant inco = IncoLightning(0xC64BB070D6F5aa796e79fA19c1008647ffF736ED);
12
13
  address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
@@ -823,6 +824,26 @@ library e {
823
824
  inco.reveal(eaddress.unwrap(a));
824
825
  }
825
826
 
827
+ /// @notice Verifies a decryption attestation for a euint256
828
+ /// @param handle The encrypted handle
829
+ /// @param value The claimed decrypted value
830
+ /// @param signatures The covalidator signatures
831
+ /// @return True if the attestation is valid
832
+ function verifyDecryption(euint256 handle, uint256 value, bytes[] memory signatures) internal view returns (bool) {
833
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: euint256.unwrap(handle), value: bytes32(value)});
834
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
835
+ }
836
+
837
+ /// @notice Verifies a decryption attestation for an ebool
838
+ /// @param handle The encrypted handle
839
+ /// @param value The claimed decrypted value
840
+ /// @param signatures The covalidator signatures
841
+ /// @return True if the attestation is valid
842
+ function verifyDecryption(ebool handle, bool value, bytes[] memory signatures) internal view returns (bool) {
843
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: ebool.unwrap(handle), value: value ? bytes32(uint256(1)) : bytes32(0)});
844
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
845
+ }
846
+
826
847
  /// @notice Allows this contract to access an encrypted uint256
827
848
  /// @param a The encrypted uint256
828
849
  function allowThis(euint256 a) internal {
@@ -7,6 +7,7 @@ pragma solidity ^0.8;
7
7
 
8
8
  import { IncoLightning } from "../IncoLightning.sol";
9
9
  import { ebool, euint256, eaddress, ETypes } from "../Types.sol";
10
+ import { DecryptionAttestation } from "../lightning-parts/DecryptionAttester.types.sol";
10
11
 
11
12
  IncoLightning constant inco = IncoLightning(0x4732520194584a04Cac0224e067658619F4086bD);
12
13
  address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
@@ -823,6 +824,26 @@ library e {
823
824
  inco.reveal(eaddress.unwrap(a));
824
825
  }
825
826
 
827
+ /// @notice Verifies a decryption attestation for a euint256
828
+ /// @param handle The encrypted handle
829
+ /// @param value The claimed decrypted value
830
+ /// @param signatures The covalidator signatures
831
+ /// @return True if the attestation is valid
832
+ function verifyDecryption(euint256 handle, uint256 value, bytes[] memory signatures) internal view returns (bool) {
833
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: euint256.unwrap(handle), value: bytes32(value)});
834
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
835
+ }
836
+
837
+ /// @notice Verifies a decryption attestation for an ebool
838
+ /// @param handle The encrypted handle
839
+ /// @param value The claimed decrypted value
840
+ /// @param signatures The covalidator signatures
841
+ /// @return True if the attestation is valid
842
+ function verifyDecryption(ebool handle, bool value, bytes[] memory signatures) internal view returns (bool) {
843
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: ebool.unwrap(handle), value: value ? bytes32(uint256(1)) : bytes32(0)});
844
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
845
+ }
846
+
826
847
  /// @notice Allows this contract to access an encrypted uint256
827
848
  /// @param a The encrypted uint256
828
849
  function allowThis(euint256 a) internal {
@@ -7,6 +7,7 @@ pragma solidity ^0.8;
7
7
 
8
8
  import { IncoLightning } from "../IncoLightning.sol";
9
9
  import { ebool, euint256, eaddress, ETypes } from "../Types.sol";
10
+ import { DecryptionAttestation } from "../lightning-parts/DecryptionAttester.types.sol";
10
11
 
11
12
  IncoLightning constant inco = IncoLightning(0x4046b737B454b0430FBF29cea070e3337AdE95aD);
12
13
  address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
@@ -823,6 +824,26 @@ library e {
823
824
  inco.reveal(eaddress.unwrap(a));
824
825
  }
825
826
 
827
+ /// @notice Verifies a decryption attestation for a euint256
828
+ /// @param handle The encrypted handle
829
+ /// @param value The claimed decrypted value
830
+ /// @param signatures The covalidator signatures
831
+ /// @return True if the attestation is valid
832
+ function verifyDecryption(euint256 handle, uint256 value, bytes[] memory signatures) internal view returns (bool) {
833
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: euint256.unwrap(handle), value: bytes32(value)});
834
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
835
+ }
836
+
837
+ /// @notice Verifies a decryption attestation for an ebool
838
+ /// @param handle The encrypted handle
839
+ /// @param value The claimed decrypted value
840
+ /// @param signatures The covalidator signatures
841
+ /// @return True if the attestation is valid
842
+ function verifyDecryption(ebool handle, bool value, bytes[] memory signatures) internal view returns (bool) {
843
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: ebool.unwrap(handle), value: value ? bytes32(uint256(1)) : bytes32(0)});
844
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
845
+ }
846
+
826
847
  /// @notice Allows this contract to access an encrypted uint256
827
848
  /// @param a The encrypted uint256
828
849
  function allowThis(euint256 a) internal {
@@ -7,6 +7,7 @@ pragma solidity ^0.8;
7
7
 
8
8
  import { IncoLightning } from "../IncoLightning.sol";
9
9
  import { ebool, euint256, eaddress, ETypes } from "../Types.sol";
10
+ import { DecryptionAttestation } from "../lightning-parts/DecryptionAttester.types.sol";
10
11
 
11
12
  IncoLightning constant inco = IncoLightning(0x63D8135aF4D393B1dB43B649010c8D3EE19FC9fd);
12
13
  address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
@@ -823,6 +824,26 @@ library e {
823
824
  inco.reveal(eaddress.unwrap(a));
824
825
  }
825
826
 
827
+ /// @notice Verifies a decryption attestation for a euint256
828
+ /// @param handle The encrypted handle
829
+ /// @param value The claimed decrypted value
830
+ /// @param signatures The covalidator signatures
831
+ /// @return True if the attestation is valid
832
+ function verifyDecryption(euint256 handle, uint256 value, bytes[] memory signatures) internal view returns (bool) {
833
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: euint256.unwrap(handle), value: bytes32(value)});
834
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
835
+ }
836
+
837
+ /// @notice Verifies a decryption attestation for an ebool
838
+ /// @param handle The encrypted handle
839
+ /// @param value The claimed decrypted value
840
+ /// @param signatures The covalidator signatures
841
+ /// @return True if the attestation is valid
842
+ function verifyDecryption(ebool handle, bool value, bytes[] memory signatures) internal view returns (bool) {
843
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: ebool.unwrap(handle), value: value ? bytes32(uint256(1)) : bytes32(0)});
844
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
845
+ }
846
+
826
847
  /// @notice Allows this contract to access an encrypted uint256
827
848
  /// @param a The encrypted uint256
828
849
  function allowThis(euint256 a) internal {
@@ -7,6 +7,7 @@ pragma solidity ^0.8;
7
7
 
8
8
  import { IncoLightning } from "../IncoLightning.sol";
9
9
  import { ebool, euint256, eaddress, ETypes } from "../Types.sol";
10
+ import { DecryptionAttestation } from "../lightning-parts/DecryptionAttester.types.sol";
10
11
 
11
12
  IncoLightning constant inco = IncoLightning(0x168FDc3Ae19A5d5b03614578C58974FF30FCBe92);
12
13
  address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
@@ -823,6 +824,26 @@ library e {
823
824
  inco.reveal(eaddress.unwrap(a));
824
825
  }
825
826
 
827
+ /// @notice Verifies a decryption attestation for a euint256
828
+ /// @param handle The encrypted handle
829
+ /// @param value The claimed decrypted value
830
+ /// @param signatures The covalidator signatures
831
+ /// @return True if the attestation is valid
832
+ function verifyDecryption(euint256 handle, uint256 value, bytes[] memory signatures) internal view returns (bool) {
833
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: euint256.unwrap(handle), value: bytes32(value)});
834
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
835
+ }
836
+
837
+ /// @notice Verifies a decryption attestation for an ebool
838
+ /// @param handle The encrypted handle
839
+ /// @param value The claimed decrypted value
840
+ /// @param signatures The covalidator signatures
841
+ /// @return True if the attestation is valid
842
+ function verifyDecryption(ebool handle, bool value, bytes[] memory signatures) internal view returns (bool) {
843
+ DecryptionAttestation memory attestation = DecryptionAttestation({handle: ebool.unwrap(handle), value: value ? bytes32(uint256(1)) : bytes32(0)});
844
+ return inco.incoVerifier().isValidDecryptionAttestation(attestation, signatures);
845
+ }
846
+
826
847
  /// @notice Allows this contract to access an encrypted uint256
827
848
  /// @param a The encrypted uint256
828
849
  function allowThis(euint256 a) internal {
@@ -21,7 +21,11 @@ contract IncoTest is MockOpHandler, DeployUtils, FakeDecryptionAttester, MockRem
21
21
  address immutable testDeployer;
22
22
 
23
23
  // Constants for testing
24
- bytes testNetworkPubkey = hex"02516bda9e68a1c3dce74dc1b6ed7d91a91d51c1e1933947f06331cef59631e9eb";
24
+ // X-Wing public key (1216 bytes) - matches Go covalidator test key (seed of all zeros)
25
+ // Generated using HPKE layer: hpke.KEM_XWING.Scheme().DeriveKeyPair(seed) for interop with hpke-rs
26
+ // This is the same key used in @contracts/pega/lib/keys.ts anointedXwingKey
27
+ bytes testNetworkPubkey =
28
+ hex"ca882388911c7c762aafc20debd63e845b3bed28c9d5262cdea7771fb31bd660a1ae7b395a9a7df3d12c7b118e8eda5057572c1ba05cd9b635edf33dabca4cac7291e0848f19c20e5beb850c3818f3543d49b3a5c729cb86a28fda539775d04feda112fe0c81d138aaf623aea7d507a4e826e890105db6065a44aba76a10d771c00d1b33f4ac51869806aae18eada68f19047024542d64a7aa1c91a5e1aa49d93613b5224b415bcc7aa166e4b55033438d20c641f9664fdb1689b53208181463e3d1325d46b30f07c5945b7e3fa1418bf833d975258461b294664eaf60795964924a280729c10a37fc6e967440bdd55d4ca53596286383481291152365303d44517cef369c00933b0b30368a230353e729c031075e8388673678a56b3ba84a165b28096ee9bd684483e1844258b451c365c41fa534152a3b64120041450128e960c7d6437d717ee266bdde7aaeec225ed93b958d188e97407349f1382976ca47d761ecc59a6f394487eb015c083abb490584677240eb47f838c838568a496119378b8bb81484610a50792b5d9c9939db188e7d0249d3cb918c436f111a2898849b286b0743a22c57464c709c5eaceac1ba493adca3328c0b14b5e38d3aea74e328b622b17e7181c35ad11c2103bdb7f2b209d93dcbc4ab61a06bc37139e6d2b7a06c5b7e9267bef3a8918a706f793271a5acc2574532da79e5a10cf074b998147a3c43586a411a513bba0d11cc19a36c83b19277f28022c88b120abfdba7076a8263e05336e3245aef7033eb3c762b5bbfa5791ac960398b649d5cbb652ddc6b2398143a0861ab3b410b696328879c099098adf819fbf7ac170030e86675e7f45c22ac9e1cf52c3102487bb0b91ab592afdc69c6e3a9b71876b86260b6c736b8291098f1130d3b763525cbad540ce2d042eacb6ed43b7bcba898f712c412f26066e09945f44ec7026c8ef959831abc10719d2017a12a41728b41c02371a5f5756ebc79406be708ea41bbd21563c874a0b791a3b4e4224a609967004f065c5ab4f3b4c61cb35df70573269da53179c3701fc5205f61974426f9b794c1b5826494b70842b6920c17752029369264dc8590b898b85c9d89a258e1f46c1b0490efd17c485cb51687cea272041e90b8e629521d3c5e3fa7518161bad7a159295b63cc6c0077897b53d47db8bc0ecb820f550705b65715a1a1094d04854f56acd26aa0baa10cb8447fad6211f53105796a42882328e6852e8de821c283b51eaab9bc95c4dc53615626049d63b1f9a457193805276b1905b0ab39353b5cf91fdd6023d4d816aef9cce4a3cfb3d12190172df221ae61d427563a098cc60e3dc9997ef54959180be5dc64a911157db6be3a01be2ee343caab33b8729abf0c50c674758c511291941fceac646232920907c2e88b9ec10211161729c797643a553a6ae5c4b7483c04e3263bd291e311c609071348b7c3310aa97d6b8318e0a4afe8399fa22f951049a9bb8860f7c69a333d3cc1aaf0129ab560713bf29eb3a01f9a276c78e54e3a3648b2447c80242b271b11406866389426d8b59796540d6b5702092ab21ee217c075cfc0c17ef826ce9ea29b9e61617457a5b1aaa23a58615dc53c59183beb36ea19498c21820b70ab47adeb678f1c52bf8768b3597b608ea1a8a15cd62e8a29bec4a1ac248ef9f02de0144bca06025f95a42bd6c8eaaaaaa2366328561d";
25
29
  address private constant ANVIL_ZEROTH_ADDRESS = 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266;
26
30
  uint256 private constant ANVIL_ZEROTH_PRIVATE_KEY =
27
31
  0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80;