diff --git a/.github/workflows/cargo-tests.yml b/.github/workflows/cargo-tests.yml index 42edbc7f..1e6993d0 100644 --- a/.github/workflows/cargo-tests.yml +++ b/.github/workflows/cargo-tests.yml @@ -51,6 +51,15 @@ jobs: run: make init_db working-directory: fhevm-engine/coprocessor + - name: Use Node.js + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: 20.x + + - run: cp ./contracts/.env.example ./contracts/.env + - run: npm --prefix ./contracts ci --include=optional + - run: "cd contracts && npm install && npx hardhat compile" + - name: Run tests run: | DATABASE_URL=postgresql://postgres:postgres@localhost:5432/coprocessor cargo test --release -- --test-threads=1 diff --git a/.github/workflows/fhevm-core-contracts-publish.yml b/.github/workflows/fhevm-core-contracts-publish.yml index 895a2b08..08bce910 100644 --- a/.github/workflows/fhevm-core-contracts-publish.yml +++ b/.github/workflows/fhevm-core-contracts-publish.yml @@ -28,7 +28,7 @@ jobs: node-version: 20.x - name: Prepare environment file - run: cp .env.example.deployment .env + run: cp .env.example .env - name: Install dependencies run: npm ci --include=optional @@ -47,6 +47,7 @@ jobs: tag: prerelease token: ${{ secrets.NPM_TOKEN }} provenance: true + access: public - name: Publish release to npm if: ${{ inputs.release == 'true' }} @@ -55,3 +56,4 @@ jobs: package: ./contracts/package.json token: ${{ secrets.NPM_TOKEN }} provenance: true + access: public diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec80f524..fd6a6de2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,9 @@ name: Pull request tests (contracts) on: pull_request: branches: - - main + - "*" + paths: + - contracts/** jobs: build: diff --git a/contracts/.npmignore b/contracts/.npmignore index cd8384ee..b85f45e0 100644 --- a/contracts/.npmignore +++ b/contracts/.npmignore @@ -3,11 +3,8 @@ !/artifacts/contracts/FHEGasLimit.sol/FHEGasLimit.json !/artifacts/contracts/InputVerifier.sol/InputVerifier.json !/artifacts/contracts/KMSVerifier.sol/KMSVerifier.json -!/artifacts/contracts/TFHEExecutor.sol/TFHEExecutor.json -!/artifacts/contracts/TFHEExecutorWithEvents.sol/TFHEExecutorWithEvents.json -!/artifacts/decryptionOracle/DecryptionOracle.sol/DecryptionOracle.json +!/artifacts/contracts/HTTPZExecutor.sol/HTTPZExecutor.json !contracts/** -!decryptionOracle/** !package.json !LICENSE !README.md \ No newline at end of file diff --git a/contracts/CustomProvider.ts b/contracts/CustomProvider.ts index c6806da7..02bcee52 100644 --- a/contracts/CustomProvider.ts +++ b/contracts/CustomProvider.ts @@ -27,7 +27,7 @@ class CustomProvider extends ProviderWrapper { this.lastBlockSnapshot = parseInt(blockNumberHex); this.lastBlockSnapshotForDecrypt = parseInt(blockNumberHex); const parsedEnvCoprocessor = dotenv.parse(fs.readFileSync('addresses/.env.exec')); - const coprocAdd = parsedEnvCoprocessor.TFHE_EXECUTOR_CONTRACT_ADDRESS; + const coprocAdd = parsedEnvCoprocessor.HTTPZ_EXECUTOR_CONTRACT_ADDRESS; this.lastCounterRand = await this._wrappedProvider.request({ method: 'eth_getStorageAt', params: [coprocAdd, '0xa436a06f0efce5ea38c956a21e24202a59b3b746d48a23fb52b4a5bc33fe3e00', 'latest'], diff --git a/contracts/addresses/.env.exec b/contracts/addresses/.env.exec index fa03768f..2663a789 100644 --- a/contracts/addresses/.env.exec +++ b/contracts/addresses/.env.exec @@ -1 +1 @@ -TFHE_EXECUTOR_CONTRACT_ADDRESS=0xCD3ab3bd6bcc0c0bf3E27912a92043e817B1cf69 +HTTPZ_EXECUTOR_CONTRACT_ADDRESS=0xCD3ab3bd6bcc0c0bf3E27912a92043e817B1cf69 diff --git a/contracts/addresses/HTTPZExecutorAddress.sol b/contracts/addresses/HTTPZExecutorAddress.sol new file mode 100644 index 00000000..ca514777 --- /dev/null +++ b/contracts/addresses/HTTPZExecutorAddress.sol @@ -0,0 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear + +pragma solidity ^0.8.24; + +address constant httpzExecutorAdd = 0xCD3ab3bd6bcc0c0bf3E27912a92043e817B1cf69; diff --git a/contracts/addresses/TFHEExecutorAddress.sol b/contracts/addresses/TFHEExecutorAddress.sol deleted file mode 100644 index 9abbd551..00000000 --- a/contracts/addresses/TFHEExecutorAddress.sol +++ /dev/null @@ -1,5 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause-Clear - -pragma solidity ^0.8.24; - -address constant tfheExecutorAdd = 0xCD3ab3bd6bcc0c0bf3E27912a92043e817B1cf69; diff --git a/contracts/artifacts/contracts/ACL.sol/ACL.json b/contracts/artifacts/contracts/ACL.sol/ACL.json new file mode 100644 index 00000000..610e36ad --- /dev/null +++ b/contracts/artifacts/contracts/ACL.sol/ACL.json @@ -0,0 +1,663 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ACL", + "sourceName": "contracts/ACL.sol", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "AlreadyDelegated", + "type": "error" + }, + { + "inputs": [], + "name": "ContractAddressesIsEmpty", + "type": "error" + }, + { + "inputs": [], + "name": "ContractAddressesMaxLengthExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [], + "name": "HandlesListIsEmpty", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "NotDelegatedYet", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + } + ], + "name": "SenderCannotBeContractAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "SenderNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "handle", + "type": "bytes32" + } + ], + "name": "Allowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "handlesList", + "type": "bytes32[]" + } + ], + "name": "AllowedForDecryption", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "contractAddresses", + "type": "address[]" + } + ], + "name": "NewDelegation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "contractAddresses", + "type": "address[]" + } + ], + "name": "RevokedDelegation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "handle", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "allow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "handlesList", + "type": "bytes32[]" + } + ], + "name": "allowForDecryption", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "handle", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "allowTransient", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "handle", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "allowedOnBehalf", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "handle", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "allowedTransient", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "cleanTransientStorage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "address[]", + "name": "contractAddresses", + "type": "address[]" + } + ], + "name": "delegateAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getHTTPZExecutorAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVersion", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "handle", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "isAllowed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "handle", + "type": "bytes32" + } + ], + "name": "isAllowedForDecryption", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "handle", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "persistAllowed", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "address[]", + "name": "contractAddresses", + "type": "address[]" + } + ], + "name": "revokeDelegation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "bytecode": "0x60a060405230608052348015610013575f80fd5b5061001c610021565b6100d3565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100715760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100d05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b60805161191c6100f95f395f8181610f0e01528181610f37015261109c015261191c5ff3fe608060405260043610610162575f3560e01c806379ba5097116100c6578063b9819d911161007c578063f2fde38b11610057578063f2fde38b1461042b578063f72164de1461044a578063fadd224614610469575f80fd5b8063b9819d91146103a4578063c0d02943146103ca578063e30c397814610417575f80fd5b80638da5cb5b116100ac5780638da5cb5b14610311578063ad3cb1cc1461033d578063b9496b6214610385575f80fd5b806379ba5097146102de57806382027b6d146102f2575f80fd5b80634f1ef2861161011b578063531efc9211610101578063531efc921461028c578063715018a6146102ab57806374b79a5a146102bf575f80fd5b80634f1ef2861461025757806352d1902d1461026a575f80fd5b80631e2f86ba1161014b5780631e2f86ba146101b157806335334c23146102245780633e395cec14610238575f80fd5b8063088563e8146101665780630d8e6e2c14610187575b5f80fd5b348015610171575f80fd5b506101856101803660046114fa565b610488565b005b348015610192575f80fd5b5061019b610655565b6040516101a891906115c7565b60405180910390f35b3480156101bc575f80fd5b506102146101cb3660046115f9565b5f9182527fcaeeb749b0b652d94927794ec4f309146afb8975e723911d557314d9d3b87200602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60405190151581526020016101a8565b34801561022f575f80fd5b506101856106b6565b348015610243575f80fd5b506101856102523660046115f9565b6106e0565b610185610265366004611623565b610780565b348015610275575f80fd5b5061027e61079f565b6040519081526020016101a8565b348015610297575f80fd5b506101856102a63660046114fa565b6107cd565b3480156102b6575f80fd5b50610185610a1c565b3480156102ca575f80fd5b506102146102d93660046115f9565b610a2f565b3480156102e9575f80fd5b50610185610a82565b3480156102fd575f80fd5b5061021461030c3660046115f9565b610aca565b34801561031c575f80fd5b50610325610b27565b6040516001600160a01b0390911681526020016101a8565b348015610348575f80fd5b5061019b6040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b348015610390575f80fd5b5061018561039f3660046115f9565b610b5b565b3480156103af575f80fd5b5073cd3ab3bd6bcc0c0bf3e27912a92043e817b1cf69610325565b3480156103d5575f80fd5b506102146103e43660046116c3565b5f9081527fcaeeb749b0b652d94927794ec4f309146afb8975e723911d557314d9d3b87201602052604090205460ff1690565b348015610422575f80fd5b50610325610c08565b348015610436575f80fd5b506101856104453660046116da565b610c30565b348015610455575f80fd5b506102146104643660046116f3565b610cb5565b348015610474575f80fd5b5061018561048336600461173d565b610d6a565b80515f8190036104ab576040516317d7ad0760e21b815260040160405180910390fd5b7fcaeeb749b0b652d94927794ec4f309146afb8975e723911d557314d9d3b872005f5b8281101561060357335f90815260028301602090815260408083206001600160a01b038916845290915281208551909190869084908110610511576105116117c9565b6020908102919091018101516001600160a01b031682528101919091526040015f205460ff1615610590578484828151811061054f5761054f6117c9565b6020026020010151604051632210106160e01b81526004016105879291906001600160a01b0392831681529116602082015260400190565b60405180910390fd5b335f90815260028301602090815260408083206001600160a01b03891684529091528120855182908790859081106105ca576105ca6117c9565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff19169115159190911790556001016104ce565b50836001600160a01b0316336001600160a01b03167f7c0a18a6132447b7c9f34ae509fec1dba0cb0ff0bdd1704b99779a1c744a138e8560405161064791906117dd565b60405180910390a350505050565b6060604051806040016040528060038152602001621050d360ea1b81525061067c5f610e66565b6106866001610e66565b61068f5f610e66565b6040516020016106a29493929190611829565b604051602081830303815290604052905090565b5f5c5f805d600190810190805b828110156106db57805c5f825d5f815d5081016106c3565b505050565b3373cd3ab3bd6bcc0c0bf3e27912a92043e817b1cf6914610724576107058233610aca565b610724576040516368692cbb60e11b8152336004820152602401610587565b5f828260405160200161075392919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b6040516020818303038152906040528051906020012090506001815d60015f5c0181815d805f5d50505050565b610788610f03565b61079182610fba565b61079b8282610fc2565b5050565b5f6107a8611091565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b80515f8190036107f0576040516317d7ad0760e21b815260040160405180910390fd5b600a811115610812576040516365ac366b60e11b815260040160405180910390fd5b7fcaeeb749b0b652d94927794ec4f309146afb8975e723911d557314d9d3b872005f5b828110156109d857336001600160a01b0316848281518110610859576108596117c9565b60200260200101516001600160a01b0316036108b257838181518110610881576108816117c9565b6020026020010151604051630c24836b60e31b815260040161058791906001600160a01b0391909116815260200190565b335f90815260028301602090815260408083206001600160a01b0389168452909152812085519091908690849081106108ed576108ed6117c9565b6020908102919091018101516001600160a01b031682528101919091526040015f205460ff1615610963578484828151811061092b5761092b6117c9565b6020026020010151604051633e39e40f60e21b81526004016105879291906001600160a01b0392831681529116602082015260400190565b335f90815260028301602090815260408083206001600160a01b0389168452909152812085516001929087908590811061099f5761099f6117c9565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff1916911515919091179055600101610835565b50836001600160a01b0316336001600160a01b03167f6ac533ce8df9b9d2a4842715e991ef317c4a8148d2dbc0a5109ce6979de353e58560405161064791906117dd565b610a246110da565b610a2d5f61110c565b565b5f805f8484604051602001610a6092919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b60408051808303601f1901815291905280516020909101205c95945050505050565b3380610a8c610c08565b6001600160a01b031614610abe5760405163118cdaa760e01b81526001600160a01b0382166004820152602401610587565b610ac78161110c565b50565b5f610ad58383610a2f565b80610b2057505f8381527fcaeeb749b0b652d94927794ec4f309146afb8975e723911d557314d9d3b87200602090815260408083206001600160a01b038616845290915290205460ff165b9392505050565b5f807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b7fcaeeb749b0b652d94927794ec4f309146afb8975e723911d557314d9d3b87200610b868333610aca565b610ba5576040516368692cbb60e11b8152336004820152602401610587565b5f838152602082815260408083206001600160a01b03861680855290835292819020805460ff191660011790555185815233917fe2e1decee6e05ee246cd7c7f1337d25cdfd41dcbdcf8c57b61630be56cc7366a910160405180910390a3505050565b5f807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610b4b565b610c386110da565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b0383169081178255610c7c610b27565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b5f8381527fcaeeb749b0b652d94927794ec4f309146afb8975e723911d557314d9d3b87200602081815260408084206001600160a01b038616855290915282205460ff168015610d2457505f858152602082815260408083206001600160a01b038816845290915290205460ff165b8015610d6057506001600160a01b038084165f90815260028301602090815260408083208a8516845282528083209388168352929052205460ff165b9695505050505050565b80515f819003610d8d5760405163385e8ccb60e11b815260040160405180910390fd5b7fcaeeb749b0b652d94927794ec4f309146afb8975e723911d557314d9d3b872005f5b82811015610e1f575f848281518110610dcb57610dcb6117c9565b60200260200101519050610ddf8133610aca565b610dfe576040516368692cbb60e11b8152336004820152602401610587565b5f90815260018381016020526040909120805460ff19168217905501610db0565b50336001600160a01b03167fd913ac93a959116526793ef772233273d5249597d33cddfdc34f29920541fd0a84604051610e5991906118a6565b60405180910390a2505050565b60605f610e7283611144565b60010190505f8167ffffffffffffffff811115610e9157610e91611492565b6040519080825280601f01601f191660200182016040528015610ebb576020820181803683370190505b5090508181016020015b5f19017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8504945084610ec557509392505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610f9c57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610f907f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614155b15610a2d5760405163703e46dd60e11b815260040160405180910390fd5b610ac76110da565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561101c575060408051601f3d908101601f19168201909252611019918101906118dd565b60015b61104457604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610587565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc811461108757604051632a87526960e21b815260048101829052602401610587565b6106db8383611226565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610a2d5760405163703e46dd60e11b815260040160405180910390fd5b336110e3610b27565b6001600160a01b031614610a2d5760405163118cdaa760e01b8152336004820152602401610587565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561079b8261127b565b5f807a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000831061118c577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106111b8576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106111d657662386f26fc10000830492506010015b6305f5e10083106111ee576305f5e100830492506008015b612710831061120257612710830492506004015b60648310611214576064830492506002015b600a8310611220576001015b92915050565b61122f826112eb565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a2805115611273576106db8282611361565b61079b6113d3565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b806001600160a01b03163b5f0361132057604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610587565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b03168460405161137d91906118f4565b5f60405180830381855af49150503d805f81146113b5576040519150601f19603f3d011682016040523d82523d5f602084013e6113ba565b606091505b50915091506113ca8583836113f2565b95945050505050565b3415610a2d5760405163b398979f60e01b815260040160405180910390fd5b606082611407576114028261144e565b610b20565b815115801561141e57506001600160a01b0384163b155b1561144757604051639996b31560e01b81526001600160a01b0385166004820152602401610587565b5092915050565b80511561145e5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160a01b038116811461148d575f80fd5b919050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff811182821017156114cf576114cf611492565b604052919050565b5f67ffffffffffffffff8211156114f0576114f0611492565b5060051b60200190565b5f806040838503121561150b575f80fd5b61151483611477565b915060208084013567ffffffffffffffff811115611530575f80fd5b8401601f81018613611540575f80fd5b803561155361154e826114d7565b6114a6565b81815260059190911b82018301908381019088831115611571575f80fd5b928401925b828410156115965761158784611477565b82529284019290840190611576565b80955050505050509250929050565b5f5b838110156115bf5781810151838201526020016115a7565b50505f910152565b602081525f82518060208401526115e58160408501602087016115a5565b601f01601f19169190910160400192915050565b5f806040838503121561160a575f80fd5b8235915061161a60208401611477565b90509250929050565b5f8060408385031215611634575f80fd5b61163d83611477565b915060208084013567ffffffffffffffff8082111561165a575f80fd5b818601915086601f83011261166d575f80fd5b81358181111561167f5761167f611492565b611691601f8201601f191685016114a6565b915080825287848285010111156116a6575f80fd5b80848401858401375f848284010152508093505050509250929050565b5f602082840312156116d3575f80fd5b5035919050565b5f602082840312156116ea575f80fd5b610b2082611477565b5f805f8060808587031215611706575f80fd5b61170f85611477565b93506020850135925061172460408601611477565b915061173260608601611477565b905092959194509250565b5f602080838503121561174e575f80fd5b823567ffffffffffffffff811115611764575f80fd5b8301601f81018513611774575f80fd5b803561178261154e826114d7565b81815260059190911b820183019083810190878311156117a0575f80fd5b928401925b828410156117be578335825292840192908401906117a5565b979650505050505050565b634e487b7160e01b5f52603260045260245ffd5b602080825282518282018190525f9190848201906040850190845b8181101561181d5783516001600160a01b0316835292840192918401916001016117f8565b50909695505050505050565b5f855161183a818460208a016115a5565b61103b60f11b9083019081528551611859816002840160208a016115a5565b808201915050601760f91b806002830152855161187d816003850160208a016115a5565b600392019182015283516118988160048401602088016115a5565b016004019695505050505050565b602080825282518282018190525f9190848201906040850190845b8181101561181d578351835292840192918401916001016118c1565b5f602082840312156118ed575f80fd5b5051919050565b5f82516119058184602087016115a5565b919091019291505056fea164736f6c6343000818000a", + "deployedBytecode": "0x608060405260043610610162575f3560e01c806379ba5097116100c6578063b9819d911161007c578063f2fde38b11610057578063f2fde38b1461042b578063f72164de1461044a578063fadd224614610469575f80fd5b8063b9819d91146103a4578063c0d02943146103ca578063e30c397814610417575f80fd5b80638da5cb5b116100ac5780638da5cb5b14610311578063ad3cb1cc1461033d578063b9496b6214610385575f80fd5b806379ba5097146102de57806382027b6d146102f2575f80fd5b80634f1ef2861161011b578063531efc9211610101578063531efc921461028c578063715018a6146102ab57806374b79a5a146102bf575f80fd5b80634f1ef2861461025757806352d1902d1461026a575f80fd5b80631e2f86ba1161014b5780631e2f86ba146101b157806335334c23146102245780633e395cec14610238575f80fd5b8063088563e8146101665780630d8e6e2c14610187575b5f80fd5b348015610171575f80fd5b506101856101803660046114fa565b610488565b005b348015610192575f80fd5b5061019b610655565b6040516101a891906115c7565b60405180910390f35b3480156101bc575f80fd5b506102146101cb3660046115f9565b5f9182527fcaeeb749b0b652d94927794ec4f309146afb8975e723911d557314d9d3b87200602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60405190151581526020016101a8565b34801561022f575f80fd5b506101856106b6565b348015610243575f80fd5b506101856102523660046115f9565b6106e0565b610185610265366004611623565b610780565b348015610275575f80fd5b5061027e61079f565b6040519081526020016101a8565b348015610297575f80fd5b506101856102a63660046114fa565b6107cd565b3480156102b6575f80fd5b50610185610a1c565b3480156102ca575f80fd5b506102146102d93660046115f9565b610a2f565b3480156102e9575f80fd5b50610185610a82565b3480156102fd575f80fd5b5061021461030c3660046115f9565b610aca565b34801561031c575f80fd5b50610325610b27565b6040516001600160a01b0390911681526020016101a8565b348015610348575f80fd5b5061019b6040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b348015610390575f80fd5b5061018561039f3660046115f9565b610b5b565b3480156103af575f80fd5b5073cd3ab3bd6bcc0c0bf3e27912a92043e817b1cf69610325565b3480156103d5575f80fd5b506102146103e43660046116c3565b5f9081527fcaeeb749b0b652d94927794ec4f309146afb8975e723911d557314d9d3b87201602052604090205460ff1690565b348015610422575f80fd5b50610325610c08565b348015610436575f80fd5b506101856104453660046116da565b610c30565b348015610455575f80fd5b506102146104643660046116f3565b610cb5565b348015610474575f80fd5b5061018561048336600461173d565b610d6a565b80515f8190036104ab576040516317d7ad0760e21b815260040160405180910390fd5b7fcaeeb749b0b652d94927794ec4f309146afb8975e723911d557314d9d3b872005f5b8281101561060357335f90815260028301602090815260408083206001600160a01b038916845290915281208551909190869084908110610511576105116117c9565b6020908102919091018101516001600160a01b031682528101919091526040015f205460ff1615610590578484828151811061054f5761054f6117c9565b6020026020010151604051632210106160e01b81526004016105879291906001600160a01b0392831681529116602082015260400190565b60405180910390fd5b335f90815260028301602090815260408083206001600160a01b03891684529091528120855182908790859081106105ca576105ca6117c9565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff19169115159190911790556001016104ce565b50836001600160a01b0316336001600160a01b03167f7c0a18a6132447b7c9f34ae509fec1dba0cb0ff0bdd1704b99779a1c744a138e8560405161064791906117dd565b60405180910390a350505050565b6060604051806040016040528060038152602001621050d360ea1b81525061067c5f610e66565b6106866001610e66565b61068f5f610e66565b6040516020016106a29493929190611829565b604051602081830303815290604052905090565b5f5c5f805d600190810190805b828110156106db57805c5f825d5f815d5081016106c3565b505050565b3373cd3ab3bd6bcc0c0bf3e27912a92043e817b1cf6914610724576107058233610aca565b610724576040516368692cbb60e11b8152336004820152602401610587565b5f828260405160200161075392919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b6040516020818303038152906040528051906020012090506001815d60015f5c0181815d805f5d50505050565b610788610f03565b61079182610fba565b61079b8282610fc2565b5050565b5f6107a8611091565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b80515f8190036107f0576040516317d7ad0760e21b815260040160405180910390fd5b600a811115610812576040516365ac366b60e11b815260040160405180910390fd5b7fcaeeb749b0b652d94927794ec4f309146afb8975e723911d557314d9d3b872005f5b828110156109d857336001600160a01b0316848281518110610859576108596117c9565b60200260200101516001600160a01b0316036108b257838181518110610881576108816117c9565b6020026020010151604051630c24836b60e31b815260040161058791906001600160a01b0391909116815260200190565b335f90815260028301602090815260408083206001600160a01b0389168452909152812085519091908690849081106108ed576108ed6117c9565b6020908102919091018101516001600160a01b031682528101919091526040015f205460ff1615610963578484828151811061092b5761092b6117c9565b6020026020010151604051633e39e40f60e21b81526004016105879291906001600160a01b0392831681529116602082015260400190565b335f90815260028301602090815260408083206001600160a01b0389168452909152812085516001929087908590811061099f5761099f6117c9565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff1916911515919091179055600101610835565b50836001600160a01b0316336001600160a01b03167f6ac533ce8df9b9d2a4842715e991ef317c4a8148d2dbc0a5109ce6979de353e58560405161064791906117dd565b610a246110da565b610a2d5f61110c565b565b5f805f8484604051602001610a6092919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b60408051808303601f1901815291905280516020909101205c95945050505050565b3380610a8c610c08565b6001600160a01b031614610abe5760405163118cdaa760e01b81526001600160a01b0382166004820152602401610587565b610ac78161110c565b50565b5f610ad58383610a2f565b80610b2057505f8381527fcaeeb749b0b652d94927794ec4f309146afb8975e723911d557314d9d3b87200602090815260408083206001600160a01b038616845290915290205460ff165b9392505050565b5f807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b7fcaeeb749b0b652d94927794ec4f309146afb8975e723911d557314d9d3b87200610b868333610aca565b610ba5576040516368692cbb60e11b8152336004820152602401610587565b5f838152602082815260408083206001600160a01b03861680855290835292819020805460ff191660011790555185815233917fe2e1decee6e05ee246cd7c7f1337d25cdfd41dcbdcf8c57b61630be56cc7366a910160405180910390a3505050565b5f807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610b4b565b610c386110da565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b0383169081178255610c7c610b27565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b5f8381527fcaeeb749b0b652d94927794ec4f309146afb8975e723911d557314d9d3b87200602081815260408084206001600160a01b038616855290915282205460ff168015610d2457505f858152602082815260408083206001600160a01b038816845290915290205460ff165b8015610d6057506001600160a01b038084165f90815260028301602090815260408083208a8516845282528083209388168352929052205460ff165b9695505050505050565b80515f819003610d8d5760405163385e8ccb60e11b815260040160405180910390fd5b7fcaeeb749b0b652d94927794ec4f309146afb8975e723911d557314d9d3b872005f5b82811015610e1f575f848281518110610dcb57610dcb6117c9565b60200260200101519050610ddf8133610aca565b610dfe576040516368692cbb60e11b8152336004820152602401610587565b5f90815260018381016020526040909120805460ff19168217905501610db0565b50336001600160a01b03167fd913ac93a959116526793ef772233273d5249597d33cddfdc34f29920541fd0a84604051610e5991906118a6565b60405180910390a2505050565b60605f610e7283611144565b60010190505f8167ffffffffffffffff811115610e9157610e91611492565b6040519080825280601f01601f191660200182016040528015610ebb576020820181803683370190505b5090508181016020015b5f19017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8504945084610ec557509392505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610f9c57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610f907f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614155b15610a2d5760405163703e46dd60e11b815260040160405180910390fd5b610ac76110da565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561101c575060408051601f3d908101601f19168201909252611019918101906118dd565b60015b61104457604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610587565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc811461108757604051632a87526960e21b815260048101829052602401610587565b6106db8383611226565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610a2d5760405163703e46dd60e11b815260040160405180910390fd5b336110e3610b27565b6001600160a01b031614610a2d5760405163118cdaa760e01b8152336004820152602401610587565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b031916815561079b8261127b565b5f807a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000831061118c577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106111b8576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106111d657662386f26fc10000830492506010015b6305f5e10083106111ee576305f5e100830492506008015b612710831061120257612710830492506004015b60648310611214576064830492506002015b600a8310611220576001015b92915050565b61122f826112eb565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a2805115611273576106db8282611361565b61079b6113d3565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b806001600160a01b03163b5f0361132057604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610587565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b03168460405161137d91906118f4565b5f60405180830381855af49150503d805f81146113b5576040519150601f19603f3d011682016040523d82523d5f602084013e6113ba565b606091505b50915091506113ca8583836113f2565b95945050505050565b3415610a2d5760405163b398979f60e01b815260040160405180910390fd5b606082611407576114028261144e565b610b20565b815115801561141e57506001600160a01b0384163b155b1561144757604051639996b31560e01b81526001600160a01b0385166004820152602401610587565b5092915050565b80511561145e5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160a01b038116811461148d575f80fd5b919050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff811182821017156114cf576114cf611492565b604052919050565b5f67ffffffffffffffff8211156114f0576114f0611492565b5060051b60200190565b5f806040838503121561150b575f80fd5b61151483611477565b915060208084013567ffffffffffffffff811115611530575f80fd5b8401601f81018613611540575f80fd5b803561155361154e826114d7565b6114a6565b81815260059190911b82018301908381019088831115611571575f80fd5b928401925b828410156115965761158784611477565b82529284019290840190611576565b80955050505050509250929050565b5f5b838110156115bf5781810151838201526020016115a7565b50505f910152565b602081525f82518060208401526115e58160408501602087016115a5565b601f01601f19169190910160400192915050565b5f806040838503121561160a575f80fd5b8235915061161a60208401611477565b90509250929050565b5f8060408385031215611634575f80fd5b61163d83611477565b915060208084013567ffffffffffffffff8082111561165a575f80fd5b818601915086601f83011261166d575f80fd5b81358181111561167f5761167f611492565b611691601f8201601f191685016114a6565b915080825287848285010111156116a6575f80fd5b80848401858401375f848284010152508093505050509250929050565b5f602082840312156116d3575f80fd5b5035919050565b5f602082840312156116ea575f80fd5b610b2082611477565b5f805f8060808587031215611706575f80fd5b61170f85611477565b93506020850135925061172460408601611477565b915061173260608601611477565b905092959194509250565b5f602080838503121561174e575f80fd5b823567ffffffffffffffff811115611764575f80fd5b8301601f81018513611774575f80fd5b803561178261154e826114d7565b81815260059190911b820183019083810190878311156117a0575f80fd5b928401925b828410156117be578335825292840192908401906117a5565b979650505050505050565b634e487b7160e01b5f52603260045260245ffd5b602080825282518282018190525f9190848201906040850190845b8181101561181d5783516001600160a01b0316835292840192918401916001016117f8565b50909695505050505050565b5f855161183a818460208a016115a5565b61103b60f11b9083019081528551611859816002840160208a016115a5565b808201915050601760f91b806002830152855161187d816003850160208a016115a5565b600392019182015283516118988160048401602088016115a5565b016004019695505050505050565b602080825282518282018190525f9190848201906040850190845b8181101561181d578351835292840192918401916001016118c1565b5f602082840312156118ed575f80fd5b5051919050565b5f82516119058184602087016115a5565b919091019291505056fea164736f6c6343000818000a", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/contracts/artifacts/contracts/HTTPZExecutor.sol/HTTPZExecutor.json b/contracts/artifacts/contracts/HTTPZExecutor.sol/HTTPZExecutor.json new file mode 100644 index 00000000..d7b9d7f1 --- /dev/null +++ b/contracts/artifacts/contracts/HTTPZExecutor.sol/HTTPZExecutor.json @@ -0,0 +1,2353 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "HTTPZExecutor", + "sourceName": "contracts/HTTPZExecutor.sol", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "handle", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "ACLNotAllowed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [], + "name": "DivisionByZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [], + "name": "IncompatibleTypes", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum FheType", + "name": "typeOf", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "InvalidByteLength", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidType", + "type": "error" + }, + { + "inputs": [], + "name": "IsNotScalar", + "type": "error" + }, + { + "inputs": [], + "name": "IsScalar", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [], + "name": "NotPowerOfTwo", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "SecondOperandIsNotScalar", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, + { + "inputs": [], + "name": "UnsupportedType", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "ct", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "enum FheType", + "name": "toType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "Cast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheAdd", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheBitAnd", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheBitOr", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheBitXor", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheDiv", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheEq", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "rhs", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheEqBytes", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheGe", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheGt", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "control", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "ifTrue", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "ifFalse", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheIfThenElse", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheLe", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheLt", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheMax", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheMin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheMul", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheNe", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "rhs", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheNeBytes", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "ct", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheNeg", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "ct", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheNot", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum FheType", + "name": "randType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes16", + "name": "seed", + "type": "bytes16" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheRand", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "upperBound", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum FheType", + "name": "randType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes16", + "name": "seed", + "type": "bytes16" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheRandBounded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheRem", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheRotl", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheRotr", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheShl", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheShr", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "FheSub", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "pt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum FheType", + "name": "toType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "TrivialEncrypt", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "pt", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "enum FheType", + "name": "toType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "TrivialEncryptBytes", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "inputHandle", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "userAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "inputProof", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "enum FheType", + "name": "inputType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "name": "VerifyCiphertext", + "type": "event" + }, + { + "inputs": [], + "name": "HANDLE_VERSION", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "ct", + "type": "bytes32" + }, + { + "internalType": "enum FheType", + "name": "toType", + "type": "uint8" + } + ], + "name": "cast", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheAdd", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheBitAnd", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheBitOr", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheBitXor", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheDiv", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "rhs", + "type": "bytes" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheEq", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheEq", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheGe", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheGt", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "control", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "ifTrue", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "ifFalse", + "type": "bytes32" + } + ], + "name": "fheIfThenElse", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheLe", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheLt", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheMax", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheMin", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheMul", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "rhs", + "type": "bytes" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheNe", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheNe", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "ct", + "type": "bytes32" + } + ], + "name": "fheNeg", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "ct", + "type": "bytes32" + } + ], + "name": "fheNot", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum FheType", + "name": "randType", + "type": "uint8" + } + ], + "name": "fheRand", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "upperBound", + "type": "uint256" + }, + { + "internalType": "enum FheType", + "name": "randType", + "type": "uint8" + } + ], + "name": "fheRandBounded", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheRem", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheRotl", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheRotr", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheShl", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheShr", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "lhs", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "rhs", + "type": "bytes32" + }, + { + "internalType": "bytes1", + "name": "scalarByte", + "type": "bytes1" + } + ], + "name": "fheSub", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getACLAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getFHEGasLimitAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getInputVerifierAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVersion", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "pt", + "type": "bytes" + }, + { + "internalType": "enum FheType", + "name": "toType", + "type": "uint8" + } + ], + "name": "trivialEncrypt", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "pt", + "type": "uint256" + }, + { + "internalType": "enum FheType", + "name": "toType", + "type": "uint8" + } + ], + "name": "trivialEncrypt", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "inputHandle", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "userAddress", + "type": "address" + }, + { + "internalType": "bytes", + "name": "inputProof", + "type": "bytes" + }, + { + "internalType": "enum FheType", + "name": "inputType", + "type": "uint8" + } + ], + "name": "verifyCiphertext", + "outputs": [ + { + "internalType": "bytes32", + "name": "result", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x60a06040523060805234801562000014575f80fd5b506200001f6200002f565b620000296200002f565b620000e3565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff1615620000805760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b0390811614620000e05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b608051614ec86200010a5f395f81816122300152818161225901526123c30152614ec85ff3fe6080604052600436106102d7575f3560e01c80637702dcff1161017b578063ccc480a1116100d1578063d99882d511610087578063f51ccfb011610062578063f51ccfb0146107f0578063f6859bdc1461080f578063f77f3f1d14610835575f80fd5b8063d99882d51461079e578063e30c3978146107bd578063f2fde38b146107d1575f80fd5b8063d580c063116100b7578063d580c06314610741578063d75d6e8a14610760578063d8092cbc1461077f575f80fd5b8063ccc480a114610703578063cf4d18aa14610722575f80fd5b806391f98ffe11610131578063ad3cb1cc1161010c578063ad3cb1cc1461067d578063c021329e146106c5578063c7d34a6e146106e4575f80fd5b806391f98ffe146106195780639cd07acb14610638578063a8c7c2c114610657575f80fd5b806385362ee71161016157806385362ee7146105c75780638b49ceb4146105e65780638da5cb5b14610605575f80fd5b80637702dcff1461059457806379ba5097146105b3575f80fd5b806352d1902d1161023057806363a2db29116101e6578063715018a6116101c1578063715018a61461054257806372107681146105565780637513a40414610575575f80fd5b806363a2db29146104df5780636754b360146104fe5780636a8c8eb41461051d575f80fd5b80635a53accb116102165780635a53accb1461046e5780635c1f9d5a1461048d578063601303d1146104ac575f80fd5b806352d1902d1461043b57806357f0a5681461044f575f80fd5b8063196d0b9b1161029057806336318d641161026b57806336318d64146103e857806348eef47e146104075780634f1ef28614610426575f80fd5b8063196d0b9b1461038b57806319e1c5c4146103aa5780631c89ee44146103c9575f80fd5b8063117b2f38116102c0578063117b2f381461032e5780631391547f1461034d578063182b6d981461036c575f80fd5b806304559f71146102db5780630d8e6e2c1461030d575b5f80fd5b3480156102e6575f80fd5b506102fa6102f5366004614608565b610854565b6040519081526020015b60405180910390f35b348015610318575f80fd5b506103216108c1565b6040516103049190614687565b348015610339575f80fd5b506102fa610348366004614608565b61093c565b348015610358575f80fd5b506102fa610367366004614608565b61099e565b348015610377575f80fd5b506102fa610386366004614608565b610a00565b348015610396575f80fd5b506102fa6103a536600461475a565b610a62565b3480156103b5575f80fd5b506102fa6103c43660046147be565b610ac2565b3480156103d4575f80fd5b506102fa6103e3366004614809565b610b1a565b3480156103f3575f80fd5b506102fa610402366004614608565b610b64565b348015610412575f80fd5b506102fa610421366004614809565b610bc6565b61043961043436600461482a565b610c2d565b005b348015610446575f80fd5b506102fa610c4c565b34801561045a575f80fd5b506102fa610469366004614608565b610c7a565b348015610479575f80fd5b506102fa610488366004614608565b610cdc565b348015610498575f80fd5b506102fa6104a7366004614875565b610d3e565b3480156104b7575f80fd5b505f80516020614e9c8339815191525b6040516001600160a01b039091168152602001610304565b3480156104ea575f80fd5b506102fa6104f9366004614608565b610d8b565b348015610509575f80fd5b506102fa610518366004614608565b610ded565b348015610528575f80fd5b506105305f81565b60405160ff9091168152602001610304565b34801561054d575f80fd5b50610439610e4f565b348015610561575f80fd5b506102fa610570366004614608565b610e62565b348015610580575f80fd5b506102fa61058f366004614608565b610ec4565b34801561059f575f80fd5b506102fa6105ae3660046148bf565b610f26565b3480156105be575f80fd5b50610439610f7c565b3480156105d2575f80fd5b506102fa6105e1366004614608565b610fc9565b3480156105f1575f80fd5b506102fa610600366004614608565b61102b565b348015610610575f80fd5b506104c761108d565b348015610624575f80fd5b506102fa610633366004614608565b6110c1565b348015610643575f80fd5b506102fa610652366004614809565b611123565b348015610662575f80fd5b5073901f8942346f7ab3a01f6d7613119bca447bb0306104c7565b348015610688575f80fd5b506103216040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b3480156106d0575f80fd5b506102fa6106df366004614608565b61116d565b3480156106ef575f80fd5b506102fa6106fe366004614875565b6111cf565b34801561070e575f80fd5b506102fa61071d366004614608565b61121c565b34801561072d575f80fd5b506102fa61073c366004614608565b61127e565b34801561074c575f80fd5b506102fa61075b3660046148e8565b6112e0565b34801561076b575f80fd5b506102fa61077a3660046148ff565b61132e565b34801561078a575f80fd5b506102fa610799366004614608565b611391565b3480156107a9575f80fd5b506102fa6107b8366004614608565b6113f3565b3480156107c8575f80fd5b506104c7611455565b3480156107dc575f80fd5b506104396107eb366004614918565b61147d565b3480156107fb575f80fd5b506102fa61080a3660046148e8565b611502565b34801561081a575f80fd5b507350157cffd6bbfa2dece204a89ec419c23ef5755d6104c7565b348015610840575f80fd5b506102fa61084f366004614608565b611547565b5f6108608484846115a9565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fc11d62b13c360a83082487064be1ec0878b2f0be4f012bf59f89e128063d47ff906080015b60405180910390a29392505050565b60606040518060400160405280600d81526020017f485454505a4578656375746f72000000000000000000000000000000000000008152506109025f611674565b61090c6001611674565b6109155f611674565b6040516020016109289493929190614931565b604051602081830303815290604052905090565b5f610948848484611711565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fdb9050d65240431621d61d6f94b970e63f53a67a5766614ee6e5c5bbd41c8e2e906080016108b2565b5f6109aa8484846117d0565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f38c3a63c4230de5b741f494ffb54e3087104030279bc7bccee8ad9ad31712b21906080016108b2565b5f610a0c848484611890565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907feb6d37bd271abe1395b21d6d78f3487d6584862872c29ffd3f90736ee99b7393906080016108b2565b5f610a6f85858585611950565b9050336001600160a01b03167f6755f7cde41daab1460146e746a77619c8a667b2daf9a8a89f2ddbb4ab6c9c5c8686868686604051610ab29594939291906149d6565b60405180910390a2949350505050565b5f610acd8383611aaa565b9050336001600160a01b03167f73d63045efdd8765c74bf1a2fd222ee44346fdb6ab36cddde6ab76895ab37700848484604051610b0c93929190614a1c565b60405180910390a292915050565b5f610b258383611c2b565b9050336001600160a01b03167f31ccae6a2f8e3ced1692f77c8f668133e4afdaaa35afe844ff4659a6c27e627f848484604051610b0c93929190614a4b565b5f610b70848484611f08565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907ffd7c9208f956bf0c6ab76a667f04361245ad3e0a2d0eff92eb827acfcca68ea9906080016108b2565b5f80610bd0611fc8565b9050610bdd84848361207c565b9150336001600160a01b03167f5222d96b836727a1d6fe1ee9aef27f9bb507bd41794defa376ff6c648aaf8ff185858486604051610c1e9493929190614a5f565b60405180910390a25092915050565b610c35612225565b610c3e826122dc565b610c4882826122e4565b5050565b5f610c556123b8565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b5f610c86848484612401565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f215346a4f9f975e6d5484e290bd4e53ca14453a9d282ebd3ccedb2a0f171753d906080016108b2565b5f610ce88484846124c1565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f3bab2ee0e2f90f4690c6a87bf63cf1a6b626086e95f231860b152966e8dabbf7906080016108b2565b5f610d4a8484846125c8565b9050336001600160a01b03167f47e8e97859ad4b25674962a094a8f83066e2a6bd7dd962887ff29a903edb7ff6858585856040516108b29493929190614a98565b5f610d978484846127f2565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f56df279bbfb03d9ed097bbe2f28d520ca0c1161206327926e98664d70d2c24c4906080016108b2565b5f610df98484846128cb565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907feb0e4f8dc74058194d0602425fe602f955c222200f7f10c6fe67992f7b24c7e9906080016108b2565b610e57612998565b610e605f6129ca565b565b5f610e6e848484612a02565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f0d483b100d8c73b208984ec697caa3091521ee5525ce69edcf97d7e395d3d059906080016108b2565b5f610ed0848484612ac2565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fdef2e704a077284a07f3d0b436db88f5d981b69f58ab7c1ae623252718a6de01906080016108b2565b5f610f32848484612b82565b60408051868152602081018690529081018490526060810182905290915033907f60be9d61aad849facc28c38b048cb5c4be3420b8fa2233e08cfa06be1b6d1c3e906080016108b2565b3380610f86611455565b6001600160a01b031614610fbd5760405163118cdaa760e01b81526001600160a01b03821660048201526024015b60405180910390fd5b610fc6816129ca565b50565b5f610fd5848484612c8d565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fc9ff8f0d18a3f766ce5de3de216076050140e4fc2652f5e0e745f6fc836cda8b906080016108b2565b5f611037848484612d4d565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f4d32284bd3193ecaa44e1ceca32f41c5d6c32803a92e07967dd3ee4229721582906080016108b2565b5f807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b5f6110cd848484612e26565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f324220bfc9cb158b492991c03c309cd86e5345cac45aacae2092ddabe31fa3d8906080016108b2565b5f61112e8383612ef3565b9050336001600160a01b03167f063ccd1bba45151d91f6a418065047a3d048d058a922535747bb2b575a01d236848484604051610b0c93929190614a4b565b5f611179848484613011565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fc148675905d07ad5496f8ef4d8195c907503f3ec12fd10ed5f21240abc693634906080016108b2565b5f6111db8484846130de565b9050336001600160a01b03167fc52085bd4e8736b3a28c71fd809a34139bfa9f70ebaa5c740d66170c5e9058ce858585856040516108b29493929190614a98565b5f611228848484613273565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fe84282aaebcca698443e39a2a948a345d0d2ebc654af5cb657a2d7e8053bf6cb906080016108b2565b5f61128a848484613340565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f0e691cd0bf8c4e9308e4ced1bb9c964117dc5c5bb9b9ab5bdfebf2c9b13a897c906080016108b2565b5f6112ea82613447565b604080518481526020810183905291925033917f8c664d3c3ca583fc5803b8a91c49644bbd9550bfa87967c73ad1de83027768c091015b60405180910390a2919050565b5f80611338611fc8565b9050611344838261350f565b9150336001600160a01b03167f0c8aca6017003326051e19913ef02631f24b801125e1fa8a1d812e868319fda684838560405161138393929190614acd565b60405180910390a250919050565b5f61139d848484613651565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f6960c1e88f61c352dba34d1bbf6753e302795264d5d8ae82f7983c7004651e5d906080016108b2565b5f6113ff84848461379d565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fe42486b0ccdbef81a2075c48c8e515c079aea73c8b82429997c72a2fe1bf4fef906080016108b2565b5f807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c006110b1565b611485612998565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556114c961108d565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b5f61150c82613876565b604080518481526020810183905291925033917f55aff4cc7a3d160c83f1f15b818011ede841a0b4597fb14dcd3603df3a11e5e09101611321565b5f611553848484613942565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fb3d5c664ec86575818e8d75ff25c5f867250df8954088549c41c848cd10e76cb906080016108b2565b5f806040602060106115bd60086004614b13565b6115c79190614b13565b6115d19190614b13565b6115db9190614b13565b90506115e78582613a8e565b5f6115f186613ad4565b60405163801ec40160e01b8152909150600160f81b8516905f80516020614e9c8339815191529063801ec4019061162e9085908590600401614b26565b5f604051808303815f87803b158015611645575f80fd5b505af1158015611657573d5f803e3d5ffd5b50505050611669601288888486613af0565b979650505050505050565b60605f61168083613d5f565b60010190505f8167ffffffffffffffff81111561169f5761169f6146af565b6040519080825280601f01601f1916602001820160405280156116c9576020820181803683370190505b5090508181016020015b5f19017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846116d357509392505050565b5f8060406020601061172560086004614b13565b61172f9190614b13565b6117399190614b13565b6117439190614b13565b905061174f8582613a8e565b5f61175986613ad4565b604051639ec9108760e01b8152909150600160f81b8516905f80516020614e9c83398151915290639ec91087906117969085908590600401614b26565b5f604051808303815f87803b1580156117ad575f80fd5b505af11580156117bf573d5f803e3d5ffd5b505050506116695f88888486613af0565b5f806040602060106117e460086004614b13565b6117ee9190614b13565b6117f89190614b13565b6118029190614b13565b905061180e8582613a8e565b5f61181886613ad4565b60405163f1ec4e3d60e01b8152909150600160f81b8516905f80516020614e9c8339815191529063f1ec4e3d906118559085908590600401614b26565b5f604051808303815f87803b15801561186c575f80fd5b505af115801561187e573d5f803e3d5ffd5b50505050611669600e8888845f613af0565b5f806040602060106118a460086004614b13565b6118ae9190614b13565b6118b89190614b13565b6118c29190614b13565b90506118ce8582613a8e565b5f6118d886613ad4565b604051630144371760e41b8152909150600160f81b8516905f80516020614e9c833981519152906314437170906119159085908590600401614b26565b5f604051808303815f87803b15801561192c575f80fd5b505af115801561193e573d5f803e3d5ffd5b50505050611669600188888486613af0565b604080518082019091526001600160a01b03841681523360208201525f908161197887613ad4565b905080605381111561198c5761198c6149ae565b84605381111561199e5761199e6149ae565b146119bc5760405163b968846160e01b815260040160405180910390fd5b604051633a69c8c160e21b815273901f8942346f7ab3a01f6d7613119bca447bb0309063e9a72304906119f79085908b908a90600401614b47565b6020604051808303815f875af1158015611a13573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611a379190614b7d565b604051630f8e573b60e21b8152600481018290523360248201529093507350157cffd6bbfa2dece204a89ec419c23ef5755d90633e395cec906044015f604051808303815f87803b158015611a8a575f80fd5b505af1158015611a9c573d5f803e3d5ffd5b505050505050949350505050565b5f80610800611abd610400610200614b13565b611ac79190614b13565b905080836053811115611adc57611adc6149ae565b60ff166001901b165f03611b035760405163636f233560e11b815260040160405180910390fd5b6040516328c6831160e21b81525f80516020614e9c8339815191529063a31a0c4490611b33908690600401614b94565b5f604051808303815f87803b158015611b4a575f80fd5b505af1158015611b5c573d5f803e3d5ffd5b50505050611b6b845184613e40565b601884847350157cffd6bbfa2dece204a89ec419c23ef5755d46604051602001611b99959493929190614bc9565b604051602081830303815290604052805190602001209150611bbb8284613efb565b604051630f8e573b60e21b8152600481018290523360248201529092507350157cffd6bbfa2dece204a89ec419c23ef5755d90633e395cec906044015f604051808303815f87803b158015611c0e575f80fd5b505af1158015611c20573d5f803e3d5ffd5b505050505092915050565b6040516382027b6d60e01b8152600481018390523360248201525f907350157cffd6bbfa2dece204a89ec419c23ef5755d906382027b6d90604401602060405180830381865afa158015611c81573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611ca59190614c21565b611ccb57604051632778ce4b60e21b815260048101849052336024820152604401610fb4565b5f6101006040602060106008611ce360046001614b13565b611ced9190614b13565b611cf79190614b13565b611d019190614b13565b611d0b9190614b13565b611d159190614b13565b9050611d218482613a8e565b5f610100604060206010611d3760086004614b13565b611d419190614b13565b611d4b9190614b13565b611d559190614b13565b611d5f9190614b13565b905080846053811115611d7457611d746149ae565b60ff166001901b165f03611d9b5760405163636f233560e11b815260040160405180910390fd5b5f611da586613ad4565b9050846053811115611db957611db96149ae565b816053811115611dcb57611dcb6149ae565b03611de95760405163b968846160e01b815260040160405180910390fd5b604051630abfbaad60e31b81525f80516020614e9c833981519152906355fdd56890611e19908490600401614b94565b5f604051808303815f87803b158015611e30575f80fd5b505af1158015611e42573d5f803e3d5ffd5b50505050601786867350157cffd6bbfa2dece204a89ec419c23ef5755d46604051602001611e74959493929190614c40565b604051602081830303815290604052805190602001209350611e968486613efb565b604051630f8e573b60e21b8152600481018290523360248201529094507350157cffd6bbfa2dece204a89ec419c23ef5755d90633e395cec906044015f604051808303815f87803b158015611ee9575f80fd5b505af1158015611efb573d5f803e3d5ffd5b5050505050505092915050565b5f80604060206010611f1c60086004614b13565b611f269190614b13565b611f309190614b13565b611f3a9190614b13565b9050611f468582613a8e565b5f611f5086613ad4565b60405163fced972760e01b8152909150600160f81b8516905f80516020614e9c8339815191529063fced972790611f8d9085908590600401614b26565b5f604051808303815f87803b158015611fa4575f80fd5b505af1158015611fb6573d5f803e3d5ffd5b50505050611669601388888486613af0565b7f3d02b8d0de856b0609b3629cf5f3cd56c0504e3831cd53973d3642211620650080545f91907350157cffd6bbfa2dece204a89ec419c23ef5755d4661200f600143614c86565b60408051602081019590955260609390931b6bffffffffffffffffffffffff191692840192909252605483015240607482015242609482015260b40160408051601f1981840301815291905280516020909101208154909250815f61207383614c99565b91905055505090565b5f8061010060406020601061209360086004614b13565b61209d9190614b13565b6120a79190614b13565b6120b19190614b13565b6120bb9190614b13565b9050808460538111156120d0576120d06149ae565b60ff166001901b165f036120f75760405163636f233560e11b815260040160405180910390fd5b61210085613f48565b61211d5760405163127473a160e11b815260040160405180910390fd5b604051633d5e922160e11b81525f80516020614e9c83398151915290637abd24429061214d908790600401614b94565b5f604051808303815f87803b158015612164575f80fd5b505af1158015612176573d5f803e3d5ffd5b50505050601b8585856040516020016121929493929190614cb1565b6040516020818303038152906040528051906020012091506121b48285613efb565b604051630f8e573b60e21b8152600481018290523360248201529092507350157cffd6bbfa2dece204a89ec419c23ef5755d90633e395cec906044015f604051808303815f87803b158015612207575f80fd5b505af1158015612219573d5f803e3d5ffd5b50505050509392505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806122be57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166122b27f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614155b15610e605760405163703e46dd60e11b815260040160405180910390fd5b610fc6612998565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561233e575060408051601f3d908101601f1916820190925261233b91810190614b7d565b60015b61236657604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610fb4565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81146123a957604051632a87526960e21b815260048101829052602401610fb4565b6123b38383613f67565b505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610e605760405163703e46dd60e11b815260040160405180910390fd5b5f8060406020601061241560086004614b13565b61241f9190614b13565b6124299190614b13565b6124339190614b13565b905061243f8582613a8e565b5f61244986613ad4565b604051630bf4df3b60e11b8152909150600160f81b8516905f80516020614e9c833981519152906317e9be76906124869085908590600401614b26565b5f604051808303815f87803b15801561249d575f80fd5b505af11580156124af573d5f803e3d5ffd5b50505050611669600288888486613af0565b5f600160f81b808316146124e857604051634f224e5360e01b815260040160405180910390fd5b5f839003612509576040516323d359a360e01b815260040160405180910390fd5b5f60406020601061251c60086004614b13565b6125269190614b13565b6125309190614b13565b61253a9190614b13565b90506125468582613a8e565b5f61255086613ad4565b60405163293d01a360e21b8152909150600160f81b8516905f80516020614e9c8339815191529063a4f4068c9061258d9085908590600401614b26565b5f604051808303815f87803b1580156125a4575f80fd5b505af11580156125b6573d5f803e3d5ffd5b50505050611669600388888486613af0565b5f806108006125db610400610200614b13565b6125e59190614b13565b90506125f18582613a8e565b5f6125fb86613ad4565b9050600160f81b808516908114612625576040516309bbc1b360e31b815260040160405180910390fd5b6040516308194a5360e41b81525f80516020614e9c83398151915290638194a530906126579085908590600401614b26565b5f604051808303815f87803b15801561266e575f80fd5b505af1158015612680573d5f803e3d5ffd5b50506040516382027b6d60e01b8152600481018a90523360248201527350157cffd6bbfa2dece204a89ec419c23ef5755d92506382027b6d9150604401602060405180830381865afa1580156126d8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906126fc9190614c21565b61272257604051632778ce4b60e21b815260048101889052336024820152604401610fb4565b61272d865183613e40565b600c8787837350157cffd6bbfa2dece204a89ec419c23ef5755d4660405160200161275d96959493929190614cf3565b60405160208183030381529060405280519060200120935061277f845f613efb565b604051630f8e573b60e21b8152600481018290523360248201529094507350157cffd6bbfa2dece204a89ec419c23ef5755d90633e395cec906044015f604051808303815f87803b1580156127d2575f80fd5b505af11580156127e4573d5f803e3d5ffd5b505050505050509392505050565b5f80610100604060206010600861280b60046001614b13565b6128159190614b13565b61281f9190614b13565b6128299190614b13565b6128339190614b13565b61283d9190614b13565b90506128498582613a8e565b5f61285386613ad4565b604051630585a0d560e11b8152909150600160f81b8516905f80516020614e9c83398151915290630b0b41aa906128909085908590600401614b26565b5f604051808303815f87803b1580156128a7575f80fd5b505af11580156128b9573d5f803e3d5ffd5b50505050611669600688888486613af0565b5f806101006040602060106128e260086004614b13565b6128ec9190614b13565b6128f69190614b13565b6129009190614b13565b61290a9190614b13565b90506129168582613a8e565b5f61292086613ad4565b60405163d52059c160e01b8152909150600160f81b8516905f80516020614e9c8339815191529063d52059c19061295d9085908590600401614b26565b5f604051808303815f87803b158015612974575f80fd5b505af1158015612986573d5f803e3d5ffd5b50505050611669600a88888486613af0565b336129a161108d565b6001600160a01b031614610e605760405163118cdaa760e01b8152336004820152602401610fb4565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319168155610c4882613fbc565b5f80604060206010612a1660086004614b13565b612a209190614b13565b612a2a9190614b13565b612a349190614b13565b9050612a408582613a8e565b5f612a4a86613ad4565b604051630b20432b60e21b8152909150600160f81b8516905f80516020614e9c83398151915290632c810cac90612a879085908590600401614b26565b5f604051808303815f87803b158015612a9e575f80fd5b505af1158015612ab0573d5f803e3d5ffd5b5050505061166960118888845f613af0565b5f80604060206010612ad660086004614b13565b612ae09190614b13565b612aea9190614b13565b612af49190614b13565b9050612b008582613a8e565b5f612b0a86613ad4565b604051630b171ff760e01b8152909150600160f81b8516905f80516020614e9c83398151915290630b171ff790612b479085908590600401614b26565b5f604051808303815f87803b158015612b5e575f80fd5b505af1158015612b70573d5f803e3d5ffd5b5050505061166960108888845f613af0565b5f8061080061040061020061010060806040602060106008612ba660046001614b13565b612bb09190614b13565b612bba9190614b13565b612bc49190614b13565b612bce9190614b13565b612bd89190614b13565b612be29190614b13565b612bec9190614b13565b612bf69190614b13565b612c009190614b13565b9050612c0c8482613a8e565b5f612c1685613ad4565b60405163e7b5afe360e01b81529091505f80516020614e9c8339815191529063e7b5afe390612c49908490600401614b94565b5f604051808303815f87803b158015612c60575f80fd5b505af1158015612c72573d5f803e3d5ffd5b50505050612c83601987878761402c565b9695505050505050565b5f80604060206010612ca160086004614b13565b612cab9190614b13565b612cb59190614b13565b612cbf9190614b13565b9050612ccb8582613a8e565b5f612cd586613ad4565b604051633941d74360e21b8152909150600160f81b8516905f80516020614e9c8339815191529063e5075d0c90612d129085908590600401614b26565b5f604051808303815f87803b158015612d29575f80fd5b505af1158015612d3b573d5f803e3d5ffd5b50505050611669600f8888845f613af0565b5f806101006040602060106008612d6660046001614b13565b612d709190614b13565b612d7a9190614b13565b612d849190614b13565b612d8e9190614b13565b612d989190614b13565b9050612da48582613a8e565b5f612dae86613ad4565b604051632f891e1b60e01b8152909150600160f81b8516905f80516020614e9c83398151915290632f891e1b90612deb9085908590600401614b26565b5f604051808303815f87803b158015612e02575f80fd5b505af1158015612e14573d5f803e3d5ffd5b50505050611669600788888486613af0565b5f80610100604060206010612e3d60086004614b13565b612e479190614b13565b612e519190614b13565b612e5b9190614b13565b612e659190614b13565b9050612e718582613a8e565b5f612e7b86613ad4565b604051630ae767b360e01b8152909150600160f81b8516905f80516020614e9c83398151915290630ae767b390612eb89085908590600401614b26565b5f604051808303815f87803b158015612ecf575f80fd5b505af1158015612ee1573d5f803e3d5ffd5b50505050611669600988888486613af0565b5f8061010060806040602060106008612f0e60046001614b13565b612f189190614b13565b612f229190614b13565b612f2c9190614b13565b612f369190614b13565b612f409190614b13565b612f4a9190614b13565b905080836053811115612f5f57612f5f6149ae565b60ff166001901b165f03612f865760405163636f233560e11b815260040160405180910390fd5b6040516328c6831160e21b81525f80516020614e9c8339815191529063a31a0c4490612fb6908690600401614b94565b5f604051808303815f87803b158015612fcd575f80fd5b505af1158015612fdf573d5f803e3d5ffd5b50505050601884847350157cffd6bbfa2dece204a89ec419c23ef5755d46604051602001611b99959493929190614c40565b5f8061010060406020601061302860086004614b13565b6130329190614b13565b61303c9190614b13565b6130469190614b13565b6130509190614b13565b905061305c8582613a8e565b5f61306686613ad4565b604051636b053d1d60e11b8152909150600160f81b8516905f80516020614e9c8339815191529063d60a7a3a906130a39085908590600401614b26565b5f604051808303815f87803b1580156130ba575f80fd5b505af11580156130cc573d5f803e3d5ffd5b50505050611669600b88888486613af0565b5f806108006130f1610400610200614b13565b6130fb9190614b13565b90506131078582613a8e565b5f61311186613ad4565b9050600160f81b80851690811461313b576040516309bbc1b360e31b815260040160405180910390fd5b604051633b470ee160e01b81525f80516020614e9c83398151915290633b470ee19061316d9085908590600401614b26565b5f604051808303815f87803b158015613184575f80fd5b505af1158015613196573d5f803e3d5ffd5b50506040516382027b6d60e01b8152600481018a90523360248201527350157cffd6bbfa2dece204a89ec419c23ef5755d92506382027b6d9150604401602060405180830381865afa1580156131ee573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906132129190614c21565b61323857604051632778ce4b60e21b815260048101889052336024820152604401610fb4565b613243865183613e40565b600d8787837350157cffd6bbfa2dece204a89ec419c23ef5755d4660405160200161275d96959493929190614cf3565b5f8061010060406020601061328a60086004614b13565b6132949190614b13565b61329e9190614b13565b6132a89190614b13565b6132b29190614b13565b90506132be8582613a8e565b5f6132c886613ad4565b60405163061b95e560e21b8152909150600160f81b8516905f80516020614e9c8339815191529063186e5794906133059085908590600401614b26565b5f604051808303815f87803b15801561331c575f80fd5b505af115801561332e573d5f803e3d5ffd5b50505050611669600888888486613af0565b5f600160f81b8083161461336757604051634f224e5360e01b815260040160405180910390fd5b5f839003613388576040516323d359a360e01b815260040160405180910390fd5b5f60406020601061339b60086004614b13565b6133a59190614b13565b6133af9190614b13565b6133b99190614b13565b90506133c58582613a8e565b5f6133cf86613ad4565b604051634bf5249160e11b8152909150600160f81b8516905f80516020614e9c833981519152906397ea49229061340c9085908590600401614b26565b5f604051808303815f87803b158015613423575f80fd5b505af1158015613435573d5f803e3d5ffd5b50505050611669600488888486613af0565b5f8061010060406020601061345e60086004614b13565b6134689190614b13565b6134729190614b13565b61347c9190614b13565b6134869190614b13565b90506134928382613a8e565b5f61349c84613ad4565b6040516333becb3b60e01b81529091505f80516020614e9c833981519152906333becb3b906134cf908490600401614b94565b5f604051808303815f87803b1580156134e6575f80fd5b505af11580156134f8573d5f803e3d5ffd5b50505050613507601485614364565b949350505050565b5f80610800610400610200610100604060206010600861353160046001614b13565b61353b9190614b13565b6135459190614b13565b61354f9190614b13565b6135599190614b13565b6135639190614b13565b61356d9190614b13565b6135779190614b13565b6135819190614b13565b905080846053811115613596576135966149ae565b60ff166001901b165f036135bd5760405163636f233560e11b815260040160405180910390fd5b60405162d435d160e31b81525f80516020614e9c833981519152906306a1ae88906135ec908790600401614b94565b5f604051808303815f87803b158015613603575f80fd5b505af1158015613615573d5f803e3d5ffd5b50505050601a848460405160200161362f93929190614d5b565b604051602081830303815290604052805190602001209150611bbb8285613efb565b5f806108006104006102006101006080604060206010600861367560046001614b13565b61367f9190614b13565b6136899190614b13565b6136939190614b13565b61369d9190614b13565b6136a79190614b13565b6136b19190614b13565b6136bb9190614b13565b6136c59190614b13565b6136cf9190614b13565b90506136db8582613a8e565b5f6136e586613ad4565b9050600160f81b80851690811480156137125750600882605381111561370d5761370d6149ae565b60ff16115b156137305760405163dac55bcd60e01b815260040160405180910390fd5b604051633b470ee160e01b81525f80516020614e9c83398151915290633b470ee1906137629085908590600401614b26565b5f604051808303815f87803b158015613779575f80fd5b505af115801561378b573d5f803e3d5ffd5b50505050611669600d8888845f613af0565b5f8061010060406020601060086137b660046001614b13565b6137c09190614b13565b6137ca9190614b13565b6137d49190614b13565b6137de9190614b13565b6137e89190614b13565b90506137f48582613a8e565b5f6137fe86613ad4565b6040516330cd786560e11b8152909150600160f81b8516905f80516020614e9c8339815191529063619af0ca9061383b9085908590600401614b26565b5f604051808303815f87803b158015613852575f80fd5b505af1158015613864573d5f803e3d5ffd5b50505050611669600588888486613af0565b5f80610100604060206010600861388f60046001614b13565b6138999190614b13565b6138a39190614b13565b6138ad9190614b13565b6138b79190614b13565b6138c19190614b13565b90506138cd8382613a8e565b5f6138d784613ad4565b6040516322f1ff5160e11b81529091505f80516020614e9c833981519152906345e3fea29061390a908490600401614b94565b5f604051808303815f87803b158015613921575f80fd5b505af1158015613933573d5f803e3d5ffd5b50505050613507601585614364565b5f806108006104006102006101006080604060206010600861396660046001614b13565b6139709190614b13565b61397a9190614b13565b6139849190614b13565b61398e9190614b13565b6139989190614b13565b6139a29190614b13565b6139ac9190614b13565b6139b69190614b13565b6139c09190614b13565b90506139cc8582613a8e565b5f6139d686613ad4565b9050600160f81b8085169081148015613a03575060088260538111156139fe576139fe6149ae565b60ff16115b15613a215760405163dac55bcd60e01b815260040160405180910390fd5b6040516308194a5360e41b81525f80516020614e9c83398151915290638194a53090613a539085908590600401614b26565b5f604051808303815f87803b158015613a6a575f80fd5b505af1158015613a7c573d5f803e3d5ffd5b50505050611669600c8888845f613af0565b5f613a9883613ad4565b905081816053811115613aad57613aad6149ae565b60ff166001901b165f036123b35760405163636f233560e11b815260040160405180910390fd5b5f81601e1a6053811115613aea57613aea6149ae565b92915050565b6040516382027b6d60e01b8152600481018590523360248201525f907350157cffd6bbfa2dece204a89ec419c23ef5755d906382027b6d90604401602060405180830381865afa158015613b46573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613b6a9190614c21565b613b9057604051632778ce4b60e21b815260048101869052336024820152604401610fb4565b6001600160f81b031983165f03613c9c576040516382027b6d60e01b8152600481018590523360248201527350157cffd6bbfa2dece204a89ec419c23ef5755d906382027b6d90604401602060405180830381865afa158015613bf5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613c199190614c21565b613c3f57604051632778ce4b60e21b815260048101859052336024820152604401610fb4565b5f613c4985613ad4565b90505f613c5587613ad4565b9050816053811115613c6957613c696149ae565b816053811115613c7b57613c7b6149ae565b14613c9957604051631f3158c760e01b815260040160405180910390fd5b50505b858585857350157cffd6bbfa2dece204a89ec419c23ef5755d46604051602001613ccb96959493929190614d96565b604051602081830303815290604052805190602001209050613ced8183613efb565b604051630f8e573b60e21b8152600481018290523360248201529091507350157cffd6bbfa2dece204a89ec419c23ef5755d90633e395cec906044015f604051808303815f87803b158015613d40575f80fd5b505af1158015613d52573d5f803e3d5ffd5b5050505095945050505050565b5f807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310613da7577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310613dd3576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310613df157662386f26fc10000830492506010015b6305f5e1008310613e09576305f5e100830492506008015b6127108310613e1d57612710830492506004015b60648310613e2f576064830492506002015b600a8310613aea5760010192915050565b6009816053811115613e5457613e546149ae565b03613e7e5781604014610c4857808260405163b30c0c5760e01b8152600401610fb4929190614de6565b600a816053811115613e9257613e926149ae565b03613ebc5781608014610c4857808260405163b30c0c5760e01b8152600401610fb4929190614de6565b600b816053811115613ed057613ed06149ae565b03610c48578161010014610c4857808260405163b30c0c5760e01b8152600401610fb4929190614de6565b69ffffffffffffffff00004660101b166affffffffffffffffffffff198316176aff00000000000000000000176008826053811115613f3c57613f3c6149ae565b60ff16901b1792915050565b5f8082118015613aea5750613f5e600183614c86565b82161592915050565b613f708261445d565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a2805115613fb4576123b382826144d3565b610c48614545565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b6040516382027b6d60e01b8152600481018490523360248201525f907350157cffd6bbfa2dece204a89ec419c23ef5755d906382027b6d90604401602060405180830381865afa158015614082573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906140a69190614c21565b6140cc57604051632778ce4b60e21b815260048101859052336024820152604401610fb4565b6040516382027b6d60e01b8152600481018490523360248201527350157cffd6bbfa2dece204a89ec419c23ef5755d906382027b6d90604401602060405180830381865afa158015614120573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906141449190614c21565b61416a57604051632778ce4b60e21b815260048101849052336024820152604401610fb4565b6040516382027b6d60e01b8152600481018390523360248201527350157cffd6bbfa2dece204a89ec419c23ef5755d906382027b6d90604401602060405180830381865afa1580156141be573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906141e29190614c21565b61420857604051632778ce4b60e21b815260048101839052336024820152604401610fb4565b5f61421285613ad4565b90505f61421e85613ad4565b90505f61422a85613ad4565b90505f83605381111561423f5761423f6149ae565b1461425d5760405163636f233560e11b815260040160405180910390fd5b80605381111561426f5761426f6149ae565b826053811115614281576142816149ae565b1461429f57604051631f3158c760e01b815260040160405180910390fd5b878787877350157cffd6bbfa2dece204a89ec419c23ef5755d466040516020016142ce96959493929190614e01565b6040516020818303038152906040528051906020012093506142f08483613efb565b604051630f8e573b60e21b8152600481018290523360248201529094507350157cffd6bbfa2dece204a89ec419c23ef5755d90633e395cec906044015f604051808303815f87803b158015614343575f80fd5b505af1158015614355573d5f803e3d5ffd5b50505050505050949350505050565b6040516382027b6d60e01b8152600481018290523360248201525f907350157cffd6bbfa2dece204a89ec419c23ef5755d906382027b6d90604401602060405180830381865afa1580156143ba573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906143de9190614c21565b61440457604051632778ce4b60e21b815260048101839052336024820152604401610fb4565b82827350157cffd6bbfa2dece204a89ec419c23ef5755d4660405160200161442f9493929190614e47565b6040516020818303038152906040528051906020012090505f61445183613ad4565b9050611bbb8282613efb565b806001600160a01b03163b5f0361449257604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610fb4565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b0316846040516144ef9190614e80565b5f60405180830381855af49150503d805f8114614527576040519150601f19603f3d011682016040523d82523d5f602084013e61452c565b606091505b509150915061453c858383614564565b95945050505050565b3415610e605760405163b398979f60e01b815260040160405180910390fd5b60608261457957614574826145c3565b6145bc565b815115801561459057506001600160a01b0384163b155b156145b957604051639996b31560e01b81526001600160a01b0385166004820152602401610fb4565b50805b9392505050565b8051156145d35780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160f81b031981168114614603575f80fd5b919050565b5f805f6060848603121561461a575f80fd5b8335925060208401359150614631604085016145ec565b90509250925092565b5f5b8381101561465457818101518382015260200161463c565b50505f910152565b5f815180845261467381602086016020860161463a565b601f01601f19169290920160200192915050565b602081525f6145bc602083018461465c565b80356001600160a01b0381168114614603575f80fd5b634e487b7160e01b5f52604160045260245ffd5b5f82601f8301126146d2575f80fd5b813567ffffffffffffffff808211156146ed576146ed6146af565b604051601f8301601f19908116603f01168101908282118183101715614715576147156146af565b8160405283815286602085880101111561472d575f80fd5b836020870160208301375f602085830101528094505050505092915050565b803560548110614603575f80fd5b5f805f806080858703121561476d575f80fd5b8435935061477d60208601614699565b9250604085013567ffffffffffffffff811115614798575f80fd5b6147a4878288016146c3565b9250506147b36060860161474c565b905092959194509250565b5f80604083850312156147cf575f80fd5b823567ffffffffffffffff8111156147e5575f80fd5b6147f1858286016146c3565b9250506148006020840161474c565b90509250929050565b5f806040838503121561481a575f80fd5b823591506148006020840161474c565b5f806040838503121561483b575f80fd5b61484483614699565b9150602083013567ffffffffffffffff81111561485f575f80fd5b61486b858286016146c3565b9150509250929050565b5f805f60608486031215614887575f80fd5b83359250602084013567ffffffffffffffff8111156148a4575f80fd5b6148b0868287016146c3565b925050614631604085016145ec565b5f805f606084860312156148d1575f80fd5b505081359360208301359350604090920135919050565b5f602082840312156148f8575f80fd5b5035919050565b5f6020828403121561490f575f80fd5b6145bc8261474c565b5f60208284031215614928575f80fd5b6145bc82614699565b5f8551614942818460208a0161463a565b61103b60f11b9083019081528551614961816002840160208a0161463a565b808201915050601760f91b8060028301528551614985816003850160208a0161463a565b600392019182015283516149a081600484016020880161463a565b016004019695505050505050565b634e487b7160e01b5f52602160045260245ffd5b605481106149d2576149d26149ae565b9052565b8581526001600160a01b038516602082015260a060408201525f6149fd60a083018661465c565b9050614a0c60608301856149c2565b8260808301529695505050505050565b606081525f614a2e606083018661465c565b9050614a3d60208301856149c2565b826040830152949350505050565b83815260608101614a3d60208301856149c2565b84815260808101614a7360208301866149c2565b6fffffffffffffffffffffffffffffffff199390931660408201526060015292915050565b848152608060208201525f614ab0608083018661465c565b6001600160f81b0319949094166040830152506060015292915050565b60608101614adb82866149c2565b6fffffffffffffffffffffffffffffffff1993909316602082015260400152919050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115613aea57613aea614aff565b60408101614b3482856149c2565b60ff60f81b831660208301529392505050565b5f6001600160a01b03808651168352806020870151166020840152508360408301526080606083015261453c608083018461465c565b5f60208284031215614b8d575f80fd5b5051919050565b60208101613aea82846149c2565b601c8110614bb257614bb26149ae565b60f81b9052565b60548110614bb257614bb26149ae565b614bd38187614ba2565b5f8551614be7816001850160208a0161463a565b8201614bf66001820187614bb9565b60609490941b6bffffffffffffffffffffffff19166002850152505060168201526036019392505050565b5f60208284031215614c31575f80fd5b815180151581146145bc575f80fd5b614c4a8187614ba2565b846001820152614c5d6021820185614bb9565b60609290921b6bffffffffffffffffffffffff1916602283015260368201526056019392505050565b81810381811115613aea57613aea614aff565b5f60018201614caa57614caa614aff565b5060010190565b614cbb8186614ba2565b836001820152614cce6021820184614bb9565b6fffffffffffffffffffffffffffffffff199190911660228201526032019392505050565b614cfd8188614ba2565b8560018201525f8551614d17816021850160208a0161463a565b6001600160f81b0319959095166021929095019182019490945260609290921b6bffffffffffffffffffffffff191660228301526036820152605601949350505050565b614d658185614ba2565b614d726001820184614bb9565b6fffffffffffffffffffffffffffffffff1991909116600282015260120192915050565b614da08188614ba2565b600181019590955260218501939093526001600160f81b031991909116604184015260601b6bffffffffffffffffffffffff191660428301526056820152607601919050565b60408101614df482856149c2565b8260208301529392505050565b614e0b8188614ba2565b60018101959095526021850193909352604184019190915260601b6bffffffffffffffffffffffff191660618301526075820152609501919050565b614e518186614ba2565b600181019390935260609190911b6bffffffffffffffffffffffff191660218301526035820152605501919050565b5f8251614e9181846020870161463a565b919091019291505056fe00000000000000000000000036772142b74871f255cbd7a3e89b401d3e45825fa164736f6c6343000818000a", + "deployedBytecode": "0x6080604052600436106102d7575f3560e01c80637702dcff1161017b578063ccc480a1116100d1578063d99882d511610087578063f51ccfb011610062578063f51ccfb0146107f0578063f6859bdc1461080f578063f77f3f1d14610835575f80fd5b8063d99882d51461079e578063e30c3978146107bd578063f2fde38b146107d1575f80fd5b8063d580c063116100b7578063d580c06314610741578063d75d6e8a14610760578063d8092cbc1461077f575f80fd5b8063ccc480a114610703578063cf4d18aa14610722575f80fd5b806391f98ffe11610131578063ad3cb1cc1161010c578063ad3cb1cc1461067d578063c021329e146106c5578063c7d34a6e146106e4575f80fd5b806391f98ffe146106195780639cd07acb14610638578063a8c7c2c114610657575f80fd5b806385362ee71161016157806385362ee7146105c75780638b49ceb4146105e65780638da5cb5b14610605575f80fd5b80637702dcff1461059457806379ba5097146105b3575f80fd5b806352d1902d1161023057806363a2db29116101e6578063715018a6116101c1578063715018a61461054257806372107681146105565780637513a40414610575575f80fd5b806363a2db29146104df5780636754b360146104fe5780636a8c8eb41461051d575f80fd5b80635a53accb116102165780635a53accb1461046e5780635c1f9d5a1461048d578063601303d1146104ac575f80fd5b806352d1902d1461043b57806357f0a5681461044f575f80fd5b8063196d0b9b1161029057806336318d641161026b57806336318d64146103e857806348eef47e146104075780634f1ef28614610426575f80fd5b8063196d0b9b1461038b57806319e1c5c4146103aa5780631c89ee44146103c9575f80fd5b8063117b2f38116102c0578063117b2f381461032e5780631391547f1461034d578063182b6d981461036c575f80fd5b806304559f71146102db5780630d8e6e2c1461030d575b5f80fd5b3480156102e6575f80fd5b506102fa6102f5366004614608565b610854565b6040519081526020015b60405180910390f35b348015610318575f80fd5b506103216108c1565b6040516103049190614687565b348015610339575f80fd5b506102fa610348366004614608565b61093c565b348015610358575f80fd5b506102fa610367366004614608565b61099e565b348015610377575f80fd5b506102fa610386366004614608565b610a00565b348015610396575f80fd5b506102fa6103a536600461475a565b610a62565b3480156103b5575f80fd5b506102fa6103c43660046147be565b610ac2565b3480156103d4575f80fd5b506102fa6103e3366004614809565b610b1a565b3480156103f3575f80fd5b506102fa610402366004614608565b610b64565b348015610412575f80fd5b506102fa610421366004614809565b610bc6565b61043961043436600461482a565b610c2d565b005b348015610446575f80fd5b506102fa610c4c565b34801561045a575f80fd5b506102fa610469366004614608565b610c7a565b348015610479575f80fd5b506102fa610488366004614608565b610cdc565b348015610498575f80fd5b506102fa6104a7366004614875565b610d3e565b3480156104b7575f80fd5b505f80516020614e9c8339815191525b6040516001600160a01b039091168152602001610304565b3480156104ea575f80fd5b506102fa6104f9366004614608565b610d8b565b348015610509575f80fd5b506102fa610518366004614608565b610ded565b348015610528575f80fd5b506105305f81565b60405160ff9091168152602001610304565b34801561054d575f80fd5b50610439610e4f565b348015610561575f80fd5b506102fa610570366004614608565b610e62565b348015610580575f80fd5b506102fa61058f366004614608565b610ec4565b34801561059f575f80fd5b506102fa6105ae3660046148bf565b610f26565b3480156105be575f80fd5b50610439610f7c565b3480156105d2575f80fd5b506102fa6105e1366004614608565b610fc9565b3480156105f1575f80fd5b506102fa610600366004614608565b61102b565b348015610610575f80fd5b506104c761108d565b348015610624575f80fd5b506102fa610633366004614608565b6110c1565b348015610643575f80fd5b506102fa610652366004614809565b611123565b348015610662575f80fd5b5073901f8942346f7ab3a01f6d7613119bca447bb0306104c7565b348015610688575f80fd5b506103216040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b3480156106d0575f80fd5b506102fa6106df366004614608565b61116d565b3480156106ef575f80fd5b506102fa6106fe366004614875565b6111cf565b34801561070e575f80fd5b506102fa61071d366004614608565b61121c565b34801561072d575f80fd5b506102fa61073c366004614608565b61127e565b34801561074c575f80fd5b506102fa61075b3660046148e8565b6112e0565b34801561076b575f80fd5b506102fa61077a3660046148ff565b61132e565b34801561078a575f80fd5b506102fa610799366004614608565b611391565b3480156107a9575f80fd5b506102fa6107b8366004614608565b6113f3565b3480156107c8575f80fd5b506104c7611455565b3480156107dc575f80fd5b506104396107eb366004614918565b61147d565b3480156107fb575f80fd5b506102fa61080a3660046148e8565b611502565b34801561081a575f80fd5b507350157cffd6bbfa2dece204a89ec419c23ef5755d6104c7565b348015610840575f80fd5b506102fa61084f366004614608565b611547565b5f6108608484846115a9565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fc11d62b13c360a83082487064be1ec0878b2f0be4f012bf59f89e128063d47ff906080015b60405180910390a29392505050565b60606040518060400160405280600d81526020017f485454505a4578656375746f72000000000000000000000000000000000000008152506109025f611674565b61090c6001611674565b6109155f611674565b6040516020016109289493929190614931565b604051602081830303815290604052905090565b5f610948848484611711565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fdb9050d65240431621d61d6f94b970e63f53a67a5766614ee6e5c5bbd41c8e2e906080016108b2565b5f6109aa8484846117d0565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f38c3a63c4230de5b741f494ffb54e3087104030279bc7bccee8ad9ad31712b21906080016108b2565b5f610a0c848484611890565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907feb6d37bd271abe1395b21d6d78f3487d6584862872c29ffd3f90736ee99b7393906080016108b2565b5f610a6f85858585611950565b9050336001600160a01b03167f6755f7cde41daab1460146e746a77619c8a667b2daf9a8a89f2ddbb4ab6c9c5c8686868686604051610ab29594939291906149d6565b60405180910390a2949350505050565b5f610acd8383611aaa565b9050336001600160a01b03167f73d63045efdd8765c74bf1a2fd222ee44346fdb6ab36cddde6ab76895ab37700848484604051610b0c93929190614a1c565b60405180910390a292915050565b5f610b258383611c2b565b9050336001600160a01b03167f31ccae6a2f8e3ced1692f77c8f668133e4afdaaa35afe844ff4659a6c27e627f848484604051610b0c93929190614a4b565b5f610b70848484611f08565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907ffd7c9208f956bf0c6ab76a667f04361245ad3e0a2d0eff92eb827acfcca68ea9906080016108b2565b5f80610bd0611fc8565b9050610bdd84848361207c565b9150336001600160a01b03167f5222d96b836727a1d6fe1ee9aef27f9bb507bd41794defa376ff6c648aaf8ff185858486604051610c1e9493929190614a5f565b60405180910390a25092915050565b610c35612225565b610c3e826122dc565b610c4882826122e4565b5050565b5f610c556123b8565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b5f610c86848484612401565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f215346a4f9f975e6d5484e290bd4e53ca14453a9d282ebd3ccedb2a0f171753d906080016108b2565b5f610ce88484846124c1565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f3bab2ee0e2f90f4690c6a87bf63cf1a6b626086e95f231860b152966e8dabbf7906080016108b2565b5f610d4a8484846125c8565b9050336001600160a01b03167f47e8e97859ad4b25674962a094a8f83066e2a6bd7dd962887ff29a903edb7ff6858585856040516108b29493929190614a98565b5f610d978484846127f2565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f56df279bbfb03d9ed097bbe2f28d520ca0c1161206327926e98664d70d2c24c4906080016108b2565b5f610df98484846128cb565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907feb0e4f8dc74058194d0602425fe602f955c222200f7f10c6fe67992f7b24c7e9906080016108b2565b610e57612998565b610e605f6129ca565b565b5f610e6e848484612a02565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f0d483b100d8c73b208984ec697caa3091521ee5525ce69edcf97d7e395d3d059906080016108b2565b5f610ed0848484612ac2565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fdef2e704a077284a07f3d0b436db88f5d981b69f58ab7c1ae623252718a6de01906080016108b2565b5f610f32848484612b82565b60408051868152602081018690529081018490526060810182905290915033907f60be9d61aad849facc28c38b048cb5c4be3420b8fa2233e08cfa06be1b6d1c3e906080016108b2565b3380610f86611455565b6001600160a01b031614610fbd5760405163118cdaa760e01b81526001600160a01b03821660048201526024015b60405180910390fd5b610fc6816129ca565b50565b5f610fd5848484612c8d565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fc9ff8f0d18a3f766ce5de3de216076050140e4fc2652f5e0e745f6fc836cda8b906080016108b2565b5f611037848484612d4d565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f4d32284bd3193ecaa44e1ceca32f41c5d6c32803a92e07967dd3ee4229721582906080016108b2565b5f807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b5f6110cd848484612e26565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f324220bfc9cb158b492991c03c309cd86e5345cac45aacae2092ddabe31fa3d8906080016108b2565b5f61112e8383612ef3565b9050336001600160a01b03167f063ccd1bba45151d91f6a418065047a3d048d058a922535747bb2b575a01d236848484604051610b0c93929190614a4b565b5f611179848484613011565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fc148675905d07ad5496f8ef4d8195c907503f3ec12fd10ed5f21240abc693634906080016108b2565b5f6111db8484846130de565b9050336001600160a01b03167fc52085bd4e8736b3a28c71fd809a34139bfa9f70ebaa5c740d66170c5e9058ce858585856040516108b29493929190614a98565b5f611228848484613273565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fe84282aaebcca698443e39a2a948a345d0d2ebc654af5cb657a2d7e8053bf6cb906080016108b2565b5f61128a848484613340565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f0e691cd0bf8c4e9308e4ced1bb9c964117dc5c5bb9b9ab5bdfebf2c9b13a897c906080016108b2565b5f6112ea82613447565b604080518481526020810183905291925033917f8c664d3c3ca583fc5803b8a91c49644bbd9550bfa87967c73ad1de83027768c091015b60405180910390a2919050565b5f80611338611fc8565b9050611344838261350f565b9150336001600160a01b03167f0c8aca6017003326051e19913ef02631f24b801125e1fa8a1d812e868319fda684838560405161138393929190614acd565b60405180910390a250919050565b5f61139d848484613651565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f6960c1e88f61c352dba34d1bbf6753e302795264d5d8ae82f7983c7004651e5d906080016108b2565b5f6113ff84848461379d565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fe42486b0ccdbef81a2075c48c8e515c079aea73c8b82429997c72a2fe1bf4fef906080016108b2565b5f807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c006110b1565b611485612998565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556114c961108d565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b5f61150c82613876565b604080518481526020810183905291925033917f55aff4cc7a3d160c83f1f15b818011ede841a0b4597fb14dcd3603df3a11e5e09101611321565b5f611553848484613942565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fb3d5c664ec86575818e8d75ff25c5f867250df8954088549c41c848cd10e76cb906080016108b2565b5f806040602060106115bd60086004614b13565b6115c79190614b13565b6115d19190614b13565b6115db9190614b13565b90506115e78582613a8e565b5f6115f186613ad4565b60405163801ec40160e01b8152909150600160f81b8516905f80516020614e9c8339815191529063801ec4019061162e9085908590600401614b26565b5f604051808303815f87803b158015611645575f80fd5b505af1158015611657573d5f803e3d5ffd5b50505050611669601288888486613af0565b979650505050505050565b60605f61168083613d5f565b60010190505f8167ffffffffffffffff81111561169f5761169f6146af565b6040519080825280601f01601f1916602001820160405280156116c9576020820181803683370190505b5090508181016020015b5f19017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846116d357509392505050565b5f8060406020601061172560086004614b13565b61172f9190614b13565b6117399190614b13565b6117439190614b13565b905061174f8582613a8e565b5f61175986613ad4565b604051639ec9108760e01b8152909150600160f81b8516905f80516020614e9c83398151915290639ec91087906117969085908590600401614b26565b5f604051808303815f87803b1580156117ad575f80fd5b505af11580156117bf573d5f803e3d5ffd5b505050506116695f88888486613af0565b5f806040602060106117e460086004614b13565b6117ee9190614b13565b6117f89190614b13565b6118029190614b13565b905061180e8582613a8e565b5f61181886613ad4565b60405163f1ec4e3d60e01b8152909150600160f81b8516905f80516020614e9c8339815191529063f1ec4e3d906118559085908590600401614b26565b5f604051808303815f87803b15801561186c575f80fd5b505af115801561187e573d5f803e3d5ffd5b50505050611669600e8888845f613af0565b5f806040602060106118a460086004614b13565b6118ae9190614b13565b6118b89190614b13565b6118c29190614b13565b90506118ce8582613a8e565b5f6118d886613ad4565b604051630144371760e41b8152909150600160f81b8516905f80516020614e9c833981519152906314437170906119159085908590600401614b26565b5f604051808303815f87803b15801561192c575f80fd5b505af115801561193e573d5f803e3d5ffd5b50505050611669600188888486613af0565b604080518082019091526001600160a01b03841681523360208201525f908161197887613ad4565b905080605381111561198c5761198c6149ae565b84605381111561199e5761199e6149ae565b146119bc5760405163b968846160e01b815260040160405180910390fd5b604051633a69c8c160e21b815273901f8942346f7ab3a01f6d7613119bca447bb0309063e9a72304906119f79085908b908a90600401614b47565b6020604051808303815f875af1158015611a13573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611a379190614b7d565b604051630f8e573b60e21b8152600481018290523360248201529093507350157cffd6bbfa2dece204a89ec419c23ef5755d90633e395cec906044015f604051808303815f87803b158015611a8a575f80fd5b505af1158015611a9c573d5f803e3d5ffd5b505050505050949350505050565b5f80610800611abd610400610200614b13565b611ac79190614b13565b905080836053811115611adc57611adc6149ae565b60ff166001901b165f03611b035760405163636f233560e11b815260040160405180910390fd5b6040516328c6831160e21b81525f80516020614e9c8339815191529063a31a0c4490611b33908690600401614b94565b5f604051808303815f87803b158015611b4a575f80fd5b505af1158015611b5c573d5f803e3d5ffd5b50505050611b6b845184613e40565b601884847350157cffd6bbfa2dece204a89ec419c23ef5755d46604051602001611b99959493929190614bc9565b604051602081830303815290604052805190602001209150611bbb8284613efb565b604051630f8e573b60e21b8152600481018290523360248201529092507350157cffd6bbfa2dece204a89ec419c23ef5755d90633e395cec906044015f604051808303815f87803b158015611c0e575f80fd5b505af1158015611c20573d5f803e3d5ffd5b505050505092915050565b6040516382027b6d60e01b8152600481018390523360248201525f907350157cffd6bbfa2dece204a89ec419c23ef5755d906382027b6d90604401602060405180830381865afa158015611c81573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611ca59190614c21565b611ccb57604051632778ce4b60e21b815260048101849052336024820152604401610fb4565b5f6101006040602060106008611ce360046001614b13565b611ced9190614b13565b611cf79190614b13565b611d019190614b13565b611d0b9190614b13565b611d159190614b13565b9050611d218482613a8e565b5f610100604060206010611d3760086004614b13565b611d419190614b13565b611d4b9190614b13565b611d559190614b13565b611d5f9190614b13565b905080846053811115611d7457611d746149ae565b60ff166001901b165f03611d9b5760405163636f233560e11b815260040160405180910390fd5b5f611da586613ad4565b9050846053811115611db957611db96149ae565b816053811115611dcb57611dcb6149ae565b03611de95760405163b968846160e01b815260040160405180910390fd5b604051630abfbaad60e31b81525f80516020614e9c833981519152906355fdd56890611e19908490600401614b94565b5f604051808303815f87803b158015611e30575f80fd5b505af1158015611e42573d5f803e3d5ffd5b50505050601786867350157cffd6bbfa2dece204a89ec419c23ef5755d46604051602001611e74959493929190614c40565b604051602081830303815290604052805190602001209350611e968486613efb565b604051630f8e573b60e21b8152600481018290523360248201529094507350157cffd6bbfa2dece204a89ec419c23ef5755d90633e395cec906044015f604051808303815f87803b158015611ee9575f80fd5b505af1158015611efb573d5f803e3d5ffd5b5050505050505092915050565b5f80604060206010611f1c60086004614b13565b611f269190614b13565b611f309190614b13565b611f3a9190614b13565b9050611f468582613a8e565b5f611f5086613ad4565b60405163fced972760e01b8152909150600160f81b8516905f80516020614e9c8339815191529063fced972790611f8d9085908590600401614b26565b5f604051808303815f87803b158015611fa4575f80fd5b505af1158015611fb6573d5f803e3d5ffd5b50505050611669601388888486613af0565b7f3d02b8d0de856b0609b3629cf5f3cd56c0504e3831cd53973d3642211620650080545f91907350157cffd6bbfa2dece204a89ec419c23ef5755d4661200f600143614c86565b60408051602081019590955260609390931b6bffffffffffffffffffffffff191692840192909252605483015240607482015242609482015260b40160408051601f1981840301815291905280516020909101208154909250815f61207383614c99565b91905055505090565b5f8061010060406020601061209360086004614b13565b61209d9190614b13565b6120a79190614b13565b6120b19190614b13565b6120bb9190614b13565b9050808460538111156120d0576120d06149ae565b60ff166001901b165f036120f75760405163636f233560e11b815260040160405180910390fd5b61210085613f48565b61211d5760405163127473a160e11b815260040160405180910390fd5b604051633d5e922160e11b81525f80516020614e9c83398151915290637abd24429061214d908790600401614b94565b5f604051808303815f87803b158015612164575f80fd5b505af1158015612176573d5f803e3d5ffd5b50505050601b8585856040516020016121929493929190614cb1565b6040516020818303038152906040528051906020012091506121b48285613efb565b604051630f8e573b60e21b8152600481018290523360248201529092507350157cffd6bbfa2dece204a89ec419c23ef5755d90633e395cec906044015f604051808303815f87803b158015612207575f80fd5b505af1158015612219573d5f803e3d5ffd5b50505050509392505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806122be57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166122b27f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614155b15610e605760405163703e46dd60e11b815260040160405180910390fd5b610fc6612998565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561233e575060408051601f3d908101601f1916820190925261233b91810190614b7d565b60015b61236657604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610fb4565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81146123a957604051632a87526960e21b815260048101829052602401610fb4565b6123b38383613f67565b505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610e605760405163703e46dd60e11b815260040160405180910390fd5b5f8060406020601061241560086004614b13565b61241f9190614b13565b6124299190614b13565b6124339190614b13565b905061243f8582613a8e565b5f61244986613ad4565b604051630bf4df3b60e11b8152909150600160f81b8516905f80516020614e9c833981519152906317e9be76906124869085908590600401614b26565b5f604051808303815f87803b15801561249d575f80fd5b505af11580156124af573d5f803e3d5ffd5b50505050611669600288888486613af0565b5f600160f81b808316146124e857604051634f224e5360e01b815260040160405180910390fd5b5f839003612509576040516323d359a360e01b815260040160405180910390fd5b5f60406020601061251c60086004614b13565b6125269190614b13565b6125309190614b13565b61253a9190614b13565b90506125468582613a8e565b5f61255086613ad4565b60405163293d01a360e21b8152909150600160f81b8516905f80516020614e9c8339815191529063a4f4068c9061258d9085908590600401614b26565b5f604051808303815f87803b1580156125a4575f80fd5b505af11580156125b6573d5f803e3d5ffd5b50505050611669600388888486613af0565b5f806108006125db610400610200614b13565b6125e59190614b13565b90506125f18582613a8e565b5f6125fb86613ad4565b9050600160f81b808516908114612625576040516309bbc1b360e31b815260040160405180910390fd5b6040516308194a5360e41b81525f80516020614e9c83398151915290638194a530906126579085908590600401614b26565b5f604051808303815f87803b15801561266e575f80fd5b505af1158015612680573d5f803e3d5ffd5b50506040516382027b6d60e01b8152600481018a90523360248201527350157cffd6bbfa2dece204a89ec419c23ef5755d92506382027b6d9150604401602060405180830381865afa1580156126d8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906126fc9190614c21565b61272257604051632778ce4b60e21b815260048101889052336024820152604401610fb4565b61272d865183613e40565b600c8787837350157cffd6bbfa2dece204a89ec419c23ef5755d4660405160200161275d96959493929190614cf3565b60405160208183030381529060405280519060200120935061277f845f613efb565b604051630f8e573b60e21b8152600481018290523360248201529094507350157cffd6bbfa2dece204a89ec419c23ef5755d90633e395cec906044015f604051808303815f87803b1580156127d2575f80fd5b505af11580156127e4573d5f803e3d5ffd5b505050505050509392505050565b5f80610100604060206010600861280b60046001614b13565b6128159190614b13565b61281f9190614b13565b6128299190614b13565b6128339190614b13565b61283d9190614b13565b90506128498582613a8e565b5f61285386613ad4565b604051630585a0d560e11b8152909150600160f81b8516905f80516020614e9c83398151915290630b0b41aa906128909085908590600401614b26565b5f604051808303815f87803b1580156128a7575f80fd5b505af11580156128b9573d5f803e3d5ffd5b50505050611669600688888486613af0565b5f806101006040602060106128e260086004614b13565b6128ec9190614b13565b6128f69190614b13565b6129009190614b13565b61290a9190614b13565b90506129168582613a8e565b5f61292086613ad4565b60405163d52059c160e01b8152909150600160f81b8516905f80516020614e9c8339815191529063d52059c19061295d9085908590600401614b26565b5f604051808303815f87803b158015612974575f80fd5b505af1158015612986573d5f803e3d5ffd5b50505050611669600a88888486613af0565b336129a161108d565b6001600160a01b031614610e605760405163118cdaa760e01b8152336004820152602401610fb4565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319168155610c4882613fbc565b5f80604060206010612a1660086004614b13565b612a209190614b13565b612a2a9190614b13565b612a349190614b13565b9050612a408582613a8e565b5f612a4a86613ad4565b604051630b20432b60e21b8152909150600160f81b8516905f80516020614e9c83398151915290632c810cac90612a879085908590600401614b26565b5f604051808303815f87803b158015612a9e575f80fd5b505af1158015612ab0573d5f803e3d5ffd5b5050505061166960118888845f613af0565b5f80604060206010612ad660086004614b13565b612ae09190614b13565b612aea9190614b13565b612af49190614b13565b9050612b008582613a8e565b5f612b0a86613ad4565b604051630b171ff760e01b8152909150600160f81b8516905f80516020614e9c83398151915290630b171ff790612b479085908590600401614b26565b5f604051808303815f87803b158015612b5e575f80fd5b505af1158015612b70573d5f803e3d5ffd5b5050505061166960108888845f613af0565b5f8061080061040061020061010060806040602060106008612ba660046001614b13565b612bb09190614b13565b612bba9190614b13565b612bc49190614b13565b612bce9190614b13565b612bd89190614b13565b612be29190614b13565b612bec9190614b13565b612bf69190614b13565b612c009190614b13565b9050612c0c8482613a8e565b5f612c1685613ad4565b60405163e7b5afe360e01b81529091505f80516020614e9c8339815191529063e7b5afe390612c49908490600401614b94565b5f604051808303815f87803b158015612c60575f80fd5b505af1158015612c72573d5f803e3d5ffd5b50505050612c83601987878761402c565b9695505050505050565b5f80604060206010612ca160086004614b13565b612cab9190614b13565b612cb59190614b13565b612cbf9190614b13565b9050612ccb8582613a8e565b5f612cd586613ad4565b604051633941d74360e21b8152909150600160f81b8516905f80516020614e9c8339815191529063e5075d0c90612d129085908590600401614b26565b5f604051808303815f87803b158015612d29575f80fd5b505af1158015612d3b573d5f803e3d5ffd5b50505050611669600f8888845f613af0565b5f806101006040602060106008612d6660046001614b13565b612d709190614b13565b612d7a9190614b13565b612d849190614b13565b612d8e9190614b13565b612d989190614b13565b9050612da48582613a8e565b5f612dae86613ad4565b604051632f891e1b60e01b8152909150600160f81b8516905f80516020614e9c83398151915290632f891e1b90612deb9085908590600401614b26565b5f604051808303815f87803b158015612e02575f80fd5b505af1158015612e14573d5f803e3d5ffd5b50505050611669600788888486613af0565b5f80610100604060206010612e3d60086004614b13565b612e479190614b13565b612e519190614b13565b612e5b9190614b13565b612e659190614b13565b9050612e718582613a8e565b5f612e7b86613ad4565b604051630ae767b360e01b8152909150600160f81b8516905f80516020614e9c83398151915290630ae767b390612eb89085908590600401614b26565b5f604051808303815f87803b158015612ecf575f80fd5b505af1158015612ee1573d5f803e3d5ffd5b50505050611669600988888486613af0565b5f8061010060806040602060106008612f0e60046001614b13565b612f189190614b13565b612f229190614b13565b612f2c9190614b13565b612f369190614b13565b612f409190614b13565b612f4a9190614b13565b905080836053811115612f5f57612f5f6149ae565b60ff166001901b165f03612f865760405163636f233560e11b815260040160405180910390fd5b6040516328c6831160e21b81525f80516020614e9c8339815191529063a31a0c4490612fb6908690600401614b94565b5f604051808303815f87803b158015612fcd575f80fd5b505af1158015612fdf573d5f803e3d5ffd5b50505050601884847350157cffd6bbfa2dece204a89ec419c23ef5755d46604051602001611b99959493929190614c40565b5f8061010060406020601061302860086004614b13565b6130329190614b13565b61303c9190614b13565b6130469190614b13565b6130509190614b13565b905061305c8582613a8e565b5f61306686613ad4565b604051636b053d1d60e11b8152909150600160f81b8516905f80516020614e9c8339815191529063d60a7a3a906130a39085908590600401614b26565b5f604051808303815f87803b1580156130ba575f80fd5b505af11580156130cc573d5f803e3d5ffd5b50505050611669600b88888486613af0565b5f806108006130f1610400610200614b13565b6130fb9190614b13565b90506131078582613a8e565b5f61311186613ad4565b9050600160f81b80851690811461313b576040516309bbc1b360e31b815260040160405180910390fd5b604051633b470ee160e01b81525f80516020614e9c83398151915290633b470ee19061316d9085908590600401614b26565b5f604051808303815f87803b158015613184575f80fd5b505af1158015613196573d5f803e3d5ffd5b50506040516382027b6d60e01b8152600481018a90523360248201527350157cffd6bbfa2dece204a89ec419c23ef5755d92506382027b6d9150604401602060405180830381865afa1580156131ee573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906132129190614c21565b61323857604051632778ce4b60e21b815260048101889052336024820152604401610fb4565b613243865183613e40565b600d8787837350157cffd6bbfa2dece204a89ec419c23ef5755d4660405160200161275d96959493929190614cf3565b5f8061010060406020601061328a60086004614b13565b6132949190614b13565b61329e9190614b13565b6132a89190614b13565b6132b29190614b13565b90506132be8582613a8e565b5f6132c886613ad4565b60405163061b95e560e21b8152909150600160f81b8516905f80516020614e9c8339815191529063186e5794906133059085908590600401614b26565b5f604051808303815f87803b15801561331c575f80fd5b505af115801561332e573d5f803e3d5ffd5b50505050611669600888888486613af0565b5f600160f81b8083161461336757604051634f224e5360e01b815260040160405180910390fd5b5f839003613388576040516323d359a360e01b815260040160405180910390fd5b5f60406020601061339b60086004614b13565b6133a59190614b13565b6133af9190614b13565b6133b99190614b13565b90506133c58582613a8e565b5f6133cf86613ad4565b604051634bf5249160e11b8152909150600160f81b8516905f80516020614e9c833981519152906397ea49229061340c9085908590600401614b26565b5f604051808303815f87803b158015613423575f80fd5b505af1158015613435573d5f803e3d5ffd5b50505050611669600488888486613af0565b5f8061010060406020601061345e60086004614b13565b6134689190614b13565b6134729190614b13565b61347c9190614b13565b6134869190614b13565b90506134928382613a8e565b5f61349c84613ad4565b6040516333becb3b60e01b81529091505f80516020614e9c833981519152906333becb3b906134cf908490600401614b94565b5f604051808303815f87803b1580156134e6575f80fd5b505af11580156134f8573d5f803e3d5ffd5b50505050613507601485614364565b949350505050565b5f80610800610400610200610100604060206010600861353160046001614b13565b61353b9190614b13565b6135459190614b13565b61354f9190614b13565b6135599190614b13565b6135639190614b13565b61356d9190614b13565b6135779190614b13565b6135819190614b13565b905080846053811115613596576135966149ae565b60ff166001901b165f036135bd5760405163636f233560e11b815260040160405180910390fd5b60405162d435d160e31b81525f80516020614e9c833981519152906306a1ae88906135ec908790600401614b94565b5f604051808303815f87803b158015613603575f80fd5b505af1158015613615573d5f803e3d5ffd5b50505050601a848460405160200161362f93929190614d5b565b604051602081830303815290604052805190602001209150611bbb8285613efb565b5f806108006104006102006101006080604060206010600861367560046001614b13565b61367f9190614b13565b6136899190614b13565b6136939190614b13565b61369d9190614b13565b6136a79190614b13565b6136b19190614b13565b6136bb9190614b13565b6136c59190614b13565b6136cf9190614b13565b90506136db8582613a8e565b5f6136e586613ad4565b9050600160f81b80851690811480156137125750600882605381111561370d5761370d6149ae565b60ff16115b156137305760405163dac55bcd60e01b815260040160405180910390fd5b604051633b470ee160e01b81525f80516020614e9c83398151915290633b470ee1906137629085908590600401614b26565b5f604051808303815f87803b158015613779575f80fd5b505af115801561378b573d5f803e3d5ffd5b50505050611669600d8888845f613af0565b5f8061010060406020601060086137b660046001614b13565b6137c09190614b13565b6137ca9190614b13565b6137d49190614b13565b6137de9190614b13565b6137e89190614b13565b90506137f48582613a8e565b5f6137fe86613ad4565b6040516330cd786560e11b8152909150600160f81b8516905f80516020614e9c8339815191529063619af0ca9061383b9085908590600401614b26565b5f604051808303815f87803b158015613852575f80fd5b505af1158015613864573d5f803e3d5ffd5b50505050611669600588888486613af0565b5f80610100604060206010600861388f60046001614b13565b6138999190614b13565b6138a39190614b13565b6138ad9190614b13565b6138b79190614b13565b6138c19190614b13565b90506138cd8382613a8e565b5f6138d784613ad4565b6040516322f1ff5160e11b81529091505f80516020614e9c833981519152906345e3fea29061390a908490600401614b94565b5f604051808303815f87803b158015613921575f80fd5b505af1158015613933573d5f803e3d5ffd5b50505050613507601585614364565b5f806108006104006102006101006080604060206010600861396660046001614b13565b6139709190614b13565b61397a9190614b13565b6139849190614b13565b61398e9190614b13565b6139989190614b13565b6139a29190614b13565b6139ac9190614b13565b6139b69190614b13565b6139c09190614b13565b90506139cc8582613a8e565b5f6139d686613ad4565b9050600160f81b8085169081148015613a03575060088260538111156139fe576139fe6149ae565b60ff16115b15613a215760405163dac55bcd60e01b815260040160405180910390fd5b6040516308194a5360e41b81525f80516020614e9c83398151915290638194a53090613a539085908590600401614b26565b5f604051808303815f87803b158015613a6a575f80fd5b505af1158015613a7c573d5f803e3d5ffd5b50505050611669600c8888845f613af0565b5f613a9883613ad4565b905081816053811115613aad57613aad6149ae565b60ff166001901b165f036123b35760405163636f233560e11b815260040160405180910390fd5b5f81601e1a6053811115613aea57613aea6149ae565b92915050565b6040516382027b6d60e01b8152600481018590523360248201525f907350157cffd6bbfa2dece204a89ec419c23ef5755d906382027b6d90604401602060405180830381865afa158015613b46573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613b6a9190614c21565b613b9057604051632778ce4b60e21b815260048101869052336024820152604401610fb4565b6001600160f81b031983165f03613c9c576040516382027b6d60e01b8152600481018590523360248201527350157cffd6bbfa2dece204a89ec419c23ef5755d906382027b6d90604401602060405180830381865afa158015613bf5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613c199190614c21565b613c3f57604051632778ce4b60e21b815260048101859052336024820152604401610fb4565b5f613c4985613ad4565b90505f613c5587613ad4565b9050816053811115613c6957613c696149ae565b816053811115613c7b57613c7b6149ae565b14613c9957604051631f3158c760e01b815260040160405180910390fd5b50505b858585857350157cffd6bbfa2dece204a89ec419c23ef5755d46604051602001613ccb96959493929190614d96565b604051602081830303815290604052805190602001209050613ced8183613efb565b604051630f8e573b60e21b8152600481018290523360248201529091507350157cffd6bbfa2dece204a89ec419c23ef5755d90633e395cec906044015f604051808303815f87803b158015613d40575f80fd5b505af1158015613d52573d5f803e3d5ffd5b5050505095945050505050565b5f807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310613da7577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef81000000008310613dd3576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310613df157662386f26fc10000830492506010015b6305f5e1008310613e09576305f5e100830492506008015b6127108310613e1d57612710830492506004015b60648310613e2f576064830492506002015b600a8310613aea5760010192915050565b6009816053811115613e5457613e546149ae565b03613e7e5781604014610c4857808260405163b30c0c5760e01b8152600401610fb4929190614de6565b600a816053811115613e9257613e926149ae565b03613ebc5781608014610c4857808260405163b30c0c5760e01b8152600401610fb4929190614de6565b600b816053811115613ed057613ed06149ae565b03610c48578161010014610c4857808260405163b30c0c5760e01b8152600401610fb4929190614de6565b69ffffffffffffffff00004660101b166affffffffffffffffffffff198316176aff00000000000000000000176008826053811115613f3c57613f3c6149ae565b60ff16901b1792915050565b5f8082118015613aea5750613f5e600183614c86565b82161592915050565b613f708261445d565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a2805115613fb4576123b382826144d3565b610c48614545565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b6040516382027b6d60e01b8152600481018490523360248201525f907350157cffd6bbfa2dece204a89ec419c23ef5755d906382027b6d90604401602060405180830381865afa158015614082573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906140a69190614c21565b6140cc57604051632778ce4b60e21b815260048101859052336024820152604401610fb4565b6040516382027b6d60e01b8152600481018490523360248201527350157cffd6bbfa2dece204a89ec419c23ef5755d906382027b6d90604401602060405180830381865afa158015614120573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906141449190614c21565b61416a57604051632778ce4b60e21b815260048101849052336024820152604401610fb4565b6040516382027b6d60e01b8152600481018390523360248201527350157cffd6bbfa2dece204a89ec419c23ef5755d906382027b6d90604401602060405180830381865afa1580156141be573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906141e29190614c21565b61420857604051632778ce4b60e21b815260048101839052336024820152604401610fb4565b5f61421285613ad4565b90505f61421e85613ad4565b90505f61422a85613ad4565b90505f83605381111561423f5761423f6149ae565b1461425d5760405163636f233560e11b815260040160405180910390fd5b80605381111561426f5761426f6149ae565b826053811115614281576142816149ae565b1461429f57604051631f3158c760e01b815260040160405180910390fd5b878787877350157cffd6bbfa2dece204a89ec419c23ef5755d466040516020016142ce96959493929190614e01565b6040516020818303038152906040528051906020012093506142f08483613efb565b604051630f8e573b60e21b8152600481018290523360248201529094507350157cffd6bbfa2dece204a89ec419c23ef5755d90633e395cec906044015f604051808303815f87803b158015614343575f80fd5b505af1158015614355573d5f803e3d5ffd5b50505050505050949350505050565b6040516382027b6d60e01b8152600481018290523360248201525f907350157cffd6bbfa2dece204a89ec419c23ef5755d906382027b6d90604401602060405180830381865afa1580156143ba573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906143de9190614c21565b61440457604051632778ce4b60e21b815260048101839052336024820152604401610fb4565b82827350157cffd6bbfa2dece204a89ec419c23ef5755d4660405160200161442f9493929190614e47565b6040516020818303038152906040528051906020012090505f61445183613ad4565b9050611bbb8282613efb565b806001600160a01b03163b5f0361449257604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610fb4565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b0316846040516144ef9190614e80565b5f60405180830381855af49150503d805f8114614527576040519150601f19603f3d011682016040523d82523d5f602084013e61452c565b606091505b509150915061453c858383614564565b95945050505050565b3415610e605760405163b398979f60e01b815260040160405180910390fd5b60608261457957614574826145c3565b6145bc565b815115801561459057506001600160a01b0384163b155b156145b957604051639996b31560e01b81526001600160a01b0385166004820152602401610fb4565b50805b9392505050565b8051156145d35780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160f81b031981168114614603575f80fd5b919050565b5f805f6060848603121561461a575f80fd5b8335925060208401359150614631604085016145ec565b90509250925092565b5f5b8381101561465457818101518382015260200161463c565b50505f910152565b5f815180845261467381602086016020860161463a565b601f01601f19169290920160200192915050565b602081525f6145bc602083018461465c565b80356001600160a01b0381168114614603575f80fd5b634e487b7160e01b5f52604160045260245ffd5b5f82601f8301126146d2575f80fd5b813567ffffffffffffffff808211156146ed576146ed6146af565b604051601f8301601f19908116603f01168101908282118183101715614715576147156146af565b8160405283815286602085880101111561472d575f80fd5b836020870160208301375f602085830101528094505050505092915050565b803560548110614603575f80fd5b5f805f806080858703121561476d575f80fd5b8435935061477d60208601614699565b9250604085013567ffffffffffffffff811115614798575f80fd5b6147a4878288016146c3565b9250506147b36060860161474c565b905092959194509250565b5f80604083850312156147cf575f80fd5b823567ffffffffffffffff8111156147e5575f80fd5b6147f1858286016146c3565b9250506148006020840161474c565b90509250929050565b5f806040838503121561481a575f80fd5b823591506148006020840161474c565b5f806040838503121561483b575f80fd5b61484483614699565b9150602083013567ffffffffffffffff81111561485f575f80fd5b61486b858286016146c3565b9150509250929050565b5f805f60608486031215614887575f80fd5b83359250602084013567ffffffffffffffff8111156148a4575f80fd5b6148b0868287016146c3565b925050614631604085016145ec565b5f805f606084860312156148d1575f80fd5b505081359360208301359350604090920135919050565b5f602082840312156148f8575f80fd5b5035919050565b5f6020828403121561490f575f80fd5b6145bc8261474c565b5f60208284031215614928575f80fd5b6145bc82614699565b5f8551614942818460208a0161463a565b61103b60f11b9083019081528551614961816002840160208a0161463a565b808201915050601760f91b8060028301528551614985816003850160208a0161463a565b600392019182015283516149a081600484016020880161463a565b016004019695505050505050565b634e487b7160e01b5f52602160045260245ffd5b605481106149d2576149d26149ae565b9052565b8581526001600160a01b038516602082015260a060408201525f6149fd60a083018661465c565b9050614a0c60608301856149c2565b8260808301529695505050505050565b606081525f614a2e606083018661465c565b9050614a3d60208301856149c2565b826040830152949350505050565b83815260608101614a3d60208301856149c2565b84815260808101614a7360208301866149c2565b6fffffffffffffffffffffffffffffffff199390931660408201526060015292915050565b848152608060208201525f614ab0608083018661465c565b6001600160f81b0319949094166040830152506060015292915050565b60608101614adb82866149c2565b6fffffffffffffffffffffffffffffffff1993909316602082015260400152919050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115613aea57613aea614aff565b60408101614b3482856149c2565b60ff60f81b831660208301529392505050565b5f6001600160a01b03808651168352806020870151166020840152508360408301526080606083015261453c608083018461465c565b5f60208284031215614b8d575f80fd5b5051919050565b60208101613aea82846149c2565b601c8110614bb257614bb26149ae565b60f81b9052565b60548110614bb257614bb26149ae565b614bd38187614ba2565b5f8551614be7816001850160208a0161463a565b8201614bf66001820187614bb9565b60609490941b6bffffffffffffffffffffffff19166002850152505060168201526036019392505050565b5f60208284031215614c31575f80fd5b815180151581146145bc575f80fd5b614c4a8187614ba2565b846001820152614c5d6021820185614bb9565b60609290921b6bffffffffffffffffffffffff1916602283015260368201526056019392505050565b81810381811115613aea57613aea614aff565b5f60018201614caa57614caa614aff565b5060010190565b614cbb8186614ba2565b836001820152614cce6021820184614bb9565b6fffffffffffffffffffffffffffffffff199190911660228201526032019392505050565b614cfd8188614ba2565b8560018201525f8551614d17816021850160208a0161463a565b6001600160f81b0319959095166021929095019182019490945260609290921b6bffffffffffffffffffffffff191660228301526036820152605601949350505050565b614d658185614ba2565b614d726001820184614bb9565b6fffffffffffffffffffffffffffffffff1991909116600282015260120192915050565b614da08188614ba2565b600181019590955260218501939093526001600160f81b031991909116604184015260601b6bffffffffffffffffffffffff191660428301526056820152607601919050565b60408101614df482856149c2565b8260208301529392505050565b614e0b8188614ba2565b60018101959095526021850193909352604184019190915260601b6bffffffffffffffffffffffff191660618301526075820152609501919050565b614e518186614ba2565b600181019390935260609190911b6bffffffffffffffffffffffff191660218301526035820152605501919050565b5f8251614e9181846020870161463a565b919091019291505056fe00000000000000000000000036772142b74871f255cbd7a3e89b401d3e45825fa164736f6c6343000818000a", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/contracts/codegen/common.ts b/contracts/codegen/common.ts index 3c40fb65..888c6491 100644 --- a/contracts/codegen/common.ts +++ b/contracts/codegen/common.ts @@ -1,262 +1,404 @@ -import { strict as assert } from 'node:assert'; +/** + * Enum representing different types of arguments. + */ +export enum ArgumentType { + /** + * Represents an encrypted boolean argument type. + */ + Ebool, + + /** + * Represents an encrypted unsigned integer argument type. + */ + Euint, -export enum Network { - Evmos, - Network1, + /** + * Represents a generic unsigned integer argument type. + */ + Uint, } +export type FunctionType = { + /** + * The type of the function argument. + */ + type: ArgumentType; + + /** + * The bit length of the function argument. + */ + bits: number; +}; + +export type OverloadSignature = { + /** + * The name of the overload signature. + */ + name: string; + + /** + * The arguments of the overload signature. + */ + arguments: FunctionType[]; + + /** + * The return type of the overload signature. + */ + returnType: FunctionType; + + /** + * The binary operator associated with the overload signature. + * Optional. + */ + binaryOperator?: string; + + /** + * The unary operator associated with the overload signature. + * Optional. + */ + unaryOperator?: string; +}; + +export type OverloadShard = { + /** + * The shard number of the overload. + */ + shardNumber: number; + + /** + * The overload signatures in the shard. + */ + overloads: OverloadSignature[]; +}; + +/** + * Represents a Fully Homomorphic Encryption (FHE) type definition. + * This interface defines the structure of an FHE type, including its + * properties, supported operators, and related metadata. + */ +export interface FheType { + /** + * The name or identifier of the FHE type. + */ + type: string; + + /** + * A list of operators that are supported by this FHE type. + */ + supportedOperators: string[]; + + /** + * The bit length of the FHE type, representing its size in bits. + */ + bitLength: number; + + /** + * The corresponding clear (non-encrypted) type that matches this FHE type. + */ + clearMatchingType: string; + + /** + * The value associated with this FHE type. + */ + value: number; + + /** + * An optional list of alias types that are associated with this FHE type. + */ + aliases?: AliasFheType[]; +} + +/** + * Represents an alias for a Fully Homomorphic Encryption (FHE) type. + * This interface provides a way to define alternative names or representations + * for an FHE type, along with its supported operators and the corresponding + * clear (unencrypted) matching type. + */ +export interface AliasFheType { + /** + * The name or identifier of the FHE type. + */ + type: string; + + /** + * A list of operators that are supported by this FHE type. + */ + supportedOperators: string[]; + + /** + * The corresponding clear (non-encrypted) type that matches this FHE type. + */ + clearMatchingType: string; +} + +/** + * Represents an adjusted Fully Homomorphic Encryption (FHE) type with metadata + * about its properties, supported operations, and related type information. + */ +export interface AdjustedFheType { + /** + * The name of the FHE type. + */ + type: string; + + /** + * A list of operators supported by this FHE type. + */ + supportedOperators: string[]; + + /** + * The bit length of the FHE type, indicating its size or precision. + */ + bitLength: number; + + /** + * The corresponding clear (non-encrypted) type that matches this FHE type. + */ + clearMatchingType: string; + + /** + * (Optional) A specific value associated with this FHE type. + */ + value?: number; + + /** + * (Optional) Indicates whether this type is an alias for another type. + */ + isAlias?: boolean; + + /** + * (Optional) The name of the type this alias refers to, if applicable. + */ + aliasType?: string; + + /** + * (Optional) The corresponding clear type for the alias, if applicable. + */ + clearMatchingTypeAlias?: string; +} + +/** + * Represents an operator with various properties and configurations. + */ export type Operator = { + /** + * The name of the operator. + */ name: string; - // express left scalar operation as different operation with arguments swapped + + /** + * Express left scalar operation as a different operation with arguments swapped. + * Optional. + */ leftScalarInvertOp?: string; - precompileName: string; + + /** + * Indicates if the operator has a scalar operand. + */ hasScalar: boolean; + + /** + * Indicates if the operator has an encrypted operand. + */ hasEncrypted: boolean; + + /** + * The arguments required by the operator. + */ arguments: OperatorArguments; + + /** + * The return type of the operator. + */ returnType: ReturnType; - // if true do trivial encryption for left scalar operand, this is workaround until tfhe-rs supports left scalar operands + + /** + * If true, perform trivial encryption for the left scalar operand. + * This is a workaround until tfhe-rs supports left scalar operands. + * Optional. + */ leftScalarEncrypt?: boolean; - // disable left scalar operator + + /** + * If true, disable the left scalar operator. + * Optional. + */ leftScalarDisable?: boolean; - fheLibName?: string; - binarySolidityOperator?: string; - unarySolidityOperator?: string; + + /** + * The name of the FHE library associated with this operator. + */ + fheLibName: string; + + /** + * Indicates if the operator is a shift operator. + * Optional. + */ shiftOperator?: boolean; - rotateOperator?: boolean; -}; -export type CodegenContext = { - libFheAddress: string; + /** + * Indicates if the operator is a rotate operator. + * Optional. + */ + rotateOperator?: boolean; }; +/** + * Enum representing the types of operator arguments. + * + * @enum {number} + * @property {number} Binary - Represents a binary operator argument. + * @property {number} Unary - Represents a unary operator argument. + */ export enum OperatorArguments { Binary, Unary, } +/** + * Enum representing the possible return types. + */ export enum ReturnType { - Uint, + Euint, Ebool, } -export const SUPPORTED_BITS: number[] = [4, 8, 16, 32, 64, 128, 256]; - -export const ALL_OPERATORS: Operator[] = [ - { - name: 'add', - precompileName: 'Add', - hasScalar: true, - hasEncrypted: true, - arguments: OperatorArguments.Binary, - returnType: ReturnType.Uint, - binarySolidityOperator: '+', - }, - { - name: 'sub', - precompileName: 'Subtract', - hasScalar: true, - hasEncrypted: true, - arguments: OperatorArguments.Binary, - returnType: ReturnType.Uint, - leftScalarEncrypt: true, - binarySolidityOperator: '-', - }, - { - name: 'mul', - precompileName: 'Multiply', - hasScalar: true, - hasEncrypted: true, - arguments: OperatorArguments.Binary, - returnType: ReturnType.Uint, - binarySolidityOperator: '*', - }, - { - name: 'div', - precompileName: 'Divide', - hasScalar: true, - hasEncrypted: false, - arguments: OperatorArguments.Binary, - returnType: ReturnType.Uint, - leftScalarDisable: true, - }, - { - name: 'rem', - precompileName: 'Rem', - hasScalar: true, - hasEncrypted: false, - arguments: OperatorArguments.Binary, - returnType: ReturnType.Uint, - leftScalarDisable: true, - }, - { - name: 'and', - precompileName: 'BitwiseAnd', - hasScalar: true, - hasEncrypted: true, - arguments: OperatorArguments.Binary, - returnType: ReturnType.Uint, - fheLibName: 'fheBitAnd', - binarySolidityOperator: '&', - }, - { - name: 'or', - precompileName: 'BitwiseOr', - hasScalar: true, - hasEncrypted: true, - arguments: OperatorArguments.Binary, - returnType: ReturnType.Uint, - fheLibName: 'fheBitOr', - binarySolidityOperator: '|', - }, - { - name: 'xor', - precompileName: 'BitwiseXor', - hasScalar: true, - hasEncrypted: true, - arguments: OperatorArguments.Binary, - returnType: ReturnType.Uint, - fheLibName: 'fheBitXor', - binarySolidityOperator: '^', - }, - { - name: 'shl', - precompileName: 'ShiftLeft', - hasScalar: true, - hasEncrypted: true, - arguments: OperatorArguments.Binary, - returnType: ReturnType.Uint, - leftScalarEncrypt: true, - shiftOperator: true, - }, - { - name: 'shr', - precompileName: 'ShiftRight', - hasScalar: true, - hasEncrypted: true, - arguments: OperatorArguments.Binary, - returnType: ReturnType.Uint, - leftScalarEncrypt: true, - shiftOperator: true, - }, - { - name: 'rotl', - precompileName: 'RotateLeft', - hasScalar: true, - hasEncrypted: true, - arguments: OperatorArguments.Binary, - returnType: ReturnType.Uint, - leftScalarEncrypt: true, - rotateOperator: true, - }, - { - name: 'rotr', - precompileName: 'RotateRight', - hasScalar: true, - hasEncrypted: true, - arguments: OperatorArguments.Binary, - returnType: ReturnType.Uint, - leftScalarEncrypt: true, - rotateOperator: true, - }, - { - name: 'eq', - precompileName: 'Equal', - hasScalar: true, - hasEncrypted: true, - arguments: OperatorArguments.Binary, - returnType: ReturnType.Ebool, - }, - { - name: 'ne', - precompileName: 'NotEqual', - hasScalar: true, - hasEncrypted: true, - arguments: OperatorArguments.Binary, - returnType: ReturnType.Ebool, - }, - { - name: 'ge', - leftScalarInvertOp: 'le', - precompileName: 'GreaterThanOrEqual', - hasScalar: true, - hasEncrypted: true, - arguments: OperatorArguments.Binary, - returnType: ReturnType.Ebool, - }, - { - name: 'gt', - leftScalarInvertOp: 'lt', - precompileName: 'GreaterThan', - hasScalar: true, - hasEncrypted: true, - arguments: OperatorArguments.Binary, - returnType: ReturnType.Ebool, - }, - { - name: 'le', - leftScalarInvertOp: 'ge', - precompileName: 'LessThanOrEqual', - hasScalar: true, - hasEncrypted: true, - arguments: OperatorArguments.Binary, - returnType: ReturnType.Ebool, - }, - { - name: 'lt', - leftScalarInvertOp: 'gt', - precompileName: 'LessThan', - hasScalar: true, - hasEncrypted: true, - arguments: OperatorArguments.Binary, - returnType: ReturnType.Ebool, - }, - { - name: 'min', - precompileName: 'Min', - hasScalar: true, - hasEncrypted: true, - arguments: OperatorArguments.Binary, - returnType: ReturnType.Uint, - }, - { - name: 'max', - precompileName: 'Max', - hasScalar: true, - hasEncrypted: true, - arguments: OperatorArguments.Binary, - returnType: ReturnType.Uint, - }, - { - name: 'neg', - precompileName: 'Negate', - hasScalar: true, - hasEncrypted: true, - arguments: OperatorArguments.Unary, - returnType: ReturnType.Uint, - unarySolidityOperator: '-', - }, - { - name: 'not', - precompileName: 'Not', - hasScalar: true, - hasEncrypted: true, - arguments: OperatorArguments.Unary, - returnType: ReturnType.Uint, - unarySolidityOperator: '~', - }, -]; - -export function checks(operators: Operator[]): Operator[] { - const nameMap: { [key: string]: boolean } = {}; - const precompNameMap: { [key: string]: boolean } = {}; +/** + * Validates the FHE (Fully Homomorphic Encryption) types. + * + * This function ensures that the provided FHE types are correctly defined, + * have valid properties, and do not contain duplicates. + * + * @param fheTypes - An array of FHE types to validate. + * @throws Will throw an error if the FHE types array is undefined, not an array, or empty. + * Will throw an error if any FHE type has invalid properties or if duplicate FHE types are found. + */ +export function validateFHETypes(fheTypes: FheType[]): void { + if (!fheTypes || !Array.isArray(fheTypes) || fheTypes.length === 0) { + throw new Error('fheTypes is not defined or invalid'); + } + fheTypes.forEach((fheType) => { + if (typeof fheType.type !== 'string' || typeof fheType.clearMatchingType !== 'string') { + throw new Error(`Invalid FHE type: ${JSON.stringify(fheType)}`); + } - operators.forEach((op) => { - assert(nameMap[op.name] == null); - nameMap[op.name] = true; + if (!Array.isArray(fheType.supportedOperators) || fheType.supportedOperators.some((op) => typeof op !== 'string')) { + throw new Error(`Invalid supportedOperators for FHE type: ${fheType.type}`); + } + + if (typeof fheType.bitLength !== 'number' || fheType.bitLength < 0) { + throw new Error(`Invalid bitLength for FHE type: ${fheType.type}`); + } + + if (typeof fheType.value !== 'number' || fheType.value < 0) { + throw new Error(`Invalid value for FHE type: ${fheType.type}`); + } + + if ( + fheType.aliases && + (!Array.isArray(fheType.aliases) || + fheType.aliases.some( + (alias) => + typeof alias.type !== 'string' || + !Array.isArray(alias.supportedOperators) || + alias.supportedOperators.some((op) => typeof op !== 'string') || + typeof alias.clearMatchingType !== 'string', + )) + ) { + throw new Error(`Invalid aliases for FHE type: ${fheType.type}`); + } - assert(precompNameMap[op.precompileName] == null); - precompNameMap[op.precompileName] = true; + if (fheType.aliases) { + fheType.aliases.forEach((alias) => { + if (typeof alias.type !== 'string') { + throw new Error(`Invalid alias type: ${JSON.stringify(alias)}`); + } + + if (!Array.isArray(alias.supportedOperators) || alias.supportedOperators.some((op) => typeof op !== 'string')) { + throw new Error(`Invalid supportedOperators for alias: ${alias.type}`); + } + + if (typeof alias.clearMatchingType !== 'string') { + throw new Error(`Invalid clearMatchingType for alias: ${alias.type}`); + } + }); + } }); - return operators; + const nameMap: Record = {}; + + fheTypes.forEach((fheType) => { + if (nameMap[fheType.type] != null) { + throw new Error(`Duplicate FheType found: ${fheType.type}`); + } + + nameMap[fheType.type] = true; + }); +} + +/** + * Validates an array of operators to ensure they are correctly defined and have unique names. + * + * @param operators - An array of Operator objects to validate. + * @throws Will throw an error if the operators array is undefined, not an array, or empty. + * @throws Will throw an error if any operator has invalid properties or if duplicate operator names are found. + */ +export function validateOperators(operators: Operator[]): void { + if (!operators || !Array.isArray(operators) || operators.length === 0) { + throw new Error('Operators is not defined or invalid'); + } + + const nameMap: Record = {}; + + operators.forEach((op) => { + if (typeof op.name !== 'string' || op.name.trim() === '') { + throw new Error(`Invalid operator name: ${JSON.stringify(op)}`); + } + + if (nameMap[op.name] != null) { + throw new Error(`Duplicate operator name found: ${op.name}`); + } + + if (typeof op.hasScalar !== 'boolean') { + throw new Error(`Invalid hasScalar value for operator: ${op.name}`); + } + + if (typeof op.hasEncrypted !== 'boolean') { + throw new Error(`Invalid hasEncrypted value for operator: ${op.name}`); + } + + if (op.arguments === null || !Object.values(OperatorArguments).includes(op.arguments)) { + throw new Error(`Invalid arguments for operator: ${op.name}`); + } + + if (op.returnType === null || !Object.values(ReturnType).includes(op.returnType)) { + throw new Error(`Invalid returnType for operator: ${op.name}`); + } + + if (op.leftScalarInvertOp && typeof op.leftScalarInvertOp !== 'string') { + throw new Error(`Invalid leftScalarInvertOp for operator: ${op.name}`); + } + + if (op.leftScalarEncrypt != null && typeof op.leftScalarEncrypt !== 'boolean') { + throw new Error(`Invalid leftScalarEncrypt value for operator: ${op.name}`); + } + + if (op.leftScalarDisable != null && typeof op.leftScalarDisable !== 'boolean') { + throw new Error(`Invalid leftScalarDisable value for operator: ${op.name}`); + } + + if (typeof op.fheLibName !== 'string' || op.fheLibName.trim() === '') { + throw new Error(`Invalid fheLibName for operator: ${op.name}`); + } + + if (op.shiftOperator != null && typeof op.shiftOperator !== 'boolean') { + throw new Error(`Invalid shiftOperator value for operator: ${op.name}`); + } + + if (op.rotateOperator != null && typeof op.rotateOperator !== 'boolean') { + throw new Error(`Invalid rotateOperator value for operator: ${op.name}`); + } + + nameMap[op.name] = true; + }); } diff --git a/contracts/codegen/generateOverloads.ts b/contracts/codegen/generateOverloads.ts index 48689280..90554d17 100644 --- a/contracts/codegen/generateOverloads.ts +++ b/contracts/codegen/generateOverloads.ts @@ -1,14 +1,35 @@ +import { FheType } from './common'; +import { findMinimumValueInBigIntArray, generateRandomNumber } from './utils'; + +/** + * Represents a test structure with input and output types. + * + * @property inputs - An array of `bigint` values representing the inputs. + * @property output - The output value, which can be a `number`, `boolean`, or `bigint`. + */ type Test = { inputs: bigint[]; output: number | boolean | bigint; }; +/** + * Represents a collection of supported functions, where each function is identified + * by a unique key and associated with its corresponding `SupportedFunction` definition. + */ type SupportedFunctions = { [key: string]: SupportedFunction; }; +/** + * Represents the parameters that can be used to configure supported functions. + * + * @property safeMin - Optional. If `true`, ensures that the minimum value is safely handled. + * @property noScalar - Optional. If `true`, disables scalar operations. + * @property lhsHigher - Optional. If `true`, enforces that the left-hand side value is higher. + * @property scalarOnly - Optional. If `true`, restricts operations to scalar values only. + * @property limit - Optional. Specifies a limit type, such as `'bits'`, to constrain operations. + */ type SupportedFunctionParams = { - supportedBits: number[]; safeMin?: boolean; noScalar?: boolean; lhsHigher?: boolean; @@ -19,37 +40,30 @@ type SupportedFunctionParams = { type SupportedFunction = SupportedFunctionParams & ( | { + // Represents a binary function (e.g., addition, subtraction) that operates on two inputs. unary?: false; evalTest: (lhsNumber: bigint, rhsNumber: bigint, lhs: number, rhs: number) => number | boolean | bigint; } | { + // Represents a unary function (e.g., negation, bitwise NOT) that operates on a single input. unary: true; evalTest: (lhs: bigint, bits: number) => number | boolean | bigint; } ); -(BigInt as any).prototype['toJSON'] = function () { - return this.toString(); -}; - -const SUPPORTED_UINT = [8, 16, 32, 64, 128, 256]; -const SUPPORTED_BITS = [4, 8, 16, 32, 64, 128, 256]; - -const bigIntMin = (...args: bigint[]) => { - return args.reduce((min, e) => (e < min ? e : min), args[0]); -}; - -const bigIntMax = (...args: bigint[]) => { - return args.reduce((max, e) => (e > max ? e : max), args[0]); -}; - -const generateNumber = (bits: number) => { - const power = BigInt(Math.pow(2, bits) - 1); - const maxRange = bigIntMin(power, BigInt(Number.MAX_SAFE_INTEGER)); - const substract = bigIntMax(BigInt(Math.floor(Math.random() * Number(maxRange))), 1n); - return bigIntMax(power - substract, 1n); -}; - +/** + * Safely evaluates a function with given inputs, ensuring the result does not exceed a specified bit limit. + * + * @param fn - A function that takes four arguments: `lhsNumber`, `rhsNumber`, `lhs`, and `rhs`, and returns a `number`, `boolean`, or `bigint`. + * @param lhsNumber - The left-hand side number as a `bigint`. + * @param rhsNumber - The right-hand side number as a `bigint`. + * @param lhs - The left-hand side number as a `number`. + * @param rhs - The right-hand side number as a `number`. + * @param safeMin - A boolean flag indicating whether to use the minimum (`Math.min`) or maximum (`Math.max`) of `lhs` and `rhs` to determine the bit limit. Defaults to `false`. + * @returns An object containing: + * - `inputs`: An array with the adjusted `lhsNumber` and `rhsNumber`. + * - `output`: The result of the function `fn` after adjustments. + */ const safeEval = ( fn: (lhsNumber: bigint, rhsNumber: bigint, lhs: number, rhs: number) => number | boolean | bigint, lhsNumber: bigint, @@ -60,13 +74,12 @@ const safeEval = ( ) => { const bitResults = safeMin ? Math.min(lhs, rhs) : Math.max(lhs, rhs); let result = fn(lhsNumber, rhsNumber, lhs, rhs); - const logs: any[] = []; + if (typeof result === 'number' || typeof result === 'bigint') { while ((result as number | bigint) > Math.pow(2, bitResults) - 1) { lhsNumber = lhsNumber / 2n + 1n; rhsNumber = rhsNumber / 2n + 1n; result = fn(lhsNumber, rhsNumber, lhs, rhs); - logs.push([lhs, rhs, lhsNumber, rhsNumber, result]); } } return { inputs: [lhsNumber, rhsNumber], output: result }; @@ -74,58 +87,47 @@ const safeEval = ( export const SUPPORTED_FUNCTIONS: SupportedFunctions = { add: { - supportedBits: SUPPORTED_BITS, safeMin: true, evalTest: (lhsNumber, rhsNumber) => BigInt(lhsNumber) + BigInt(rhsNumber), }, sub: { - supportedBits: SUPPORTED_BITS, lhsHigher: true, evalTest: (lhsNumber, rhsNumber) => lhsNumber - rhsNumber, }, mul: { - supportedBits: SUPPORTED_BITS, safeMin: true, evalTest: (lhsNumber, rhsNumber) => BigInt(lhsNumber) * BigInt(rhsNumber), }, div: { - supportedBits: SUPPORTED_BITS, evalTest: (lhsNumber, rhsNumber) => lhsNumber / rhsNumber, scalarOnly: true, }, rem: { - supportedBits: SUPPORTED_BITS, evalTest: (lhsNumber, rhsNumber) => lhsNumber % rhsNumber, scalarOnly: true, }, le: { - supportedBits: SUPPORTED_BITS, evalTest: (lhsNumber, rhsNumber) => lhsNumber <= rhsNumber, }, lt: { - supportedBits: SUPPORTED_BITS, evalTest: (lhsNumber, rhsNumber) => lhsNumber < rhsNumber, }, ge: { - supportedBits: SUPPORTED_BITS, evalTest: (lhsNumber, rhsNumber) => lhsNumber >= rhsNumber, }, gt: { - supportedBits: SUPPORTED_BITS, evalTest: (lhsNumber, rhsNumber) => lhsNumber > rhsNumber, }, eq: { - supportedBits: SUPPORTED_BITS, evalTest: (lhsNumber, rhsNumber) => lhsNumber === rhsNumber, }, ne: { - supportedBits: SUPPORTED_BITS, evalTest: (lhsNumber, rhsNumber) => lhsNumber !== rhsNumber, }, shl: { - supportedBits: SUPPORTED_BITS, limit: 'bits', - evalTest: (lhsNumber, rhsNumber, lhs, rhs) => { + evalTest: (lhsNumber, rhsNumber, lhs, _rhs) => { + // Perform a left shift operation by manipulating the bit positions of the binary representation. const bits = `${new Array(256).fill('0').join('')}${lhsNumber.toString(2)}`.slice(-lhs).split(''); const r = bits.map((_, index) => { const newIndex = Number(BigInt(index) + (rhsNumber % BigInt(lhs))); @@ -135,9 +137,8 @@ export const SUPPORTED_FUNCTIONS: SupportedFunctions = { }, }, shr: { - supportedBits: SUPPORTED_BITS, limit: 'bits', - evalTest: (lhsNumber, rhsNumber, lhs, rhs) => { + evalTest: (lhsNumber, rhsNumber, lhs, _rhs) => { const bits = `${new Array(256).fill('0').join('')}${lhsNumber.toString(2)}`.slice(-lhs).split(''); const r = bits.map((_, index) => { const newIndex = Number(BigInt(index) - (rhsNumber % BigInt(lhs))); @@ -147,9 +148,8 @@ export const SUPPORTED_FUNCTIONS: SupportedFunctions = { }, }, rotl: { - supportedBits: SUPPORTED_BITS, limit: 'bits', - evalTest: (lhsNumber, rhsNumber, lhs, rhs) => { + evalTest: (lhsNumber, rhsNumber, lhs, _rhs) => { const bits = `${new Array(256).fill('0').join('')}${lhsNumber.toString(2)}`.slice(-lhs).split(''); const r = bits.map((_, index) => { let newIndex = Number(BigInt(index) + (rhsNumber % BigInt(lhs))); @@ -160,9 +160,8 @@ export const SUPPORTED_FUNCTIONS: SupportedFunctions = { }, }, rotr: { - supportedBits: SUPPORTED_BITS, limit: 'bits', - evalTest: (lhsNumber, rhsNumber, lhs, rhs) => { + evalTest: (lhsNumber, rhsNumber, lhs, _rhs) => { const bits = `${new Array(256).fill('0').join('')}${lhsNumber.toString(2)}`.slice(-lhs).split(''); const r = bits.map((_, index) => { let newIndex = Number(BigInt(index) - (rhsNumber % BigInt(lhs))); @@ -173,28 +172,22 @@ export const SUPPORTED_FUNCTIONS: SupportedFunctions = { }, }, max: { - supportedBits: SUPPORTED_BITS, unary: false, evalTest: (lhsNumber, rhsNumber) => (lhsNumber > rhsNumber ? lhsNumber : rhsNumber), }, min: { - supportedBits: SUPPORTED_BITS, evalTest: (lhsNumber, rhsNumber) => (lhsNumber < rhsNumber ? lhsNumber : rhsNumber), }, or: { - supportedBits: SUPPORTED_BITS, evalTest: (lhsNumber, rhsNumber) => lhsNumber | rhsNumber, }, and: { - supportedBits: SUPPORTED_BITS, evalTest: (lhsNumber, rhsNumber) => lhsNumber & rhsNumber, }, xor: { - supportedBits: SUPPORTED_BITS, evalTest: (lhsNumber, rhsNumber) => lhsNumber ^ rhsNumber, }, not: { - supportedBits: SUPPORTED_BITS, unary: true, evalTest: (lhsNumber, bits) => { const val = `${new Array(256).fill('0').join('')}${lhsNumber.toString(2)}`.slice(-bits).split(''); @@ -209,7 +202,6 @@ export const SUPPORTED_FUNCTIONS: SupportedFunctions = { }, }, neg: { - supportedBits: SUPPORTED_BITS, unary: true, evalTest: (lhsNumber, bits) => { const val = `${new Array(256).fill('0').join('')}${lhsNumber.toString(2)}`.slice(-bits).split(''); @@ -227,82 +219,188 @@ export const SUPPORTED_FUNCTIONS: SupportedFunctions = { }, }; -export const generateTests = () => { - const tests: any = {}; +/** + * Generates test cases for supported functions based on the provided FHE types. + * + * @param fheTypes - An array of FHE types, each containing information about type, bit length, and supported operators. + * @returns An object containing generated test cases for each supported function and FHE type combination. + */ +export const generateOverloads = (fheTypes: FheType[]) => { + const generatedTests: any = {}; Object.keys(SUPPORTED_FUNCTIONS).forEach((functionName: string) => { const test = SUPPORTED_FUNCTIONS[functionName]; - test.supportedBits.forEach((lhs: number) => { - if (test.unary) { - let lhsNumber = generateNumber(lhs); - const encryptedTestName = [functionName, `euint${lhs}`].join('_'); - const encryptedTests: Test[] = []; - encryptedTests.push({ - inputs: [lhsNumber], - output: test.evalTest(lhsNumber, lhs), - }); - tests[encryptedTestName] = encryptedTests; - } else { - test.supportedBits.forEach((rhs: number) => { - const bitResults = Math.min(lhs, rhs); - let lhsNumber = generateNumber(lhs); - let rhsNumber = generateNumber(rhs); - if (test.limit === 'bits') { - rhsNumber = BigInt(1 + Math.floor(Math.random() * (rhs - 1))); - } - const smallest = bigIntMax(bigIntMin(lhsNumber, rhsNumber), 8n); - const only8bits = test.limit === 'bits' && rhs === 8; - const onlyEncrypted8bits = only8bits && lhs > 4; - if ((test.limit !== 'bits' || onlyEncrypted8bits) && !test.scalarOnly) { - const encryptedTestName = [functionName, `euint${lhs}`, `euint${rhs}`].join('_'); - const encryptedTests: Test[] = []; - if (!test.lhsHigher) { - encryptedTests.push(safeEval(test.evalTest, lhsNumber, rhsNumber, lhs, rhs, test.safeMin)); - encryptedTests.push(safeEval(test.evalTest, smallest - 4n, smallest, lhs, rhs, test.safeMin)); - } - encryptedTests.push(safeEval(test.evalTest, smallest, smallest, lhs, rhs, test.safeMin)); - encryptedTests.push(safeEval(test.evalTest, smallest, smallest - 4n, lhs, rhs, test.safeMin)); - tests[encryptedTestName] = encryptedTests; - } + fheTypes.forEach((lhsFheType: FheType) => { + if (lhsFheType.type.startsWith('Uint') && lhsFheType.supportedOperators.includes(functionName)) { + if (test.unary) { + let lhsNumber = generateRandomNumber(lhsFheType.bitLength); + const encryptedTestName = [functionName, `e${lhsFheType.type.toLowerCase()}`].join('_'); + const encryptedTests: Test[] = []; + encryptedTests.push({ + inputs: [lhsNumber], + output: test.evalTest(lhsNumber, lhsFheType.bitLength), + }); + generatedTests[encryptedTestName] = encryptedTests; + } else { + fheTypes.forEach((rhsFheType: FheType) => { + if (rhsFheType.type.startsWith('Uint') && rhsFheType.supportedOperators.includes(functionName)) { + const bitResults = Math.min(lhsFheType.bitLength, rhsFheType.bitLength); + let lhsNumber = generateRandomNumber(lhsFheType.bitLength); + let rhsNumber = generateRandomNumber(rhsFheType.bitLength); - const scalarCondition = !test.noScalar && (lhs === rhs || (rhs == 8 && lhs == 4) || (rhs == 4 && lhs == 8)); + if (test.limit === 'bits') { + // @dev We set the floor as 5 to prevent underflows since tests would use smallest - 4n. + rhsNumber = BigInt(5 + Math.floor(Math.random() * (rhsFheType.bitLength - 1))); + } - if (SUPPORTED_UINT.includes(rhs) && (only8bits || (test.limit !== 'bits' && scalarCondition))) { - if (test.limit !== 'bits') { - rhsNumber = generateNumber(bitResults); - } - const encryptedTestName = [functionName, `euint${lhs}`, `uint${rhs}`].join('_'); - const encryptedTests: Test[] = []; - if (!test.lhsHigher) { - encryptedTests.push(safeEval(test.evalTest, lhsNumber, rhsNumber, lhs, rhs, test.safeMin)); - encryptedTests.push(safeEval(test.evalTest, smallest - 4n, smallest, lhs, rhs, test.safeMin)); - } - encryptedTests.push(safeEval(test.evalTest, smallest, smallest, lhs, rhs, test.safeMin)); - encryptedTests.push(safeEval(test.evalTest, smallest, smallest - 4n, lhs, rhs, test.safeMin)); - tests[encryptedTestName] = encryptedTests; - } - if (SUPPORTED_UINT.includes(lhs) && test.limit !== 'bits' && scalarCondition && !test.scalarOnly) { - lhsNumber = generateNumber(bitResults); - const encryptedTestName = [functionName, `uint${lhs}`, `euint${rhs}`].join('_'); - const encryptedTests: Test[] = []; - if (!test.lhsHigher) { - encryptedTests.push(safeEval(test.evalTest, lhsNumber, rhsNumber, lhs, rhs, test.safeMin)); - encryptedTests.push(safeEval(test.evalTest, smallest - 4n, smallest, lhs, rhs, test.safeMin)); + const smallest = findMinimumValueInBigIntArray(lhsNumber, rhsNumber); + const only8bits = test.limit === 'bits' && rhsFheType.bitLength === 8; + + if ((test.limit !== 'bits' || only8bits) && !test.scalarOnly) { + const encryptedTestName = [ + functionName, + `e${lhsFheType.type.toLowerCase()}`, + `e${rhsFheType.type.toLowerCase()}`, + ].join('_'); + const encryptedTests: Test[] = []; + if (!test.lhsHigher) { + encryptedTests.push( + safeEval( + test.evalTest, + lhsNumber, + rhsNumber, + lhsFheType.bitLength, + rhsFheType.bitLength, + test.safeMin, + ), + ); + encryptedTests.push( + safeEval( + test.evalTest, + smallest - 4n, + smallest, + lhsFheType.bitLength, + rhsFheType.bitLength, + test.safeMin, + ), + ); + } + encryptedTests.push( + safeEval(test.evalTest, smallest, smallest, lhsFheType.bitLength, rhsFheType.bitLength, test.safeMin), + ); + encryptedTests.push( + safeEval( + test.evalTest, + smallest, + smallest - 4n, + lhsFheType.bitLength, + rhsFheType.bitLength, + test.safeMin, + ), + ); + generatedTests[encryptedTestName] = encryptedTests; + } + + const scalarCondition = !test.noScalar && lhsFheType.bitLength === rhsFheType.bitLength; + + if (only8bits || (test.limit !== 'bits' && scalarCondition)) { + if (test.limit !== 'bits') { + rhsNumber = generateRandomNumber(bitResults); + } + const encryptedTestName = [ + functionName, + `e${lhsFheType.type.toLowerCase()}`, + `uint${rhsFheType.bitLength}`, + ].join('_'); + const encryptedTests: Test[] = []; + if (!test.lhsHigher) { + encryptedTests.push( + safeEval( + test.evalTest, + lhsNumber, + rhsNumber, + lhsFheType.bitLength, + rhsFheType.bitLength, + test.safeMin, + ), + ); + encryptedTests.push( + safeEval( + test.evalTest, + smallest - 4n, + smallest, + lhsFheType.bitLength, + rhsFheType.bitLength, + test.safeMin, + ), + ); + } + encryptedTests.push( + safeEval(test.evalTest, smallest, smallest, lhsFheType.bitLength, rhsFheType.bitLength, test.safeMin), + ); + encryptedTests.push( + safeEval( + test.evalTest, + smallest, + smallest - 4n, + lhsFheType.bitLength, + rhsFheType.bitLength, + test.safeMin, + ), + ); + generatedTests[encryptedTestName] = encryptedTests; + } + if (test.limit !== 'bits' && scalarCondition && !test.scalarOnly) { + lhsNumber = generateRandomNumber(bitResults); + const encryptedTestName = [ + functionName, + `uint${lhsFheType.bitLength}`, + `e${rhsFheType.type.toLowerCase()}`, + ].join('_'); + const encryptedTests: Test[] = []; + if (!test.lhsHigher) { + encryptedTests.push( + safeEval( + test.evalTest, + lhsNumber, + rhsNumber, + lhsFheType.bitLength, + rhsFheType.bitLength, + test.safeMin, + ), + ); + encryptedTests.push( + safeEval( + test.evalTest, + smallest - 4n, + smallest, + lhsFheType.bitLength, + rhsFheType.bitLength, + test.safeMin, + ), + ); + } + encryptedTests.push( + safeEval(test.evalTest, smallest, smallest, lhsFheType.bitLength, rhsFheType.bitLength, test.safeMin), + ); + encryptedTests.push( + safeEval( + test.evalTest, + smallest, + smallest - 4n, + lhsFheType.bitLength, + rhsFheType.bitLength, + test.safeMin, + ), + ); + generatedTests[encryptedTestName] = encryptedTests; + } } - encryptedTests.push(safeEval(test.evalTest, smallest, smallest, lhs, rhs, test.safeMin)); - encryptedTests.push(safeEval(test.evalTest, smallest, smallest - 4n, lhs, rhs, test.safeMin)); - tests[encryptedTestName] = encryptedTests; - } - }); + }); + } } }); }); - return tests; -}; - -const tests = generateTests(); -const fs = require('fs'); -const path = require('path'); - -fs.writeFileSync(`${path.resolve(__dirname)}/overloads.json`, JSON.stringify(tests)); + return generatedTests; +}; diff --git a/contracts/codegen/main.ts b/contracts/codegen/main.ts index a8aa8e98..1c0b3f57 100644 --- a/contracts/codegen/main.ts +++ b/contracts/codegen/main.ts @@ -1,25 +1,62 @@ import { mkdirSync, writeFileSync } from 'fs'; +import path from 'path'; -import { ALL_OPERATORS, SUPPORTED_BITS, checks } from './common'; +import { validateFHETypes, validateOperators } from './common'; +import { generateOverloads } from './generateOverloads'; +import { ALL_OPERATORS } from './operators'; import operatorsPrices from './operatorsPrices.json'; -import { generateFHEGasLimit } from './payments'; -import * as t from './templates'; -import * as testgen from './testgen'; +import { generateSolidityFHEGasLimit } from './payments'; +import { generateSolidityFheType, generateSolidityHTTPZLib, generateSolidityImplLib } from './templates'; +import { + generateSolidityOverloadTestFiles, + generateSolidityUnitTestContracts, + generateTypeScriptTestCode, + splitOverloadsToShards, +} from './testgen'; +import { ALL_FHE_TYPES } from './types'; +/** + * Generates all necessary files including Solidity contracts and TypeScript test files. + * + * This function performs the following steps: + * 1. Generates FHE types from a JSON file. + * 2. Validates and processes the list of operators. + * 3. Generates Solidity source code for HTTPZ and implementation contracts. + * 4. Splits the generated overloads into multiple shards to avoid exceeding Solidity's contract size limit. + * 5. Writes the generated Solidity contracts and test files to the appropriate directories. + * 6. Generates TypeScript test code for the split overloads and writes them to the test directory. + * + */ function generateAllFiles() { - const numSplits = 12; - const operators = checks(ALL_OPERATORS); - const [tfheSolSource, overloads] = t.tfheSol(operators, SUPPORTED_BITS, false); - const ovShards = testgen.splitOverloadsToShards(overloads); - writeFileSync('lib/Impl.sol', t.implSol(operators)); - writeFileSync('lib/TFHE.sol', tfheSolSource); - writeFileSync('contracts/FHEGasLimit.sol', generateFHEGasLimit(operatorsPrices)); + const numberOfTestSplits = 12; + + // Validate the FHE types + validateFHETypes(ALL_FHE_TYPES); + // Validate the operators + validateOperators(ALL_OPERATORS); + + /// Generate core Solidity contract files. + writeFileSync('contracts/FheType.sol', generateSolidityFheType(ALL_FHE_TYPES)); + writeFileSync('lib/Impl.sol', generateSolidityImplLib(ALL_OPERATORS)); + writeFileSync('lib/HTTPZ.sol', generateSolidityHTTPZLib(ALL_OPERATORS, ALL_FHE_TYPES)); + writeFileSync('contracts/FHEGasLimit.sol', generateSolidityFHEGasLimit(operatorsPrices)); + + // TODO: For now, the testgen only supports automatically generated tests for euintXX. + /// Generate overloads, split them into shards, and generate Solidity contracts to be used for TypeScript unit test files. + writeFileSync( + `${path.resolve(__dirname)}/overloads.json`, + JSON.stringify(generateOverloads(ALL_FHE_TYPES), (_key, value) => + typeof value === 'bigint' ? value.toString() : value, + ), + ); + const overloadShards = splitOverloadsToShards(generateSolidityOverloadTestFiles(ALL_OPERATORS, ALL_FHE_TYPES)); mkdirSync('contracts/tests', { recursive: true }); - ovShards.forEach((os) => { - writeFileSync(`examples/tests/TFHETestSuite${os.shardNumber}.sol`, testgen.generateSmartContract(os)); + overloadShards.forEach((os) => { + writeFileSync(`examples/tests/HTTPZTestSuite${os.shardNumber}.sol`, generateSolidityUnitTestContracts(os)); }); - const tsSplits: string[] = testgen.generateTestCode(ovShards, numSplits); - tsSplits.forEach((split, splitIdx) => writeFileSync(`test/tfheOperations/tfheOperations${splitIdx + 1}.ts`, split)); + + const tsSplits: string[] = generateTypeScriptTestCode(overloadShards, numberOfTestSplits); + tsSplits.forEach((split, splitIdx) => writeFileSync(`test/httpzOperations/httpzOperations${splitIdx + 1}.ts`, split)); } generateAllFiles(); diff --git a/contracts/codegen/operators.ts b/contracts/codegen/operators.ts new file mode 100644 index 00000000..c09ca386 --- /dev/null +++ b/contracts/codegen/operators.ts @@ -0,0 +1,211 @@ +import { Operator, OperatorArguments, ReturnType } from './common'; + +/** + * A list of all supported operators with their respective properties. + * + * Each operator object contains the following properties: + * - `name`: The name of the operator. + * - `hasScalar`: A boolean indicating if the operator supports scalar values. + * - `hasEncrypted`: A boolean indicating if the operator supports encrypted values. + * - `arguments`: The type of arguments the operator accepts (binary or unary). + * - `returnType`: The return type of the operator. + * - `fheLibName`: The corresponding function name in the FHE library. + * - `leftScalarEncrypt` (optional): A boolean indicating if the left scalar should be encrypted. + * - `leftScalarDisable` (optional): A boolean indicating if the left scalar is disabled. + * - `shiftOperator` (optional): A boolean indicating if the operator is a shift operator. + * - `rotateOperator` (optional): A boolean indicating if the operator is a rotate operator. + * - `leftScalarInvertOp` (optional): The name of the inverted operator for the left scalar. + */ +export const ALL_OPERATORS: Operator[] = [ + { + name: 'add', + hasScalar: true, + hasEncrypted: true, + arguments: OperatorArguments.Binary, + returnType: ReturnType.Euint, + fheLibName: 'fheAdd', + }, + { + name: 'sub', + hasScalar: true, + hasEncrypted: true, + arguments: OperatorArguments.Binary, + returnType: ReturnType.Euint, + leftScalarEncrypt: true, + fheLibName: 'fheSub', + }, + { + name: 'mul', + hasScalar: true, + hasEncrypted: true, + arguments: OperatorArguments.Binary, + returnType: ReturnType.Euint, + fheLibName: 'fheMul', + }, + { + name: 'div', + hasScalar: true, + hasEncrypted: false, + arguments: OperatorArguments.Binary, + returnType: ReturnType.Euint, + leftScalarDisable: true, + fheLibName: 'fheDiv', + }, + { + name: 'rem', + hasScalar: true, + hasEncrypted: false, + arguments: OperatorArguments.Binary, + returnType: ReturnType.Euint, + leftScalarDisable: true, + fheLibName: 'fheRem', + }, + { + name: 'and', + hasScalar: true, + hasEncrypted: true, + arguments: OperatorArguments.Binary, + returnType: ReturnType.Euint, + fheLibName: 'fheBitAnd', + }, + { + name: 'or', + hasScalar: true, + hasEncrypted: true, + arguments: OperatorArguments.Binary, + returnType: ReturnType.Euint, + fheLibName: 'fheBitOr', + }, + { + name: 'xor', + hasScalar: true, + hasEncrypted: true, + arguments: OperatorArguments.Binary, + returnType: ReturnType.Euint, + fheLibName: 'fheBitXor', + }, + { + name: 'shl', + hasScalar: true, + hasEncrypted: true, + arguments: OperatorArguments.Binary, + returnType: ReturnType.Euint, + leftScalarEncrypt: true, + shiftOperator: true, + fheLibName: 'fheShl', + }, + { + name: 'shr', + hasScalar: true, + hasEncrypted: true, + arguments: OperatorArguments.Binary, + returnType: ReturnType.Euint, + leftScalarEncrypt: true, + shiftOperator: true, + fheLibName: 'fheShr', + }, + { + name: 'rotl', + hasScalar: true, + hasEncrypted: true, + arguments: OperatorArguments.Binary, + returnType: ReturnType.Euint, + leftScalarEncrypt: true, + rotateOperator: true, + fheLibName: 'fheRotl', + }, + { + name: 'rotr', + hasScalar: true, + hasEncrypted: true, + arguments: OperatorArguments.Binary, + returnType: ReturnType.Euint, + leftScalarEncrypt: true, + rotateOperator: true, + fheLibName: 'fheRotr', + }, + { + name: 'eq', + hasScalar: true, + hasEncrypted: true, + arguments: OperatorArguments.Binary, + returnType: ReturnType.Ebool, + fheLibName: 'fheEq', + }, + { + name: 'ne', + hasScalar: true, + hasEncrypted: true, + arguments: OperatorArguments.Binary, + returnType: ReturnType.Ebool, + fheLibName: 'fheNe', + }, + { + name: 'ge', + leftScalarInvertOp: 'le', + hasScalar: true, + hasEncrypted: true, + arguments: OperatorArguments.Binary, + returnType: ReturnType.Ebool, + fheLibName: 'fheGe', + }, + { + name: 'gt', + leftScalarInvertOp: 'lt', + hasScalar: true, + hasEncrypted: true, + arguments: OperatorArguments.Binary, + returnType: ReturnType.Ebool, + fheLibName: 'fheGt', + }, + { + name: 'le', + leftScalarInvertOp: 'ge', + hasScalar: true, + hasEncrypted: true, + arguments: OperatorArguments.Binary, + returnType: ReturnType.Ebool, + fheLibName: 'fheLe', + }, + { + name: 'lt', + leftScalarInvertOp: 'gt', + hasScalar: true, + hasEncrypted: true, + arguments: OperatorArguments.Binary, + returnType: ReturnType.Ebool, + fheLibName: 'fheLt', + }, + { + name: 'min', + hasScalar: true, + hasEncrypted: true, + arguments: OperatorArguments.Binary, + returnType: ReturnType.Euint, + fheLibName: 'fheMin', + }, + { + name: 'max', + hasScalar: true, + hasEncrypted: true, + arguments: OperatorArguments.Binary, + returnType: ReturnType.Euint, + fheLibName: 'fheMax', + }, + { + name: 'neg', + hasScalar: true, + hasEncrypted: true, + arguments: OperatorArguments.Unary, + returnType: ReturnType.Euint, + fheLibName: 'fheNeg', + }, + { + name: 'not', + hasScalar: true, + hasEncrypted: true, + arguments: OperatorArguments.Unary, + returnType: ReturnType.Euint, + fheLibName: 'fheNot', + }, +]; diff --git a/contracts/codegen/operatorsPrices.json b/contracts/codegen/operatorsPrices.json index 8c861dcb..87aaad8a 100644 --- a/contracts/codegen/operatorsPrices.json +++ b/contracts/codegen/operatorsPrices.json @@ -2,529 +2,464 @@ "fheAdd": { "binary": true, "scalar": { - "1": 65000, - "2": 94000, - "3": 133000, - "4": 162000, - "5": 188000, - "6": 218000, - "8": 253000 + "Uint8": 94000, + "Uint16": 133000, + "Uint32": 162000, + "Uint64": 188000, + "Uint128": 218000 }, "nonScalar": { - "1": 65000, - "2": 94000, - "3": 133000, - "4": 162000, - "5": 188000, - "6": 218000, - "8": 253000 + "Uint8": 94000, + "Uint16": 133000, + "Uint32": 162000, + "Uint64": 188000, + "Uint128": 218000 } }, "fheSub": { "binary": true, "scalar": { - "1": 65000, - "2": 94000, - "3": 133000, - "4": 162000, - "5": 188000, - "6": 218000, - "8": 253000 + "Uint8": 94000, + "Uint16": 133000, + "Uint32": 162000, + "Uint64": 188000, + "Uint128": 218000 }, "nonScalar": { - "1": 65000, - "2": 94000, - "3": 133000, - "4": 162000, - "5": 188000, - "6": 218000, - "8": 253000 + "Uint8": 94000, + "Uint16": 133000, + "Uint32": 162000, + "Uint64": 188000, + "Uint128": 218000 } }, "fheMul": { "binary": true, "scalar": { - "1": 88000, - "2": 159000, - "3": 208000, - "4": 264000, - "5": 356000, - "6": 480000, - "8": 647000 + "Uint8": 159000, + "Uint16": 208000, + "Uint32": 264000, + "Uint64": 356000, + "Uint128": 480000 }, "nonScalar": { - "1": 150000, - "2": 197000, - "3": 262000, - "4": 359000, - "5": 641000, - "6": 1145000, - "8": 2045000 + "Uint8": 197000, + "Uint16": 262000, + "Uint32": 359000, + "Uint64": 641000, + "Uint128": 1145000 } }, "fheDiv": { "binary": true, "scalar": { - "1": 139000, - "2": 238000, - "3": 314000, - "4": 398000, - "5": 584000, - "6": 857000, - "8": 1258000 + "Uint8": 238000, + "Uint16": 314000, + "Uint32": 398000, + "Uint64": 584000, + "Uint128": 857000 } }, "fheRem": { "binary": true, "scalar": { - "1": 286000, - "2": 460000, - "3": 622000, - "4": 805000, - "5": 1095000, - "6": 1499000, - "8": 2052000 + "Uint8": 460000, + "Uint16": 622000, + "Uint32": 805000, + "Uint64": 1095000, + "Uint128": 1499000 } }, "fheBitAnd": { "binary": true, "scalar": { - "0": 26000, - "1": 32000, - "2": 34000, - "3": 34000, - "4": 35000, - "5": 38000, - "6": 41000, - "8": 44000 + "Bool": 26000, + "Uint8": 34000, + "Uint16": 34000, + "Uint32": 35000, + "Uint64": 38000, + "Uint128": 41000, + "Uint256": 44000 }, "nonScalar": { - "0": 26000, - "1": 32000, - "2": 34000, - "3": 34000, - "4": 35000, - "5": 38000, - "6": 41000, - "8": 44000 + "Bool": 26000, + "Uint8": 34000, + "Uint16": 34000, + "Uint32": 35000, + "Uint64": 38000, + "Uint128": 41000, + "Uint256": 44000 } }, "fheBitOr": { "binary": true, "scalar": { - "0": 26000, - "1": 32000, - "2": 34000, - "3": 34000, - "4": 35000, - "5": 38000, - "6": 41000, - "8": 44000 + "Bool": 26000, + "Uint8": 34000, + "Uint16": 34000, + "Uint32": 35000, + "Uint64": 38000, + "Uint128": 41000, + "Uint256": 44000 }, "nonScalar": { - "0": 26000, - "1": 32000, - "2": 34000, - "3": 34000, - "4": 35000, - "5": 38000, - "6": 41000, - "8": 44000 + "Bool": 26000, + "Uint8": 34000, + "Uint16": 34000, + "Uint32": 35000, + "Uint64": 38000, + "Uint128": 41000, + "Uint256": 44000 } }, "fheBitXor": { "binary": true, "scalar": { - "0": 26000, - "1": 32000, - "2": 34000, - "3": 34000, - "4": 35000, - "5": 38000, - "6": 41000, - "8": 44000 + "Bool": 26000, + "Uint8": 34000, + "Uint16": 34000, + "Uint32": 35000, + "Uint64": 38000, + "Uint128": 41000, + "Uint256": 44000 }, "nonScalar": { - "0": 26000, - "1": 32000, - "2": 34000, - "3": 34000, - "4": 35000, - "5": 38000, - "6": 41000, - "8": 44000 + "Bool": 26000, + "Uint8": 34000, + "Uint16": 34000, + "Uint32": 35000, + "Uint64": 38000, + "Uint128": 41000, + "Uint256": 44000 } }, "fheShl": { "binary": true, "scalar": { - "1": 35000, - "2": 35000, - "3": 35000, - "4": 35000, - "5": 38000, - "6": 41000, - "8": 44000 + "Uint8": 35000, + "Uint16": 35000, + "Uint32": 35000, + "Uint64": 38000, + "Uint128": 41000, + "Uint256": 44000 }, "nonScalar": { - "1": 116000, - "2": 133000, - "3": 153000, - "4": 183000, - "5": 227000, - "6": 282000, - "8": 350000 + "Uint8": 133000, + "Uint16": 153000, + "Uint32": 183000, + "Uint64": 227000, + "Uint128": 282000, + "Uint256": 350000 } }, "fheShr": { "binary": true, "scalar": { - "1": 35000, - "2": 35000, - "3": 35000, - "4": 35000, - "5": 38000, - "6": 41000, - "8": 44000 + "Uint8": 35000, + "Uint16": 35000, + "Uint32": 35000, + "Uint64": 38000, + "Uint128": 41000, + "Uint256": 44000 }, "nonScalar": { - "1": 116000, - "2": 133000, - "3": 153000, - "4": 183000, - "5": 227000, - "6": 282000, - "8": 350000 + "Uint8": 133000, + "Uint16": 153000, + "Uint32": 183000, + "Uint64": 227000, + "Uint128": 282000, + "Uint256": 350000 } }, "fheRotl": { "binary": true, "scalar": { - "1": 35000, - "2": 35000, - "3": 35000, - "4": 35000, - "5": 38000, - "6": 41000, - "8": 44000 + "Uint8": 35000, + "Uint16": 35000, + "Uint32": 35000, + "Uint64": 38000, + "Uint128": 41000, + "Uint256": 44000 }, "nonScalar": { - "1": 116000, - "2": 133000, - "3": 153000, - "4": 183000, - "5": 227000, - "6": 282000, - "8": 350000 + "Uint8": 133000, + "Uint16": 153000, + "Uint32": 183000, + "Uint64": 227000, + "Uint128": 282000, + "Uint256": 350000 } }, "fheRotr": { "binary": true, "scalar": { - "1": 35000, - "2": 35000, - "3": 35000, - "4": 35000, - "5": 38000, - "6": 41000, - "8": 44000 + "Uint8": 35000, + "Uint16": 35000, + "Uint32": 35000, + "Uint64": 38000, + "Uint128": 41000, + "Uint256": 44000 }, "nonScalar": { - "1": 116000, - "2": 133000, - "3": 153000, - "4": 183000, - "5": 227000, - "6": 282000, - "8": 350000 + "Uint8": 133000, + "Uint16": 153000, + "Uint32": 183000, + "Uint64": 227000, + "Uint128": 282000, + "Uint256": 350000 } }, "fheEq": { "binary": true, "scalar": { - "0": 49000, - "1": 51000, - "2": 53000, - "3": 54000, - "4": 82000, - "5": 86000, - "6": 88000, - "7": 90000, - "8": 100000, - "9": 150000, - "10": 200000, - "11": 300000 + "Bool": 49000, + "Uint8": 53000, + "Uint16": 54000, + "Uint32": 82000, + "Uint64": 86000, + "Uint128": 88000, + "Uint160": 90000, + "Uint256": 100000, + "Uint512": 150000, + "Uint1024": 200000, + "Uint2048": 300000 }, "nonScalar": { - "0": 49000, - "1": 51000, - "2": 53000, - "3": 54000, - "4": 82000, - "5": 86000, - "6": 88000, - "7": 90000, - "8": 100000, - "9": 150000, - "10": 200000, - "11": 300000 + "Bool": 49000, + "Uint8": 53000, + "Uint16": 54000, + "Uint32": 82000, + "Uint64": 86000, + "Uint128": 88000, + "Uint160": 90000, + "Uint256": 100000, + "Uint512": 150000, + "Uint1024": 200000, + "Uint2048": 300000 } }, "fheNe": { "binary": true, "scalar": { - "0": 49000, - "1": 51000, - "2": 53000, - "3": 54000, - "4": 82000, - "5": 86000, - "6": 88000, - "7": 90000, - "8": 100000, - "9": 150000, - "10": 200000, - "11": 300000 + "Bool": 49000, + "Uint8": 53000, + "Uint16": 54000, + "Uint32": 82000, + "Uint64": 86000, + "Uint128": 88000, + "Uint160": 90000, + "Uint256": 100000, + "Uint512": 150000, + "Uint1024": 200000, + "Uint2048": 300000 }, "nonScalar": { - "0": 49000, - "1": 51000, - "2": 53000, - "3": 54000, - "4": 82000, - "5": 86000, - "6": 88000, - "7": 90000, - "8": 100000, - "9": 150000, - "10": 200000, - "11": 300000 + "Bool": 49000, + "Uint8": 53000, + "Uint16": 54000, + "Uint32": 82000, + "Uint64": 86000, + "Uint128": 88000, + "Uint160": 90000, + "Uint256": 100000, + "Uint512": 150000, + "Uint1024": 200000, + "Uint2048": 300000 } }, "fheGe": { "binary": true, "scalar": { - "1": 70000, - "2": 82000, - "3": 105000, - "4": 128000, - "5": 156000, - "6": 190000, - "8": 231000 + "Uint8": 82000, + "Uint16": 105000, + "Uint32": 128000, + "Uint64": 156000, + "Uint128": 190000 }, "nonScalar": { - "1": 70000, - "2": 82000, - "3": 105000, - "4": 128000, - "5": 156000, - "6": 190000, - "8": 231000 + "Uint8": 82000, + "Uint16": 105000, + "Uint32": 128000, + "Uint64": 156000, + "Uint128": 190000 } }, "fheGt": { "binary": true, "scalar": { - "1": 70000, - "2": 82000, - "3": 105000, - "4": 128000, - "5": 156000, - "6": 190000, - "8": 231000 + "Uint8": 82000, + "Uint16": 105000, + "Uint32": 128000, + "Uint64": 156000, + "Uint128": 190000 }, "nonScalar": { - "1": 70000, - "2": 82000, - "3": 105000, - "4": 128000, - "5": 156000, - "6": 190000, - "8": 231000 + "Uint8": 82000, + "Uint16": 105000, + "Uint32": 128000, + "Uint64": 156000, + "Uint128": 190000 } }, "fheLe": { "binary": true, "scalar": { - "1": 70000, - "2": 82000, - "3": 105000, - "4": 128000, - "5": 156000, - "6": 190000, - "8": 231000 + "Uint8": 82000, + "Uint16": 105000, + "Uint32": 128000, + "Uint64": 156000, + "Uint128": 190000 }, "nonScalar": { - "1": 70000, - "2": 82000, - "3": 105000, - "4": 128000, - "5": 156000, - "6": 190000, - "8": 231000 + "Uint8": 82000, + "Uint16": 105000, + "Uint32": 128000, + "Uint64": 156000, + "Uint128": 190000 } }, "fheLt": { "binary": true, "scalar": { - "1": 70000, - "2": 82000, - "3": 105000, - "4": 128000, - "5": 156000, - "6": 190000, - "8": 231000 + "Uint8": 82000, + "Uint16": 105000, + "Uint32": 128000, + "Uint64": 156000, + "Uint128": 190000 }, "nonScalar": { - "1": 70000, - "2": 82000, - "3": 105000, - "4": 128000, - "5": 156000, - "6": 190000, - "8": 231000 + "Uint8": 82000, + "Uint16": 105000, + "Uint32": 128000, + "Uint64": 156000, + "Uint128": 190000 } }, "fheMin": { "binary": true, "scalar": { - "1": 121000, - "2": 128000, - "3": 150000, - "4": 164000, - "5": 192000, - "6": 225000, - "8": 264000 + "Uint8": 128000, + "Uint16": 150000, + "Uint32": 164000, + "Uint64": 192000, + "Uint128": 225000 }, "nonScalar": { - "1": 121000, - "2": 128000, - "3": 153000, - "4": 183000, - "5": 210000, - "6": 241000, - "8": 277000 + "Uint8": 128000, + "Uint16": 153000, + "Uint32": 183000, + "Uint64": 210000, + "Uint128": 241000 } }, "fheMax": { "binary": true, "scalar": { - "1": 121000, - "2": 128000, - "3": 150000, - "4": 164000, - "5": 192000, - "6": 225000, - "8": 264000 + "Uint8": 128000, + "Uint16": 150000, + "Uint32": 164000, + "Uint64": 192000, + "Uint128": 225000 }, "nonScalar": { - "1": 121000, - "2": 128000, - "3": 153000, - "4": 183000, - "5": 210000, - "6": 241000, - "8": 277000 + "Uint8": 128000, + "Uint16": 153000, + "Uint32": 183000, + "Uint64": 210000, + "Uint128": 241000 } }, "fheNeg": { "binary": false, "types": { - "1": 60000, - "2": 95000, - "3": 131000, - "4": 160000, - "5": 199000, - "6": 248000, - "8": 309000 + "Uint8": 95000, + "Uint16": 131000, + "Uint32": 160000, + "Uint64": 199000, + "Uint128": 248000, + "Uint256": 309000 } }, "fheNot": { "binary": false, "types": { - "0": 30000, - "1": 33000, - "2": 34000, - "3": 35000, - "4": 36000, - "5": 37000, - "6": 38000, - "8": 39000 + "Bool": 30000, + "Uint8": 34000, + "Uint16": 35000, + "Uint32": 36000, + "Uint64": 37000, + "Uint128": 38000, + "Uint256": 39000 } }, "cast": { "binary": false, "types": { - "0": 200, - "1": 200, - "2": 200, - "3": 200, - "4": 200, - "5": 200, - "6": 200, - "8": 200 + "Bool": 200, + "Uint8": 200, + "Uint16": 200, + "Uint32": 200, + "Uint64": 200, + "Uint128": 200, + "Uint256": 200 } }, "trivialEncrypt": { "binary": false, "types": { - "0": 100, - "1": 100, - "2": 100, - "3": 200, - "4": 300, - "5": 600, - "6": 650, - "7": 700, - "8": 800, - "9": 1600, - "10": 3200, - "11": 6400 + "Bool": 100, + "Uint8": 100, + "Uint16": 200, + "Uint32": 300, + "Uint64": 600, + "Uint128": 650, + "Uint160": 700, + "Uint256": 800, + "Uint512": 1600, + "Uint1024": 3200, + "Uint2048": 6400 } }, "ifThenElse": { "binary": false, "types": { - "0": 43000, - "1": 45000, - "2": 47000, - "3": 47000, - "4": 50000, - "5": 53000, - "6": 70000, - "7": 80000, - "8": 90000, - "9": 150000, - "10": 200000, - "11": 300000 + "Bool": 43000, + "Uint8": 47000, + "Uint16": 47000, + "Uint32": 50000, + "Uint64": 53000, + "Uint128": 70000, + "Uint160": 80000, + "Uint256": 90000, + "Uint512": 150000, + "Uint1024": 200000, + "Uint2048": 300000 } }, "fheRand": { "binary": false, "types": { - "0": 100000, - "1": 100000, - "2": 100000, - "3": 100000, - "4": 100000, - "5": 100000, - "6": 100000, - "8": 100000, - "9": 200000, - "10": 300000, - "11": 400000 + "Bool": 100000, + "Uint8": 100000, + "Uint16": 100000, + "Uint32": 100000, + "Uint64": 100000, + "Uint128": 100000, + "Uint256": 100000, + "Uint512": 200000, + "Uint1024": 300000, + "Uint2048": 400000 } }, "fheRandBounded": { "binary": false, "types": { - "1": 100000, - "2": 100000, - "3": 100000, - "4": 100000, - "5": 100000, - "6": 100000, - "8": 100000 + "Uint8": 100000, + "Uint16": 100000, + "Uint32": 100000, + "Uint64": 100000, + "Uint128": 100000, + "Uint256": 100000 } } } diff --git a/contracts/codegen/overloadTests.ts b/contracts/codegen/overloadTests.ts index 38145712..94c430f1 100644 --- a/contracts/codegen/overloadTests.ts +++ b/contracts/codegen/overloadTests.ts @@ -23,6 +23,6 @@ const transformBigInt = (o: { [methodName: string]: OverloadTestJSON[] }) => { transformBigInt(overloads); -export const overloadTests: { [methodName: string]: OverloadTest[] } = overloads as unknown as { - [methodName: string]: OverloadTest[]; -}; +type OverloadTests = { [methodName: string]: OverloadTest[] }; + +export const overloadTests: OverloadTests = overloads as unknown as OverloadTests; diff --git a/contracts/codegen/overloads.json b/contracts/codegen/overloads.json index b6d9c42f..c0fc42e5 100644 --- a/contracts/codegen/overloads.json +++ b/contracts/codegen/overloads.json @@ -1,1260 +1,557 @@ { - "add_euint4_euint4": [ - { "inputs": ["2", "7"], "output": "9" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["5", "5"], "output": "10" }, - { "inputs": ["8", "4"], "output": "12" } - ], - "add_euint4_euint8": [ - { "inputs": ["2", "10"], "output": "12" }, - { "inputs": ["5", "9"], "output": "14" }, - { "inputs": ["5", "5"], "output": "10" }, - { "inputs": ["9", "5"], "output": "14" } - ], - "add_euint4_uint8": [ - { "inputs": ["9", "2"], "output": "11" }, - { "inputs": ["5", "9"], "output": "14" }, - { "inputs": ["5", "5"], "output": "10" }, - { "inputs": ["9", "5"], "output": "14" } - ], - "add_euint4_euint16": [ - { "inputs": ["2", "9"], "output": "11" }, - { "inputs": ["6", "8"], "output": "14" }, - { "inputs": ["5", "5"], "output": "10" }, - { "inputs": ["8", "6"], "output": "14" } - ], - "add_euint4_euint32": [ - { "inputs": ["2", "9"], "output": "11" }, - { "inputs": ["4", "6"], "output": "10" }, - { "inputs": ["6", "6"], "output": "12" }, - { "inputs": ["6", "4"], "output": "10" } - ], - "add_euint4_euint64": [ - { "inputs": ["1", "9"], "output": "10" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["5", "5"], "output": "10" }, - { "inputs": ["8", "4"], "output": "12" } - ], - "add_euint4_euint128": [ - { "inputs": ["2", "9"], "output": "11" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["5", "5"], "output": "10" }, - { "inputs": ["8", "4"], "output": "12" } - ], - "add_euint4_euint256": [ - { "inputs": ["2", "9"], "output": "11" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["5", "5"], "output": "10" }, - { "inputs": ["8", "4"], "output": "12" } - ], - "add_euint8_euint4": [ - { "inputs": ["10", "2"], "output": "12" }, - { "inputs": ["5", "9"], "output": "14" }, - { "inputs": ["5", "5"], "output": "10" }, - { "inputs": ["9", "5"], "output": "14" } - ], - "add_uint8_euint4": [ - { "inputs": ["6", "9"], "output": "15" }, - { "inputs": ["5", "9"], "output": "14" }, - { "inputs": ["5", "5"], "output": "10" }, - { "inputs": ["9", "5"], "output": "14" } - ], "add_euint8_euint8": [ - { "inputs": ["219", "18"], "output": "237" }, - { "inputs": ["14", "18"], "output": "32" }, - { "inputs": ["18", "18"], "output": "36" }, - { "inputs": ["18", "14"], "output": "32" } + { "inputs": ["60", "43"], "output": "103" }, + { "inputs": ["39", "43"], "output": "82" }, + { "inputs": ["43", "43"], "output": "86" }, + { "inputs": ["43", "39"], "output": "82" } ], "add_euint8_uint8": [ - { "inputs": ["110", "64"], "output": "174" }, - { "inputs": ["14", "18"], "output": "32" }, - { "inputs": ["18", "18"], "output": "36" }, - { "inputs": ["18", "14"], "output": "32" } + { "inputs": ["60", "164"], "output": "224" }, + { "inputs": ["39", "43"], "output": "82" }, + { "inputs": ["43", "43"], "output": "86" }, + { "inputs": ["43", "39"], "output": "82" } ], "add_uint8_euint8": [ - { "inputs": ["52", "126"], "output": "178" }, - { "inputs": ["14", "18"], "output": "32" }, - { "inputs": ["18", "18"], "output": "36" }, - { "inputs": ["18", "14"], "output": "32" } + { "inputs": ["115", "83"], "output": "198" }, + { "inputs": ["39", "43"], "output": "82" }, + { "inputs": ["43", "43"], "output": "86" }, + { "inputs": ["43", "39"], "output": "82" } ], "add_euint8_euint16": [ - { "inputs": ["2", "132"], "output": "134" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "16" }, - { "inputs": ["8", "4"], "output": "12" } + { "inputs": ["2", "190"], "output": "192" }, + { "inputs": ["78", "82"], "output": "160" }, + { "inputs": ["82", "82"], "output": "164" }, + { "inputs": ["82", "78"], "output": "160" } ], "add_euint8_euint32": [ - { "inputs": ["2", "251"], "output": "253" }, - { "inputs": ["59", "63"], "output": "122" }, - { "inputs": ["63", "63"], "output": "126" }, - { "inputs": ["63", "59"], "output": "122" } + { "inputs": ["2", "128"], "output": "130" }, + { "inputs": ["52", "56"], "output": "108" }, + { "inputs": ["56", "56"], "output": "112" }, + { "inputs": ["56", "52"], "output": "108" } ], "add_euint8_euint64": [ { "inputs": ["2", "129"], "output": "131" }, - { "inputs": ["87", "91"], "output": "178" }, - { "inputs": ["91", "91"], "output": "182" }, - { "inputs": ["91", "87"], "output": "178" } + { "inputs": ["73", "77"], "output": "150" }, + { "inputs": ["77", "77"], "output": "154" }, + { "inputs": ["77", "73"], "output": "150" } ], "add_euint8_euint128": [ { "inputs": ["2", "129"], "output": "131" }, - { "inputs": ["16", "20"], "output": "36" }, - { "inputs": ["20", "20"], "output": "40" }, - { "inputs": ["20", "16"], "output": "36" } - ], - "add_euint8_euint256": [ - { "inputs": ["2", "129"], "output": "131" }, - { "inputs": ["82", "86"], "output": "168" }, - { "inputs": ["86", "86"], "output": "172" }, - { "inputs": ["86", "82"], "output": "168" } - ], - "add_euint16_euint4": [ - { "inputs": ["8", "2"], "output": "10" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["5", "5"], "output": "10" }, - { "inputs": ["8", "4"], "output": "12" } + { "inputs": ["96", "98"], "output": "194" }, + { "inputs": ["98", "98"], "output": "196" }, + { "inputs": ["98", "96"], "output": "194" } ], "add_euint16_euint8": [ - { "inputs": ["205", "2"], "output": "207" }, - { "inputs": ["90", "94"], "output": "184" }, - { "inputs": ["94", "94"], "output": "188" }, - { "inputs": ["94", "90"], "output": "184" } + { "inputs": ["143", "2"], "output": "145" }, + { "inputs": ["116", "120"], "output": "236" }, + { "inputs": ["120", "120"], "output": "240" }, + { "inputs": ["120", "116"], "output": "236" } ], "add_euint16_euint16": [ - { "inputs": ["26028", "36322"], "output": "62350" }, - { "inputs": ["26024", "26028"], "output": "52052" }, - { "inputs": ["26028", "26028"], "output": "52056" }, - { "inputs": ["26028", "26024"], "output": "52052" } + { "inputs": ["12891", "27558"], "output": "40449" }, + { "inputs": ["25777", "25781"], "output": "51558" }, + { "inputs": ["25781", "25781"], "output": "51562" }, + { "inputs": ["25781", "25777"], "output": "51558" } ], "add_euint16_uint16": [ - { "inputs": ["26028", "15417"], "output": "41445" }, - { "inputs": ["26024", "26028"], "output": "52052" }, - { "inputs": ["26028", "26028"], "output": "52056" }, - { "inputs": ["26028", "26024"], "output": "52052" } + { "inputs": ["25781", "8341"], "output": "34122" }, + { "inputs": ["25777", "25781"], "output": "51558" }, + { "inputs": ["25781", "25781"], "output": "51562" }, + { "inputs": ["25781", "25777"], "output": "51558" } ], "add_uint16_euint16": [ - { "inputs": ["22897", "15417"], "output": "38314" }, - { "inputs": ["26024", "26028"], "output": "52052" }, - { "inputs": ["26028", "26028"], "output": "52056" }, - { "inputs": ["26028", "26024"], "output": "52052" } + { "inputs": ["34894", "8341"], "output": "43235" }, + { "inputs": ["25777", "25781"], "output": "51558" }, + { "inputs": ["25781", "25781"], "output": "51562" }, + { "inputs": ["25781", "25777"], "output": "51558" } ], "add_euint16_euint32": [ - { "inputs": ["2", "52896"], "output": "52898" }, - { "inputs": ["19184", "19188"], "output": "38372" }, - { "inputs": ["19188", "19188"], "output": "38376" }, - { "inputs": ["19188", "19184"], "output": "38372" } + { "inputs": ["2", "34882"], "output": "34884" }, + { "inputs": ["31494", "31496"], "output": "62990" }, + { "inputs": ["31496", "31496"], "output": "62992" }, + { "inputs": ["31496", "31494"], "output": "62990" } ], "add_euint16_euint64": [ - { "inputs": ["2", "65506"], "output": "65508" }, - { "inputs": ["32347", "32349"], "output": "64696" }, - { "inputs": ["32349", "32349"], "output": "64698" }, - { "inputs": ["32349", "32347"], "output": "64696" } - ], - "add_euint16_euint128": [ { "inputs": ["2", "32769"], "output": "32771" }, - { "inputs": ["25454", "25456"], "output": "50910" }, - { "inputs": ["25456", "25456"], "output": "50912" }, - { "inputs": ["25456", "25454"], "output": "50910" } + { "inputs": ["29582", "29584"], "output": "59166" }, + { "inputs": ["29584", "29584"], "output": "59168" }, + { "inputs": ["29584", "29582"], "output": "59166" } ], - "add_euint16_euint256": [ + "add_euint16_euint128": [ { "inputs": ["2", "32769"], "output": "32771" }, - { "inputs": ["20019", "20021"], "output": "40040" }, - { "inputs": ["20021", "20021"], "output": "40042" }, - { "inputs": ["20021", "20019"], "output": "40040" } - ], - "add_euint32_euint4": [ - { "inputs": ["10", "1"], "output": "11" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["5", "5"], "output": "10" }, - { "inputs": ["8", "4"], "output": "12" } + { "inputs": ["3188", "3192"], "output": "6380" }, + { "inputs": ["3192", "3192"], "output": "6384" }, + { "inputs": ["3192", "3188"], "output": "6380" } ], "add_euint32_euint8": [ - { "inputs": ["129", "2"], "output": "131" }, - { "inputs": ["79", "81"], "output": "160" }, - { "inputs": ["81", "81"], "output": "162" }, - { "inputs": ["81", "79"], "output": "160" } + { "inputs": ["164", "2"], "output": "166" }, + { "inputs": ["124", "126"], "output": "250" }, + { "inputs": ["126", "126"], "output": "252" }, + { "inputs": ["126", "124"], "output": "250" } ], "add_euint32_euint16": [ - { "inputs": ["35595", "11"], "output": "35606" }, - { "inputs": ["18477", "18479"], "output": "36956" }, - { "inputs": ["18479", "18479"], "output": "36958" }, - { "inputs": ["18479", "18477"], "output": "36956" } + { "inputs": ["39452", "2"], "output": "39454" }, + { "inputs": ["31922", "31924"], "output": "63846" }, + { "inputs": ["31924", "31924"], "output": "63848" }, + { "inputs": ["31924", "31922"], "output": "63846" } ], "add_euint32_euint32": [ - { "inputs": ["1855544902", "1743021443"], "output": "3598566345" }, - { "inputs": ["1743021441", "1743021443"], "output": "3486042884" }, - { "inputs": ["1743021443", "1743021443"], "output": "3486042886" }, - { "inputs": ["1743021443", "1743021441"], "output": "3486042884" } + { "inputs": ["1207439433", "625085240"], "output": "1832524673" }, + { "inputs": ["625085236", "625085240"], "output": "1250170476" }, + { "inputs": ["625085240", "625085240"], "output": "1250170480" }, + { "inputs": ["625085240", "625085236"], "output": "1250170476" } ], "add_euint32_uint32": [ - { "inputs": ["1855544902", "749023821"], "output": "2604568723" }, - { "inputs": ["1743021441", "1743021443"], "output": "3486042884" }, - { "inputs": ["1743021443", "1743021443"], "output": "3486042886" }, - { "inputs": ["1743021443", "1743021441"], "output": "3486042884" } + { "inputs": ["1207439433", "1304939103"], "output": "2512378536" }, + { "inputs": ["625085236", "625085240"], "output": "1250170476" }, + { "inputs": ["625085240", "625085240"], "output": "1250170480" }, + { "inputs": ["625085240", "625085236"], "output": "1250170476" } ], "add_uint32_euint32": [ - { "inputs": ["1745146365", "1498047640"], "output": "3243194005" }, - { "inputs": ["1743021441", "1743021443"], "output": "3486042884" }, - { "inputs": ["1743021443", "1743021443"], "output": "3486042886" }, - { "inputs": ["1743021443", "1743021441"], "output": "3486042884" } + { "inputs": ["444335334", "1304939103"], "output": "1749274437" }, + { "inputs": ["625085236", "625085240"], "output": "1250170476" }, + { "inputs": ["625085240", "625085240"], "output": "1250170480" }, + { "inputs": ["625085240", "625085236"], "output": "1250170476" } ], "add_euint32_euint64": [ - { "inputs": ["2", "4294187631"], "output": "4294187633" }, - { "inputs": ["1977492101", "1977492105"], "output": "3954984206" }, - { "inputs": ["1977492105", "1977492105"], "output": "3954984210" }, - { "inputs": ["1977492105", "1977492101"], "output": "3954984206" } + { "inputs": ["2", "4293160823"], "output": "4293160825" }, + { "inputs": ["1224626629", "1224626631"], "output": "2449253260" }, + { "inputs": ["1224626631", "1224626631"], "output": "2449253262" }, + { "inputs": ["1224626631", "1224626629"], "output": "2449253260" } ], "add_euint32_euint128": [ { "inputs": ["2", "2147483649"], "output": "2147483651" }, - { "inputs": ["788156404", "788156408"], "output": "1576312812" }, - { "inputs": ["788156408", "788156408"], "output": "1576312816" }, - { "inputs": ["788156408", "788156404"], "output": "1576312812" } - ], - "add_euint32_euint256": [ - { "inputs": ["2", "2147483649"], "output": "2147483651" }, - { "inputs": ["1370548128", "1370548130"], "output": "2741096258" }, - { "inputs": ["1370548130", "1370548130"], "output": "2741096260" }, - { "inputs": ["1370548130", "1370548128"], "output": "2741096258" } - ], - "add_euint64_euint4": [ - { "inputs": ["9", "2"], "output": "11" }, - { "inputs": ["5", "7"], "output": "12" }, - { "inputs": ["7", "7"], "output": "14" }, - { "inputs": ["7", "5"], "output": "12" } + { "inputs": ["353124684", "353124688"], "output": "706249372" }, + { "inputs": ["353124688", "353124688"], "output": "706249376" }, + { "inputs": ["353124688", "353124684"], "output": "706249372" } ], "add_euint64_euint8": [ { "inputs": ["129", "2"], "output": "131" }, - { "inputs": ["66", "70"], "output": "136" }, - { "inputs": ["70", "70"], "output": "140" }, - { "inputs": ["70", "66"], "output": "136" } + { "inputs": ["85", "87"], "output": "172" }, + { "inputs": ["87", "87"], "output": "174" }, + { "inputs": ["87", "85"], "output": "172" } ], "add_euint64_euint16": [ - { "inputs": ["65532", "2"], "output": "65534" }, - { "inputs": ["23004", "23006"], "output": "46010" }, - { "inputs": ["23006", "23006"], "output": "46012" }, - { "inputs": ["23006", "23004"], "output": "46010" } + { "inputs": ["65516", "2"], "output": "65518" }, + { "inputs": ["28197", "28199"], "output": "56396" }, + { "inputs": ["28199", "28199"], "output": "56398" }, + { "inputs": ["28199", "28197"], "output": "56396" } ], "add_euint64_euint32": [ - { "inputs": ["4294529095", "2"], "output": "4294529097" }, - { "inputs": ["1772669097", "1772669099"], "output": "3545338196" }, - { "inputs": ["1772669099", "1772669099"], "output": "3545338198" }, - { "inputs": ["1772669099", "1772669097"], "output": "3545338196" } + { "inputs": ["4293159209", "2"], "output": "4293159211" }, + { "inputs": ["1744161840", "1744161842"], "output": "3488323682" }, + { "inputs": ["1744161842", "1744161842"], "output": "3488323684" }, + { "inputs": ["1744161842", "1744161840"], "output": "3488323682" } ], "add_euint64_euint64": [ - { - "inputs": ["9222005500490563257", "9222323180954998973"], - "output": "18444328681445562230" - }, - { - "inputs": ["9222005500490563255", "9222005500490563257"], - "output": "18444011000981126512" - }, - { - "inputs": ["9222005500490563257", "9222005500490563257"], - "output": "18444011000981126514" - }, - { - "inputs": ["9222005500490563257", "9222005500490563255"], - "output": "18444011000981126512" - } + { "inputs": ["9222760210277548579", "9219874693396051112"], "output": "18442634903673599691" }, + { "inputs": ["9219874693396051110", "9219874693396051112"], "output": "18439749386792102222" }, + { "inputs": ["9219874693396051112", "9219874693396051112"], "output": "18439749386792102224" }, + { "inputs": ["9219874693396051112", "9219874693396051110"], "output": "18439749386792102222" } ], "add_euint64_uint64": [ - { - "inputs": ["9222005500490563257", "9221821229831123671"], - "output": "18443826730321686928" - }, - { - "inputs": ["9222005500490563255", "9222005500490563257"], - "output": "18444011000981126512" - }, - { - "inputs": ["9222005500490563257", "9222005500490563257"], - "output": "18444011000981126514" - }, - { - "inputs": ["9222005500490563257", "9222005500490563255"], - "output": "18444011000981126512" - } + { "inputs": ["9222760210277548579", "9221980582519356759"], "output": "18444740792796905338" }, + { "inputs": ["9219874693396051110", "9219874693396051112"], "output": "18439749386792102222" }, + { "inputs": ["9219874693396051112", "9219874693396051112"], "output": "18439749386792102224" }, + { "inputs": ["9219874693396051112", "9219874693396051110"], "output": "18439749386792102222" } ], "add_uint64_euint64": [ - { - "inputs": ["9221960957990697049", "9221821229831123671"], - "output": "18443782187821820720" - }, - { - "inputs": ["9222005500490563255", "9222005500490563257"], - "output": "18444011000981126512" - }, - { - "inputs": ["9222005500490563257", "9222005500490563257"], - "output": "18444011000981126514" - }, - { - "inputs": ["9222005500490563257", "9222005500490563255"], - "output": "18444011000981126512" - } + { "inputs": ["9220631068145391485", "9221980582519356759"], "output": "18442611650664748244" }, + { "inputs": ["9219874693396051110", "9219874693396051112"], "output": "18439749386792102222" }, + { "inputs": ["9219874693396051112", "9219874693396051112"], "output": "18439749386792102224" }, + { "inputs": ["9219874693396051112", "9219874693396051110"], "output": "18439749386792102222" } ], "add_euint64_euint128": [ { "inputs": ["2", "9223372036854775809"], "output": "9223372036854775811" }, - { - "inputs": ["9220019285142748118", "9220019285142748120"], - "output": "18440038570285496238" - }, - { - "inputs": ["9220019285142748120", "9220019285142748120"], - "output": "18440038570285496240" - }, - { - "inputs": ["9220019285142748120", "9220019285142748118"], - "output": "18440038570285496238" - } - ], - "add_euint64_euint256": [ - { "inputs": ["2", "9223372036854775809"], "output": "9223372036854775811" }, - { - "inputs": ["9223002406300982591", "9223002406300982593"], - "output": "18446004812601965184" - }, - { - "inputs": ["9223002406300982593", "9223002406300982593"], - "output": "18446004812601965186" - }, - { - "inputs": ["9223002406300982593", "9223002406300982591"], - "output": "18446004812601965184" - } - ], - "add_euint128_euint4": [ - { "inputs": ["9", "2"], "output": "11" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["5", "5"], "output": "10" }, - { "inputs": ["8", "4"], "output": "12" } + { "inputs": ["9220946912366982479", "9220946912366982481"], "output": "18441893824733964960" }, + { "inputs": ["9220946912366982481", "9220946912366982481"], "output": "18441893824733964962" }, + { "inputs": ["9220946912366982481", "9220946912366982479"], "output": "18441893824733964960" } ], "add_euint128_euint8": [ { "inputs": ["129", "2"], "output": "131" }, - { "inputs": ["118", "120"], "output": "238" }, - { "inputs": ["120", "120"], "output": "240" }, - { "inputs": ["120", "118"], "output": "238" } + { "inputs": ["68", "70"], "output": "138" }, + { "inputs": ["70", "70"], "output": "140" }, + { "inputs": ["70", "68"], "output": "138" } ], "add_euint128_euint16": [ { "inputs": ["32769", "2"], "output": "32771" }, - { "inputs": ["31253", "31255"], "output": "62508" }, - { "inputs": ["31255", "31255"], "output": "62510" }, - { "inputs": ["31255", "31253"], "output": "62508" } + { "inputs": ["2173", "2177"], "output": "4350" }, + { "inputs": ["2177", "2177"], "output": "4354" }, + { "inputs": ["2177", "2173"], "output": "4350" } ], "add_euint128_euint32": [ { "inputs": ["2147483649", "2"], "output": "2147483651" }, - { "inputs": ["417384794", "417384798"], "output": "834769592" }, - { "inputs": ["417384798", "417384798"], "output": "834769596" }, - { "inputs": ["417384798", "417384794"], "output": "834769592" } + { "inputs": ["2076195698", "2076195700"], "output": "4152391398" }, + { "inputs": ["2076195700", "2076195700"], "output": "4152391400" }, + { "inputs": ["2076195700", "2076195698"], "output": "4152391398" } ], "add_euint128_euint64": [ { "inputs": ["9223372036854775809", "2"], "output": "9223372036854775811" }, - { - "inputs": ["9219789077213425563", "9219789077213425565"], - "output": "18439578154426851128" - }, - { - "inputs": ["9219789077213425565", "9219789077213425565"], - "output": "18439578154426851130" - }, - { - "inputs": ["9219789077213425565", "9219789077213425563"], - "output": "18439578154426851128" - } + { "inputs": ["9222713195267995584", "9222713195267995586"], "output": "18445426390535991170" }, + { "inputs": ["9222713195267995586", "9222713195267995586"], "output": "18445426390535991172" }, + { "inputs": ["9222713195267995586", "9222713195267995584"], "output": "18445426390535991170" } ], "add_euint128_euint128": [ { - "inputs": ["170141183460469231731685489259224150459", "170141183460469231731686328709125723252"], - "output": "340282366920938463463371817968349873711" + "inputs": ["170141183460469231731683313325121486414", "170141183460469231731685510248870029522"], + "output": "340282366920938463463368823573991515936" }, { - "inputs": ["170141183460469231731685489259224150457", "170141183460469231731685489259224150459"], - "output": "340282366920938463463370978518448300916" + "inputs": ["170141183460469231731683313325121486412", "170141183460469231731683313325121486414"], + "output": "340282366920938463463366626650242972826" }, { - "inputs": ["170141183460469231731685489259224150459", "170141183460469231731685489259224150459"], - "output": "340282366920938463463370978518448300918" + "inputs": ["170141183460469231731683313325121486414", "170141183460469231731683313325121486414"], + "output": "340282366920938463463366626650242972828" }, { - "inputs": ["170141183460469231731685489259224150459", "170141183460469231731685489259224150457"], - "output": "340282366920938463463370978518448300916" + "inputs": ["170141183460469231731683313325121486414", "170141183460469231731683313325121486412"], + "output": "340282366920938463463366626650242972826" } ], "add_euint128_uint128": [ { - "inputs": ["170141183460469231731685489259224150459", "170141183460469231731685023392215721043"], - "output": "340282366920938463463370512651439871502" + "inputs": ["170141183460469231731683313325121486414", "170141183460469231731687096250414571900"], + "output": "340282366920938463463370409575536058314" }, { - "inputs": ["170141183460469231731685489259224150457", "170141183460469231731685489259224150459"], - "output": "340282366920938463463370978518448300916" + "inputs": ["170141183460469231731683313325121486412", "170141183460469231731683313325121486414"], + "output": "340282366920938463463366626650242972826" }, { - "inputs": ["170141183460469231731685489259224150459", "170141183460469231731685489259224150459"], - "output": "340282366920938463463370978518448300918" + "inputs": ["170141183460469231731683313325121486414", "170141183460469231731683313325121486414"], + "output": "340282366920938463463366626650242972828" }, { - "inputs": ["170141183460469231731685489259224150459", "170141183460469231731685489259224150457"], - "output": "340282366920938463463370978518448300916" + "inputs": ["170141183460469231731683313325121486414", "170141183460469231731683313325121486412"], + "output": "340282366920938463463366626650242972826" } ], "add_uint128_euint128": [ { - "inputs": ["170141183460469231731685837916615726593", "170141183460469231731685023392215721043"], - "output": "340282366920938463463370861308831447636" - }, - { - "inputs": ["170141183460469231731685489259224150457", "170141183460469231731685489259224150459"], - "output": "340282366920938463463370978518448300916" - }, - { - "inputs": ["170141183460469231731685489259224150459", "170141183460469231731685489259224150459"], - "output": "340282366920938463463370978518448300918" - }, - { - "inputs": ["170141183460469231731685489259224150459", "170141183460469231731685489259224150457"], - "output": "340282366920938463463370978518448300916" - } - ], - "add_euint128_euint256": [ - { - "inputs": ["2", "170141183460469231731687303715884105729"], - "output": "170141183460469231731687303715884105731" - }, - { - "inputs": ["170141183460469231731686007573348351546", "170141183460469231731686007573348351548"], - "output": "340282366920938463463372015146696703094" - }, - { - "inputs": ["170141183460469231731686007573348351548", "170141183460469231731686007573348351548"], - "output": "340282366920938463463372015146696703096" - }, - { - "inputs": ["170141183460469231731686007573348351548", "170141183460469231731686007573348351546"], - "output": "340282366920938463463372015146696703094" - } - ], - "add_euint256_euint4": [ - { "inputs": ["9", "2"], "output": "11" }, - { "inputs": ["6", "8"], "output": "14" }, - { "inputs": ["5", "5"], "output": "10" }, - { "inputs": ["8", "6"], "output": "14" } - ], - "add_euint256_euint8": [ - { "inputs": ["129", "2"], "output": "131" }, - { "inputs": ["101", "103"], "output": "204" }, - { "inputs": ["103", "103"], "output": "206" }, - { "inputs": ["103", "101"], "output": "204" } - ], - "add_euint256_euint16": [ - { "inputs": ["32769", "2"], "output": "32771" }, - { "inputs": ["18590", "18592"], "output": "37182" }, - { "inputs": ["18592", "18592"], "output": "37184" }, - { "inputs": ["18592", "18590"], "output": "37182" } - ], - "add_euint256_euint32": [ - { "inputs": ["2147483649", "2"], "output": "2147483651" }, - { "inputs": ["1298573356", "1298573358"], "output": "2597146714" }, - { "inputs": ["1298573358", "1298573358"], "output": "2597146716" }, - { "inputs": ["1298573358", "1298573356"], "output": "2597146714" } - ], - "add_euint256_euint64": [ - { "inputs": ["9223372036854775809", "2"], "output": "9223372036854775811" }, - { - "inputs": ["9220748041203345234", "9220748041203345236"], - "output": "18441496082406690470" - }, - { - "inputs": ["9220748041203345236", "9220748041203345236"], - "output": "18441496082406690472" - }, - { - "inputs": ["9220748041203345236", "9220748041203345234"], - "output": "18441496082406690470" - } - ], - "add_euint256_euint128": [ - { - "inputs": ["170141183460469231731687303715884105729", "2"], - "output": "170141183460469231731687303715884105731" - }, - { - "inputs": ["170141183460469231731684278054029333276", "170141183460469231731684278054029333278"], - "output": "340282366920938463463368556108058666554" - }, - { - "inputs": ["170141183460469231731684278054029333278", "170141183460469231731684278054029333278"], - "output": "340282366920938463463368556108058666556" - }, - { - "inputs": ["170141183460469231731684278054029333278", "170141183460469231731684278054029333276"], - "output": "340282366920938463463368556108058666554" - } - ], - "add_euint256_euint256": [ - { - "inputs": [ - "57896044618658097711785492504343953926634992332820282019728789013802824080146", - "57896044618658097711785492504343953926634992332820282019728788109485910742180" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577123288734822326" - }, - { - "inputs": [ - "57896044618658097711785492504343953926634992332820282019728788109485910742178", - "57896044618658097711785492504343953926634992332820282019728788109485910742180" - ], - "output": "115792089237316195423570985008687907853269984665640564039457576218971821484358" - }, - { - "inputs": [ - "57896044618658097711785492504343953926634992332820282019728788109485910742180", - "57896044618658097711785492504343953926634992332820282019728788109485910742180" - ], - "output": "115792089237316195423570985008687907853269984665640564039457576218971821484360" - }, - { - "inputs": [ - "57896044618658097711785492504343953926634992332820282019728788109485910742180", - "57896044618658097711785492504343953926634992332820282019728788109485910742178" - ], - "output": "115792089237316195423570985008687907853269984665640564039457576218971821484358" - } - ], - "add_euint256_uint256": [ - { - "inputs": [ - "57896044618658097711785492504343953926634992332820282019728789013802824080146", - "57896044618658097711785492504343953926634992332820282019728788733583887971237" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577747386712051383" - }, - { - "inputs": [ - "57896044618658097711785492504343953926634992332820282019728788109485910742178", - "57896044618658097711785492504343953926634992332820282019728788109485910742180" - ], - "output": "115792089237316195423570985008687907853269984665640564039457576218971821484358" - }, - { - "inputs": [ - "57896044618658097711785492504343953926634992332820282019728788109485910742180", - "57896044618658097711785492504343953926634992332820282019728788109485910742180" - ], - "output": "115792089237316195423570985008687907853269984665640564039457576218971821484360" - }, - { - "inputs": [ - "57896044618658097711785492504343953926634992332820282019728788109485910742180", - "57896044618658097711785492504343953926634992332820282019728788109485910742178" - ], - "output": "115792089237316195423570985008687907853269984665640564039457576218971821484358" - } - ], - "add_uint256_euint256": [ - { - "inputs": [ - "57896044618658097711785492504343953926634992332820282019728789372175656948236", - "57896044618658097711785492504343953926634992332820282019728788733583887971237" - ], - "output": "115792089237316195423570985008687907853269984665640564039457578105759544919473" + "inputs": ["170141183460469231731685844084542920794", "170141183460469231731687096250414571900"], + "output": "340282366920938463463372940334957492694" }, { - "inputs": [ - "57896044618658097711785492504343953926634992332820282019728788109485910742178", - "57896044618658097711785492504343953926634992332820282019728788109485910742180" - ], - "output": "115792089237316195423570985008687907853269984665640564039457576218971821484358" + "inputs": ["170141183460469231731683313325121486412", "170141183460469231731683313325121486414"], + "output": "340282366920938463463366626650242972826" }, { - "inputs": [ - "57896044618658097711785492504343953926634992332820282019728788109485910742180", - "57896044618658097711785492504343953926634992332820282019728788109485910742180" - ], - "output": "115792089237316195423570985008687907853269984665640564039457576218971821484360" + "inputs": ["170141183460469231731683313325121486414", "170141183460469231731683313325121486414"], + "output": "340282366920938463463366626650242972828" }, { - "inputs": [ - "57896044618658097711785492504343953926634992332820282019728788109485910742180", - "57896044618658097711785492504343953926634992332820282019728788109485910742178" - ], - "output": "115792089237316195423570985008687907853269984665640564039457576218971821484358" + "inputs": ["170141183460469231731683313325121486414", "170141183460469231731683313325121486412"], + "output": "340282366920938463463366626650242972826" } ], - "sub_euint4_euint4": [ + "sub_euint8_euint8": [ { "inputs": ["8", "8"], "output": "0" }, { "inputs": ["8", "4"], "output": "4" } ], - "sub_euint4_euint8": [ + "sub_euint8_uint8": [ { "inputs": ["8", "8"], "output": "0" }, { "inputs": ["8", "4"], "output": "4" } ], - "sub_euint4_uint8": [ + "sub_uint8_euint8": [ { "inputs": ["8", "8"], "output": "0" }, { "inputs": ["8", "4"], "output": "4" } ], - "sub_euint4_euint16": [ - { "inputs": ["13", "13"], "output": "0" }, - { "inputs": ["13", "9"], "output": "4" } - ], - "sub_euint4_euint32": [ - { "inputs": ["13", "13"], "output": "0" }, - { "inputs": ["13", "9"], "output": "4" } - ], - "sub_euint4_euint64": [ - { "inputs": ["12", "12"], "output": "0" }, - { "inputs": ["12", "8"], "output": "4" } - ], - "sub_euint4_euint128": [ - { "inputs": ["13", "13"], "output": "0" }, - { "inputs": ["13", "9"], "output": "4" } - ], - "sub_euint4_euint256": [ - { "inputs": ["14", "14"], "output": "0" }, - { "inputs": ["14", "10"], "output": "4" } - ], - "sub_euint8_euint4": [ - { "inputs": ["14", "14"], "output": "0" }, - { "inputs": ["14", "10"], "output": "4" } - ], - "sub_uint8_euint4": [ - { "inputs": ["14", "14"], "output": "0" }, - { "inputs": ["14", "10"], "output": "4" } - ], - "sub_euint8_euint8": [ - { "inputs": ["152", "152"], "output": "0" }, - { "inputs": ["152", "148"], "output": "4" } - ], - "sub_euint8_uint8": [ - { "inputs": ["152", "152"], "output": "0" }, - { "inputs": ["152", "148"], "output": "4" } - ], - "sub_uint8_euint8": [ - { "inputs": ["152", "152"], "output": "0" }, - { "inputs": ["152", "148"], "output": "4" } - ], "sub_euint8_euint16": [ - { "inputs": ["32", "32"], "output": "0" }, - { "inputs": ["32", "28"], "output": "4" } + { "inputs": ["122", "122"], "output": "0" }, + { "inputs": ["122", "118"], "output": "4" } ], "sub_euint8_euint32": [ - { "inputs": ["102", "102"], "output": "0" }, - { "inputs": ["102", "98"], "output": "4" } + { "inputs": ["5", "5"], "output": "0" }, + { "inputs": ["5", "1"], "output": "4" } ], "sub_euint8_euint64": [ - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "4" } + { "inputs": ["128", "128"], "output": "0" }, + { "inputs": ["128", "124"], "output": "4" } ], "sub_euint8_euint128": [ - { "inputs": ["157", "157"], "output": "0" }, - { "inputs": ["157", "153"], "output": "4" } - ], - "sub_euint8_euint256": [ - { "inputs": ["224", "224"], "output": "0" }, - { "inputs": ["224", "220"], "output": "4" } - ], - "sub_euint16_euint4": [ - { "inputs": ["14", "14"], "output": "0" }, - { "inputs": ["14", "10"], "output": "4" } + { "inputs": ["81", "81"], "output": "0" }, + { "inputs": ["81", "77"], "output": "4" } ], "sub_euint16_euint8": [ - { "inputs": ["195", "195"], "output": "0" }, - { "inputs": ["195", "191"], "output": "4" } + { "inputs": ["229", "229"], "output": "0" }, + { "inputs": ["229", "225"], "output": "4" } ], "sub_euint16_euint16": [ - { "inputs": ["14486", "14486"], "output": "0" }, - { "inputs": ["14486", "14482"], "output": "4" } + { "inputs": ["19901", "19901"], "output": "0" }, + { "inputs": ["19901", "19897"], "output": "4" } ], "sub_euint16_uint16": [ - { "inputs": ["14486", "14486"], "output": "0" }, - { "inputs": ["14486", "14482"], "output": "4" } + { "inputs": ["19901", "19901"], "output": "0" }, + { "inputs": ["19901", "19897"], "output": "4" } ], "sub_uint16_euint16": [ - { "inputs": ["14486", "14486"], "output": "0" }, - { "inputs": ["14486", "14482"], "output": "4" } + { "inputs": ["19901", "19901"], "output": "0" }, + { "inputs": ["19901", "19897"], "output": "4" } ], "sub_euint16_euint32": [ - { "inputs": ["32818", "32818"], "output": "0" }, - { "inputs": ["32818", "32814"], "output": "4" } + { "inputs": ["32341", "32341"], "output": "0" }, + { "inputs": ["32341", "32337"], "output": "4" } ], "sub_euint16_euint64": [ - { "inputs": ["12596", "12596"], "output": "0" }, - { "inputs": ["12596", "12592"], "output": "4" } + { "inputs": ["19303", "19303"], "output": "0" }, + { "inputs": ["19303", "19299"], "output": "4" } ], "sub_euint16_euint128": [ - { "inputs": ["45485", "45485"], "output": "0" }, - { "inputs": ["45485", "45481"], "output": "4" } - ], - "sub_euint16_euint256": [ - { "inputs": ["40273", "40273"], "output": "0" }, - { "inputs": ["40273", "40269"], "output": "4" } - ], - "sub_euint32_euint4": [ - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "4" } + { "inputs": ["22846", "22846"], "output": "0" }, + { "inputs": ["22846", "22842"], "output": "4" } ], "sub_euint32_euint8": [ - { "inputs": ["69", "69"], "output": "0" }, - { "inputs": ["69", "65"], "output": "4" } + { "inputs": ["34", "34"], "output": "0" }, + { "inputs": ["34", "30"], "output": "4" } ], "sub_euint32_euint16": [ - { "inputs": ["18922", "18922"], "output": "0" }, - { "inputs": ["18922", "18918"], "output": "4" } + { "inputs": ["63126", "63126"], "output": "0" }, + { "inputs": ["63126", "63122"], "output": "4" } ], "sub_euint32_euint32": [ - { "inputs": ["1818111464", "1818111464"], "output": "0" }, - { "inputs": ["1818111464", "1818111460"], "output": "4" } + { "inputs": ["779288523", "779288523"], "output": "0" }, + { "inputs": ["779288523", "779288519"], "output": "4" } ], "sub_euint32_uint32": [ - { "inputs": ["1818111464", "1818111464"], "output": "0" }, - { "inputs": ["1818111464", "1818111460"], "output": "4" } + { "inputs": ["779288523", "779288523"], "output": "0" }, + { "inputs": ["779288523", "779288519"], "output": "4" } ], "sub_uint32_euint32": [ - { "inputs": ["1818111464", "1818111464"], "output": "0" }, - { "inputs": ["1818111464", "1818111460"], "output": "4" } + { "inputs": ["779288523", "779288523"], "output": "0" }, + { "inputs": ["779288523", "779288519"], "output": "4" } ], "sub_euint32_euint64": [ - { "inputs": ["2880371585", "2880371585"], "output": "0" }, - { "inputs": ["2880371585", "2880371581"], "output": "4" } + { "inputs": ["1225613024", "1225613024"], "output": "0" }, + { "inputs": ["1225613024", "1225613020"], "output": "4" } ], "sub_euint32_euint128": [ - { "inputs": ["3561141951", "3561141951"], "output": "0" }, - { "inputs": ["3561141951", "3561141947"], "output": "4" } - ], - "sub_euint32_euint256": [ - { "inputs": ["3022897647", "3022897647"], "output": "0" }, - { "inputs": ["3022897647", "3022897643"], "output": "4" } - ], - "sub_euint64_euint4": [ - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "4" } + { "inputs": ["3346802097", "3346802097"], "output": "0" }, + { "inputs": ["3346802097", "3346802093"], "output": "4" } ], "sub_euint64_euint8": [ - { "inputs": ["117", "117"], "output": "0" }, - { "inputs": ["117", "113"], "output": "4" } + { "inputs": ["108", "108"], "output": "0" }, + { "inputs": ["108", "104"], "output": "4" } ], "sub_euint64_euint16": [ - { "inputs": ["54317", "54317"], "output": "0" }, - { "inputs": ["54317", "54313"], "output": "4" } + { "inputs": ["38988", "38988"], "output": "0" }, + { "inputs": ["38988", "38984"], "output": "4" } ], "sub_euint64_euint32": [ - { "inputs": ["148706478", "148706478"], "output": "0" }, - { "inputs": ["148706478", "148706474"], "output": "4" } + { "inputs": ["474514241", "474514241"], "output": "0" }, + { "inputs": ["474514241", "474514237"], "output": "4" } ], "sub_euint64_euint64": [ - { - "inputs": ["18440691834306324731", "18440691834306324731"], - "output": "0" - }, - { - "inputs": ["18440691834306324731", "18440691834306324727"], - "output": "4" - } + { "inputs": ["18438299184994625617", "18438299184994625617"], "output": "0" }, + { "inputs": ["18438299184994625617", "18438299184994625613"], "output": "4" } ], "sub_euint64_uint64": [ - { - "inputs": ["18440691834306324731", "18440691834306324731"], - "output": "0" - }, - { - "inputs": ["18440691834306324731", "18440691834306324727"], - "output": "4" - } + { "inputs": ["18438299184994625617", "18438299184994625617"], "output": "0" }, + { "inputs": ["18438299184994625617", "18438299184994625613"], "output": "4" } ], "sub_uint64_euint64": [ - { - "inputs": ["18440691834306324731", "18440691834306324731"], - "output": "0" - }, - { - "inputs": ["18440691834306324731", "18440691834306324727"], - "output": "4" - } + { "inputs": ["18438299184994625617", "18438299184994625617"], "output": "0" }, + { "inputs": ["18438299184994625617", "18438299184994625613"], "output": "4" } ], "sub_euint64_euint128": [ - { - "inputs": ["18445847707614326699", "18445847707614326699"], - "output": "0" - }, - { - "inputs": ["18445847707614326699", "18445847707614326695"], - "output": "4" - } - ], - "sub_euint64_euint256": [ - { - "inputs": ["18445224051732608013", "18445224051732608013"], - "output": "0" - }, - { - "inputs": ["18445224051732608013", "18445224051732608009"], - "output": "4" - } - ], - "sub_euint128_euint4": [ - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "4" } + { "inputs": ["18442304799775759835", "18442304799775759835"], "output": "0" }, + { "inputs": ["18442304799775759835", "18442304799775759831"], "output": "4" } ], "sub_euint128_euint8": [ - { "inputs": ["232", "232"], "output": "0" }, - { "inputs": ["232", "228"], "output": "4" } + { "inputs": ["182", "182"], "output": "0" }, + { "inputs": ["182", "178"], "output": "4" } ], "sub_euint128_euint16": [ - { "inputs": ["25392", "25392"], "output": "0" }, - { "inputs": ["25392", "25388"], "output": "4" } + { "inputs": ["25031", "25031"], "output": "0" }, + { "inputs": ["25031", "25027"], "output": "4" } ], "sub_euint128_euint32": [ - { "inputs": ["373346389", "373346389"], "output": "0" }, - { "inputs": ["373346389", "373346385"], "output": "4" } + { "inputs": ["1180050592", "1180050592"], "output": "0" }, + { "inputs": ["1180050592", "1180050588"], "output": "4" } ], "sub_euint128_euint64": [ - { - "inputs": ["18441111603467904997", "18441111603467904997"], - "output": "0" - }, - { - "inputs": ["18441111603467904997", "18441111603467904993"], - "output": "4" - } + { "inputs": ["18442903117134440669", "18442903117134440669"], "output": "0" }, + { "inputs": ["18442903117134440669", "18442903117134440665"], "output": "4" } ], "sub_euint128_euint128": [ - { - "inputs": ["340282366920938463463366688248127833841", "340282366920938463463366688248127833841"], - "output": "0" - }, - { - "inputs": ["340282366920938463463366688248127833841", "340282366920938463463366688248127833837"], - "output": "4" - } + { "inputs": ["340282366920938463463371947750305409571", "340282366920938463463371947750305409571"], "output": "0" }, + { "inputs": ["340282366920938463463371947750305409571", "340282366920938463463371947750305409567"], "output": "4" } ], "sub_euint128_uint128": [ - { - "inputs": ["340282366920938463463366688248127833841", "340282366920938463463366688248127833841"], - "output": "0" - }, - { - "inputs": ["340282366920938463463366688248127833841", "340282366920938463463366688248127833837"], - "output": "4" - } + { "inputs": ["340282366920938463463371947750305409571", "340282366920938463463371947750305409571"], "output": "0" }, + { "inputs": ["340282366920938463463371947750305409571", "340282366920938463463371947750305409567"], "output": "4" } ], "sub_uint128_euint128": [ - { - "inputs": ["340282366920938463463366688248127833841", "340282366920938463463366688248127833841"], - "output": "0" - }, - { - "inputs": ["340282366920938463463366688248127833841", "340282366920938463463366688248127833837"], - "output": "4" - } + { "inputs": ["340282366920938463463371947750305409571", "340282366920938463463371947750305409571"], "output": "0" }, + { "inputs": ["340282366920938463463371947750305409571", "340282366920938463463371947750305409567"], "output": "4" } ], - "sub_euint128_euint256": [ - { - "inputs": ["340282366920938463463369549263218693865", "340282366920938463463369549263218693865"], - "output": "0" - }, - { - "inputs": ["340282366920938463463369549263218693865", "340282366920938463463369549263218693861"], - "output": "4" - } + "mul_euint8_euint8": [ + { "inputs": ["9", "12"], "output": "108" }, + { "inputs": ["15", "16"], "output": "240" }, + { "inputs": ["9", "9"], "output": "81" }, + { "inputs": ["16", "15"], "output": "240" } ], - "sub_euint256_euint4": [ - { "inputs": ["11", "11"], "output": "0" }, - { "inputs": ["11", "7"], "output": "4" } + "mul_euint8_uint8": [ + { "inputs": ["9", "12"], "output": "108" }, + { "inputs": ["15", "16"], "output": "240" }, + { "inputs": ["9", "9"], "output": "81" }, + { "inputs": ["16", "15"], "output": "240" } ], - "sub_euint256_euint8": [ - { "inputs": ["234", "234"], "output": "0" }, - { "inputs": ["234", "230"], "output": "4" } + "mul_uint8_euint8": [ + { "inputs": ["10", "12"], "output": "120" }, + { "inputs": ["15", "16"], "output": "240" }, + { "inputs": ["9", "9"], "output": "81" }, + { "inputs": ["16", "15"], "output": "240" } ], - "sub_euint256_euint16": [ - { "inputs": ["46280", "46280"], "output": "0" }, - { "inputs": ["46280", "46276"], "output": "4" } + "mul_euint8_euint16": [ + { "inputs": ["2", "75"], "output": "150" }, + { "inputs": ["11", "11"], "output": "121" }, + { "inputs": ["11", "11"], "output": "121" }, + { "inputs": ["11", "11"], "output": "121" } ], - "sub_euint256_euint32": [ - { "inputs": ["2775500374", "2775500374"], "output": "0" }, - { "inputs": ["2775500374", "2775500370"], "output": "4" } - ], - "sub_euint256_euint64": [ - { - "inputs": ["18445296154698553701", "18445296154698553701"], - "output": "0" - }, - { - "inputs": ["18445296154698553701", "18445296154698553697"], - "output": "4" - } - ], - "sub_euint256_euint128": [ - { - "inputs": ["340282366920938463463373776145256730539", "340282366920938463463373776145256730539"], - "output": "0" - }, - { - "inputs": ["340282366920938463463373776145256730539", "340282366920938463463373776145256730535"], - "output": "4" - } - ], - "sub_euint256_euint256": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579667871013646565", - "115792089237316195423570985008687907853269984665640564039457579667871013646565" - ], - "output": "0" - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579667871013646565", - "115792089237316195423570985008687907853269984665640564039457579667871013646561" - ], - "output": "4" - } - ], - "sub_euint256_uint256": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579667871013646565", - "115792089237316195423570985008687907853269984665640564039457579667871013646565" - ], - "output": "0" - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579667871013646565", - "115792089237316195423570985008687907853269984665640564039457579667871013646561" - ], - "output": "4" - } - ], - "sub_uint256_euint256": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579667871013646565", - "115792089237316195423570985008687907853269984665640564039457579667871013646565" - ], - "output": "0" - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579667871013646565", - "115792089237316195423570985008687907853269984665640564039457579667871013646561" - ], - "output": "4" - } - ], - "mul_euint4_euint4": [ - { "inputs": ["1", "7"], "output": "7" }, - { "inputs": ["3", "5"], "output": "15" }, - { "inputs": ["3", "3"], "output": "9" }, - { "inputs": ["5", "3"], "output": "15" } - ], - "mul_euint4_euint8": [ - { "inputs": ["2", "5"], "output": "10" }, - { "inputs": ["3", "5"], "output": "15" }, - { "inputs": ["3", "3"], "output": "9" }, - { "inputs": ["5", "3"], "output": "15" } - ], - "mul_euint4_uint8": [ - { "inputs": ["3", "4"], "output": "12" }, - { "inputs": ["3", "5"], "output": "15" }, - { "inputs": ["3", "3"], "output": "9" }, - { "inputs": ["5", "3"], "output": "15" } - ], - "mul_euint4_euint16": [ - { "inputs": ["2", "6"], "output": "12" }, - { "inputs": ["3", "5"], "output": "15" }, - { "inputs": ["3", "3"], "output": "9" }, - { "inputs": ["5", "3"], "output": "15" } - ], - "mul_euint4_euint32": [ - { "inputs": ["2", "5"], "output": "10" }, - { "inputs": ["3", "4"], "output": "12" }, - { "inputs": ["3", "3"], "output": "9" }, - { "inputs": ["4", "3"], "output": "12" } - ], - "mul_euint4_euint64": [ - { "inputs": ["2", "5"], "output": "10" }, - { "inputs": ["3", "5"], "output": "15" }, - { "inputs": ["3", "3"], "output": "9" }, - { "inputs": ["5", "3"], "output": "15" } - ], - "mul_euint4_euint128": [ - { "inputs": ["2", "5"], "output": "10" }, - { "inputs": ["3", "3"], "output": "9" }, - { "inputs": ["3", "3"], "output": "9" }, - { "inputs": ["3", "3"], "output": "9" } - ], - "mul_euint4_euint256": [ - { "inputs": ["2", "5"], "output": "10" }, - { "inputs": ["3", "5"], "output": "15" }, - { "inputs": ["3", "3"], "output": "9" }, - { "inputs": ["5", "3"], "output": "15" } - ], - "mul_euint8_euint4": [ - { "inputs": ["7", "2"], "output": "14" }, - { "inputs": ["3", "5"], "output": "15" }, - { "inputs": ["3", "3"], "output": "9" }, - { "inputs": ["5", "3"], "output": "15" } - ], - "mul_uint8_euint4": [ - { "inputs": ["2", "4"], "output": "8" }, - { "inputs": ["3", "5"], "output": "15" }, - { "inputs": ["3", "3"], "output": "9" }, - { "inputs": ["5", "3"], "output": "15" } - ], - "mul_euint8_euint8": [ - { "inputs": ["8", "12"], "output": "96" }, - { "inputs": ["12", "14"], "output": "168" }, - { "inputs": ["14", "14"], "output": "196" }, - { "inputs": ["14", "12"], "output": "168" } - ], - "mul_euint8_uint8": [ - { "inputs": ["14", "6"], "output": "84" }, - { "inputs": ["12", "14"], "output": "168" }, - { "inputs": ["14", "14"], "output": "196" }, - { "inputs": ["14", "12"], "output": "168" } - ], - "mul_uint8_euint8": [ - { "inputs": ["12", "11"], "output": "132" }, - { "inputs": ["12", "14"], "output": "168" }, - { "inputs": ["14", "14"], "output": "196" }, - { "inputs": ["14", "12"], "output": "168" } - ], - "mul_euint8_euint16": [ - { "inputs": ["2", "60"], "output": "120" }, - { "inputs": ["13", "13"], "output": "169" }, - { "inputs": ["13", "13"], "output": "169" }, - { "inputs": ["13", "13"], "output": "169" } - ], - "mul_euint8_euint32": [ - { "inputs": ["2", "79"], "output": "158" }, - { "inputs": ["10", "14"], "output": "140" }, - { "inputs": ["14", "14"], "output": "196" }, - { "inputs": ["14", "10"], "output": "140" } + "mul_euint8_euint32": [ + { "inputs": ["2", "111"], "output": "222" }, + { "inputs": ["10", "10"], "output": "100" }, + { "inputs": ["10", "10"], "output": "100" }, + { "inputs": ["10", "10"], "output": "100" } ], "mul_euint8_euint64": [ { "inputs": ["2", "65"], "output": "130" }, - { "inputs": ["8", "10"], "output": "80" }, - { "inputs": ["10", "10"], "output": "100" }, - { "inputs": ["10", "8"], "output": "80" } + { "inputs": ["15", "15"], "output": "225" }, + { "inputs": ["15", "15"], "output": "225" }, + { "inputs": ["15", "15"], "output": "225" } ], "mul_euint8_euint128": [ { "inputs": ["2", "65"], "output": "130" }, - { "inputs": ["9", "10"], "output": "90" }, - { "inputs": ["10", "10"], "output": "100" }, - { "inputs": ["10", "9"], "output": "90" } - ], - "mul_euint8_euint256": [ - { "inputs": ["2", "65"], "output": "130" }, - { "inputs": ["4", "8"], "output": "32" }, - { "inputs": ["8", "8"], "output": "64" }, - { "inputs": ["8", "4"], "output": "32" } - ], - "mul_euint16_euint4": [ - { "inputs": ["5", "2"], "output": "10" }, - { "inputs": ["3", "5"], "output": "15" }, - { "inputs": ["3", "3"], "output": "9" }, - { "inputs": ["5", "3"], "output": "15" } + { "inputs": ["13", "14"], "output": "182" }, + { "inputs": ["14", "14"], "output": "196" }, + { "inputs": ["14", "13"], "output": "182" } ], "mul_euint16_euint8": [ - { "inputs": ["87", "2"], "output": "174" }, - { "inputs": ["9", "10"], "output": "90" }, - { "inputs": ["10", "10"], "output": "100" }, - { "inputs": ["10", "9"], "output": "90" } + { "inputs": ["82", "3"], "output": "246" }, + { "inputs": ["12", "12"], "output": "144" }, + { "inputs": ["12", "12"], "output": "144" }, + { "inputs": ["12", "12"], "output": "144" } ], "mul_euint16_euint16": [ - { "inputs": ["117", "200"], "output": "23400" }, - { "inputs": ["233", "233"], "output": "54289" }, - { "inputs": ["233", "233"], "output": "54289" }, - { "inputs": ["233", "233"], "output": "54289" } + { "inputs": ["158", "189"], "output": "29862" }, + { "inputs": ["158", "158"], "output": "24964" }, + { "inputs": ["158", "158"], "output": "24964" }, + { "inputs": ["158", "158"], "output": "24964" } ], "mul_euint16_uint16": [ - { "inputs": ["233", "168"], "output": "39144" }, - { "inputs": ["233", "233"], "output": "54289" }, - { "inputs": ["233", "233"], "output": "54289" }, - { "inputs": ["233", "233"], "output": "54289" } + { "inputs": ["314", "60"], "output": "18840" }, + { "inputs": ["158", "158"], "output": "24964" }, + { "inputs": ["158", "158"], "output": "24964" }, + { "inputs": ["158", "158"], "output": "24964" } ], "mul_uint16_euint16": [ - { "inputs": ["140", "168"], "output": "23520" }, - { "inputs": ["233", "233"], "output": "54289" }, - { "inputs": ["233", "233"], "output": "54289" }, - { "inputs": ["233", "233"], "output": "54289" } + { "inputs": ["231", "119"], "output": "27489" }, + { "inputs": ["158", "158"], "output": "24964" }, + { "inputs": ["158", "158"], "output": "24964" }, + { "inputs": ["158", "158"], "output": "24964" } ], "mul_euint16_euint32": [ - { "inputs": ["2", "27164"], "output": "54328" }, - { "inputs": ["244", "244"], "output": "59536" }, - { "inputs": ["244", "244"], "output": "59536" }, - { "inputs": ["244", "244"], "output": "59536" } + { "inputs": ["2", "22653"], "output": "45306" }, + { "inputs": ["167", "167"], "output": "27889" }, + { "inputs": ["167", "167"], "output": "27889" }, + { "inputs": ["167", "167"], "output": "27889" } ], "mul_euint16_euint64": [ - { "inputs": ["2", "32755"], "output": "65510" }, - { "inputs": ["216", "216"], "output": "46656" }, - { "inputs": ["216", "216"], "output": "46656" }, - { "inputs": ["216", "216"], "output": "46656" } + { "inputs": ["2", "32763"], "output": "65526" }, + { "inputs": ["147", "147"], "output": "21609" }, + { "inputs": ["147", "147"], "output": "21609" }, + { "inputs": ["147", "147"], "output": "21609" } ], "mul_euint16_euint128": [ { "inputs": ["2", "16385"], "output": "32770" }, - { "inputs": ["206", "206"], "output": "42436" }, - { "inputs": ["206", "206"], "output": "42436" }, - { "inputs": ["206", "206"], "output": "42436" } - ], - "mul_euint16_euint256": [ - { "inputs": ["2", "16385"], "output": "32770" }, - { "inputs": ["228", "228"], "output": "51984" }, - { "inputs": ["228", "228"], "output": "51984" }, - { "inputs": ["228", "228"], "output": "51984" } - ], - "mul_euint32_euint4": [ - { "inputs": ["6", "2"], "output": "12" }, - { "inputs": ["3", "5"], "output": "15" }, - { "inputs": ["3", "3"], "output": "9" }, - { "inputs": ["5", "3"], "output": "15" } + { "inputs": ["169", "169"], "output": "28561" }, + { "inputs": ["169", "169"], "output": "28561" }, + { "inputs": ["169", "169"], "output": "28561" } ], "mul_euint32_euint8": [ - { "inputs": ["114", "2"], "output": "228" }, + { "inputs": ["83", "2"], "output": "166" }, { "inputs": ["15", "16"], "output": "240" }, { "inputs": ["9", "9"], "output": "81" }, { "inputs": ["16", "15"], "output": "240" } ], "mul_euint32_euint16": [ - { "inputs": ["30224", "2"], "output": "60448" }, - { "inputs": ["160", "160"], "output": "25600" }, - { "inputs": ["160", "160"], "output": "25600" }, - { "inputs": ["160", "160"], "output": "25600" } + { "inputs": ["30558", "2"], "output": "61116" }, + { "inputs": ["204", "204"], "output": "41616" }, + { "inputs": ["204", "204"], "output": "41616" }, + { "inputs": ["204", "204"], "output": "41616" } ], "mul_euint32_euint32": [ - { "inputs": ["96111", "23856"], "output": "2292824016" }, - { "inputs": ["47710", "47710"], "output": "2276244100" }, - { "inputs": ["47710", "47710"], "output": "2276244100" }, - { "inputs": ["47710", "47710"], "output": "2276244100" } + { "inputs": ["64612", "43519"], "output": "2811849628" }, + { "inputs": ["43519", "43519"], "output": "1893903361" }, + { "inputs": ["43519", "43519"], "output": "1893903361" }, + { "inputs": ["43519", "43519"], "output": "1893903361" } ], "mul_euint32_uint32": [ - { "inputs": ["48056", "45037"], "output": "2164298072" }, - { "inputs": ["47710", "47710"], "output": "2276244100" }, - { "inputs": ["47710", "47710"], "output": "2276244100" }, - { "inputs": ["47710", "47710"], "output": "2276244100" } + { "inputs": ["64612", "55230"], "output": "3568520760" }, + { "inputs": ["43519", "43519"], "output": "1893903361" }, + { "inputs": ["43519", "43519"], "output": "1893903361" }, + { "inputs": ["43519", "43519"], "output": "1893903361" } ], "mul_uint32_euint32": [ - { "inputs": ["25623", "45037"], "output": "1153983051" }, - { "inputs": ["47710", "47710"], "output": "2276244100" }, - { "inputs": ["47710", "47710"], "output": "2276244100" }, - { "inputs": ["47710", "47710"], "output": "2276244100" } + { "inputs": ["27553", "55230"], "output": "1521752190" }, + { "inputs": ["43519", "43519"], "output": "1893903361" }, + { "inputs": ["43519", "43519"], "output": "1893903361" }, + { "inputs": ["43519", "43519"], "output": "1893903361" } ], "mul_euint32_euint64": [ - { "inputs": ["2", "2146877501"], "output": "4293755002" }, - { "inputs": ["43587", "43587"], "output": "1899826569" }, - { "inputs": ["43587", "43587"], "output": "1899826569" }, - { "inputs": ["43587", "43587"], "output": "1899826569" } + { "inputs": ["2", "2146777724"], "output": "4293555448" }, + { "inputs": ["37567", "37567"], "output": "1411279489" }, + { "inputs": ["37567", "37567"], "output": "1411279489" }, + { "inputs": ["37567", "37567"], "output": "1411279489" } ], "mul_euint32_euint128": [ { "inputs": ["2", "1073741825"], "output": "2147483650" }, - { "inputs": ["63676", "63676"], "output": "4054632976" }, - { "inputs": ["63676", "63676"], "output": "4054632976" }, - { "inputs": ["63676", "63676"], "output": "4054632976" } - ], - "mul_euint32_euint256": [ - { "inputs": ["2", "1073741825"], "output": "2147483650" }, - { "inputs": ["59596", "59596"], "output": "3551683216" }, - { "inputs": ["59596", "59596"], "output": "3551683216" }, - { "inputs": ["59596", "59596"], "output": "3551683216" } - ], - "mul_euint64_euint4": [ - { "inputs": ["5", "2"], "output": "10" }, - { "inputs": ["3", "5"], "output": "15" }, - { "inputs": ["3", "3"], "output": "9" }, - { "inputs": ["5", "3"], "output": "15" } + { "inputs": ["59155", "59155"], "output": "3499314025" }, + { "inputs": ["59155", "59155"], "output": "3499314025" }, + { "inputs": ["59155", "59155"], "output": "3499314025" } ], "mul_euint64_euint8": [ { "inputs": ["65", "2"], "output": "130" }, - { "inputs": ["12", "13"], "output": "156" }, - { "inputs": ["13", "13"], "output": "169" }, - { "inputs": ["13", "12"], "output": "156" } + { "inputs": ["9", "9"], "output": "81" }, + { "inputs": ["9", "9"], "output": "81" }, + { "inputs": ["9", "9"], "output": "81" } ], "mul_euint64_euint16": [ - { "inputs": ["32754", "2"], "output": "65508" }, - { "inputs": ["191", "191"], "output": "36481" }, - { "inputs": ["191", "191"], "output": "36481" }, - { "inputs": ["191", "191"], "output": "36481" } + { "inputs": ["32758", "2"], "output": "65516" }, + { "inputs": ["187", "187"], "output": "34969" }, + { "inputs": ["187", "187"], "output": "34969" }, + { "inputs": ["187", "187"], "output": "34969" } ], "mul_euint64_euint32": [ - { "inputs": ["2147463302", "2"], "output": "4294926604" }, - { "inputs": ["62313", "62313"], "output": "3882909969" }, - { "inputs": ["62313", "62313"], "output": "3882909969" }, - { "inputs": ["62313", "62313"], "output": "3882909969" } + { "inputs": ["2146759087", "2"], "output": "4293518174" }, + { "inputs": ["37371", "37371"], "output": "1396591641" }, + { "inputs": ["37371", "37371"], "output": "1396591641" }, + { "inputs": ["37371", "37371"], "output": "1396591641" } ], "mul_euint64_euint64": [ - { - "inputs": ["4294482875", "4294789499"], - "output": "18443899955185329625" - }, - { - "inputs": ["4294482875", "4294482875"], - "output": "18442583163668265625" - }, - { - "inputs": ["4294482875", "4294482875"], - "output": "18442583163668265625" - }, - { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" } + { "inputs": ["4293254104", "4293612295"], "output": "18433568606493608680" }, + { "inputs": ["4293254104", "4293254104"], "output": "18432030801512842816" }, + { "inputs": ["4293254104", "4293254104"], "output": "18432030801512842816" }, + { "inputs": ["4293254104", "4293254104"], "output": "18432030801512842816" } ], "mul_euint64_uint64": [ - { - "inputs": ["4294482875", "4294108167"], - "output": "18440973986579140125" - }, - { - "inputs": ["4294482875", "4294482875"], - "output": "18442583163668265625" - }, - { - "inputs": ["4294482875", "4294482875"], - "output": "18442583163668265625" - }, - { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" } + { "inputs": ["4293254104", "4293126895"], "output": "18431484660951527080" }, + { "inputs": ["4293254104", "4293254104"], "output": "18432030801512842816" }, + { "inputs": ["4293254104", "4293254104"], "output": "18432030801512842816" }, + { "inputs": ["4293254104", "4293254104"], "output": "18432030801512842816" } ], "mul_uint64_euint64": [ - { - "inputs": ["4293014414", "4294108167"], - "output": "18434668256206119138" - }, - { - "inputs": ["4294482875", "4294482875"], - "output": "18442583163668265625" - }, - { - "inputs": ["4294482875", "4294482875"], - "output": "18442583163668265625" - }, - { "inputs": ["4294482875", "4294482875"], "output": "18442583163668265625" } + { "inputs": ["4294802282", "4293126895"], "output": "18438131185561574390" }, + { "inputs": ["4293254104", "4293254104"], "output": "18432030801512842816" }, + { "inputs": ["4293254104", "4293254104"], "output": "18432030801512842816" }, + { "inputs": ["4293254104", "4293254104"], "output": "18432030801512842816" } ], "mul_euint64_euint128": [ { "inputs": ["2", "4611686018427387905"], "output": "9223372036854775810" }, - { - "inputs": ["4293652736", "4293652736"], - "output": "18435453817360285696" - }, - { - "inputs": ["4293652736", "4293652736"], - "output": "18435453817360285696" - }, - { "inputs": ["4293652736", "4293652736"], "output": "18435453817360285696" } - ], - "mul_euint64_euint256": [ - { "inputs": ["2", "4611686018427387905"], "output": "9223372036854775810" }, - { - "inputs": ["4292932541", "4292932541"], - "output": "18429269801576716681" - }, - { - "inputs": ["4292932541", "4292932541"], - "output": "18429269801576716681" - }, - { "inputs": ["4292932541", "4292932541"], "output": "18429269801576716681" } - ], - "mul_euint128_euint4": [ - { "inputs": ["5", "2"], "output": "10" }, - { "inputs": ["3", "4"], "output": "12" }, - { "inputs": ["3", "3"], "output": "9" }, - { "inputs": ["4", "3"], "output": "12" } + { "inputs": ["4294743110", "4294743110"], "output": "18444818380892472100" }, + { "inputs": ["4294743110", "4294743110"], "output": "18444818380892472100" }, + { "inputs": ["4294743110", "4294743110"], "output": "18444818380892472100" } ], "mul_euint128_euint8": [ { "inputs": ["65", "2"], "output": "130" }, @@ -1264,8103 +561,4194 @@ ], "mul_euint128_euint16": [ { "inputs": ["16385", "2"], "output": "32770" }, - { "inputs": ["233", "233"], "output": "54289" }, - { "inputs": ["233", "233"], "output": "54289" }, - { "inputs": ["233", "233"], "output": "54289" } + { "inputs": ["209", "209"], "output": "43681" }, + { "inputs": ["209", "209"], "output": "43681" }, + { "inputs": ["209", "209"], "output": "43681" } ], "mul_euint128_euint32": [ { "inputs": ["1073741825", "2"], "output": "2147483650" }, - { "inputs": ["46331", "46331"], "output": "2146561561" }, - { "inputs": ["46331", "46331"], "output": "2146561561" }, - { "inputs": ["46331", "46331"], "output": "2146561561" } + { "inputs": ["50332", "50332"], "output": "2533310224" }, + { "inputs": ["50332", "50332"], "output": "2533310224" }, + { "inputs": ["50332", "50332"], "output": "2533310224" } ], "mul_euint128_euint64": [ { "inputs": ["4611686018427387905", "2"], "output": "9223372036854775810" }, - { - "inputs": ["4294304633", "4294304633"], - "output": "18441052281005264689" - }, - { - "inputs": ["4294304633", "4294304633"], - "output": "18441052281005264689" - }, - { "inputs": ["4294304633", "4294304633"], "output": "18441052281005264689" } + { "inputs": ["4293710558", "4293710558"], "output": "18435950355880671364" }, + { "inputs": ["4293710558", "4293710558"], "output": "18435950355880671364" }, + { "inputs": ["4293710558", "4293710558"], "output": "18435950355880671364" } ], "mul_euint128_euint128": [ - { - "inputs": ["9223372036854775809", "9223372036854775809"], - "output": "85070591730234615884290395931651604481" - }, - { - "inputs": ["9223372036854775809", "9223372036854775809"], - "output": "85070591730234615884290395931651604481" - }, - { - "inputs": ["9223372036854775809", "9223372036854775809"], - "output": "85070591730234615884290395931651604481" - }, - { - "inputs": ["9223372036854775809", "9223372036854775809"], - "output": "85070591730234615884290395931651604481" - } + { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" }, + { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" }, + { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" }, + { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" } ], "mul_euint128_uint128": [ - { - "inputs": ["9223372036854775809", "9223372036854775809"], - "output": "85070591730234615884290395931651604481" - }, - { - "inputs": ["9223372036854775809", "9223372036854775809"], - "output": "85070591730234615884290395931651604481" - }, - { - "inputs": ["9223372036854775809", "9223372036854775809"], - "output": "85070591730234615884290395931651604481" - }, - { - "inputs": ["9223372036854775809", "9223372036854775809"], - "output": "85070591730234615884290395931651604481" - } + { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" }, + { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" }, + { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" }, + { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" } ], "mul_uint128_euint128": [ - { - "inputs": ["9223372036854775809", "9223372036854775809"], - "output": "85070591730234615884290395931651604481" - }, - { - "inputs": ["9223372036854775809", "9223372036854775809"], - "output": "85070591730234615884290395931651604481" - }, - { - "inputs": ["9223372036854775809", "9223372036854775809"], - "output": "85070591730234615884290395931651604481" - }, - { - "inputs": ["9223372036854775809", "9223372036854775809"], - "output": "85070591730234615884290395931651604481" - } + { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" }, + { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" }, + { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" }, + { "inputs": ["9223372036854775809", "9223372036854775809"], "output": "85070591730234615884290395931651604481" } ], - "mul_euint128_euint256": [ - { - "inputs": ["2", "85070591730234615865843651857942052865"], - "output": "170141183460469231731687303715884105730" - }, - { - "inputs": ["9223372036854775809", "9223372036854775809"], - "output": "85070591730234615884290395931651604481" - }, - { - "inputs": ["9223372036854775809", "9223372036854775809"], - "output": "85070591730234615884290395931651604481" - }, - { - "inputs": ["9223372036854775809", "9223372036854775809"], - "output": "85070591730234615884290395931651604481" - } + "div_euint8_uint8": [ + { "inputs": ["195", "15"], "output": "13" }, + { "inputs": ["132", "136"], "output": "0" }, + { "inputs": ["136", "136"], "output": "1" }, + { "inputs": ["136", "132"], "output": "1" } ], - "mul_euint256_euint4": [ - { "inputs": ["5", "2"], "output": "10" }, - { "inputs": ["3", "5"], "output": "15" }, - { "inputs": ["3", "3"], "output": "9" }, - { "inputs": ["5", "3"], "output": "15" } + "div_euint16_uint16": [ + { "inputs": ["57739", "4746"], "output": "12" }, + { "inputs": ["40623", "40627"], "output": "0" }, + { "inputs": ["40627", "40627"], "output": "1" }, + { "inputs": ["40627", "40623"], "output": "1" } ], - "mul_euint256_euint8": [ - { "inputs": ["65", "2"], "output": "130" }, - { "inputs": ["13", "14"], "output": "182" }, - { "inputs": ["14", "14"], "output": "196" }, - { "inputs": ["14", "13"], "output": "182" } + "div_euint32_uint32": [ + { "inputs": ["1363446085", "3649881051"], "output": "0" }, + { "inputs": ["1363446081", "1363446085"], "output": "0" }, + { "inputs": ["1363446085", "1363446085"], "output": "1" }, + { "inputs": ["1363446085", "1363446081"], "output": "1" } ], - "mul_euint256_euint16": [ - { "inputs": ["16385", "2"], "output": "32770" }, - { "inputs": ["233", "233"], "output": "54289" }, - { "inputs": ["233", "233"], "output": "54289" }, - { "inputs": ["233", "233"], "output": "54289" } + "div_euint64_uint64": [ + { "inputs": ["18440646836152690157", "18438103833113857629"], "output": "1" }, + { "inputs": ["18440646836152690153", "18440646836152690157"], "output": "0" }, + { "inputs": ["18440646836152690157", "18440646836152690157"], "output": "1" }, + { "inputs": ["18440646836152690157", "18440646836152690153"], "output": "1" } ], - "mul_euint256_euint32": [ - { "inputs": ["1073741825", "2"], "output": "2147483650" }, - { "inputs": ["60165", "60165"], "output": "3619827225" }, - { "inputs": ["60165", "60165"], "output": "3619827225" }, - { "inputs": ["60165", "60165"], "output": "3619827225" } + "div_euint128_uint128": [ + { "inputs": ["340282366920938463463374322587192683391", "340282366920938463463372741886609497051"], "output": "1" }, + { "inputs": ["340282366920938463463370776661314054357", "340282366920938463463370776661314054361"], "output": "0" }, + { "inputs": ["340282366920938463463370776661314054361", "340282366920938463463370776661314054361"], "output": "1" }, + { "inputs": ["340282366920938463463370776661314054361", "340282366920938463463370776661314054357"], "output": "1" } ], - "mul_euint256_euint64": [ - { "inputs": ["4611686018427387905", "2"], "output": "9223372036854775810" }, - { - "inputs": ["4292912378", "4292912378"], - "output": "18429096685185614884" - }, - { - "inputs": ["4292912378", "4292912378"], - "output": "18429096685185614884" - }, - { "inputs": ["4292912378", "4292912378"], "output": "18429096685185614884" } + "rem_euint8_uint8": [ + { "inputs": ["60", "52"], "output": "8" }, + { "inputs": ["56", "60"], "output": "56" }, + { "inputs": ["60", "60"], "output": "0" }, + { "inputs": ["60", "56"], "output": "4" } ], - "mul_euint256_euint128": [ - { - "inputs": ["85070591730234615865843651857942052865", "2"], - "output": "170141183460469231731687303715884105730" - }, + "rem_euint16_uint16": [ + { "inputs": ["46301", "41035"], "output": "5266" }, + { "inputs": ["13685", "13689"], "output": "13685" }, + { "inputs": ["13689", "13689"], "output": "0" }, + { "inputs": ["13689", "13685"], "output": "4" } + ], + "rem_euint32_uint32": [ + { "inputs": ["776989572", "1250036493"], "output": "776989572" }, + { "inputs": ["776989568", "776989572"], "output": "776989568" }, + { "inputs": ["776989572", "776989572"], "output": "0" }, + { "inputs": ["776989572", "776989568"], "output": "4" } + ], + "rem_euint64_uint64": [ + { "inputs": ["18446365514936997281", "18444514768344696103"], "output": "1850746592301178" }, + { "inputs": ["18443475369477407605", "18443475369477407609"], "output": "18443475369477407605" }, + { "inputs": ["18443475369477407609", "18443475369477407609"], "output": "0" }, + { "inputs": ["18443475369477407609", "18443475369477407605"], "output": "4" } + ], + "rem_euint128_uint128": [ { - "inputs": ["9223372036854775809", "9223372036854775809"], - "output": "85070591730234615884290395931651604481" + "inputs": ["340282366920938463463370370169883706125", "340282366920938463463370231193739517089"], + "output": "138976144189036" }, { - "inputs": ["9223372036854775809", "9223372036854775809"], - "output": "85070591730234615884290395931651604481" + "inputs": ["340282366920938463463370370169883706121", "340282366920938463463370370169883706125"], + "output": "340282366920938463463370370169883706121" }, - { - "inputs": ["9223372036854775809", "9223372036854775809"], - "output": "85070591730234615884290395931651604481" - } + { "inputs": ["340282366920938463463370370169883706125", "340282366920938463463370370169883706125"], "output": "0" }, + { "inputs": ["340282366920938463463370370169883706125", "340282366920938463463370370169883706121"], "output": "4" } + ], + "le_euint8_euint8": [ + { "inputs": ["39", "157"], "output": true }, + { "inputs": ["35", "39"], "output": true }, + { "inputs": ["39", "39"], "output": true }, + { "inputs": ["39", "35"], "output": false } + ], + "le_euint8_uint8": [ + { "inputs": ["39", "142"], "output": true }, + { "inputs": ["35", "39"], "output": true }, + { "inputs": ["39", "39"], "output": true }, + { "inputs": ["39", "35"], "output": false } + ], + "le_uint8_euint8": [ + { "inputs": ["66", "142"], "output": true }, + { "inputs": ["35", "39"], "output": true }, + { "inputs": ["39", "39"], "output": true }, + { "inputs": ["39", "35"], "output": false } + ], + "le_euint8_euint16": [ + { "inputs": ["236", "55098"], "output": true }, + { "inputs": ["232", "236"], "output": true }, + { "inputs": ["236", "236"], "output": true }, + { "inputs": ["236", "232"], "output": false } + ], + "le_euint8_euint32": [ + { "inputs": ["72", "758251877"], "output": true }, + { "inputs": ["68", "72"], "output": true }, + { "inputs": ["72", "72"], "output": true }, + { "inputs": ["72", "68"], "output": false } + ], + "le_euint8_euint64": [ + { "inputs": ["11", "18437972223771147543"], "output": true }, + { "inputs": ["7", "11"], "output": true }, + { "inputs": ["11", "11"], "output": true }, + { "inputs": ["11", "7"], "output": false } + ], + "le_euint8_euint128": [ + { "inputs": ["219", "340282366920938463463366265507713033021"], "output": true }, + { "inputs": ["215", "219"], "output": true }, + { "inputs": ["219", "219"], "output": true }, + { "inputs": ["219", "215"], "output": false } + ], + "le_euint16_euint8": [ + { "inputs": ["34870", "99"], "output": false }, + { "inputs": ["95", "99"], "output": true }, + { "inputs": ["99", "99"], "output": true }, + { "inputs": ["99", "95"], "output": false } + ], + "le_euint16_euint16": [ + { "inputs": ["38345", "16194"], "output": false }, + { "inputs": ["16190", "16194"], "output": true }, + { "inputs": ["16194", "16194"], "output": true }, + { "inputs": ["16194", "16190"], "output": false } + ], + "le_euint16_uint16": [ + { "inputs": ["38345", "42460"], "output": true }, + { "inputs": ["16190", "16194"], "output": true }, + { "inputs": ["16194", "16194"], "output": true }, + { "inputs": ["16194", "16190"], "output": false } + ], + "le_uint16_euint16": [ + { "inputs": ["51054", "42460"], "output": false }, + { "inputs": ["16190", "16194"], "output": true }, + { "inputs": ["16194", "16194"], "output": true }, + { "inputs": ["16194", "16190"], "output": false } + ], + "le_euint16_euint32": [ + { "inputs": ["29474", "3219516439"], "output": true }, + { "inputs": ["29470", "29474"], "output": true }, + { "inputs": ["29474", "29474"], "output": true }, + { "inputs": ["29474", "29470"], "output": false } + ], + "le_euint16_euint64": [ + { "inputs": ["29106", "18442806822823999673"], "output": true }, + { "inputs": ["29102", "29106"], "output": true }, + { "inputs": ["29106", "29106"], "output": true }, + { "inputs": ["29106", "29102"], "output": false } + ], + "le_euint16_euint128": [ + { "inputs": ["7170", "340282366920938463463366074008751282463"], "output": true }, + { "inputs": ["7166", "7170"], "output": true }, + { "inputs": ["7170", "7170"], "output": true }, + { "inputs": ["7170", "7166"], "output": false } + ], + "le_euint32_euint8": [ + { "inputs": ["1930732229", "195"], "output": false }, + { "inputs": ["191", "195"], "output": true }, + { "inputs": ["195", "195"], "output": true }, + { "inputs": ["195", "191"], "output": false } + ], + "le_euint32_euint16": [ + { "inputs": ["2664331870", "23178"], "output": false }, + { "inputs": ["23174", "23178"], "output": true }, + { "inputs": ["23178", "23178"], "output": true }, + { "inputs": ["23178", "23174"], "output": false } + ], + "le_euint32_euint32": [ + { "inputs": ["2863625950", "4192865811"], "output": true }, + { "inputs": ["2863625946", "2863625950"], "output": true }, + { "inputs": ["2863625950", "2863625950"], "output": true }, + { "inputs": ["2863625950", "2863625946"], "output": false } + ], + "le_euint32_uint32": [ + { "inputs": ["2863625950", "798702437"], "output": false }, + { "inputs": ["2863625946", "2863625950"], "output": true }, + { "inputs": ["2863625950", "2863625950"], "output": true }, + { "inputs": ["2863625950", "2863625946"], "output": false } + ], + "le_uint32_euint32": [ + { "inputs": ["157142361", "798702437"], "output": true }, + { "inputs": ["2863625946", "2863625950"], "output": true }, + { "inputs": ["2863625950", "2863625950"], "output": true }, + { "inputs": ["2863625950", "2863625946"], "output": false } + ], + "le_euint32_euint64": [ + { "inputs": ["215623253", "18445295311260044567"], "output": true }, + { "inputs": ["215623249", "215623253"], "output": true }, + { "inputs": ["215623253", "215623253"], "output": true }, + { "inputs": ["215623253", "215623249"], "output": false } + ], + "le_euint32_euint128": [ + { "inputs": ["1568015631", "340282366920938463463374286021638126829"], "output": true }, + { "inputs": ["1568015627", "1568015631"], "output": true }, + { "inputs": ["1568015631", "1568015631"], "output": true }, + { "inputs": ["1568015631", "1568015627"], "output": false } + ], + "le_euint64_euint8": [ + { "inputs": ["18437871768273129823", "131"], "output": false }, + { "inputs": ["127", "131"], "output": true }, + { "inputs": ["131", "131"], "output": true }, + { "inputs": ["131", "127"], "output": false } + ], + "le_euint64_euint16": [ + { "inputs": ["18439152659591216685", "55506"], "output": false }, + { "inputs": ["55502", "55506"], "output": true }, + { "inputs": ["55506", "55506"], "output": true }, + { "inputs": ["55506", "55502"], "output": false } + ], + "le_euint64_euint32": [ + { "inputs": ["18445892208919425787", "3177314053"], "output": false }, + { "inputs": ["3177314049", "3177314053"], "output": true }, + { "inputs": ["3177314053", "3177314053"], "output": true }, + { "inputs": ["3177314053", "3177314049"], "output": false } ], - "mul_euint256_euint256": [ + "le_euint64_euint64": [ + { "inputs": ["18438238801869078835", "18442593177036192671"], "output": true }, + { "inputs": ["18438238801869078831", "18438238801869078835"], "output": true }, + { "inputs": ["18438238801869078835", "18438238801869078835"], "output": true }, + { "inputs": ["18438238801869078835", "18438238801869078831"], "output": false } + ], + "le_euint64_uint64": [ + { "inputs": ["18438238801869078835", "18440816070541543123"], "output": true }, + { "inputs": ["18438238801869078831", "18438238801869078835"], "output": true }, + { "inputs": ["18438238801869078835", "18438238801869078835"], "output": true }, + { "inputs": ["18438238801869078835", "18438238801869078831"], "output": false } + ], + "le_uint64_euint64": [ + { "inputs": ["18443140294712249967", "18440816070541543123"], "output": false }, + { "inputs": ["18438238801869078831", "18438238801869078835"], "output": true }, + { "inputs": ["18438238801869078835", "18438238801869078835"], "output": true }, + { "inputs": ["18438238801869078835", "18438238801869078831"], "output": false } + ], + "le_euint64_euint128": [ + { "inputs": ["18446277775807091475", "340282366920938463463369104932305896159"], "output": true }, + { "inputs": ["18446277775807091471", "18446277775807091475"], "output": true }, + { "inputs": ["18446277775807091475", "18446277775807091475"], "output": true }, + { "inputs": ["18446277775807091475", "18446277775807091471"], "output": false } + ], + "le_euint128_euint8": [ + { "inputs": ["340282366920938463463369723749966576711", "123"], "output": false }, + { "inputs": ["119", "123"], "output": true }, + { "inputs": ["123", "123"], "output": true }, + { "inputs": ["123", "119"], "output": false } + ], + "le_euint128_euint16": [ + { "inputs": ["340282366920938463463366493901488243473", "46970"], "output": false }, + { "inputs": ["46966", "46970"], "output": true }, + { "inputs": ["46970", "46970"], "output": true }, + { "inputs": ["46970", "46966"], "output": false } + ], + "le_euint128_euint32": [ + { "inputs": ["340282366920938463463371762180222329769", "2422228240"], "output": false }, + { "inputs": ["2422228236", "2422228240"], "output": true }, + { "inputs": ["2422228240", "2422228240"], "output": true }, + { "inputs": ["2422228240", "2422228236"], "output": false } + ], + "le_euint128_euint64": [ + { "inputs": ["340282366920938463463367247949545716773", "18444473108685392665"], "output": false }, + { "inputs": ["18444473108685392661", "18444473108685392665"], "output": true }, + { "inputs": ["18444473108685392665", "18444473108685392665"], "output": true }, + { "inputs": ["18444473108685392665", "18444473108685392661"], "output": false } + ], + "le_euint128_euint128": [ { - "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], - "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + "inputs": ["340282366920938463463370009314863091025", "340282366920938463463371617970688826001"], + "output": true }, { - "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], - "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + "inputs": ["340282366920938463463370009314863091021", "340282366920938463463370009314863091025"], + "output": true }, { - "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], - "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + "inputs": ["340282366920938463463370009314863091025", "340282366920938463463370009314863091025"], + "output": true }, { - "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], - "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + "inputs": ["340282366920938463463370009314863091025", "340282366920938463463370009314863091021"], + "output": false } ], - "mul_euint256_uint256": [ + "le_euint128_uint128": [ { - "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], - "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + "inputs": ["340282366920938463463370009314863091025", "340282366920938463463374519696507687579"], + "output": true }, { - "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], - "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + "inputs": ["340282366920938463463370009314863091021", "340282366920938463463370009314863091025"], + "output": true }, { - "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], - "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + "inputs": ["340282366920938463463370009314863091025", "340282366920938463463370009314863091025"], + "output": true }, { - "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], - "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + "inputs": ["340282366920938463463370009314863091025", "340282366920938463463370009314863091021"], + "output": false } ], - "mul_uint256_euint256": [ + "le_uint128_euint128": [ { - "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], - "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + "inputs": ["340282366920938463463373710078550862123", "340282366920938463463374519696507687579"], + "output": true }, { - "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], - "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + "inputs": ["340282366920938463463370009314863091021", "340282366920938463463370009314863091025"], + "output": true }, { - "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], - "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + "inputs": ["340282366920938463463370009314863091025", "340282366920938463463370009314863091025"], + "output": true }, { - "inputs": ["170141183460469231731687303715884105729", "170141183460469231731687303715884105729"], - "output": "28948022309329048855892746252171976963657778533331079473327770609410050621441" + "inputs": ["340282366920938463463370009314863091025", "340282366920938463463370009314863091021"], + "output": false } ], - "div_euint4_uint8": [ - { "inputs": ["14", "14"], "output": "1" }, - { "inputs": ["10", "14"], "output": "0" }, - { "inputs": ["14", "14"], "output": "1" }, - { "inputs": ["14", "10"], "output": "1" } + "lt_euint8_euint8": [ + { "inputs": ["188", "127"], "output": false }, + { "inputs": ["123", "127"], "output": true }, + { "inputs": ["127", "127"], "output": false }, + { "inputs": ["127", "123"], "output": false } ], - "div_euint8_uint8": [ - { "inputs": ["87", "167"], "output": "0" }, - { "inputs": ["31", "35"], "output": "0" }, - { "inputs": ["35", "35"], "output": "1" }, - { "inputs": ["35", "31"], "output": "1" } + "lt_euint8_uint8": [ + { "inputs": ["188", "199"], "output": true }, + { "inputs": ["123", "127"], "output": true }, + { "inputs": ["127", "127"], "output": false }, + { "inputs": ["127", "123"], "output": false } ], - "div_euint16_uint16": [ - { "inputs": ["20304", "59132"], "output": "0" }, - { "inputs": ["20300", "20304"], "output": "0" }, - { "inputs": ["20304", "20304"], "output": "1" }, - { "inputs": ["20304", "20300"], "output": "1" } + "lt_uint8_euint8": [ + { "inputs": ["104", "199"], "output": true }, + { "inputs": ["123", "127"], "output": true }, + { "inputs": ["127", "127"], "output": false }, + { "inputs": ["127", "123"], "output": false } ], - "div_euint32_uint32": [ - { "inputs": ["1492630984", "1624831749"], "output": "0" }, - { "inputs": ["1492630980", "1492630984"], "output": "0" }, - { "inputs": ["1492630984", "1492630984"], "output": "1" }, - { "inputs": ["1492630984", "1492630980"], "output": "1" } + "lt_euint8_euint16": [ + { "inputs": ["184", "35665"], "output": true }, + { "inputs": ["180", "184"], "output": true }, + { "inputs": ["184", "184"], "output": false }, + { "inputs": ["184", "180"], "output": false } ], - "div_euint64_uint64": [ - { - "inputs": ["18444804438871636581", "18440669978814863107"], - "output": "1" - }, - { - "inputs": ["18444804438871636577", "18444804438871636581"], - "output": "0" - }, - { - "inputs": ["18444804438871636581", "18444804438871636581"], - "output": "1" - }, - { - "inputs": ["18444804438871636581", "18444804438871636577"], - "output": "1" - } + "lt_euint8_euint32": [ + { "inputs": ["219", "1926208071"], "output": true }, + { "inputs": ["215", "219"], "output": true }, + { "inputs": ["219", "219"], "output": false }, + { "inputs": ["219", "215"], "output": false } ], - "div_euint128_uint128": [ - { - "inputs": ["340282366920938463463372619792959880891", "340282366920938463463368477899733272407"], - "output": "1" - }, - { - "inputs": ["340282366920938463463372619792959880887", "340282366920938463463372619792959880891"], - "output": "0" - }, - { - "inputs": ["340282366920938463463372619792959880891", "340282366920938463463372619792959880891"], - "output": "1" - }, - { - "inputs": ["340282366920938463463372619792959880891", "340282366920938463463372619792959880887"], - "output": "1" - } + "lt_euint8_euint64": [ + { "inputs": ["150", "18439040263626653957"], "output": true }, + { "inputs": ["146", "150"], "output": true }, + { "inputs": ["150", "150"], "output": false }, + { "inputs": ["150", "146"], "output": false } ], - "div_euint256_uint256": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457583310417243027629", - "115792089237316195423570985008687907853269984665640564039457577919950085050983" - ], - "output": "1" - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457576535097376895415", - "115792089237316195423570985008687907853269984665640564039457576535097376895419" - ], - "output": "0" - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457576535097376895419", - "115792089237316195423570985008687907853269984665640564039457576535097376895419" - ], - "output": "1" - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457576535097376895419", - "115792089237316195423570985008687907853269984665640564039457576535097376895415" - ], - "output": "1" - } + "lt_euint8_euint128": [ + { "inputs": ["216", "340282366920938463463367679852215623579"], "output": true }, + { "inputs": ["212", "216"], "output": true }, + { "inputs": ["216", "216"], "output": false }, + { "inputs": ["216", "212"], "output": false } ], - "rem_euint4_uint8": [ - { "inputs": ["13", "2"], "output": "1" }, - { "inputs": ["9", "13"], "output": "9" }, - { "inputs": ["13", "13"], "output": "0" }, - { "inputs": ["13", "9"], "output": "4" } + "lt_euint16_euint8": [ + { "inputs": ["61321", "109"], "output": false }, + { "inputs": ["105", "109"], "output": true }, + { "inputs": ["109", "109"], "output": false }, + { "inputs": ["109", "105"], "output": false } ], - "rem_euint8_uint8": [ - { "inputs": ["85", "232"], "output": "85" }, - { "inputs": ["38", "42"], "output": "38" }, - { "inputs": ["42", "42"], "output": "0" }, - { "inputs": ["42", "38"], "output": "4" } + "lt_euint16_euint16": [ + { "inputs": ["56967", "57505"], "output": true }, + { "inputs": ["56963", "56967"], "output": true }, + { "inputs": ["56967", "56967"], "output": false }, + { "inputs": ["56967", "56963"], "output": false } ], - "rem_euint16_uint16": [ - { "inputs": ["41581", "40239"], "output": "1342" }, - { "inputs": ["40817", "40821"], "output": "40817" }, - { "inputs": ["40821", "40821"], "output": "0" }, - { "inputs": ["40821", "40817"], "output": "4" } + "lt_euint16_uint16": [ + { "inputs": ["56967", "61431"], "output": true }, + { "inputs": ["56963", "56967"], "output": true }, + { "inputs": ["56967", "56967"], "output": false }, + { "inputs": ["56967", "56963"], "output": false } ], - "rem_euint32_uint32": [ - { "inputs": ["631407091", "2150413493"], "output": "631407091" }, - { "inputs": ["631407087", "631407091"], "output": "631407087" }, - { "inputs": ["631407091", "631407091"], "output": "0" }, - { "inputs": ["631407091", "631407087"], "output": "4" } + "lt_uint16_euint16": [ + { "inputs": ["48529", "61431"], "output": true }, + { "inputs": ["56963", "56967"], "output": true }, + { "inputs": ["56967", "56967"], "output": false }, + { "inputs": ["56967", "56963"], "output": false } ], - "rem_euint64_uint64": [ + "lt_euint16_euint32": [ + { "inputs": ["29971", "3257046549"], "output": true }, + { "inputs": ["29967", "29971"], "output": true }, + { "inputs": ["29971", "29971"], "output": false }, + { "inputs": ["29971", "29967"], "output": false } + ], + "lt_euint16_euint64": [ + { "inputs": ["52683", "18445847573280013109"], "output": true }, + { "inputs": ["52679", "52683"], "output": true }, + { "inputs": ["52683", "52683"], "output": false }, + { "inputs": ["52683", "52679"], "output": false } + ], + "lt_euint16_euint128": [ + { "inputs": ["50276", "340282366920938463463369751695653808249"], "output": true }, + { "inputs": ["50272", "50276"], "output": true }, + { "inputs": ["50276", "50276"], "output": false }, + { "inputs": ["50276", "50272"], "output": false } + ], + "lt_euint32_euint8": [ + { "inputs": ["346575691", "225"], "output": false }, + { "inputs": ["221", "225"], "output": true }, + { "inputs": ["225", "225"], "output": false }, + { "inputs": ["225", "221"], "output": false } + ], + "lt_euint32_euint16": [ + { "inputs": ["2465989328", "62076"], "output": false }, + { "inputs": ["62072", "62076"], "output": true }, + { "inputs": ["62076", "62076"], "output": false }, + { "inputs": ["62076", "62072"], "output": false } + ], + "lt_euint32_euint32": [ + { "inputs": ["1393394279", "3831702666"], "output": true }, + { "inputs": ["1393394275", "1393394279"], "output": true }, + { "inputs": ["1393394279", "1393394279"], "output": false }, + { "inputs": ["1393394279", "1393394275"], "output": false } + ], + "lt_euint32_uint32": [ + { "inputs": ["1393394279", "2412857457"], "output": true }, + { "inputs": ["1393394275", "1393394279"], "output": true }, + { "inputs": ["1393394279", "1393394279"], "output": false }, + { "inputs": ["1393394279", "1393394275"], "output": false } + ], + "lt_uint32_euint32": [ + { "inputs": ["2491966974", "2412857457"], "output": false }, + { "inputs": ["1393394275", "1393394279"], "output": true }, + { "inputs": ["1393394279", "1393394279"], "output": false }, + { "inputs": ["1393394279", "1393394275"], "output": false } + ], + "lt_euint32_euint64": [ + { "inputs": ["2250828603", "18445115396085600773"], "output": true }, + { "inputs": ["2250828599", "2250828603"], "output": true }, + { "inputs": ["2250828603", "2250828603"], "output": false }, + { "inputs": ["2250828603", "2250828599"], "output": false } + ], + "lt_euint32_euint128": [ + { "inputs": ["158609828", "340282366920938463463373000362816876539"], "output": true }, + { "inputs": ["158609824", "158609828"], "output": true }, + { "inputs": ["158609828", "158609828"], "output": false }, + { "inputs": ["158609828", "158609824"], "output": false } + ], + "lt_euint64_euint8": [ + { "inputs": ["18444534503197443513", "115"], "output": false }, + { "inputs": ["111", "115"], "output": true }, + { "inputs": ["115", "115"], "output": false }, + { "inputs": ["115", "111"], "output": false } + ], + "lt_euint64_euint16": [ + { "inputs": ["18438858103232578331", "55370"], "output": false }, + { "inputs": ["55366", "55370"], "output": true }, + { "inputs": ["55370", "55370"], "output": false }, + { "inputs": ["55370", "55366"], "output": false } + ], + "lt_euint64_euint32": [ + { "inputs": ["18441065323353562291", "334218539"], "output": false }, + { "inputs": ["334218535", "334218539"], "output": true }, + { "inputs": ["334218539", "334218539"], "output": false }, + { "inputs": ["334218539", "334218535"], "output": false } + ], + "lt_euint64_euint64": [ + { "inputs": ["18441234728226266675", "18441942118839696329"], "output": true }, + { "inputs": ["18441234728226266671", "18441234728226266675"], "output": true }, + { "inputs": ["18441234728226266675", "18441234728226266675"], "output": false }, + { "inputs": ["18441234728226266675", "18441234728226266671"], "output": false } + ], + "lt_euint64_uint64": [ + { "inputs": ["18441234728226266675", "18446121979886939391"], "output": true }, + { "inputs": ["18441234728226266671", "18441234728226266675"], "output": true }, + { "inputs": ["18441234728226266675", "18441234728226266675"], "output": false }, + { "inputs": ["18441234728226266675", "18441234728226266671"], "output": false } + ], + "lt_uint64_euint64": [ + { "inputs": ["18441885283424983861", "18446121979886939391"], "output": true }, + { "inputs": ["18441234728226266671", "18441234728226266675"], "output": true }, + { "inputs": ["18441234728226266675", "18441234728226266675"], "output": false }, + { "inputs": ["18441234728226266675", "18441234728226266671"], "output": false } + ], + "lt_euint64_euint128": [ + { "inputs": ["18439004008722823085", "340282366920938463463374458349872076367"], "output": true }, + { "inputs": ["18439004008722823081", "18439004008722823085"], "output": true }, + { "inputs": ["18439004008722823085", "18439004008722823085"], "output": false }, + { "inputs": ["18439004008722823085", "18439004008722823081"], "output": false } + ], + "lt_euint128_euint8": [ + { "inputs": ["340282366920938463463367270240288085773", "54"], "output": false }, + { "inputs": ["50", "54"], "output": true }, + { "inputs": ["54", "54"], "output": false }, + { "inputs": ["54", "50"], "output": false } + ], + "lt_euint128_euint16": [ + { "inputs": ["340282366920938463463372888902430343979", "29009"], "output": false }, + { "inputs": ["29005", "29009"], "output": true }, + { "inputs": ["29009", "29009"], "output": false }, + { "inputs": ["29009", "29005"], "output": false } + ], + "lt_euint128_euint32": [ + { "inputs": ["340282366920938463463372170286955820013", "728486337"], "output": false }, + { "inputs": ["728486333", "728486337"], "output": true }, + { "inputs": ["728486337", "728486337"], "output": false }, + { "inputs": ["728486337", "728486333"], "output": false } + ], + "lt_euint128_euint64": [ + { "inputs": ["340282366920938463463374249257684977273", "18441095069125711575"], "output": false }, + { "inputs": ["18441095069125711571", "18441095069125711575"], "output": true }, + { "inputs": ["18441095069125711575", "18441095069125711575"], "output": false }, + { "inputs": ["18441095069125711575", "18441095069125711571"], "output": false } + ], + "lt_euint128_euint128": [ { - "inputs": ["18446008186519174615", "18445049964172995155"], - "output": "958222346179460" + "inputs": ["340282366920938463463371614507431562031", "340282366920938463463367730296617561237"], + "output": false }, { - "inputs": ["18443920463081385689", "18443920463081385693"], - "output": "18443920463081385689" + "inputs": ["340282366920938463463367730296617561233", "340282366920938463463367730296617561237"], + "output": true }, { - "inputs": ["18443920463081385693", "18443920463081385693"], - "output": "0" + "inputs": ["340282366920938463463367730296617561237", "340282366920938463463367730296617561237"], + "output": false }, { - "inputs": ["18443920463081385693", "18443920463081385689"], - "output": "4" + "inputs": ["340282366920938463463367730296617561237", "340282366920938463463367730296617561233"], + "output": false } ], - "rem_euint128_uint128": [ + "lt_euint128_uint128": [ { - "inputs": ["340282366920938463463367984231624733459", "340282366920938463463368025855706253793"], - "output": "340282366920938463463367984231624733459" + "inputs": ["340282366920938463463371614507431562031", "340282366920938463463371757688995790011"], + "output": true }, { - "inputs": ["340282366920938463463367984231624733455", "340282366920938463463367984231624733459"], - "output": "340282366920938463463367984231624733455" + "inputs": ["340282366920938463463367730296617561233", "340282366920938463463367730296617561237"], + "output": true }, { - "inputs": ["340282366920938463463367984231624733459", "340282366920938463463367984231624733459"], - "output": "0" + "inputs": ["340282366920938463463367730296617561237", "340282366920938463463367730296617561237"], + "output": false }, { - "inputs": ["340282366920938463463367984231624733459", "340282366920938463463367984231624733455"], - "output": "4" + "inputs": ["340282366920938463463367730296617561237", "340282366920938463463367730296617561233"], + "output": false } ], - "rem_euint256_uint256": [ + "lt_uint128_euint128": [ { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457578502975350831453", - "115792089237316195423570985008687907853269984665640564039457581127377285906497" - ], - "output": "115792089237316195423570985008687907853269984665640564039457578502975350831453" + "inputs": ["340282366920938463463371988229874083873", "340282366920938463463371757688995790011"], + "output": false }, { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577137781640958323", - "115792089237316195423570985008687907853269984665640564039457577137781640958327" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577137781640958323" + "inputs": ["340282366920938463463367730296617561233", "340282366920938463463367730296617561237"], + "output": true }, { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577137781640958327", - "115792089237316195423570985008687907853269984665640564039457577137781640958327" - ], - "output": "0" + "inputs": ["340282366920938463463367730296617561237", "340282366920938463463367730296617561237"], + "output": false }, { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577137781640958327", - "115792089237316195423570985008687907853269984665640564039457577137781640958323" - ], - "output": "4" + "inputs": ["340282366920938463463367730296617561237", "340282366920938463463367730296617561233"], + "output": false } ], - "le_euint4_euint4": [ - { "inputs": ["6", "6"], "output": true }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": false } - ], - "le_euint4_euint8": [ - { "inputs": ["1", "98"], "output": true }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": false } - ], - "le_euint4_uint8": [ - { "inputs": ["1", "2"], "output": true }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": false } - ], - "le_euint4_euint16": [ - { "inputs": ["14", "62468"], "output": true }, - { "inputs": ["10", "14"], "output": true }, - { "inputs": ["14", "14"], "output": true }, - { "inputs": ["14", "10"], "output": false } - ], - "le_euint4_euint32": [ - { "inputs": ["4", "1782114748"], "output": true }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": false } - ], - "le_euint4_euint64": [ - { "inputs": ["14", "18446414069240547725"], "output": true }, - { "inputs": ["10", "14"], "output": true }, - { "inputs": ["14", "14"], "output": true }, - { "inputs": ["14", "10"], "output": false } - ], - "le_euint4_euint128": [ - { - "inputs": ["5", "340282366920938463463372463025889881069"], - "output": true - }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": false } - ], - "le_euint4_euint256": [ - { - "inputs": ["12", "115792089237316195423570985008687907853269984665640564039457582708981712427829"], - "output": true - }, - { "inputs": ["8", "12"], "output": true }, - { "inputs": ["12", "12"], "output": true }, - { "inputs": ["12", "8"], "output": false } - ], - "le_euint8_euint4": [ - { "inputs": ["26", "10"], "output": false }, - { "inputs": ["6", "10"], "output": true }, - { "inputs": ["10", "10"], "output": true }, - { "inputs": ["10", "6"], "output": false } + "ge_euint8_euint8": [ + { "inputs": ["86", "168"], "output": false }, + { "inputs": ["82", "86"], "output": false }, + { "inputs": ["86", "86"], "output": true }, + { "inputs": ["86", "82"], "output": true } ], - "le_uint8_euint4": [ - { "inputs": ["11", "10"], "output": false }, - { "inputs": ["6", "10"], "output": true }, - { "inputs": ["10", "10"], "output": true }, - { "inputs": ["10", "6"], "output": false } + "ge_euint8_uint8": [ + { "inputs": ["86", "81"], "output": true }, + { "inputs": ["82", "86"], "output": false }, + { "inputs": ["86", "86"], "output": true }, + { "inputs": ["86", "82"], "output": true } ], - "le_euint8_euint8": [ - { "inputs": ["124", "71"], "output": false }, - { "inputs": ["67", "71"], "output": true }, - { "inputs": ["71", "71"], "output": true }, - { "inputs": ["71", "67"], "output": false } + "ge_uint8_euint8": [ + { "inputs": ["154", "81"], "output": true }, + { "inputs": ["82", "86"], "output": false }, + { "inputs": ["86", "86"], "output": true }, + { "inputs": ["86", "82"], "output": true } ], - "le_euint8_uint8": [ - { "inputs": ["124", "152"], "output": true }, - { "inputs": ["67", "71"], "output": true }, - { "inputs": ["71", "71"], "output": true }, - { "inputs": ["71", "67"], "output": false } + "ge_euint8_euint16": [ + { "inputs": ["15", "55089"], "output": false }, + { "inputs": ["11", "15"], "output": false }, + { "inputs": ["15", "15"], "output": true }, + { "inputs": ["15", "11"], "output": true } ], - "le_uint8_euint8": [ - { "inputs": ["25", "152"], "output": true }, - { "inputs": ["67", "71"], "output": true }, - { "inputs": ["71", "71"], "output": true }, - { "inputs": ["71", "67"], "output": false } + "ge_euint8_euint32": [ + { "inputs": ["214", "1604373182"], "output": false }, + { "inputs": ["210", "214"], "output": false }, + { "inputs": ["214", "214"], "output": true }, + { "inputs": ["214", "210"], "output": true } ], - "le_euint8_euint16": [ - { "inputs": ["32", "25116"], "output": true }, - { "inputs": ["28", "32"], "output": true }, - { "inputs": ["32", "32"], "output": true }, - { "inputs": ["32", "28"], "output": false } + "ge_euint8_euint64": [ + { "inputs": ["47", "18443465520975525945"], "output": false }, + { "inputs": ["43", "47"], "output": false }, + { "inputs": ["47", "47"], "output": true }, + { "inputs": ["47", "43"], "output": true } ], - "le_euint8_euint32": [ - { "inputs": ["162", "1086789383"], "output": true }, - { "inputs": ["158", "162"], "output": true }, - { "inputs": ["162", "162"], "output": true }, - { "inputs": ["162", "158"], "output": false } + "ge_euint8_euint128": [ + { "inputs": ["183", "340282366920938463463370410340993802897"], "output": false }, + { "inputs": ["179", "183"], "output": false }, + { "inputs": ["183", "183"], "output": true }, + { "inputs": ["183", "179"], "output": true } ], - "le_euint8_euint64": [ - { "inputs": ["124", "18443185604881328715"], "output": true }, - { "inputs": ["120", "124"], "output": true }, - { "inputs": ["124", "124"], "output": true }, - { "inputs": ["124", "120"], "output": false } + "ge_euint16_euint8": [ + { "inputs": ["6615", "123"], "output": true }, + { "inputs": ["119", "123"], "output": false }, + { "inputs": ["123", "123"], "output": true }, + { "inputs": ["123", "119"], "output": true } ], - "le_euint8_euint128": [ - { - "inputs": ["108", "340282366920938463463369577015243486211"], - "output": true - }, - { "inputs": ["104", "108"], "output": true }, - { "inputs": ["108", "108"], "output": true }, - { "inputs": ["108", "104"], "output": false } + "ge_euint16_euint16": [ + { "inputs": ["24484", "59186"], "output": false }, + { "inputs": ["24480", "24484"], "output": false }, + { "inputs": ["24484", "24484"], "output": true }, + { "inputs": ["24484", "24480"], "output": true } ], - "le_euint8_euint256": [ - { - "inputs": ["133", "115792089237316195423570985008687907853269984665640564039457576630649713670389"], - "output": true - }, - { "inputs": ["129", "133"], "output": true }, - { "inputs": ["133", "133"], "output": true }, - { "inputs": ["133", "129"], "output": false } + "ge_euint16_uint16": [ + { "inputs": ["24484", "57148"], "output": false }, + { "inputs": ["24480", "24484"], "output": false }, + { "inputs": ["24484", "24484"], "output": true }, + { "inputs": ["24484", "24480"], "output": true } ], - "le_euint16_euint4": [ - { "inputs": ["26735", "12"], "output": false }, - { "inputs": ["8", "12"], "output": true }, - { "inputs": ["12", "12"], "output": true }, - { "inputs": ["12", "8"], "output": false } + "ge_uint16_euint16": [ + { "inputs": ["47914", "57148"], "output": false }, + { "inputs": ["24480", "24484"], "output": false }, + { "inputs": ["24484", "24484"], "output": true }, + { "inputs": ["24484", "24480"], "output": true } ], - "le_euint16_euint8": [ - { "inputs": ["7541", "42"], "output": false }, - { "inputs": ["38", "42"], "output": true }, - { "inputs": ["42", "42"], "output": true }, - { "inputs": ["42", "38"], "output": false } + "ge_euint16_euint32": [ + { "inputs": ["44037", "2689311087"], "output": false }, + { "inputs": ["44033", "44037"], "output": false }, + { "inputs": ["44037", "44037"], "output": true }, + { "inputs": ["44037", "44033"], "output": true } ], - "le_euint16_euint16": [ - { "inputs": ["20803", "873"], "output": false }, - { "inputs": ["869", "873"], "output": true }, - { "inputs": ["873", "873"], "output": true }, - { "inputs": ["873", "869"], "output": false } + "ge_euint16_euint64": [ + { "inputs": ["43332", "18441730249652564115"], "output": false }, + { "inputs": ["43328", "43332"], "output": false }, + { "inputs": ["43332", "43332"], "output": true }, + { "inputs": ["43332", "43328"], "output": true } ], - "le_euint16_uint16": [ - { "inputs": ["20803", "27442"], "output": true }, - { "inputs": ["869", "873"], "output": true }, - { "inputs": ["873", "873"], "output": true }, - { "inputs": ["873", "869"], "output": false } + "ge_euint16_euint128": [ + { "inputs": ["7805", "340282366920938463463372490492505067497"], "output": false }, + { "inputs": ["7801", "7805"], "output": false }, + { "inputs": ["7805", "7805"], "output": true }, + { "inputs": ["7805", "7801"], "output": true } ], - "le_uint16_euint16": [ - { "inputs": ["36363", "27442"], "output": false }, - { "inputs": ["869", "873"], "output": true }, - { "inputs": ["873", "873"], "output": true }, - { "inputs": ["873", "869"], "output": false } + "ge_euint32_euint8": [ + { "inputs": ["473334660", "24"], "output": true }, + { "inputs": ["20", "24"], "output": false }, + { "inputs": ["24", "24"], "output": true }, + { "inputs": ["24", "20"], "output": true } ], - "le_euint16_euint32": [ - { "inputs": ["44937", "2020262580"], "output": true }, - { "inputs": ["44933", "44937"], "output": true }, - { "inputs": ["44937", "44937"], "output": true }, - { "inputs": ["44937", "44933"], "output": false } + "ge_euint32_euint16": [ + { "inputs": ["342883904", "62496"], "output": true }, + { "inputs": ["62492", "62496"], "output": false }, + { "inputs": ["62496", "62496"], "output": true }, + { "inputs": ["62496", "62492"], "output": true } ], - "le_euint16_euint64": [ - { "inputs": ["33530", "18441393339688273439"], "output": true }, - { "inputs": ["33526", "33530"], "output": true }, - { "inputs": ["33530", "33530"], "output": true }, - { "inputs": ["33530", "33526"], "output": false } + "ge_euint32_euint32": [ + { "inputs": ["2207546568", "886800519"], "output": true }, + { "inputs": ["886800515", "886800519"], "output": false }, + { "inputs": ["886800519", "886800519"], "output": true }, + { "inputs": ["886800519", "886800515"], "output": true } ], - "le_euint16_euint128": [ - { - "inputs": ["63634", "340282366920938463463365626120025172451"], - "output": true - }, - { "inputs": ["63630", "63634"], "output": true }, - { "inputs": ["63634", "63634"], "output": true }, - { "inputs": ["63634", "63630"], "output": false } + "ge_euint32_uint32": [ + { "inputs": ["2207546568", "2005276546"], "output": true }, + { "inputs": ["886800515", "886800519"], "output": false }, + { "inputs": ["886800519", "886800519"], "output": true }, + { "inputs": ["886800519", "886800515"], "output": true } ], - "le_euint16_euint256": [ - { - "inputs": ["10398", "115792089237316195423570985008687907853269984665640564039457582877023510899415"], - "output": true - }, - { "inputs": ["10394", "10398"], "output": true }, - { "inputs": ["10398", "10398"], "output": true }, - { "inputs": ["10398", "10394"], "output": false } + "ge_uint32_euint32": [ + { "inputs": ["282140840", "2005276546"], "output": false }, + { "inputs": ["886800515", "886800519"], "output": false }, + { "inputs": ["886800519", "886800519"], "output": true }, + { "inputs": ["886800519", "886800515"], "output": true } ], - "le_euint32_euint4": [ - { "inputs": ["1297036148", "2"], "output": false }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": false } + "ge_euint32_euint64": [ + { "inputs": ["3532368747", "18443659168796781969"], "output": false }, + { "inputs": ["3532368743", "3532368747"], "output": false }, + { "inputs": ["3532368747", "3532368747"], "output": true }, + { "inputs": ["3532368747", "3532368743"], "output": true } ], - "le_euint32_euint8": [ - { "inputs": ["884339915", "183"], "output": false }, - { "inputs": ["179", "183"], "output": true }, - { "inputs": ["183", "183"], "output": true }, - { "inputs": ["183", "179"], "output": false } + "ge_euint32_euint128": [ + { "inputs": ["4059900182", "340282366920938463463369904878669122903"], "output": false }, + { "inputs": ["4059900178", "4059900182"], "output": false }, + { "inputs": ["4059900182", "4059900182"], "output": true }, + { "inputs": ["4059900182", "4059900178"], "output": true } ], - "le_euint32_euint16": [ - { "inputs": ["787386715", "25220"], "output": false }, - { "inputs": ["25216", "25220"], "output": true }, - { "inputs": ["25220", "25220"], "output": true }, - { "inputs": ["25220", "25216"], "output": false } + "ge_euint64_euint8": [ + { "inputs": ["18438564456251792617", "139"], "output": true }, + { "inputs": ["135", "139"], "output": false }, + { "inputs": ["139", "139"], "output": true }, + { "inputs": ["139", "135"], "output": true } ], - "le_euint32_euint32": [ - { "inputs": ["1814515265", "1215301262"], "output": false }, - { "inputs": ["1215301258", "1215301262"], "output": true }, - { "inputs": ["1215301262", "1215301262"], "output": true }, - { "inputs": ["1215301262", "1215301258"], "output": false } + "ge_euint64_euint16": [ + { "inputs": ["18444798521160909039", "37704"], "output": true }, + { "inputs": ["37700", "37704"], "output": false }, + { "inputs": ["37704", "37704"], "output": true }, + { "inputs": ["37704", "37700"], "output": true } ], - "le_euint32_uint32": [ - { "inputs": ["1814515265", "524803703"], "output": false }, - { "inputs": ["1215301258", "1215301262"], "output": true }, - { "inputs": ["1215301262", "1215301262"], "output": true }, - { "inputs": ["1215301262", "1215301258"], "output": false } + "ge_euint64_euint32": [ + { "inputs": ["18445401532977048671", "112878745"], "output": true }, + { "inputs": ["112878741", "112878745"], "output": false }, + { "inputs": ["112878745", "112878745"], "output": true }, + { "inputs": ["112878745", "112878741"], "output": true } ], - "le_uint32_euint32": [ - { "inputs": ["1873209457", "524803703"], "output": false }, - { "inputs": ["1215301258", "1215301262"], "output": true }, - { "inputs": ["1215301262", "1215301262"], "output": true }, - { "inputs": ["1215301262", "1215301258"], "output": false } + "ge_euint64_euint64": [ + { "inputs": ["18446120466139235871", "18440341405583717235"], "output": true }, + { "inputs": ["18440341405583717231", "18440341405583717235"], "output": false }, + { "inputs": ["18440341405583717235", "18440341405583717235"], "output": true }, + { "inputs": ["18440341405583717235", "18440341405583717231"], "output": true } ], - "le_euint32_euint64": [ - { "inputs": ["1718048813", "18439987431102861375"], "output": true }, - { "inputs": ["1718048809", "1718048813"], "output": true }, - { "inputs": ["1718048813", "1718048813"], "output": true }, - { "inputs": ["1718048813", "1718048809"], "output": false } + "ge_euint64_uint64": [ + { "inputs": ["18446120466139235871", "18446166502931776625"], "output": false }, + { "inputs": ["18440341405583717231", "18440341405583717235"], "output": false }, + { "inputs": ["18440341405583717235", "18440341405583717235"], "output": true }, + { "inputs": ["18440341405583717235", "18440341405583717231"], "output": true } ], - "le_euint32_euint128": [ - { - "inputs": ["867198677", "340282366920938463463369757600308236313"], - "output": true - }, - { "inputs": ["867198673", "867198677"], "output": true }, - { "inputs": ["867198677", "867198677"], "output": true }, - { "inputs": ["867198677", "867198673"], "output": false } + "ge_uint64_euint64": [ + { "inputs": ["18438172977556990485", "18446166502931776625"], "output": false }, + { "inputs": ["18440341405583717231", "18440341405583717235"], "output": false }, + { "inputs": ["18440341405583717235", "18440341405583717235"], "output": true }, + { "inputs": ["18440341405583717235", "18440341405583717231"], "output": true } ], - "le_euint32_euint256": [ - { - "inputs": ["2709381066", "115792089237316195423570985008687907853269984665640564039457582000267248354603"], - "output": true - }, - { "inputs": ["2709381062", "2709381066"], "output": true }, - { "inputs": ["2709381066", "2709381066"], "output": true }, - { "inputs": ["2709381066", "2709381062"], "output": false } + "ge_euint64_euint128": [ + { "inputs": ["18438505728320386813", "340282366920938463463374040750521514095"], "output": false }, + { "inputs": ["18438505728320386809", "18438505728320386813"], "output": false }, + { "inputs": ["18438505728320386813", "18438505728320386813"], "output": true }, + { "inputs": ["18438505728320386813", "18438505728320386809"], "output": true } ], - "le_euint64_euint4": [ - { "inputs": ["18443622047758317419", "13"], "output": false }, - { "inputs": ["9", "13"], "output": true }, - { "inputs": ["13", "13"], "output": true }, - { "inputs": ["13", "9"], "output": false } + "ge_euint128_euint8": [ + { "inputs": ["340282366920938463463371824760352012773", "223"], "output": true }, + { "inputs": ["219", "223"], "output": false }, + { "inputs": ["223", "223"], "output": true }, + { "inputs": ["223", "219"], "output": true } ], - "le_euint64_euint8": [ - { "inputs": ["18443904556846943161", "36"], "output": false }, - { "inputs": ["32", "36"], "output": true }, - { "inputs": ["36", "36"], "output": true }, - { "inputs": ["36", "32"], "output": false } + "ge_euint128_euint16": [ + { "inputs": ["340282366920938463463372233668651369041", "63246"], "output": true }, + { "inputs": ["63242", "63246"], "output": false }, + { "inputs": ["63246", "63246"], "output": true }, + { "inputs": ["63246", "63242"], "output": true } ], - "le_euint64_euint16": [ - { "inputs": ["18437883313011515679", "51774"], "output": false }, - { "inputs": ["51770", "51774"], "output": true }, - { "inputs": ["51774", "51774"], "output": true }, - { "inputs": ["51774", "51770"], "output": false } + "ge_euint128_euint32": [ + { "inputs": ["340282366920938463463372367150569577497", "4231500694"], "output": true }, + { "inputs": ["4231500690", "4231500694"], "output": false }, + { "inputs": ["4231500694", "4231500694"], "output": true }, + { "inputs": ["4231500694", "4231500690"], "output": true } ], - "le_euint64_euint32": [ - { "inputs": ["18442023388952183851", "1762835382"], "output": false }, - { "inputs": ["1762835378", "1762835382"], "output": true }, - { "inputs": ["1762835382", "1762835382"], "output": true }, - { "inputs": ["1762835382", "1762835378"], "output": false } + "ge_euint128_euint64": [ + { "inputs": ["340282366920938463463365624168621185717", "18440962399890391863"], "output": true }, + { "inputs": ["18440962399890391859", "18440962399890391863"], "output": false }, + { "inputs": ["18440962399890391863", "18440962399890391863"], "output": true }, + { "inputs": ["18440962399890391863", "18440962399890391859"], "output": true } ], - "le_euint64_euint64": [ - { - "inputs": ["18440402951089431437", "18444684457474043493"], - "output": true - }, - { - "inputs": ["18440402951089431433", "18440402951089431437"], - "output": true - }, + "ge_euint128_euint128": [ { - "inputs": ["18440402951089431437", "18440402951089431437"], + "inputs": ["340282366920938463463370023716130846263", "340282366920938463463368815815998336823"], "output": true }, { - "inputs": ["18440402951089431437", "18440402951089431433"], + "inputs": ["340282366920938463463368815815998336819", "340282366920938463463368815815998336823"], "output": false - } - ], - "le_euint64_uint64": [ - { - "inputs": ["18440402951089431437", "18443808705297812893"], - "output": true - }, - { - "inputs": ["18440402951089431433", "18440402951089431437"], - "output": true }, { - "inputs": ["18440402951089431437", "18440402951089431437"], + "inputs": ["340282366920938463463368815815998336823", "340282366920938463463368815815998336823"], "output": true }, - { - "inputs": ["18440402951089431437", "18440402951089431433"], - "output": false - } + { "inputs": ["340282366920938463463368815815998336823", "340282366920938463463368815815998336819"], "output": true } ], - "le_uint64_euint64": [ + "ge_euint128_uint128": [ { - "inputs": ["18443941229431137849", "18443808705297812893"], + "inputs": ["340282366920938463463370023716130846263", "340282366920938463463374073706743756185"], "output": false }, { - "inputs": ["18440402951089431433", "18440402951089431437"], - "output": true - }, - { - "inputs": ["18440402951089431437", "18440402951089431437"], - "output": true - }, - { - "inputs": ["18440402951089431437", "18440402951089431433"], + "inputs": ["340282366920938463463368815815998336819", "340282366920938463463368815815998336823"], "output": false - } - ], - "le_euint64_euint128": [ - { - "inputs": ["18443662339869468477", "340282366920938463463371042076884293495"], - "output": true }, { - "inputs": ["18443662339869468473", "18443662339869468477"], + "inputs": ["340282366920938463463368815815998336823", "340282366920938463463368815815998336823"], "output": true }, + { "inputs": ["340282366920938463463368815815998336823", "340282366920938463463368815815998336819"], "output": true } + ], + "ge_uint128_euint128": [ { - "inputs": ["18443662339869468477", "18443662339869468477"], - "output": true + "inputs": ["340282366920938463463367818579450726251", "340282366920938463463374073706743756185"], + "output": false }, { - "inputs": ["18443662339869468477", "18443662339869468473"], + "inputs": ["340282366920938463463368815815998336819", "340282366920938463463368815815998336823"], "output": false - } - ], - "le_euint64_euint256": [ - { - "inputs": [ - "18443803742985479181", - "115792089237316195423570985008687907853269984665640564039457581800529684723115" - ], - "output": true }, { - "inputs": ["18443803742985479177", "18443803742985479181"], + "inputs": ["340282366920938463463368815815998336823", "340282366920938463463368815815998336823"], "output": true }, - { - "inputs": ["18443803742985479181", "18443803742985479181"], - "output": true + { "inputs": ["340282366920938463463368815815998336823", "340282366920938463463368815815998336819"], "output": true } + ], + "gt_euint8_euint8": [ + { "inputs": ["35", "198"], "output": false }, + { "inputs": ["31", "35"], "output": false }, + { "inputs": ["35", "35"], "output": false }, + { "inputs": ["35", "31"], "output": true } + ], + "gt_euint8_uint8": [ + { "inputs": ["35", "44"], "output": false }, + { "inputs": ["31", "35"], "output": false }, + { "inputs": ["35", "35"], "output": false }, + { "inputs": ["35", "31"], "output": true } + ], + "gt_uint8_euint8": [ + { "inputs": ["5", "44"], "output": false }, + { "inputs": ["31", "35"], "output": false }, + { "inputs": ["35", "35"], "output": false }, + { "inputs": ["35", "31"], "output": true } + ], + "gt_euint8_euint16": [ + { "inputs": ["46", "11118"], "output": false }, + { "inputs": ["42", "46"], "output": false }, + { "inputs": ["46", "46"], "output": false }, + { "inputs": ["46", "42"], "output": true } + ], + "gt_euint8_euint32": [ + { "inputs": ["192", "2330904771"], "output": false }, + { "inputs": ["188", "192"], "output": false }, + { "inputs": ["192", "192"], "output": false }, + { "inputs": ["192", "188"], "output": true } + ], + "gt_euint8_euint64": [ + { "inputs": ["44", "18446475306842233353"], "output": false }, + { "inputs": ["40", "44"], "output": false }, + { "inputs": ["44", "44"], "output": false }, + { "inputs": ["44", "40"], "output": true } + ], + "gt_euint8_euint128": [ + { "inputs": ["250", "340282366920938463463368512933663799421"], "output": false }, + { "inputs": ["246", "250"], "output": false }, + { "inputs": ["250", "250"], "output": false }, + { "inputs": ["250", "246"], "output": true } + ], + "gt_euint16_euint8": [ + { "inputs": ["59934", "11"], "output": true }, + { "inputs": ["7", "11"], "output": false }, + { "inputs": ["11", "11"], "output": false }, + { "inputs": ["11", "7"], "output": true } + ], + "gt_euint16_euint16": [ + { "inputs": ["53997", "52298"], "output": true }, + { "inputs": ["52294", "52298"], "output": false }, + { "inputs": ["52298", "52298"], "output": false }, + { "inputs": ["52298", "52294"], "output": true } + ], + "gt_euint16_uint16": [ + { "inputs": ["53997", "47327"], "output": true }, + { "inputs": ["52294", "52298"], "output": false }, + { "inputs": ["52298", "52298"], "output": false }, + { "inputs": ["52298", "52294"], "output": true } + ], + "gt_uint16_euint16": [ + { "inputs": ["56546", "47327"], "output": true }, + { "inputs": ["52294", "52298"], "output": false }, + { "inputs": ["52298", "52298"], "output": false }, + { "inputs": ["52298", "52294"], "output": true } + ], + "gt_euint16_euint32": [ + { "inputs": ["11684", "3496620610"], "output": false }, + { "inputs": ["11680", "11684"], "output": false }, + { "inputs": ["11684", "11684"], "output": false }, + { "inputs": ["11684", "11680"], "output": true } + ], + "gt_euint16_euint64": [ + { "inputs": ["52896", "18439030021705343441"], "output": false }, + { "inputs": ["52892", "52896"], "output": false }, + { "inputs": ["52896", "52896"], "output": false }, + { "inputs": ["52896", "52892"], "output": true } + ], + "gt_euint16_euint128": [ + { "inputs": ["31356", "340282366920938463463374535929837575773"], "output": false }, + { "inputs": ["31352", "31356"], "output": false }, + { "inputs": ["31356", "31356"], "output": false }, + { "inputs": ["31356", "31352"], "output": true } + ], + "gt_euint32_euint8": [ + { "inputs": ["2485789735", "45"], "output": true }, + { "inputs": ["41", "45"], "output": false }, + { "inputs": ["45", "45"], "output": false }, + { "inputs": ["45", "41"], "output": true } + ], + "gt_euint32_euint16": [ + { "inputs": ["800958767", "47076"], "output": true }, + { "inputs": ["47072", "47076"], "output": false }, + { "inputs": ["47076", "47076"], "output": false }, + { "inputs": ["47076", "47072"], "output": true } + ], + "gt_euint32_euint32": [ + { "inputs": ["1025655627", "852887920"], "output": true }, + { "inputs": ["852887916", "852887920"], "output": false }, + { "inputs": ["852887920", "852887920"], "output": false }, + { "inputs": ["852887920", "852887916"], "output": true } + ], + "gt_euint32_uint32": [ + { "inputs": ["1025655627", "2410666241"], "output": false }, + { "inputs": ["852887916", "852887920"], "output": false }, + { "inputs": ["852887920", "852887920"], "output": false }, + { "inputs": ["852887920", "852887916"], "output": true } + ], + "gt_uint32_euint32": [ + { "inputs": ["879564050", "2410666241"], "output": false }, + { "inputs": ["852887916", "852887920"], "output": false }, + { "inputs": ["852887920", "852887920"], "output": false }, + { "inputs": ["852887920", "852887916"], "output": true } + ], + "gt_euint32_euint64": [ + { "inputs": ["3028372510", "18446335663610666339"], "output": false }, + { "inputs": ["3028372506", "3028372510"], "output": false }, + { "inputs": ["3028372510", "3028372510"], "output": false }, + { "inputs": ["3028372510", "3028372506"], "output": true } + ], + "gt_euint32_euint128": [ + { "inputs": ["484328633", "340282366920938463463374257087119633669"], "output": false }, + { "inputs": ["484328629", "484328633"], "output": false }, + { "inputs": ["484328633", "484328633"], "output": false }, + { "inputs": ["484328633", "484328629"], "output": true } + ], + "gt_euint64_euint8": [ + { "inputs": ["18439020081626944927", "187"], "output": true }, + { "inputs": ["183", "187"], "output": false }, + { "inputs": ["187", "187"], "output": false }, + { "inputs": ["187", "183"], "output": true } + ], + "gt_euint64_euint16": [ + { "inputs": ["18439817071685955303", "7312"], "output": true }, + { "inputs": ["7308", "7312"], "output": false }, + { "inputs": ["7312", "7312"], "output": false }, + { "inputs": ["7312", "7308"], "output": true } + ], + "gt_euint64_euint32": [ + { "inputs": ["18441519703727072841", "3007175560"], "output": true }, + { "inputs": ["3007175556", "3007175560"], "output": false }, + { "inputs": ["3007175560", "3007175560"], "output": false }, + { "inputs": ["3007175560", "3007175556"], "output": true } + ], + "gt_euint64_euint64": [ + { "inputs": ["18440169872666386219", "18442587173410865159"], "output": false }, + { "inputs": ["18440169872666386215", "18440169872666386219"], "output": false }, + { "inputs": ["18440169872666386219", "18440169872666386219"], "output": false }, + { "inputs": ["18440169872666386219", "18440169872666386215"], "output": true } + ], + "gt_euint64_uint64": [ + { "inputs": ["18440169872666386219", "18441913509740701095"], "output": false }, + { "inputs": ["18440169872666386215", "18440169872666386219"], "output": false }, + { "inputs": ["18440169872666386219", "18440169872666386219"], "output": false }, + { "inputs": ["18440169872666386219", "18440169872666386215"], "output": true } + ], + "gt_uint64_euint64": [ + { "inputs": ["18437854703645470389", "18441913509740701095"], "output": false }, + { "inputs": ["18440169872666386215", "18440169872666386219"], "output": false }, + { "inputs": ["18440169872666386219", "18440169872666386219"], "output": false }, + { "inputs": ["18440169872666386219", "18440169872666386215"], "output": true } + ], + "gt_euint64_euint128": [ + { "inputs": ["18445443760209372617", "340282366920938463463368175816562705643"], "output": false }, + { "inputs": ["18445443760209372613", "18445443760209372617"], "output": false }, + { "inputs": ["18445443760209372617", "18445443760209372617"], "output": false }, + { "inputs": ["18445443760209372617", "18445443760209372613"], "output": true } + ], + "gt_euint128_euint8": [ + { "inputs": ["340282366920938463463373250399586077561", "171"], "output": true }, + { "inputs": ["167", "171"], "output": false }, + { "inputs": ["171", "171"], "output": false }, + { "inputs": ["171", "167"], "output": true } + ], + "gt_euint128_euint16": [ + { "inputs": ["340282366920938463463370426846948397581", "9168"], "output": true }, + { "inputs": ["9164", "9168"], "output": false }, + { "inputs": ["9168", "9168"], "output": false }, + { "inputs": ["9168", "9164"], "output": true } + ], + "gt_euint128_euint32": [ + { "inputs": ["340282366920938463463373164948202483093", "2887818930"], "output": true }, + { "inputs": ["2887818926", "2887818930"], "output": false }, + { "inputs": ["2887818930", "2887818930"], "output": false }, + { "inputs": ["2887818930", "2887818926"], "output": true } + ], + "gt_euint128_euint64": [ + { "inputs": ["340282366920938463463371168779907705603", "18438625154404107395"], "output": true }, + { "inputs": ["18438625154404107391", "18438625154404107395"], "output": false }, + { "inputs": ["18438625154404107395", "18438625154404107395"], "output": false }, + { "inputs": ["18438625154404107395", "18438625154404107391"], "output": true } + ], + "gt_euint128_euint128": [ + { + "inputs": ["340282366920938463463373884922085455539", "340282366920938463463369976375287623855"], + "output": true }, { - "inputs": ["18443803742985479181", "18443803742985479177"], + "inputs": ["340282366920938463463369976375287623851", "340282366920938463463369976375287623855"], "output": false - } - ], - "le_euint128_euint4": [ + }, { - "inputs": ["340282366920938463463373221658110991435", "1"], + "inputs": ["340282366920938463463369976375287623855", "340282366920938463463369976375287623855"], "output": false }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": false } + { "inputs": ["340282366920938463463369976375287623855", "340282366920938463463369976375287623851"], "output": true } ], - "le_euint128_euint8": [ + "gt_euint128_uint128": [ + { + "inputs": ["340282366920938463463373884922085455539", "340282366920938463463369085505008719331"], + "output": true + }, { - "inputs": ["340282366920938463463373663014854424779", "48"], + "inputs": ["340282366920938463463369976375287623851", "340282366920938463463369976375287623855"], "output": false }, - { "inputs": ["44", "48"], "output": true }, - { "inputs": ["48", "48"], "output": true }, - { "inputs": ["48", "44"], "output": false } - ], - "le_euint128_euint16": [ { - "inputs": ["340282366920938463463371412966556965647", "54237"], + "inputs": ["340282366920938463463369976375287623855", "340282366920938463463369976375287623855"], "output": false }, - { "inputs": ["54233", "54237"], "output": true }, - { "inputs": ["54237", "54237"], "output": true }, - { "inputs": ["54237", "54233"], "output": false } + { "inputs": ["340282366920938463463369976375287623855", "340282366920938463463369976375287623851"], "output": true } ], - "le_euint128_euint32": [ + "gt_uint128_euint128": [ + { + "inputs": ["340282366920938463463371356969098868361", "340282366920938463463369085505008719331"], + "output": true + }, { - "inputs": ["340282366920938463463372847665266392859", "623901814"], + "inputs": ["340282366920938463463369976375287623851", "340282366920938463463369976375287623855"], "output": false }, - { "inputs": ["623901810", "623901814"], "output": true }, - { "inputs": ["623901814", "623901814"], "output": true }, - { "inputs": ["623901814", "623901810"], "output": false } + { + "inputs": ["340282366920938463463369976375287623855", "340282366920938463463369976375287623855"], + "output": false + }, + { "inputs": ["340282366920938463463369976375287623855", "340282366920938463463369976375287623851"], "output": true } ], - "le_euint128_euint64": [ + "eq_euint8_euint8": [ + { "inputs": ["213", "56"], "output": false }, + { "inputs": ["52", "56"], "output": false }, + { "inputs": ["56", "56"], "output": true }, + { "inputs": ["56", "52"], "output": false } + ], + "eq_euint8_uint8": [ + { "inputs": ["213", "125"], "output": false }, + { "inputs": ["52", "56"], "output": false }, + { "inputs": ["56", "56"], "output": true }, + { "inputs": ["56", "52"], "output": false } + ], + "eq_uint8_euint8": [ + { "inputs": ["136", "125"], "output": false }, + { "inputs": ["52", "56"], "output": false }, + { "inputs": ["56", "56"], "output": true }, + { "inputs": ["56", "52"], "output": false } + ], + "eq_euint8_euint16": [ + { "inputs": ["250", "14601"], "output": false }, + { "inputs": ["246", "250"], "output": false }, + { "inputs": ["250", "250"], "output": true }, + { "inputs": ["250", "246"], "output": false } + ], + "eq_euint8_euint32": [ + { "inputs": ["158", "2809636866"], "output": false }, + { "inputs": ["154", "158"], "output": false }, + { "inputs": ["158", "158"], "output": true }, + { "inputs": ["158", "154"], "output": false } + ], + "eq_euint8_euint64": [ + { "inputs": ["146", "18440024496930372815"], "output": false }, + { "inputs": ["142", "146"], "output": false }, + { "inputs": ["146", "146"], "output": true }, + { "inputs": ["146", "142"], "output": false } + ], + "eq_euint8_euint128": [ + { "inputs": ["184", "340282366920938463463366255205276884577"], "output": false }, + { "inputs": ["180", "184"], "output": false }, + { "inputs": ["184", "184"], "output": true }, + { "inputs": ["184", "180"], "output": false } + ], + "eq_euint8_euint256": [ { - "inputs": ["340282366920938463463366067679463384359", "18440549964651513569"], + "inputs": ["50", "115792089237316195423570985008687907853269984665640564039457580120173907554311"], "output": false }, + { "inputs": ["46", "50"], "output": false }, + { "inputs": ["50", "50"], "output": true }, + { "inputs": ["50", "46"], "output": false } + ], + "eq_euint16_euint8": [ + { "inputs": ["27804", "54"], "output": false }, + { "inputs": ["50", "54"], "output": false }, + { "inputs": ["54", "54"], "output": true }, + { "inputs": ["54", "50"], "output": false } + ], + "eq_euint16_euint16": [ + { "inputs": ["58707", "22411"], "output": false }, + { "inputs": ["22407", "22411"], "output": false }, + { "inputs": ["22411", "22411"], "output": true }, + { "inputs": ["22411", "22407"], "output": false } + ], + "eq_euint16_uint16": [ + { "inputs": ["58707", "6146"], "output": false }, + { "inputs": ["22407", "22411"], "output": false }, + { "inputs": ["22411", "22411"], "output": true }, + { "inputs": ["22411", "22407"], "output": false } + ], + "eq_uint16_euint16": [ + { "inputs": ["64594", "6146"], "output": false }, + { "inputs": ["22407", "22411"], "output": false }, + { "inputs": ["22411", "22411"], "output": true }, + { "inputs": ["22411", "22407"], "output": false } + ], + "eq_euint16_euint32": [ + { "inputs": ["8745", "3742971394"], "output": false }, + { "inputs": ["8741", "8745"], "output": false }, + { "inputs": ["8745", "8745"], "output": true }, + { "inputs": ["8745", "8741"], "output": false } + ], + "eq_euint16_euint64": [ + { "inputs": ["63668", "18440473783754628421"], "output": false }, + { "inputs": ["63664", "63668"], "output": false }, + { "inputs": ["63668", "63668"], "output": true }, + { "inputs": ["63668", "63664"], "output": false } + ], + "eq_euint16_euint128": [ + { "inputs": ["2173", "340282366920938463463371019993626911167"], "output": false }, + { "inputs": ["2169", "2173"], "output": false }, + { "inputs": ["2173", "2173"], "output": true }, + { "inputs": ["2173", "2169"], "output": false } + ], + "eq_euint16_euint256": [ { - "inputs": ["18440549964651513565", "18440549964651513569"], - "output": true + "inputs": ["28243", "115792089237316195423570985008687907853269984665640564039457578538708824837469"], + "output": false }, + { "inputs": ["28239", "28243"], "output": false }, + { "inputs": ["28243", "28243"], "output": true }, + { "inputs": ["28243", "28239"], "output": false } + ], + "eq_euint32_euint8": [ + { "inputs": ["2215698206", "97"], "output": false }, + { "inputs": ["93", "97"], "output": false }, + { "inputs": ["97", "97"], "output": true }, + { "inputs": ["97", "93"], "output": false } + ], + "eq_euint32_euint16": [ + { "inputs": ["3225313867", "9645"], "output": false }, + { "inputs": ["9641", "9645"], "output": false }, + { "inputs": ["9645", "9645"], "output": true }, + { "inputs": ["9645", "9641"], "output": false } + ], + "eq_euint32_euint32": [ + { "inputs": ["1939169580", "2867187706"], "output": false }, + { "inputs": ["1939169576", "1939169580"], "output": false }, + { "inputs": ["1939169580", "1939169580"], "output": true }, + { "inputs": ["1939169580", "1939169576"], "output": false } + ], + "eq_euint32_uint32": [ + { "inputs": ["1939169580", "822202833"], "output": false }, + { "inputs": ["1939169576", "1939169580"], "output": false }, + { "inputs": ["1939169580", "1939169580"], "output": true }, + { "inputs": ["1939169580", "1939169576"], "output": false } + ], + "eq_uint32_euint32": [ + { "inputs": ["3468875946", "822202833"], "output": false }, + { "inputs": ["1939169576", "1939169580"], "output": false }, + { "inputs": ["1939169580", "1939169580"], "output": true }, + { "inputs": ["1939169580", "1939169576"], "output": false } + ], + "eq_euint32_euint64": [ + { "inputs": ["2698268862", "18440365030595180883"], "output": false }, + { "inputs": ["2698268858", "2698268862"], "output": false }, + { "inputs": ["2698268862", "2698268862"], "output": true }, + { "inputs": ["2698268862", "2698268858"], "output": false } + ], + "eq_euint32_euint128": [ + { "inputs": ["795954570", "340282366920938463463370019014155009739"], "output": false }, + { "inputs": ["795954566", "795954570"], "output": false }, + { "inputs": ["795954570", "795954570"], "output": true }, + { "inputs": ["795954570", "795954566"], "output": false } + ], + "eq_euint32_euint256": [ { - "inputs": ["18440549964651513569", "18440549964651513569"], - "output": true + "inputs": ["1609929242", "115792089237316195423570985008687907853269984665640564039457575736519310883673"], + "output": false }, + { "inputs": ["1609929238", "1609929242"], "output": false }, + { "inputs": ["1609929242", "1609929242"], "output": true }, + { "inputs": ["1609929242", "1609929238"], "output": false } + ], + "eq_euint64_euint8": [ + { "inputs": ["18437882252987691225", "57"], "output": false }, + { "inputs": ["53", "57"], "output": false }, + { "inputs": ["57", "57"], "output": true }, + { "inputs": ["57", "53"], "output": false } + ], + "eq_euint64_euint16": [ + { "inputs": ["18440903225701009813", "27779"], "output": false }, + { "inputs": ["27775", "27779"], "output": false }, + { "inputs": ["27779", "27779"], "output": true }, + { "inputs": ["27779", "27775"], "output": false } + ], + "eq_euint64_euint32": [ + { "inputs": ["18445072902459932393", "2427293718"], "output": false }, + { "inputs": ["2427293714", "2427293718"], "output": false }, + { "inputs": ["2427293718", "2427293718"], "output": true }, + { "inputs": ["2427293718", "2427293714"], "output": false } + ], + "eq_euint64_euint64": [ + { "inputs": ["18446429153516875237", "18446319599492506595"], "output": false }, + { "inputs": ["18446319599492506591", "18446319599492506595"], "output": false }, + { "inputs": ["18446319599492506595", "18446319599492506595"], "output": true }, + { "inputs": ["18446319599492506595", "18446319599492506591"], "output": false } + ], + "eq_euint64_uint64": [ + { "inputs": ["18446429153516875237", "18438982609483673889"], "output": false }, + { "inputs": ["18446319599492506591", "18446319599492506595"], "output": false }, + { "inputs": ["18446319599492506595", "18446319599492506595"], "output": true }, + { "inputs": ["18446319599492506595", "18446319599492506591"], "output": false } + ], + "eq_uint64_euint64": [ + { "inputs": ["18442999890088254697", "18438982609483673889"], "output": false }, + { "inputs": ["18446319599492506591", "18446319599492506595"], "output": false }, + { "inputs": ["18446319599492506595", "18446319599492506595"], "output": true }, + { "inputs": ["18446319599492506595", "18446319599492506591"], "output": false } + ], + "eq_euint64_euint128": [ + { "inputs": ["18445840409707449411", "340282366920938463463370508877589228433"], "output": false }, + { "inputs": ["18445840409707449407", "18445840409707449411"], "output": false }, + { "inputs": ["18445840409707449411", "18445840409707449411"], "output": true }, + { "inputs": ["18445840409707449411", "18445840409707449407"], "output": false } + ], + "eq_euint64_euint256": [ { - "inputs": ["18440549964651513569", "18440549964651513565"], + "inputs": [ + "18446580563862250789", + "115792089237316195423570985008687907853269984665640564039457579551317563746263" + ], "output": false - } + }, + { "inputs": ["18446580563862250785", "18446580563862250789"], "output": false }, + { "inputs": ["18446580563862250789", "18446580563862250789"], "output": true }, + { "inputs": ["18446580563862250789", "18446580563862250785"], "output": false } ], - "le_euint128_euint128": [ + "eq_euint128_euint8": [ + { "inputs": ["340282366920938463463368356955344441457", "82"], "output": false }, + { "inputs": ["78", "82"], "output": false }, + { "inputs": ["82", "82"], "output": true }, + { "inputs": ["82", "78"], "output": false } + ], + "eq_euint128_euint16": [ + { "inputs": ["340282366920938463463373086579334781917", "37506"], "output": false }, + { "inputs": ["37502", "37506"], "output": false }, + { "inputs": ["37506", "37506"], "output": true }, + { "inputs": ["37506", "37502"], "output": false } + ], + "eq_euint128_euint32": [ + { "inputs": ["340282366920938463463369450324056753207", "2892665511"], "output": false }, + { "inputs": ["2892665507", "2892665511"], "output": false }, + { "inputs": ["2892665511", "2892665511"], "output": true }, + { "inputs": ["2892665511", "2892665507"], "output": false } + ], + "eq_euint128_euint64": [ + { "inputs": ["340282366920938463463374472257592878217", "18443140825701747421"], "output": false }, + { "inputs": ["18443140825701747417", "18443140825701747421"], "output": false }, + { "inputs": ["18443140825701747421", "18443140825701747421"], "output": true }, + { "inputs": ["18443140825701747421", "18443140825701747417"], "output": false } + ], + "eq_euint128_euint128": [ { - "inputs": ["340282366920938463463373992528465349581", "340282366920938463463372840104721436799"], + "inputs": ["340282366920938463463366345845750623221", "340282366920938463463373674806907402485"], "output": false }, { - "inputs": ["340282366920938463463372840104721436795", "340282366920938463463372840104721436799"], - "output": true + "inputs": ["340282366920938463463366345845750623217", "340282366920938463463366345845750623221"], + "output": false }, { - "inputs": ["340282366920938463463372840104721436799", "340282366920938463463372840104721436799"], + "inputs": ["340282366920938463463366345845750623221", "340282366920938463463366345845750623221"], "output": true }, { - "inputs": ["340282366920938463463372840104721436799", "340282366920938463463372840104721436795"], + "inputs": ["340282366920938463463366345845750623221", "340282366920938463463366345845750623217"], "output": false } ], - "le_euint128_uint128": [ + "eq_euint128_uint128": [ { - "inputs": ["340282366920938463463373992528465349581", "340282366920938463463373835012809081201"], + "inputs": ["340282366920938463463366345845750623221", "340282366920938463463371419152273850417"], "output": false }, { - "inputs": ["340282366920938463463372840104721436795", "340282366920938463463372840104721436799"], - "output": true + "inputs": ["340282366920938463463366345845750623217", "340282366920938463463366345845750623221"], + "output": false }, { - "inputs": ["340282366920938463463372840104721436799", "340282366920938463463372840104721436799"], + "inputs": ["340282366920938463463366345845750623221", "340282366920938463463366345845750623221"], "output": true }, { - "inputs": ["340282366920938463463372840104721436799", "340282366920938463463372840104721436795"], + "inputs": ["340282366920938463463366345845750623221", "340282366920938463463366345845750623217"], "output": false } ], - "le_uint128_euint128": [ + "eq_uint128_euint128": [ { - "inputs": ["340282366920938463463374153561991926979", "340282366920938463463373835012809081201"], + "inputs": ["340282366920938463463370607155928670081", "340282366920938463463371419152273850417"], "output": false }, { - "inputs": ["340282366920938463463372840104721436795", "340282366920938463463372840104721436799"], - "output": true + "inputs": ["340282366920938463463366345845750623217", "340282366920938463463366345845750623221"], + "output": false }, { - "inputs": ["340282366920938463463372840104721436799", "340282366920938463463372840104721436799"], + "inputs": ["340282366920938463463366345845750623221", "340282366920938463463366345845750623221"], "output": true }, { - "inputs": ["340282366920938463463372840104721436799", "340282366920938463463372840104721436795"], + "inputs": ["340282366920938463463366345845750623221", "340282366920938463463366345845750623217"], "output": false } ], - "le_euint128_euint256": [ + "eq_euint128_euint256": [ { "inputs": [ - "340282366920938463463370154534182411951", - "115792089237316195423570985008687907853269984665640564039457582642838670062225" + "340282366920938463463373351977358415319", + "115792089237316195423570985008687907853269984665640564039457581853283263649559" ], - "output": true + "output": false }, { - "inputs": ["340282366920938463463370154534182411947", "340282366920938463463370154534182411951"], - "output": true + "inputs": ["340282366920938463463373351977358415315", "340282366920938463463373351977358415319"], + "output": false }, { - "inputs": ["340282366920938463463370154534182411951", "340282366920938463463370154534182411951"], + "inputs": ["340282366920938463463373351977358415319", "340282366920938463463373351977358415319"], "output": true }, { - "inputs": ["340282366920938463463370154534182411951", "340282366920938463463370154534182411947"], + "inputs": ["340282366920938463463373351977358415319", "340282366920938463463373351977358415315"], "output": false } ], - "le_euint256_euint4": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457578089704885195999", "11"], - "output": false - }, - { "inputs": ["7", "11"], "output": true }, - { "inputs": ["11", "11"], "output": true }, - { "inputs": ["11", "7"], "output": false } - ], - "le_euint256_euint8": [ + "eq_euint256_euint8": [ { - "inputs": ["115792089237316195423570985008687907853269984665640564039457580743279895693245", "161"], + "inputs": ["115792089237316195423570985008687907853269984665640564039457578937151735513693", "236"], "output": false }, - { "inputs": ["157", "161"], "output": true }, - { "inputs": ["161", "161"], "output": true }, - { "inputs": ["161", "157"], "output": false } + { "inputs": ["232", "236"], "output": false }, + { "inputs": ["236", "236"], "output": true }, + { "inputs": ["236", "232"], "output": false } ], - "le_euint256_euint16": [ + "eq_euint256_euint16": [ { - "inputs": ["115792089237316195423570985008687907853269984665640564039457582351250639102167", "47994"], + "inputs": ["115792089237316195423570985008687907853269984665640564039457576896299529748917", "8214"], "output": false }, - { "inputs": ["47990", "47994"], "output": true }, - { "inputs": ["47994", "47994"], "output": true }, - { "inputs": ["47994", "47990"], "output": false } + { "inputs": ["8210", "8214"], "output": false }, + { "inputs": ["8214", "8214"], "output": true }, + { "inputs": ["8214", "8210"], "output": false } ], - "le_euint256_euint32": [ + "eq_euint256_euint32": [ { - "inputs": ["115792089237316195423570985008687907853269984665640564039457582845443410851747", "1340548693"], + "inputs": ["115792089237316195423570985008687907853269984665640564039457576286927938569999", "3393301405"], "output": false }, - { "inputs": ["1340548689", "1340548693"], "output": true }, - { "inputs": ["1340548693", "1340548693"], "output": true }, - { "inputs": ["1340548693", "1340548689"], "output": false } + { "inputs": ["3393301401", "3393301405"], "output": false }, + { "inputs": ["3393301405", "3393301405"], "output": true }, + { "inputs": ["3393301405", "3393301401"], "output": false } ], - "le_euint256_euint64": [ + "eq_euint256_euint64": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457576194967854445761", - "18441295092771573001" + "115792089237316195423570985008687907853269984665640564039457579540655836885013", + "18444858392482385921" ], "output": false }, - { - "inputs": ["18441295092771572997", "18441295092771573001"], - "output": true - }, - { - "inputs": ["18441295092771573001", "18441295092771573001"], - "output": true - }, - { - "inputs": ["18441295092771573001", "18441295092771572997"], - "output": false - } + { "inputs": ["18444858392482385917", "18444858392482385921"], "output": false }, + { "inputs": ["18444858392482385921", "18444858392482385921"], "output": true }, + { "inputs": ["18444858392482385921", "18444858392482385917"], "output": false } ], - "le_euint256_euint128": [ + "eq_euint256_euint128": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457580916980779426235", - "340282366920938463463367434270493244717" + "115792089237316195423570985008687907853269984665640564039457580617368054482805", + "340282366920938463463372946358019545561" ], "output": false }, { - "inputs": ["340282366920938463463367434270493244713", "340282366920938463463367434270493244717"], - "output": true + "inputs": ["340282366920938463463372946358019545557", "340282366920938463463372946358019545561"], + "output": false }, { - "inputs": ["340282366920938463463367434270493244717", "340282366920938463463367434270493244717"], + "inputs": ["340282366920938463463372946358019545561", "340282366920938463463372946358019545561"], "output": true }, { - "inputs": ["340282366920938463463367434270493244717", "340282366920938463463367434270493244713"], + "inputs": ["340282366920938463463372946358019545561", "340282366920938463463372946358019545557"], "output": false } ], - "le_euint256_euint256": [ + "eq_euint256_euint256": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457583300217912499775", - "115792089237316195423570985008687907853269984665640564039457582857952818399809" + "115792089237316195423570985008687907853269984665640564039457580394167199633327", + "115792089237316195423570985008687907853269984665640564039457583329980078552527" ], "output": false }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457582857952818399805", - "115792089237316195423570985008687907853269984665640564039457582857952818399809" + "115792089237316195423570985008687907853269984665640564039457580394167199633323", + "115792089237316195423570985008687907853269984665640564039457580394167199633327" ], - "output": true + "output": false }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457582857952818399809", - "115792089237316195423570985008687907853269984665640564039457582857952818399809" + "115792089237316195423570985008687907853269984665640564039457580394167199633327", + "115792089237316195423570985008687907853269984665640564039457580394167199633327" ], "output": true }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457582857952818399809", - "115792089237316195423570985008687907853269984665640564039457582857952818399805" + "115792089237316195423570985008687907853269984665640564039457580394167199633327", + "115792089237316195423570985008687907853269984665640564039457580394167199633323" ], "output": false } ], - "le_euint256_uint256": [ + "eq_euint256_uint256": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457583300217912499775", - "115792089237316195423570985008687907853269984665640564039457580310546116642945" + "115792089237316195423570985008687907853269984665640564039457580394167199633327", + "115792089237316195423570985008687907853269984665640564039457582311755089887453" ], "output": false }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457582857952818399805", - "115792089237316195423570985008687907853269984665640564039457582857952818399809" + "115792089237316195423570985008687907853269984665640564039457580394167199633323", + "115792089237316195423570985008687907853269984665640564039457580394167199633327" ], - "output": true + "output": false }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457582857952818399809", - "115792089237316195423570985008687907853269984665640564039457582857952818399809" + "115792089237316195423570985008687907853269984665640564039457580394167199633327", + "115792089237316195423570985008687907853269984665640564039457580394167199633327" ], "output": true }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457582857952818399809", - "115792089237316195423570985008687907853269984665640564039457582857952818399805" + "115792089237316195423570985008687907853269984665640564039457580394167199633327", + "115792089237316195423570985008687907853269984665640564039457580394167199633323" ], "output": false } ], - "le_uint256_euint256": [ + "eq_uint256_euint256": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579919776168086147", - "115792089237316195423570985008687907853269984665640564039457580310546116642945" + "115792089237316195423570985008687907853269984665640564039457580878606955952931", + "115792089237316195423570985008687907853269984665640564039457582311755089887453" ], - "output": true + "output": false }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457582857952818399805", - "115792089237316195423570985008687907853269984665640564039457582857952818399809" + "115792089237316195423570985008687907853269984665640564039457580394167199633323", + "115792089237316195423570985008687907853269984665640564039457580394167199633327" ], - "output": true + "output": false }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457582857952818399809", - "115792089237316195423570985008687907853269984665640564039457582857952818399809" + "115792089237316195423570985008687907853269984665640564039457580394167199633327", + "115792089237316195423570985008687907853269984665640564039457580394167199633327" ], "output": true }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457582857952818399809", - "115792089237316195423570985008687907853269984665640564039457582857952818399805" + "115792089237316195423570985008687907853269984665640564039457580394167199633327", + "115792089237316195423570985008687907853269984665640564039457580394167199633323" ], "output": false } ], - "lt_euint4_euint4": [ - { "inputs": ["2", "6"], "output": true }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": false } - ], - "lt_euint4_euint8": [ - { "inputs": ["12", "31"], "output": true }, - { "inputs": ["8", "12"], "output": true }, - { "inputs": ["12", "12"], "output": false }, - { "inputs": ["12", "8"], "output": false } - ], - "lt_euint4_uint8": [ - { "inputs": ["12", "9"], "output": false }, - { "inputs": ["8", "12"], "output": true }, - { "inputs": ["12", "12"], "output": false }, - { "inputs": ["12", "8"], "output": false } - ], - "lt_euint4_euint16": [ - { "inputs": ["10", "24653"], "output": true }, - { "inputs": ["6", "10"], "output": true }, - { "inputs": ["10", "10"], "output": false }, - { "inputs": ["10", "6"], "output": false } - ], - "lt_euint4_euint32": [ - { "inputs": ["1", "3154883490"], "output": true }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": false } - ], - "lt_euint4_euint64": [ - { "inputs": ["13", "18441885120383916401"], "output": true }, - { "inputs": ["9", "13"], "output": true }, - { "inputs": ["13", "13"], "output": false }, - { "inputs": ["13", "9"], "output": false } + "ne_euint8_euint8": [ + { "inputs": ["70", "181"], "output": true }, + { "inputs": ["66", "70"], "output": true }, + { "inputs": ["70", "70"], "output": false }, + { "inputs": ["70", "66"], "output": true } ], - "lt_euint4_euint128": [ - { - "inputs": ["8", "340282366920938463463367828600285579945"], - "output": true - }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": false } + "ne_euint8_uint8": [ + { "inputs": ["70", "134"], "output": true }, + { "inputs": ["66", "70"], "output": true }, + { "inputs": ["70", "70"], "output": false }, + { "inputs": ["70", "66"], "output": true } + ], + "ne_uint8_euint8": [ + { "inputs": ["46", "134"], "output": true }, + { "inputs": ["66", "70"], "output": true }, + { "inputs": ["70", "70"], "output": false }, + { "inputs": ["70", "66"], "output": true } + ], + "ne_euint8_euint16": [ + { "inputs": ["142", "30297"], "output": true }, + { "inputs": ["138", "142"], "output": true }, + { "inputs": ["142", "142"], "output": false }, + { "inputs": ["142", "138"], "output": true } + ], + "ne_euint8_euint32": [ + { "inputs": ["79", "3599603165"], "output": true }, + { "inputs": ["75", "79"], "output": true }, + { "inputs": ["79", "79"], "output": false }, + { "inputs": ["79", "75"], "output": true } ], - "lt_euint4_euint256": [ + "ne_euint8_euint64": [ + { "inputs": ["33", "18442782278275008081"], "output": true }, + { "inputs": ["29", "33"], "output": true }, + { "inputs": ["33", "33"], "output": false }, + { "inputs": ["33", "29"], "output": true } + ], + "ne_euint8_euint128": [ + { "inputs": ["68", "340282366920938463463373239639391921613"], "output": true }, + { "inputs": ["64", "68"], "output": true }, + { "inputs": ["68", "68"], "output": false }, + { "inputs": ["68", "64"], "output": true } + ], + "ne_euint8_euint256": [ { - "inputs": ["11", "115792089237316195423570985008687907853269984665640564039457582432165171824629"], + "inputs": ["190", "115792089237316195423570985008687907853269984665640564039457578705707343124477"], "output": true }, - { "inputs": ["7", "11"], "output": true }, - { "inputs": ["11", "11"], "output": false }, - { "inputs": ["11", "7"], "output": false } + { "inputs": ["186", "190"], "output": true }, + { "inputs": ["190", "190"], "output": false }, + { "inputs": ["190", "186"], "output": true } ], - "lt_euint8_euint4": [ - { "inputs": ["163", "11"], "output": false }, - { "inputs": ["7", "11"], "output": true }, - { "inputs": ["11", "11"], "output": false }, - { "inputs": ["11", "7"], "output": false } - ], - "lt_uint8_euint4": [ - { "inputs": ["5", "11"], "output": true }, - { "inputs": ["7", "11"], "output": true }, - { "inputs": ["11", "11"], "output": false }, - { "inputs": ["11", "7"], "output": false } - ], - "lt_euint8_euint8": [ - { "inputs": ["221", "45"], "output": false }, - { "inputs": ["41", "45"], "output": true }, - { "inputs": ["45", "45"], "output": false }, - { "inputs": ["45", "41"], "output": false } + "ne_euint16_euint8": [ + { "inputs": ["54563", "13"], "output": true }, + { "inputs": ["9", "13"], "output": true }, + { "inputs": ["13", "13"], "output": false }, + { "inputs": ["13", "9"], "output": true } ], - "lt_euint8_uint8": [ - { "inputs": ["221", "96"], "output": false }, - { "inputs": ["41", "45"], "output": true }, - { "inputs": ["45", "45"], "output": false }, - { "inputs": ["45", "41"], "output": false } + "ne_euint16_euint16": [ + { "inputs": ["59354", "61202"], "output": true }, + { "inputs": ["59350", "59354"], "output": true }, + { "inputs": ["59354", "59354"], "output": false }, + { "inputs": ["59354", "59350"], "output": true } ], - "lt_uint8_euint8": [ - { "inputs": ["225", "96"], "output": false }, - { "inputs": ["41", "45"], "output": true }, - { "inputs": ["45", "45"], "output": false }, - { "inputs": ["45", "41"], "output": false } + "ne_euint16_uint16": [ + { "inputs": ["59354", "57888"], "output": true }, + { "inputs": ["59350", "59354"], "output": true }, + { "inputs": ["59354", "59354"], "output": false }, + { "inputs": ["59354", "59350"], "output": true } ], - "lt_euint8_euint16": [ - { "inputs": ["31", "45682"], "output": true }, - { "inputs": ["27", "31"], "output": true }, - { "inputs": ["31", "31"], "output": false }, - { "inputs": ["31", "27"], "output": false } + "ne_uint16_euint16": [ + { "inputs": ["61088", "57888"], "output": true }, + { "inputs": ["59350", "59354"], "output": true }, + { "inputs": ["59354", "59354"], "output": false }, + { "inputs": ["59354", "59350"], "output": true } ], - "lt_euint8_euint32": [ - { "inputs": ["111", "1481942282"], "output": true }, - { "inputs": ["107", "111"], "output": true }, - { "inputs": ["111", "111"], "output": false }, - { "inputs": ["111", "107"], "output": false } + "ne_euint16_euint32": [ + { "inputs": ["17814", "2854422530"], "output": true }, + { "inputs": ["17810", "17814"], "output": true }, + { "inputs": ["17814", "17814"], "output": false }, + { "inputs": ["17814", "17810"], "output": true } ], - "lt_euint8_euint64": [ - { "inputs": ["213", "18441867518419136505"], "output": true }, - { "inputs": ["209", "213"], "output": true }, - { "inputs": ["213", "213"], "output": false }, - { "inputs": ["213", "209"], "output": false } + "ne_euint16_euint64": [ + { "inputs": ["12028", "18442936603552008703"], "output": true }, + { "inputs": ["12024", "12028"], "output": true }, + { "inputs": ["12028", "12028"], "output": false }, + { "inputs": ["12028", "12024"], "output": true } ], - "lt_euint8_euint128": [ - { - "inputs": ["90", "340282366920938463463366855244560424809"], - "output": true - }, - { "inputs": ["86", "90"], "output": true }, - { "inputs": ["90", "90"], "output": false }, - { "inputs": ["90", "86"], "output": false } + "ne_euint16_euint128": [ + { "inputs": ["18440", "340282366920938463463366926074952290431"], "output": true }, + { "inputs": ["18436", "18440"], "output": true }, + { "inputs": ["18440", "18440"], "output": false }, + { "inputs": ["18440", "18436"], "output": true } ], - "lt_euint8_euint256": [ + "ne_euint16_euint256": [ { - "inputs": ["142", "115792089237316195423570985008687907853269984665640564039457583972137475354729"], + "inputs": ["60158", "115792089237316195423570985008687907853269984665640564039457575261569011961607"], "output": true }, - { "inputs": ["138", "142"], "output": true }, - { "inputs": ["142", "142"], "output": false }, - { "inputs": ["142", "138"], "output": false } + { "inputs": ["60154", "60158"], "output": true }, + { "inputs": ["60158", "60158"], "output": false }, + { "inputs": ["60158", "60154"], "output": true } ], - "lt_euint16_euint4": [ - { "inputs": ["38459", "3"], "output": false }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": false } - ], - "lt_euint16_euint8": [ - { "inputs": ["6772", "147"], "output": false }, - { "inputs": ["143", "147"], "output": true }, - { "inputs": ["147", "147"], "output": false }, - { "inputs": ["147", "143"], "output": false } + "ne_euint32_euint8": [ + { "inputs": ["245785031", "125"], "output": true }, + { "inputs": ["121", "125"], "output": true }, + { "inputs": ["125", "125"], "output": false }, + { "inputs": ["125", "121"], "output": true } ], - "lt_euint16_euint16": [ - { "inputs": ["34482", "5146"], "output": false }, - { "inputs": ["5142", "5146"], "output": true }, - { "inputs": ["5146", "5146"], "output": false }, - { "inputs": ["5146", "5142"], "output": false } + "ne_euint32_euint16": [ + { "inputs": ["3155338652", "45378"], "output": true }, + { "inputs": ["45374", "45378"], "output": true }, + { "inputs": ["45378", "45378"], "output": false }, + { "inputs": ["45378", "45374"], "output": true } ], - "lt_euint16_uint16": [ - { "inputs": ["34482", "38499"], "output": true }, - { "inputs": ["5142", "5146"], "output": true }, - { "inputs": ["5146", "5146"], "output": false }, - { "inputs": ["5146", "5142"], "output": false } + "ne_euint32_euint32": [ + { "inputs": ["3773459419", "2532361615"], "output": true }, + { "inputs": ["2532361611", "2532361615"], "output": true }, + { "inputs": ["2532361615", "2532361615"], "output": false }, + { "inputs": ["2532361615", "2532361611"], "output": true } ], - "lt_uint16_euint16": [ - { "inputs": ["21462", "38499"], "output": true }, - { "inputs": ["5142", "5146"], "output": true }, - { "inputs": ["5146", "5146"], "output": false }, - { "inputs": ["5146", "5142"], "output": false } + "ne_euint32_uint32": [ + { "inputs": ["3773459419", "3950678842"], "output": true }, + { "inputs": ["2532361611", "2532361615"], "output": true }, + { "inputs": ["2532361615", "2532361615"], "output": false }, + { "inputs": ["2532361615", "2532361611"], "output": true } ], - "lt_euint16_euint32": [ - { "inputs": ["31744", "3296344536"], "output": true }, - { "inputs": ["31740", "31744"], "output": true }, - { "inputs": ["31744", "31744"], "output": false }, - { "inputs": ["31744", "31740"], "output": false } + "ne_uint32_euint32": [ + { "inputs": ["4134317335", "3950678842"], "output": true }, + { "inputs": ["2532361611", "2532361615"], "output": true }, + { "inputs": ["2532361615", "2532361615"], "output": false }, + { "inputs": ["2532361615", "2532361611"], "output": true } ], - "lt_euint16_euint64": [ - { "inputs": ["7192", "18440977990475901673"], "output": true }, - { "inputs": ["7188", "7192"], "output": true }, - { "inputs": ["7192", "7192"], "output": false }, - { "inputs": ["7192", "7188"], "output": false } + "ne_euint32_euint64": [ + { "inputs": ["2644528897", "18437983593938809423"], "output": true }, + { "inputs": ["2644528893", "2644528897"], "output": true }, + { "inputs": ["2644528897", "2644528897"], "output": false }, + { "inputs": ["2644528897", "2644528893"], "output": true } ], - "lt_euint16_euint128": [ - { - "inputs": ["16589", "340282366920938463463371297893972390287"], - "output": true - }, - { "inputs": ["16585", "16589"], "output": true }, - { "inputs": ["16589", "16589"], "output": false }, - { "inputs": ["16589", "16585"], "output": false } + "ne_euint32_euint128": [ + { "inputs": ["2394268712", "340282366920938463463373085805777883685"], "output": true }, + { "inputs": ["2394268708", "2394268712"], "output": true }, + { "inputs": ["2394268712", "2394268712"], "output": false }, + { "inputs": ["2394268712", "2394268708"], "output": true } ], - "lt_euint16_euint256": [ + "ne_euint32_euint256": [ { - "inputs": ["58145", "115792089237316195423570985008687907853269984665640564039457578303118040864491"], + "inputs": ["3139514818", "115792089237316195423570985008687907853269984665640564039457579375390477849009"], "output": true }, - { "inputs": ["58141", "58145"], "output": true }, - { "inputs": ["58145", "58145"], "output": false }, - { "inputs": ["58145", "58141"], "output": false } - ], - "lt_euint32_euint4": [ - { "inputs": ["2282621038", "7"], "output": false }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": false } + { "inputs": ["3139514814", "3139514818"], "output": true }, + { "inputs": ["3139514818", "3139514818"], "output": false }, + { "inputs": ["3139514818", "3139514814"], "output": true } ], - "lt_euint32_euint8": [ - { "inputs": ["1459989337", "220"], "output": false }, - { "inputs": ["216", "220"], "output": true }, - { "inputs": ["220", "220"], "output": false }, - { "inputs": ["220", "216"], "output": false } + "ne_euint64_euint8": [ + { "inputs": ["18438678957133695603", "234"], "output": true }, + { "inputs": ["230", "234"], "output": true }, + { "inputs": ["234", "234"], "output": false }, + { "inputs": ["234", "230"], "output": true } ], - "lt_euint32_euint16": [ - { "inputs": ["2091084769", "25571"], "output": false }, - { "inputs": ["25567", "25571"], "output": true }, - { "inputs": ["25571", "25571"], "output": false }, - { "inputs": ["25571", "25567"], "output": false } + "ne_euint64_euint16": [ + { "inputs": ["18443521796324116489", "19773"], "output": true }, + { "inputs": ["19769", "19773"], "output": true }, + { "inputs": ["19773", "19773"], "output": false }, + { "inputs": ["19773", "19769"], "output": true } ], - "lt_euint32_euint32": [ - { "inputs": ["597865082", "2797648845"], "output": true }, - { "inputs": ["597865078", "597865082"], "output": true }, - { "inputs": ["597865082", "597865082"], "output": false }, - { "inputs": ["597865082", "597865078"], "output": false } + "ne_euint64_euint32": [ + { "inputs": ["18444944092801551515", "2507057705"], "output": true }, + { "inputs": ["2507057701", "2507057705"], "output": true }, + { "inputs": ["2507057705", "2507057705"], "output": false }, + { "inputs": ["2507057705", "2507057701"], "output": true } ], - "lt_euint32_uint32": [ - { "inputs": ["597865082", "459499324"], "output": false }, - { "inputs": ["597865078", "597865082"], "output": true }, - { "inputs": ["597865082", "597865082"], "output": false }, - { "inputs": ["597865082", "597865078"], "output": false } + "ne_euint64_euint64": [ + { "inputs": ["18441036486320033453", "18438871465129773285"], "output": true }, + { "inputs": ["18438871465129773281", "18438871465129773285"], "output": true }, + { "inputs": ["18438871465129773285", "18438871465129773285"], "output": false }, + { "inputs": ["18438871465129773285", "18438871465129773281"], "output": true } ], - "lt_uint32_euint32": [ - { "inputs": ["4239340674", "459499324"], "output": false }, - { "inputs": ["597865078", "597865082"], "output": true }, - { "inputs": ["597865082", "597865082"], "output": false }, - { "inputs": ["597865082", "597865078"], "output": false } + "ne_euint64_uint64": [ + { "inputs": ["18441036486320033453", "18442829903503957685"], "output": true }, + { "inputs": ["18438871465129773281", "18438871465129773285"], "output": true }, + { "inputs": ["18438871465129773285", "18438871465129773285"], "output": false }, + { "inputs": ["18438871465129773285", "18438871465129773281"], "output": true } ], - "lt_euint32_euint64": [ - { "inputs": ["3259927115", "18445091130782070813"], "output": true }, - { "inputs": ["3259927111", "3259927115"], "output": true }, - { "inputs": ["3259927115", "3259927115"], "output": false }, - { "inputs": ["3259927115", "3259927111"], "output": false } + "ne_uint64_euint64": [ + { "inputs": ["18440774978521118187", "18442829903503957685"], "output": true }, + { "inputs": ["18438871465129773281", "18438871465129773285"], "output": true }, + { "inputs": ["18438871465129773285", "18438871465129773285"], "output": false }, + { "inputs": ["18438871465129773285", "18438871465129773281"], "output": true } ], - "lt_euint32_euint128": [ - { - "inputs": ["2093199071", "340282366920938463463370622002914075235"], - "output": true - }, - { "inputs": ["2093199067", "2093199071"], "output": true }, - { "inputs": ["2093199071", "2093199071"], "output": false }, - { "inputs": ["2093199071", "2093199067"], "output": false } + "ne_euint64_euint128": [ + { "inputs": ["18438879338871411889", "340282366920938463463372422976738826005"], "output": true }, + { "inputs": ["18438879338871411885", "18438879338871411889"], "output": true }, + { "inputs": ["18438879338871411889", "18438879338871411889"], "output": false }, + { "inputs": ["18438879338871411889", "18438879338871411885"], "output": true } ], - "lt_euint32_euint256": [ + "ne_euint64_euint256": [ { - "inputs": ["3016190595", "115792089237316195423570985008687907853269984665640564039457583853908247743739"], + "inputs": [ + "18446383108636486165", + "115792089237316195423570985008687907853269984665640564039457577697762718054121" + ], "output": true }, - { "inputs": ["3016190591", "3016190595"], "output": true }, - { "inputs": ["3016190595", "3016190595"], "output": false }, - { "inputs": ["3016190595", "3016190591"], "output": false } + { "inputs": ["18446383108636486161", "18446383108636486165"], "output": true }, + { "inputs": ["18446383108636486165", "18446383108636486165"], "output": false }, + { "inputs": ["18446383108636486165", "18446383108636486161"], "output": true } ], - "lt_euint64_euint4": [ - { "inputs": ["18444247959988442675", "10"], "output": false }, - { "inputs": ["6", "10"], "output": true }, - { "inputs": ["10", "10"], "output": false }, - { "inputs": ["10", "6"], "output": false } + "ne_euint128_euint8": [ + { "inputs": ["340282366920938463463371541441521149849", "141"], "output": true }, + { "inputs": ["137", "141"], "output": true }, + { "inputs": ["141", "141"], "output": false }, + { "inputs": ["141", "137"], "output": true } ], - "lt_euint64_euint8": [ - { "inputs": ["18444886637718481993", "57"], "output": false }, - { "inputs": ["53", "57"], "output": true }, - { "inputs": ["57", "57"], "output": false }, - { "inputs": ["57", "53"], "output": false } + "ne_euint128_euint16": [ + { "inputs": ["340282366920938463463372894254052380995", "20753"], "output": true }, + { "inputs": ["20749", "20753"], "output": true }, + { "inputs": ["20753", "20753"], "output": false }, + { "inputs": ["20753", "20749"], "output": true } ], - "lt_euint64_euint16": [ - { "inputs": ["18440546263819960189", "42672"], "output": false }, - { "inputs": ["42668", "42672"], "output": true }, - { "inputs": ["42672", "42672"], "output": false }, - { "inputs": ["42672", "42668"], "output": false } + "ne_euint128_euint32": [ + { "inputs": ["340282366920938463463368615869493710683", "1005999743"], "output": true }, + { "inputs": ["1005999739", "1005999743"], "output": true }, + { "inputs": ["1005999743", "1005999743"], "output": false }, + { "inputs": ["1005999743", "1005999739"], "output": true } ], - "lt_euint64_euint32": [ - { "inputs": ["18441377707016357467", "2876988629"], "output": false }, - { "inputs": ["2876988625", "2876988629"], "output": true }, - { "inputs": ["2876988629", "2876988629"], "output": false }, - { "inputs": ["2876988629", "2876988625"], "output": false } + "ne_euint128_euint64": [ + { "inputs": ["340282366920938463463367197731922191521", "18444517464777265293"], "output": true }, + { "inputs": ["18444517464777265289", "18444517464777265293"], "output": true }, + { "inputs": ["18444517464777265293", "18444517464777265293"], "output": false }, + { "inputs": ["18444517464777265293", "18444517464777265289"], "output": true } ], - "lt_euint64_euint64": [ - { - "inputs": ["18443308354694945505", "18438494040818835505"], - "output": false - }, + "ne_euint128_euint128": [ { - "inputs": ["18438494040818835501", "18438494040818835505"], + "inputs": ["340282366920938463463365816546309792393", "340282366920938463463374123851958250971"], "output": true }, { - "inputs": ["18438494040818835505", "18438494040818835505"], - "output": false - }, - { - "inputs": ["18438494040818835505", "18438494040818835501"], - "output": false - } - ], - "lt_euint64_uint64": [ - { - "inputs": ["18443308354694945505", "18438426856220799235"], - "output": false - }, - { - "inputs": ["18438494040818835501", "18438494040818835505"], + "inputs": ["340282366920938463463365816546309792389", "340282366920938463463365816546309792393"], "output": true }, { - "inputs": ["18438494040818835505", "18438494040818835505"], + "inputs": ["340282366920938463463365816546309792393", "340282366920938463463365816546309792393"], "output": false }, - { - "inputs": ["18438494040818835505", "18438494040818835501"], - "output": false - } + { "inputs": ["340282366920938463463365816546309792393", "340282366920938463463365816546309792389"], "output": true } ], - "lt_uint64_euint64": [ + "ne_euint128_uint128": [ { - "inputs": ["18444682732892858227", "18438426856220799235"], - "output": false + "inputs": ["340282366920938463463365816546309792393", "340282366920938463463370133565615320155"], + "output": true }, { - "inputs": ["18438494040818835501", "18438494040818835505"], + "inputs": ["340282366920938463463365816546309792389", "340282366920938463463365816546309792393"], "output": true }, { - "inputs": ["18438494040818835505", "18438494040818835505"], + "inputs": ["340282366920938463463365816546309792393", "340282366920938463463365816546309792393"], "output": false }, - { - "inputs": ["18438494040818835505", "18438494040818835501"], - "output": false - } + { "inputs": ["340282366920938463463365816546309792393", "340282366920938463463365816546309792389"], "output": true } ], - "lt_euint64_euint128": [ + "ne_uint128_euint128": [ { - "inputs": ["18444814117403628673", "340282366920938463463365637360413874149"], + "inputs": ["340282366920938463463370376121210703377", "340282366920938463463370133565615320155"], "output": true }, { - "inputs": ["18444814117403628669", "18444814117403628673"], + "inputs": ["340282366920938463463365816546309792389", "340282366920938463463365816546309792393"], "output": true }, { - "inputs": ["18444814117403628673", "18444814117403628673"], + "inputs": ["340282366920938463463365816546309792393", "340282366920938463463365816546309792393"], "output": false }, - { - "inputs": ["18444814117403628673", "18444814117403628669"], - "output": false - } + { "inputs": ["340282366920938463463365816546309792393", "340282366920938463463365816546309792389"], "output": true } ], - "lt_euint64_euint256": [ + "ne_euint128_euint256": [ { "inputs": [ - "18440844601726997069", - "115792089237316195423570985008687907853269984665640564039457578884493044868087" + "340282366920938463463370739244187947491", + "115792089237316195423570985008687907853269984665640564039457576328752324097563" ], "output": true }, { - "inputs": ["18440844601726997065", "18440844601726997069"], - "output": true - }, - { - "inputs": ["18440844601726997069", "18440844601726997069"], - "output": false - }, - { - "inputs": ["18440844601726997069", "18440844601726997065"], - "output": false - } - ], - "lt_euint128_euint4": [ - { - "inputs": ["340282366920938463463368530671945258801", "12"], - "output": false - }, - { "inputs": ["8", "12"], "output": true }, - { "inputs": ["12", "12"], "output": false }, - { "inputs": ["12", "8"], "output": false } - ], - "lt_euint128_euint8": [ - { - "inputs": ["340282366920938463463371295793146087759", "46"], - "output": false - }, - { "inputs": ["42", "46"], "output": true }, - { "inputs": ["46", "46"], "output": false }, - { "inputs": ["46", "42"], "output": false } - ], - "lt_euint128_euint16": [ - { - "inputs": ["340282366920938463463374223690909641239", "37855"], - "output": false - }, - { "inputs": ["37851", "37855"], "output": true }, - { "inputs": ["37855", "37855"], "output": false }, - { "inputs": ["37855", "37851"], "output": false } - ], - "lt_euint128_euint32": [ - { - "inputs": ["340282366920938463463373212421821063067", "1708404829"], - "output": false - }, - { "inputs": ["1708404825", "1708404829"], "output": true }, - { "inputs": ["1708404829", "1708404829"], "output": false }, - { "inputs": ["1708404829", "1708404825"], "output": false } - ], - "lt_euint128_euint64": [ - { - "inputs": ["340282366920938463463369469329980440219", "18446437448475645327"], - "output": false - }, - { - "inputs": ["18446437448475645323", "18446437448475645327"], + "inputs": ["340282366920938463463370739244187947487", "340282366920938463463370739244187947491"], "output": true }, { - "inputs": ["18446437448475645327", "18446437448475645327"], + "inputs": ["340282366920938463463370739244187947491", "340282366920938463463370739244187947491"], "output": false }, - { - "inputs": ["18446437448475645327", "18446437448475645323"], - "output": false - } + { "inputs": ["340282366920938463463370739244187947491", "340282366920938463463370739244187947487"], "output": true } ], - "lt_euint128_euint128": [ - { - "inputs": ["340282366920938463463368309276517872429", "340282366920938463463372024309642476529"], - "output": true - }, + "ne_euint256_euint8": [ { - "inputs": ["340282366920938463463368309276517872425", "340282366920938463463368309276517872429"], + "inputs": ["115792089237316195423570985008687907853269984665640564039457579558987589688245", "89"], "output": true }, - { - "inputs": ["340282366920938463463368309276517872429", "340282366920938463463368309276517872429"], - "output": false - }, - { - "inputs": ["340282366920938463463368309276517872429", "340282366920938463463368309276517872425"], - "output": false - } + { "inputs": ["85", "89"], "output": true }, + { "inputs": ["89", "89"], "output": false }, + { "inputs": ["89", "85"], "output": true } ], - "lt_euint128_uint128": [ - { - "inputs": ["340282366920938463463368309276517872429", "340282366920938463463366305725915183957"], - "output": false - }, + "ne_euint256_euint16": [ { - "inputs": ["340282366920938463463368309276517872425", "340282366920938463463368309276517872429"], + "inputs": ["115792089237316195423570985008687907853269984665640564039457580361572069164269", "58240"], "output": true }, - { - "inputs": ["340282366920938463463368309276517872429", "340282366920938463463368309276517872429"], - "output": false - }, - { - "inputs": ["340282366920938463463368309276517872429", "340282366920938463463368309276517872425"], - "output": false - } + { "inputs": ["58236", "58240"], "output": true }, + { "inputs": ["58240", "58240"], "output": false }, + { "inputs": ["58240", "58236"], "output": true } ], - "lt_uint128_euint128": [ - { - "inputs": ["340282366920938463463371881592186712743", "340282366920938463463366305725915183957"], - "output": false - }, + "ne_euint256_euint32": [ { - "inputs": ["340282366920938463463368309276517872425", "340282366920938463463368309276517872429"], + "inputs": ["115792089237316195423570985008687907853269984665640564039457578486006925293641", "3368515216"], "output": true }, - { - "inputs": ["340282366920938463463368309276517872429", "340282366920938463463368309276517872429"], - "output": false - }, - { - "inputs": ["340282366920938463463368309276517872429", "340282366920938463463368309276517872425"], - "output": false - } + { "inputs": ["3368515212", "3368515216"], "output": true }, + { "inputs": ["3368515216", "3368515216"], "output": false }, + { "inputs": ["3368515216", "3368515212"], "output": true } ], - "lt_euint128_euint256": [ + "ne_euint256_euint64": [ { "inputs": [ - "340282366920938463463373024758287549459", - "115792089237316195423570985008687907853269984665640564039457580686028388504291" + "115792089237316195423570985008687907853269984665640564039457581050422272861653", + "18438483149139803647" ], "output": true }, - { - "inputs": ["340282366920938463463373024758287549455", "340282366920938463463373024758287549459"], - "output": true - }, - { - "inputs": ["340282366920938463463373024758287549459", "340282366920938463463373024758287549459"], - "output": false - }, - { - "inputs": ["340282366920938463463373024758287549459", "340282366920938463463373024758287549455"], - "output": false - } - ], - "lt_euint256_euint4": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457580046200927487349", "9"], - "output": false - }, - { "inputs": ["5", "9"], "output": true }, - { "inputs": ["9", "9"], "output": false }, - { "inputs": ["9", "5"], "output": false } - ], - "lt_euint256_euint8": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457575356850463874977", "220"], - "output": false - }, - { "inputs": ["216", "220"], "output": true }, - { "inputs": ["220", "220"], "output": false }, - { "inputs": ["220", "216"], "output": false } - ], - "lt_euint256_euint16": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457581793657869781609", "60020"], - "output": false - }, - { "inputs": ["60016", "60020"], "output": true }, - { "inputs": ["60020", "60020"], "output": false }, - { "inputs": ["60020", "60016"], "output": false } - ], - "lt_euint256_euint32": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457577148837567008665", "1716202338"], - "output": false - }, - { "inputs": ["1716202334", "1716202338"], "output": true }, - { "inputs": ["1716202338", "1716202338"], "output": false }, - { "inputs": ["1716202338", "1716202334"], "output": false } + { "inputs": ["18438483149139803643", "18438483149139803647"], "output": true }, + { "inputs": ["18438483149139803647", "18438483149139803647"], "output": false }, + { "inputs": ["18438483149139803647", "18438483149139803643"], "output": true } ], - "lt_euint256_euint64": [ + "ne_euint256_euint128": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577348858503949249", - "18446356831740760619" + "115792089237316195423570985008687907853269984665640564039457578428695715663237", + "340282366920938463463371318734334978879" ], - "output": false - }, - { - "inputs": ["18446356831740760615", "18446356831740760619"], "output": true }, { - "inputs": ["18446356831740760619", "18446356831740760619"], - "output": false - }, - { - "inputs": ["18446356831740760619", "18446356831740760615"], - "output": false - } - ], - "lt_euint256_euint128": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457582200169426284819", - "340282366920938463463367486483424293599" - ], - "output": false - }, - { - "inputs": ["340282366920938463463367486483424293595", "340282366920938463463367486483424293599"], + "inputs": ["340282366920938463463371318734334978875", "340282366920938463463371318734334978879"], "output": true }, { - "inputs": ["340282366920938463463367486483424293599", "340282366920938463463367486483424293599"], + "inputs": ["340282366920938463463371318734334978879", "340282366920938463463371318734334978879"], "output": false }, - { - "inputs": ["340282366920938463463367486483424293599", "340282366920938463463367486483424293595"], - "output": false - } + { "inputs": ["340282366920938463463371318734334978879", "340282366920938463463371318734334978875"], "output": true } ], - "lt_euint256_euint256": [ + "ne_euint256_euint256": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579345439988102233", - "115792089237316195423570985008687907853269984665640564039457575518813902238261" + "115792089237316195423570985008687907853269984665640564039457578761111996634411", + "115792089237316195423570985008687907853269984665640564039457577505335391945599" ], - "output": false + "output": true }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457575518813902238257", - "115792089237316195423570985008687907853269984665640564039457575518813902238261" + "115792089237316195423570985008687907853269984665640564039457577505335391945595", + "115792089237316195423570985008687907853269984665640564039457577505335391945599" ], "output": true }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457575518813902238261", - "115792089237316195423570985008687907853269984665640564039457575518813902238261" + "115792089237316195423570985008687907853269984665640564039457577505335391945599", + "115792089237316195423570985008687907853269984665640564039457577505335391945599" ], "output": false }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457575518813902238261", - "115792089237316195423570985008687907853269984665640564039457575518813902238257" + "115792089237316195423570985008687907853269984665640564039457577505335391945599", + "115792089237316195423570985008687907853269984665640564039457577505335391945595" ], - "output": false + "output": true } ], - "lt_euint256_uint256": [ + "ne_euint256_uint256": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579345439988102233", - "115792089237316195423570985008687907853269984665640564039457581362267810923471" + "115792089237316195423570985008687907853269984665640564039457578761111996634411", + "115792089237316195423570985008687907853269984665640564039457577142203967644203" ], "output": true }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457575518813902238257", - "115792089237316195423570985008687907853269984665640564039457575518813902238261" + "115792089237316195423570985008687907853269984665640564039457577505335391945595", + "115792089237316195423570985008687907853269984665640564039457577505335391945599" ], "output": true }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457575518813902238261", - "115792089237316195423570985008687907853269984665640564039457575518813902238261" + "115792089237316195423570985008687907853269984665640564039457577505335391945599", + "115792089237316195423570985008687907853269984665640564039457577505335391945599" ], "output": false }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457575518813902238261", - "115792089237316195423570985008687907853269984665640564039457575518813902238257" + "115792089237316195423570985008687907853269984665640564039457577505335391945599", + "115792089237316195423570985008687907853269984665640564039457577505335391945595" ], - "output": false + "output": true } ], - "lt_uint256_euint256": [ + "ne_uint256_euint256": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457578628645763210627", - "115792089237316195423570985008687907853269984665640564039457581362267810923471" + "115792089237316195423570985008687907853269984665640564039457577579932143265063", + "115792089237316195423570985008687907853269984665640564039457577142203967644203" ], "output": true }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457575518813902238257", - "115792089237316195423570985008687907853269984665640564039457575518813902238261" + "115792089237316195423570985008687907853269984665640564039457577505335391945595", + "115792089237316195423570985008687907853269984665640564039457577505335391945599" ], "output": true }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457575518813902238261", - "115792089237316195423570985008687907853269984665640564039457575518813902238261" + "115792089237316195423570985008687907853269984665640564039457577505335391945599", + "115792089237316195423570985008687907853269984665640564039457577505335391945599" ], "output": false }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457575518813902238261", - "115792089237316195423570985008687907853269984665640564039457575518813902238257" + "115792089237316195423570985008687907853269984665640564039457577505335391945599", + "115792089237316195423570985008687907853269984665640564039457577505335391945595" ], - "output": false + "output": true } ], - "ge_euint4_euint4": [ - { "inputs": ["6", "11"], "output": false }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": true } - ], - "ge_euint4_euint8": [ - { "inputs": ["3", "79"], "output": false }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": true } - ], - "ge_euint4_uint8": [ - { "inputs": ["3", "5"], "output": false }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": true } - ], - "ge_euint4_euint16": [ - { "inputs": ["1", "53247"], "output": false }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": true } - ], - "ge_euint4_euint32": [ - { "inputs": ["1", "2262617776"], "output": false }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": true } - ], - "ge_euint4_euint64": [ - { "inputs": ["12", "18446558548033148537"], "output": false }, - { "inputs": ["8", "12"], "output": false }, - { "inputs": ["12", "12"], "output": true }, - { "inputs": ["12", "8"], "output": true } - ], - "ge_euint4_euint128": [ - { - "inputs": ["3", "340282366920938463463374467311851431135"], - "output": false - }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": true } + "shl_euint8_euint8": [ + { "inputs": ["214", "8"], "output": "214" }, + { "inputs": ["4", "8"], "output": "4" }, + { "inputs": ["8", "8"], "output": "8" }, + { "inputs": ["8", "4"], "output": "128" } ], - "ge_euint4_euint256": [ - { - "inputs": ["5", "115792089237316195423570985008687907853269984665640564039457582400238586978263"], - "output": false - }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": true } + "shl_euint8_uint8": [ + { "inputs": ["214", "8"], "output": "214" }, + { "inputs": ["4", "8"], "output": "4" }, + { "inputs": ["8", "8"], "output": "8" }, + { "inputs": ["8", "4"], "output": "128" } ], - "ge_euint8_euint4": [ - { "inputs": ["53", "1"], "output": true }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": true } + "shl_euint16_euint8": [ + { "inputs": ["2314", "7"], "output": "34048" }, + { "inputs": ["3", "7"], "output": "384" }, + { "inputs": ["7", "7"], "output": "896" }, + { "inputs": ["7", "3"], "output": "56" } ], - "ge_uint8_euint4": [ - { "inputs": ["14", "1"], "output": true }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": true } + "shl_euint16_uint8": [ + { "inputs": ["2314", "7"], "output": "34048" }, + { "inputs": ["3", "7"], "output": "384" }, + { "inputs": ["7", "7"], "output": "896" }, + { "inputs": ["7", "3"], "output": "56" } ], - "ge_euint8_euint8": [ - { "inputs": ["63", "190"], "output": false }, - { "inputs": ["59", "63"], "output": false }, - { "inputs": ["63", "63"], "output": true }, - { "inputs": ["63", "59"], "output": true } - ], - "ge_euint8_uint8": [ - { "inputs": ["63", "223"], "output": false }, - { "inputs": ["59", "63"], "output": false }, - { "inputs": ["63", "63"], "output": true }, - { "inputs": ["63", "59"], "output": true } - ], - "ge_uint8_euint8": [ - { "inputs": ["3", "223"], "output": false }, - { "inputs": ["59", "63"], "output": false }, - { "inputs": ["63", "63"], "output": true }, - { "inputs": ["63", "59"], "output": true } - ], - "ge_euint8_euint16": [ - { "inputs": ["93", "62769"], "output": false }, - { "inputs": ["89", "93"], "output": false }, - { "inputs": ["93", "93"], "output": true }, - { "inputs": ["93", "89"], "output": true } - ], - "ge_euint8_euint32": [ - { "inputs": ["108", "54055221"], "output": false }, - { "inputs": ["104", "108"], "output": false }, - { "inputs": ["108", "108"], "output": true }, - { "inputs": ["108", "104"], "output": true } - ], - "ge_euint8_euint64": [ - { "inputs": ["27", "18441594146418724591"], "output": false }, - { "inputs": ["23", "27"], "output": false }, - { "inputs": ["27", "27"], "output": true }, - { "inputs": ["27", "23"], "output": true } - ], - "ge_euint8_euint128": [ - { - "inputs": ["198", "340282366920938463463372202187873997337"], - "output": false - }, - { "inputs": ["194", "198"], "output": false }, - { "inputs": ["198", "198"], "output": true }, - { "inputs": ["198", "194"], "output": true } - ], - "ge_euint8_euint256": [ - { - "inputs": ["195", "115792089237316195423570985008687907853269984665640564039457578830037010369755"], - "output": false - }, - { "inputs": ["191", "195"], "output": false }, - { "inputs": ["195", "195"], "output": true }, - { "inputs": ["195", "191"], "output": true } - ], - "ge_euint16_euint4": [ - { "inputs": ["60257", "13"], "output": true }, - { "inputs": ["9", "13"], "output": false }, - { "inputs": ["13", "13"], "output": true }, - { "inputs": ["13", "9"], "output": true } - ], - "ge_euint16_euint8": [ - { "inputs": ["8192", "143"], "output": true }, - { "inputs": ["139", "143"], "output": false }, - { "inputs": ["143", "143"], "output": true }, - { "inputs": ["143", "139"], "output": true } - ], - "ge_euint16_euint16": [ - { "inputs": ["51651", "13068"], "output": true }, - { "inputs": ["13064", "13068"], "output": false }, - { "inputs": ["13068", "13068"], "output": true }, - { "inputs": ["13068", "13064"], "output": true } - ], - "ge_euint16_uint16": [ - { "inputs": ["51651", "48781"], "output": true }, - { "inputs": ["13064", "13068"], "output": false }, - { "inputs": ["13068", "13068"], "output": true }, - { "inputs": ["13068", "13064"], "output": true } - ], - "ge_uint16_euint16": [ - { "inputs": ["60450", "48781"], "output": true }, - { "inputs": ["13064", "13068"], "output": false }, - { "inputs": ["13068", "13068"], "output": true }, - { "inputs": ["13068", "13064"], "output": true } - ], - "ge_euint16_euint32": [ - { "inputs": ["63432", "458410498"], "output": false }, - { "inputs": ["63428", "63432"], "output": false }, - { "inputs": ["63432", "63432"], "output": true }, - { "inputs": ["63432", "63428"], "output": true } - ], - "ge_euint16_euint64": [ - { "inputs": ["14081", "18444389415407077285"], "output": false }, - { "inputs": ["14077", "14081"], "output": false }, - { "inputs": ["14081", "14081"], "output": true }, - { "inputs": ["14081", "14077"], "output": true } - ], - "ge_euint16_euint128": [ - { - "inputs": ["25628", "340282366920938463463367234559875664879"], - "output": false - }, - { "inputs": ["25624", "25628"], "output": false }, - { "inputs": ["25628", "25628"], "output": true }, - { "inputs": ["25628", "25624"], "output": true } - ], - "ge_euint16_euint256": [ - { - "inputs": ["50106", "115792089237316195423570985008687907853269984665640564039457582313908377810967"], - "output": false - }, - { "inputs": ["50102", "50106"], "output": false }, - { "inputs": ["50106", "50106"], "output": true }, - { "inputs": ["50106", "50102"], "output": true } - ], - "ge_euint32_euint4": [ - { "inputs": ["417230890", "6"], "output": true }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": true } - ], - "ge_euint32_euint8": [ - { "inputs": ["1009223821", "187"], "output": true }, - { "inputs": ["183", "187"], "output": false }, - { "inputs": ["187", "187"], "output": true }, - { "inputs": ["187", "183"], "output": true } - ], - "ge_euint32_euint16": [ - { "inputs": ["3233856655", "54626"], "output": true }, - { "inputs": ["54622", "54626"], "output": false }, - { "inputs": ["54626", "54626"], "output": true }, - { "inputs": ["54626", "54622"], "output": true } - ], - "ge_euint32_euint32": [ - { "inputs": ["929694790", "907768232"], "output": true }, - { "inputs": ["907768228", "907768232"], "output": false }, - { "inputs": ["907768232", "907768232"], "output": true }, - { "inputs": ["907768232", "907768228"], "output": true } - ], - "ge_euint32_uint32": [ - { "inputs": ["929694790", "603878469"], "output": true }, - { "inputs": ["907768228", "907768232"], "output": false }, - { "inputs": ["907768232", "907768232"], "output": true }, - { "inputs": ["907768232", "907768228"], "output": true } - ], - "ge_uint32_euint32": [ - { "inputs": ["2155494187", "603878469"], "output": true }, - { "inputs": ["907768228", "907768232"], "output": false }, - { "inputs": ["907768232", "907768232"], "output": true }, - { "inputs": ["907768232", "907768228"], "output": true } - ], - "ge_euint32_euint64": [ - { "inputs": ["2716663813", "18446666024340671893"], "output": false }, - { "inputs": ["2716663809", "2716663813"], "output": false }, - { "inputs": ["2716663813", "2716663813"], "output": true }, - { "inputs": ["2716663813", "2716663809"], "output": true } - ], - "ge_euint32_euint128": [ - { - "inputs": ["3786584955", "340282366920938463463367364294961686443"], - "output": false - }, - { "inputs": ["3786584951", "3786584955"], "output": false }, - { "inputs": ["3786584955", "3786584955"], "output": true }, - { "inputs": ["3786584955", "3786584951"], "output": true } - ], - "ge_euint32_euint256": [ - { - "inputs": ["3646475026", "115792089237316195423570985008687907853269984665640564039457583473653753763859"], - "output": false - }, - { "inputs": ["3646475022", "3646475026"], "output": false }, - { "inputs": ["3646475026", "3646475026"], "output": true }, - { "inputs": ["3646475026", "3646475022"], "output": true } - ], - "ge_euint64_euint4": [ - { "inputs": ["18438015014584183031", "11"], "output": true }, - { "inputs": ["7", "11"], "output": false }, - { "inputs": ["11", "11"], "output": true }, - { "inputs": ["11", "7"], "output": true } - ], - "ge_euint64_euint8": [ - { "inputs": ["18444176095713623219", "248"], "output": true }, - { "inputs": ["244", "248"], "output": false }, - { "inputs": ["248", "248"], "output": true }, - { "inputs": ["248", "244"], "output": true } - ], - "ge_euint64_euint16": [ - { "inputs": ["18445173411231141809", "29055"], "output": true }, - { "inputs": ["29051", "29055"], "output": false }, - { "inputs": ["29055", "29055"], "output": true }, - { "inputs": ["29055", "29051"], "output": true } - ], - "ge_euint64_euint32": [ - { "inputs": ["18439654895803536359", "1948462184"], "output": true }, - { "inputs": ["1948462180", "1948462184"], "output": false }, - { "inputs": ["1948462184", "1948462184"], "output": true }, - { "inputs": ["1948462184", "1948462180"], "output": true } - ], - "ge_euint64_euint64": [ - { - "inputs": ["18444613618003912273", "18441817383047397973"], - "output": true - }, - { - "inputs": ["18441817383047397969", "18441817383047397973"], - "output": false - }, - { - "inputs": ["18441817383047397973", "18441817383047397973"], - "output": true - }, - { - "inputs": ["18441817383047397973", "18441817383047397969"], - "output": true - } - ], - "ge_euint64_uint64": [ - { - "inputs": ["18444613618003912273", "18444784193665775113"], - "output": false - }, - { - "inputs": ["18441817383047397969", "18441817383047397973"], - "output": false - }, - { - "inputs": ["18441817383047397973", "18441817383047397973"], - "output": true - }, - { - "inputs": ["18441817383047397973", "18441817383047397969"], - "output": true - } - ], - "ge_uint64_euint64": [ - { - "inputs": ["18439321097396363619", "18444784193665775113"], - "output": false - }, - { - "inputs": ["18441817383047397969", "18441817383047397973"], - "output": false - }, - { - "inputs": ["18441817383047397973", "18441817383047397973"], - "output": true - }, - { - "inputs": ["18441817383047397973", "18441817383047397969"], - "output": true - } - ], - "ge_euint64_euint128": [ - { - "inputs": ["18442500358670120549", "340282366920938463463373603431929658391"], - "output": false - }, - { - "inputs": ["18442500358670120545", "18442500358670120549"], - "output": false - }, - { - "inputs": ["18442500358670120549", "18442500358670120549"], - "output": true - }, - { - "inputs": ["18442500358670120549", "18442500358670120545"], - "output": true - } - ], - "ge_euint64_euint256": [ - { - "inputs": [ - "18444770112796649545", - "115792089237316195423570985008687907853269984665640564039457581281801379635505" - ], - "output": false - }, - { - "inputs": ["18444770112796649541", "18444770112796649545"], - "output": false - }, - { - "inputs": ["18444770112796649545", "18444770112796649545"], - "output": true - }, - { - "inputs": ["18444770112796649545", "18444770112796649541"], - "output": true - } - ], - "ge_euint128_euint4": [ - { - "inputs": ["340282366920938463463366351520407667333", "12"], - "output": true - }, - { "inputs": ["8", "12"], "output": false }, - { "inputs": ["12", "12"], "output": true }, - { "inputs": ["12", "8"], "output": true } - ], - "ge_euint128_euint8": [ - { - "inputs": ["340282366920938463463365913686345200467", "55"], - "output": true - }, - { "inputs": ["51", "55"], "output": false }, - { "inputs": ["55", "55"], "output": true }, - { "inputs": ["55", "51"], "output": true } - ], - "ge_euint128_euint16": [ - { - "inputs": ["340282366920938463463373250379836355353", "44459"], - "output": true - }, - { "inputs": ["44455", "44459"], "output": false }, - { "inputs": ["44459", "44459"], "output": true }, - { "inputs": ["44459", "44455"], "output": true } - ], - "ge_euint128_euint32": [ - { - "inputs": ["340282366920938463463370684518045415615", "2276077429"], - "output": true - }, - { "inputs": ["2276077425", "2276077429"], "output": false }, - { "inputs": ["2276077429", "2276077429"], "output": true }, - { "inputs": ["2276077429", "2276077425"], "output": true } - ], - "ge_euint128_euint64": [ - { - "inputs": ["340282366920938463463371033714627819917", "18439188692806479297"], - "output": true - }, - { - "inputs": ["18439188692806479293", "18439188692806479297"], - "output": false - }, - { - "inputs": ["18439188692806479297", "18439188692806479297"], - "output": true - }, - { - "inputs": ["18439188692806479297", "18439188692806479293"], - "output": true - } - ], - "ge_euint128_euint128": [ - { - "inputs": ["340282366920938463463369991167430665173", "340282366920938463463367243418798341499"], - "output": true - }, - { - "inputs": ["340282366920938463463367243418798341495", "340282366920938463463367243418798341499"], - "output": false - }, - { - "inputs": ["340282366920938463463367243418798341499", "340282366920938463463367243418798341499"], - "output": true - }, - { - "inputs": ["340282366920938463463367243418798341499", "340282366920938463463367243418798341495"], - "output": true - } - ], - "ge_euint128_uint128": [ - { - "inputs": ["340282366920938463463369991167430665173", "340282366920938463463370096368753149585"], - "output": false - }, - { - "inputs": ["340282366920938463463367243418798341495", "340282366920938463463367243418798341499"], - "output": false - }, - { - "inputs": ["340282366920938463463367243418798341499", "340282366920938463463367243418798341499"], - "output": true - }, - { - "inputs": ["340282366920938463463367243418798341499", "340282366920938463463367243418798341495"], - "output": true - } - ], - "ge_uint128_euint128": [ - { - "inputs": ["340282366920938463463370285053807900009", "340282366920938463463370096368753149585"], - "output": true - }, - { - "inputs": ["340282366920938463463367243418798341495", "340282366920938463463367243418798341499"], - "output": false - }, - { - "inputs": ["340282366920938463463367243418798341499", "340282366920938463463367243418798341499"], - "output": true - }, - { - "inputs": ["340282366920938463463367243418798341499", "340282366920938463463367243418798341495"], - "output": true - } - ], - "ge_euint128_euint256": [ - { - "inputs": [ - "340282366920938463463372552646665539131", - "115792089237316195423570985008687907853269984665640564039457578321851153049841" - ], - "output": false - }, - { - "inputs": ["340282366920938463463372552646665539127", "340282366920938463463372552646665539131"], - "output": false - }, - { - "inputs": ["340282366920938463463372552646665539131", "340282366920938463463372552646665539131"], - "output": true - }, - { - "inputs": ["340282366920938463463372552646665539131", "340282366920938463463372552646665539127"], - "output": true - } - ], - "ge_euint256_euint4": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457575496173341010993", "1"], - "output": true - }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": true } - ], - "ge_euint256_euint8": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457583777768346925767", "250"], - "output": true - }, - { "inputs": ["246", "250"], "output": false }, - { "inputs": ["250", "250"], "output": true }, - { "inputs": ["250", "246"], "output": true } - ], - "ge_euint256_euint16": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457575882393460599321", "29301"], - "output": true - }, - { "inputs": ["29297", "29301"], "output": false }, - { "inputs": ["29301", "29301"], "output": true }, - { "inputs": ["29301", "29297"], "output": true } - ], - "ge_euint256_euint32": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457576727756037416977", "2466446241"], - "output": true - }, - { "inputs": ["2466446237", "2466446241"], "output": false }, - { "inputs": ["2466446241", "2466446241"], "output": true }, - { "inputs": ["2466446241", "2466446237"], "output": true } - ], - "ge_euint256_euint64": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577778171434629241", - "18443676400252575763" - ], - "output": true - }, - { - "inputs": ["18443676400252575759", "18443676400252575763"], - "output": false - }, - { - "inputs": ["18443676400252575763", "18443676400252575763"], - "output": true - }, - { - "inputs": ["18443676400252575763", "18443676400252575759"], - "output": true - } - ], - "ge_euint256_euint128": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457581781091933664799", - "340282366920938463463369397462507033255" - ], - "output": true - }, - { - "inputs": ["340282366920938463463369397462507033251", "340282366920938463463369397462507033255"], - "output": false - }, - { - "inputs": ["340282366920938463463369397462507033255", "340282366920938463463369397462507033255"], - "output": true - }, - { - "inputs": ["340282366920938463463369397462507033255", "340282366920938463463369397462507033251"], - "output": true - } - ], - "ge_euint256_euint256": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579759156646767465", - "115792089237316195423570985008687907853269984665640564039457581776880742255263" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579759156646767461", - "115792089237316195423570985008687907853269984665640564039457579759156646767465" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579759156646767465", - "115792089237316195423570985008687907853269984665640564039457579759156646767465" - ], - "output": true - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579759156646767465", - "115792089237316195423570985008687907853269984665640564039457579759156646767461" - ], - "output": true - } - ], - "ge_euint256_uint256": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579759156646767465", - "115792089237316195423570985008687907853269984665640564039457580411660636009627" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579759156646767461", - "115792089237316195423570985008687907853269984665640564039457579759156646767465" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579759156646767465", - "115792089237316195423570985008687907853269984665640564039457579759156646767465" - ], - "output": true - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579759156646767465", - "115792089237316195423570985008687907853269984665640564039457579759156646767461" - ], - "output": true - } - ], - "ge_uint256_euint256": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457581430272333247909", - "115792089237316195423570985008687907853269984665640564039457580411660636009627" - ], - "output": true - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579759156646767461", - "115792089237316195423570985008687907853269984665640564039457579759156646767465" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579759156646767465", - "115792089237316195423570985008687907853269984665640564039457579759156646767465" - ], - "output": true - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579759156646767465", - "115792089237316195423570985008687907853269984665640564039457579759156646767461" - ], - "output": true - } - ], - "gt_euint4_euint4": [ - { "inputs": ["12", "14"], "output": false }, - { "inputs": ["8", "12"], "output": false }, - { "inputs": ["12", "12"], "output": false }, - { "inputs": ["12", "8"], "output": true } - ], - "gt_euint4_euint8": [ - { "inputs": ["1", "59"], "output": false }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } - ], - "gt_euint4_uint8": [ - { "inputs": ["1", "3"], "output": false }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } - ], - "gt_euint4_euint16": [ - { "inputs": ["13", "43765"], "output": false }, - { "inputs": ["9", "13"], "output": false }, - { "inputs": ["13", "13"], "output": false }, - { "inputs": ["13", "9"], "output": true } - ], - "gt_euint4_euint32": [ - { "inputs": ["8", "1791761269"], "output": false }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } - ], - "gt_euint4_euint64": [ - { "inputs": ["11", "18445624350177245281"], "output": false }, - { "inputs": ["7", "11"], "output": false }, - { "inputs": ["11", "11"], "output": false }, - { "inputs": ["11", "7"], "output": true } - ], - "gt_euint4_euint128": [ - { - "inputs": ["14", "340282366920938463463369565306924367885"], - "output": false - }, - { "inputs": ["10", "14"], "output": false }, - { "inputs": ["14", "14"], "output": false }, - { "inputs": ["14", "10"], "output": true } - ], - "gt_euint4_euint256": [ - { - "inputs": ["1", "115792089237316195423570985008687907853269984665640564039457576918680285784187"], - "output": false - }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } - ], - "gt_euint8_euint4": [ - { "inputs": ["94", "5"], "output": true }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } - ], - "gt_uint8_euint4": [ - { "inputs": ["1", "5"], "output": false }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } - ], - "gt_euint8_euint8": [ - { "inputs": ["239", "212"], "output": true }, - { "inputs": ["208", "212"], "output": false }, - { "inputs": ["212", "212"], "output": false }, - { "inputs": ["212", "208"], "output": true } - ], - "gt_euint8_uint8": [ - { "inputs": ["239", "184"], "output": true }, - { "inputs": ["208", "212"], "output": false }, - { "inputs": ["212", "212"], "output": false }, - { "inputs": ["212", "208"], "output": true } - ], - "gt_uint8_euint8": [ - { "inputs": ["188", "184"], "output": true }, - { "inputs": ["208", "212"], "output": false }, - { "inputs": ["212", "212"], "output": false }, - { "inputs": ["212", "208"], "output": true } - ], - "gt_euint8_euint16": [ - { "inputs": ["207", "17375"], "output": false }, - { "inputs": ["203", "207"], "output": false }, - { "inputs": ["207", "207"], "output": false }, - { "inputs": ["207", "203"], "output": true } - ], - "gt_euint8_euint32": [ - { "inputs": ["16", "2217853328"], "output": false }, - { "inputs": ["12", "16"], "output": false }, - { "inputs": ["16", "16"], "output": false }, - { "inputs": ["16", "12"], "output": true } - ], - "gt_euint8_euint64": [ - { "inputs": ["58", "18442407989859516937"], "output": false }, - { "inputs": ["54", "58"], "output": false }, - { "inputs": ["58", "58"], "output": false }, - { "inputs": ["58", "54"], "output": true } - ], - "gt_euint8_euint128": [ - { - "inputs": ["246", "340282366920938463463368600113789095143"], - "output": false - }, - { "inputs": ["242", "246"], "output": false }, - { "inputs": ["246", "246"], "output": false }, - { "inputs": ["246", "242"], "output": true } - ], - "gt_euint8_euint256": [ - { - "inputs": ["73", "115792089237316195423570985008687907853269984665640564039457582598668635855029"], - "output": false - }, - { "inputs": ["69", "73"], "output": false }, - { "inputs": ["73", "73"], "output": false }, - { "inputs": ["73", "69"], "output": true } - ], - "gt_euint16_euint4": [ - { "inputs": ["57987", "5"], "output": true }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } - ], - "gt_euint16_euint8": [ - { "inputs": ["18049", "102"], "output": true }, - { "inputs": ["98", "102"], "output": false }, - { "inputs": ["102", "102"], "output": false }, - { "inputs": ["102", "98"], "output": true } - ], - "gt_euint16_euint16": [ - { "inputs": ["49523", "63498"], "output": false }, - { "inputs": ["49519", "49523"], "output": false }, - { "inputs": ["49523", "49523"], "output": false }, - { "inputs": ["49523", "49519"], "output": true } - ], - "gt_euint16_uint16": [ - { "inputs": ["49523", "10749"], "output": true }, - { "inputs": ["49519", "49523"], "output": false }, - { "inputs": ["49523", "49523"], "output": false }, - { "inputs": ["49523", "49519"], "output": true } - ], - "gt_uint16_euint16": [ - { "inputs": ["38042", "10749"], "output": true }, - { "inputs": ["49519", "49523"], "output": false }, - { "inputs": ["49523", "49523"], "output": false }, - { "inputs": ["49523", "49519"], "output": true } - ], - "gt_euint16_euint32": [ - { "inputs": ["8095", "1426308540"], "output": false }, - { "inputs": ["8091", "8095"], "output": false }, - { "inputs": ["8095", "8095"], "output": false }, - { "inputs": ["8095", "8091"], "output": true } - ], - "gt_euint16_euint64": [ - { "inputs": ["45007", "18445308410216818905"], "output": false }, - { "inputs": ["45003", "45007"], "output": false }, - { "inputs": ["45007", "45007"], "output": false }, - { "inputs": ["45007", "45003"], "output": true } - ], - "gt_euint16_euint128": [ - { - "inputs": ["29493", "340282366920938463463370329441548615949"], - "output": false - }, - { "inputs": ["29489", "29493"], "output": false }, - { "inputs": ["29493", "29493"], "output": false }, - { "inputs": ["29493", "29489"], "output": true } - ], - "gt_euint16_euint256": [ - { - "inputs": ["30875", "115792089237316195423570985008687907853269984665640564039457575028224206757889"], - "output": false - }, - { "inputs": ["30871", "30875"], "output": false }, - { "inputs": ["30875", "30875"], "output": false }, - { "inputs": ["30875", "30871"], "output": true } - ], - "gt_euint32_euint4": [ - { "inputs": ["3015562136", "7"], "output": true }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } - ], - "gt_euint32_euint8": [ - { "inputs": ["1381529874", "57"], "output": true }, - { "inputs": ["53", "57"], "output": false }, - { "inputs": ["57", "57"], "output": false }, - { "inputs": ["57", "53"], "output": true } - ], - "gt_euint32_euint16": [ - { "inputs": ["1059995818", "54018"], "output": true }, - { "inputs": ["54014", "54018"], "output": false }, - { "inputs": ["54018", "54018"], "output": false }, - { "inputs": ["54018", "54014"], "output": true } - ], - "gt_euint32_euint32": [ - { "inputs": ["3794643996", "619151916"], "output": true }, - { "inputs": ["619151912", "619151916"], "output": false }, - { "inputs": ["619151916", "619151916"], "output": false }, - { "inputs": ["619151916", "619151912"], "output": true } - ], - "gt_euint32_uint32": [ - { "inputs": ["3794643996", "3726690353"], "output": true }, - { "inputs": ["619151912", "619151916"], "output": false }, - { "inputs": ["619151916", "619151916"], "output": false }, - { "inputs": ["619151916", "619151912"], "output": true } - ], - "gt_uint32_euint32": [ - { "inputs": ["3642906183", "3726690353"], "output": false }, - { "inputs": ["619151912", "619151916"], "output": false }, - { "inputs": ["619151916", "619151916"], "output": false }, - { "inputs": ["619151916", "619151912"], "output": true } - ], - "gt_euint32_euint64": [ - { "inputs": ["1898220780", "18441112726231908571"], "output": false }, - { "inputs": ["1898220776", "1898220780"], "output": false }, - { "inputs": ["1898220780", "1898220780"], "output": false }, - { "inputs": ["1898220780", "1898220776"], "output": true } - ], - "gt_euint32_euint128": [ - { - "inputs": ["4277077408", "340282366920938463463374604764991737889"], - "output": false - }, - { "inputs": ["4277077404", "4277077408"], "output": false }, - { "inputs": ["4277077408", "4277077408"], "output": false }, - { "inputs": ["4277077408", "4277077404"], "output": true } - ], - "gt_euint32_euint256": [ - { - "inputs": ["27376130", "115792089237316195423570985008687907853269984665640564039457582301524979306099"], - "output": false - }, - { "inputs": ["27376126", "27376130"], "output": false }, - { "inputs": ["27376130", "27376130"], "output": false }, - { "inputs": ["27376130", "27376126"], "output": true } - ], - "gt_euint64_euint4": [ - { "inputs": ["18445379539074122583", "7"], "output": true }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } - ], - "gt_euint64_euint8": [ - { "inputs": ["18445625176027562117", "124"], "output": true }, - { "inputs": ["120", "124"], "output": false }, - { "inputs": ["124", "124"], "output": false }, - { "inputs": ["124", "120"], "output": true } - ], - "gt_euint64_euint16": [ - { "inputs": ["18444002964571998281", "52124"], "output": true }, - { "inputs": ["52120", "52124"], "output": false }, - { "inputs": ["52124", "52124"], "output": false }, - { "inputs": ["52124", "52120"], "output": true } - ], - "gt_euint64_euint32": [ - { "inputs": ["18445739090666652013", "2575338339"], "output": true }, - { "inputs": ["2575338335", "2575338339"], "output": false }, - { "inputs": ["2575338339", "2575338339"], "output": false }, - { "inputs": ["2575338339", "2575338335"], "output": true } - ], - "gt_euint64_euint64": [ - { - "inputs": ["18444129545450155179", "18438304556640407461"], - "output": true - }, - { - "inputs": ["18438304556640407457", "18438304556640407461"], - "output": false - }, - { - "inputs": ["18438304556640407461", "18438304556640407461"], - "output": false - }, - { - "inputs": ["18438304556640407461", "18438304556640407457"], - "output": true - } - ], - "gt_euint64_uint64": [ - { - "inputs": ["18444129545450155179", "18441052996137337147"], - "output": true - }, - { - "inputs": ["18438304556640407457", "18438304556640407461"], - "output": false - }, - { - "inputs": ["18438304556640407461", "18438304556640407461"], - "output": false - }, - { - "inputs": ["18438304556640407461", "18438304556640407457"], - "output": true - } - ], - "gt_uint64_euint64": [ - { - "inputs": ["18440314139404889003", "18441052996137337147"], - "output": false - }, - { - "inputs": ["18438304556640407457", "18438304556640407461"], - "output": false - }, - { - "inputs": ["18438304556640407461", "18438304556640407461"], - "output": false - }, - { - "inputs": ["18438304556640407461", "18438304556640407457"], - "output": true - } - ], - "gt_euint64_euint128": [ - { - "inputs": ["18440808032965074109", "340282366920938463463365853534758019559"], - "output": false - }, - { - "inputs": ["18440808032965074105", "18440808032965074109"], - "output": false - }, - { - "inputs": ["18440808032965074109", "18440808032965074109"], - "output": false - }, - { - "inputs": ["18440808032965074109", "18440808032965074105"], - "output": true - } - ], - "gt_euint64_euint256": [ - { - "inputs": [ - "18443327594956328675", - "115792089237316195423570985008687907853269984665640564039457581268418001741927" - ], - "output": false - }, - { - "inputs": ["18443327594956328671", "18443327594956328675"], - "output": false - }, - { - "inputs": ["18443327594956328675", "18443327594956328675"], - "output": false - }, - { - "inputs": ["18443327594956328675", "18443327594956328671"], - "output": true - } - ], - "gt_euint128_euint4": [ - { - "inputs": ["340282366920938463463367426041495203879", "13"], - "output": true - }, - { "inputs": ["9", "13"], "output": false }, - { "inputs": ["13", "13"], "output": false }, - { "inputs": ["13", "9"], "output": true } - ], - "gt_euint128_euint8": [ - { - "inputs": ["340282366920938463463373004399886925283", "9"], - "output": true - }, - { "inputs": ["5", "9"], "output": false }, - { "inputs": ["9", "9"], "output": false }, - { "inputs": ["9", "5"], "output": true } - ], - "gt_euint128_euint16": [ - { - "inputs": ["340282366920938463463368543313259159187", "51225"], - "output": true - }, - { "inputs": ["51221", "51225"], "output": false }, - { "inputs": ["51225", "51225"], "output": false }, - { "inputs": ["51225", "51221"], "output": true } - ], - "gt_euint128_euint32": [ - { - "inputs": ["340282366920938463463371084318415272059", "235874492"], - "output": true - }, - { "inputs": ["235874488", "235874492"], "output": false }, - { "inputs": ["235874492", "235874492"], "output": false }, - { "inputs": ["235874492", "235874488"], "output": true } - ], - "gt_euint128_euint64": [ - { - "inputs": ["340282366920938463463366930376033772101", "18439752237470295949"], - "output": true - }, - { - "inputs": ["18439752237470295945", "18439752237470295949"], - "output": false - }, - { - "inputs": ["18439752237470295949", "18439752237470295949"], - "output": false - }, - { - "inputs": ["18439752237470295949", "18439752237470295945"], - "output": true - } - ], - "gt_euint128_euint128": [ - { - "inputs": ["340282366920938463463367714696589499231", "340282366920938463463372280163710625125"], - "output": false - }, - { - "inputs": ["340282366920938463463367714696589499227", "340282366920938463463367714696589499231"], - "output": false - }, - { - "inputs": ["340282366920938463463367714696589499231", "340282366920938463463367714696589499231"], - "output": false - }, - { - "inputs": ["340282366920938463463367714696589499231", "340282366920938463463367714696589499227"], - "output": true - } - ], - "gt_euint128_uint128": [ - { - "inputs": ["340282366920938463463367714696589499231", "340282366920938463463369886774124197135"], - "output": false - }, - { - "inputs": ["340282366920938463463367714696589499227", "340282366920938463463367714696589499231"], - "output": false - }, - { - "inputs": ["340282366920938463463367714696589499231", "340282366920938463463367714696589499231"], - "output": false - }, - { - "inputs": ["340282366920938463463367714696589499231", "340282366920938463463367714696589499227"], - "output": true - } - ], - "gt_uint128_euint128": [ - { - "inputs": ["340282366920938463463371365285946007453", "340282366920938463463369886774124197135"], - "output": true - }, - { - "inputs": ["340282366920938463463367714696589499227", "340282366920938463463367714696589499231"], - "output": false - }, - { - "inputs": ["340282366920938463463367714696589499231", "340282366920938463463367714696589499231"], - "output": false - }, - { - "inputs": ["340282366920938463463367714696589499231", "340282366920938463463367714696589499227"], - "output": true - } - ], - "gt_euint128_euint256": [ - { - "inputs": [ - "340282366920938463463370843114455636527", - "115792089237316195423570985008687907853269984665640564039457583283635470770217" - ], - "output": false - }, - { - "inputs": ["340282366920938463463370843114455636523", "340282366920938463463370843114455636527"], - "output": false - }, - { - "inputs": ["340282366920938463463370843114455636527", "340282366920938463463370843114455636527"], - "output": false - }, - { - "inputs": ["340282366920938463463370843114455636527", "340282366920938463463370843114455636523"], - "output": true - } - ], - "gt_euint256_euint4": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457576018520605547063", "8"], - "output": true - }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } - ], - "gt_euint256_euint8": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457583855482126679265", "93"], - "output": true - }, - { "inputs": ["89", "93"], "output": false }, - { "inputs": ["93", "93"], "output": false }, - { "inputs": ["93", "89"], "output": true } - ], - "gt_euint256_euint16": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457580207253841161561", "59068"], - "output": true - }, - { "inputs": ["59064", "59068"], "output": false }, - { "inputs": ["59068", "59068"], "output": false }, - { "inputs": ["59068", "59064"], "output": true } - ], - "gt_euint256_euint32": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457580729313167530831", "902297828"], - "output": true - }, - { "inputs": ["902297824", "902297828"], "output": false }, - { "inputs": ["902297828", "902297828"], "output": false }, - { "inputs": ["902297828", "902297824"], "output": true } - ], - "gt_euint256_euint64": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457582386276584123553", - "18443192077233247397" - ], - "output": true - }, - { - "inputs": ["18443192077233247393", "18443192077233247397"], - "output": false - }, - { - "inputs": ["18443192077233247397", "18443192077233247397"], - "output": false - }, - { - "inputs": ["18443192077233247397", "18443192077233247393"], - "output": true - } - ], - "gt_euint256_euint128": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457583305927195076375", - "340282366920938463463370153073900549113" - ], - "output": true - }, - { - "inputs": ["340282366920938463463370153073900549109", "340282366920938463463370153073900549113"], - "output": false - }, - { - "inputs": ["340282366920938463463370153073900549113", "340282366920938463463370153073900549113"], - "output": false - }, - { - "inputs": ["340282366920938463463370153073900549113", "340282366920938463463370153073900549109"], - "output": true - } - ], - "gt_euint256_euint256": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457580885855005541993", - "115792089237316195423570985008687907853269984665640564039457582339622165148199" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457580885855005541989", - "115792089237316195423570985008687907853269984665640564039457580885855005541993" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457580885855005541993", - "115792089237316195423570985008687907853269984665640564039457580885855005541993" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457580885855005541993", - "115792089237316195423570985008687907853269984665640564039457580885855005541989" - ], - "output": true - } - ], - "gt_euint256_uint256": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457580885855005541993", - "115792089237316195423570985008687907853269984665640564039457576330419987992913" - ], - "output": true - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457580885855005541989", - "115792089237316195423570985008687907853269984665640564039457580885855005541993" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457580885855005541993", - "115792089237316195423570985008687907853269984665640564039457580885855005541993" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457580885855005541993", - "115792089237316195423570985008687907853269984665640564039457580885855005541989" - ], - "output": true - } - ], - "gt_uint256_euint256": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457583273117366659453", - "115792089237316195423570985008687907853269984665640564039457576330419987992913" - ], - "output": true - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457580885855005541989", - "115792089237316195423570985008687907853269984665640564039457580885855005541993" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457580885855005541993", - "115792089237316195423570985008687907853269984665640564039457580885855005541993" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457580885855005541993", - "115792089237316195423570985008687907853269984665640564039457580885855005541989" - ], - "output": true - } - ], - "eq_euint4_euint4": [ - { "inputs": ["2", "2"], "output": true }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": false } - ], - "eq_euint4_euint8": [ - { "inputs": ["14", "3"], "output": false }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": false } - ], - "eq_euint4_uint8": [ - { "inputs": ["14", "7"], "output": false }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": false } - ], - "eq_euint4_euint16": [ - { "inputs": ["11", "40901"], "output": false }, - { "inputs": ["7", "11"], "output": false }, - { "inputs": ["11", "11"], "output": true }, - { "inputs": ["11", "7"], "output": false } - ], - "eq_euint4_euint32": [ - { "inputs": ["9", "1089894566"], "output": false }, - { "inputs": ["5", "9"], "output": false }, - { "inputs": ["9", "9"], "output": true }, - { "inputs": ["9", "5"], "output": false } - ], - "eq_euint4_euint64": [ - { "inputs": ["3", "18443050121569259433"], "output": false }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": false } - ], - "eq_euint4_euint128": [ - { - "inputs": ["10", "340282366920938463463370073243865312497"], - "output": false - }, - { "inputs": ["6", "10"], "output": false }, - { "inputs": ["10", "10"], "output": true }, - { "inputs": ["10", "6"], "output": false } - ], - "eq_euint4_euint256": [ - { - "inputs": ["14", "115792089237316195423570985008687907853269984665640564039457583778640701263885"], - "output": false - }, - { "inputs": ["10", "14"], "output": false }, - { "inputs": ["14", "14"], "output": true }, - { "inputs": ["14", "10"], "output": false } - ], - "eq_euint8_euint4": [ - { "inputs": ["65", "9"], "output": false }, - { "inputs": ["5", "9"], "output": false }, - { "inputs": ["9", "9"], "output": true }, - { "inputs": ["9", "5"], "output": false } - ], - "eq_uint8_euint4": [ - { "inputs": ["1", "9"], "output": false }, - { "inputs": ["5", "9"], "output": false }, - { "inputs": ["9", "9"], "output": true }, - { "inputs": ["9", "5"], "output": false } - ], - "eq_euint8_euint8": [ - { "inputs": ["175", "224"], "output": false }, - { "inputs": ["171", "175"], "output": false }, - { "inputs": ["175", "175"], "output": true }, - { "inputs": ["175", "171"], "output": false } - ], - "eq_euint8_uint8": [ - { "inputs": ["175", "253"], "output": false }, - { "inputs": ["171", "175"], "output": false }, - { "inputs": ["175", "175"], "output": true }, - { "inputs": ["175", "171"], "output": false } - ], - "eq_uint8_euint8": [ - { "inputs": ["158", "253"], "output": false }, - { "inputs": ["171", "175"], "output": false }, - { "inputs": ["175", "175"], "output": true }, - { "inputs": ["175", "171"], "output": false } - ], - "eq_euint8_euint16": [ - { "inputs": ["205", "56577"], "output": false }, - { "inputs": ["201", "205"], "output": false }, - { "inputs": ["205", "205"], "output": true }, - { "inputs": ["205", "201"], "output": false } - ], - "eq_euint8_euint32": [ - { "inputs": ["226", "3320102390"], "output": false }, - { "inputs": ["222", "226"], "output": false }, - { "inputs": ["226", "226"], "output": true }, - { "inputs": ["226", "222"], "output": false } - ], - "eq_euint8_euint64": [ - { "inputs": ["141", "18441419220641833889"], "output": false }, - { "inputs": ["137", "141"], "output": false }, - { "inputs": ["141", "141"], "output": true }, - { "inputs": ["141", "137"], "output": false } - ], - "eq_euint8_euint128": [ - { - "inputs": ["111", "340282366920938463463367365018688833419"], - "output": false - }, - { "inputs": ["107", "111"], "output": false }, - { "inputs": ["111", "111"], "output": true }, - { "inputs": ["111", "107"], "output": false } - ], - "eq_euint8_euint256": [ - { - "inputs": ["160", "115792089237316195423570985008687907853269984665640564039457581836943917626145"], - "output": false - }, - { "inputs": ["156", "160"], "output": false }, - { "inputs": ["160", "160"], "output": true }, - { "inputs": ["160", "156"], "output": false } - ], - "eq_euint16_euint4": [ - { "inputs": ["51541", "14"], "output": false }, - { "inputs": ["10", "14"], "output": false }, - { "inputs": ["14", "14"], "output": true }, - { "inputs": ["14", "10"], "output": false } - ], - "eq_euint16_euint8": [ - { "inputs": ["33521", "144"], "output": false }, - { "inputs": ["140", "144"], "output": false }, - { "inputs": ["144", "144"], "output": true }, - { "inputs": ["144", "140"], "output": false } - ], - "eq_euint16_euint16": [ - { "inputs": ["45930", "43845"], "output": false }, - { "inputs": ["43841", "43845"], "output": false }, - { "inputs": ["43845", "43845"], "output": true }, - { "inputs": ["43845", "43841"], "output": false } - ], - "eq_euint16_uint16": [ - { "inputs": ["45930", "25309"], "output": false }, - { "inputs": ["43841", "43845"], "output": false }, - { "inputs": ["43845", "43845"], "output": true }, - { "inputs": ["43845", "43841"], "output": false } - ], - "eq_uint16_euint16": [ - { "inputs": ["50532", "25309"], "output": false }, - { "inputs": ["43841", "43845"], "output": false }, - { "inputs": ["43845", "43845"], "output": true }, - { "inputs": ["43845", "43841"], "output": false } - ], - "eq_euint16_euint32": [ - { "inputs": ["14585", "2487581396"], "output": false }, - { "inputs": ["14581", "14585"], "output": false }, - { "inputs": ["14585", "14585"], "output": true }, - { "inputs": ["14585", "14581"], "output": false } - ], - "eq_euint16_euint64": [ - { "inputs": ["29419", "18446062766310773765"], "output": false }, - { "inputs": ["29415", "29419"], "output": false }, - { "inputs": ["29419", "29419"], "output": true }, - { "inputs": ["29419", "29415"], "output": false } - ], - "eq_euint16_euint128": [ - { - "inputs": ["47922", "340282366920938463463372663915711616945"], - "output": false - }, - { "inputs": ["47918", "47922"], "output": false }, - { "inputs": ["47922", "47922"], "output": true }, - { "inputs": ["47922", "47918"], "output": false } - ], - "eq_euint16_euint256": [ - { - "inputs": ["55138", "115792089237316195423570985008687907853269984665640564039457576200268434748919"], - "output": false - }, - { "inputs": ["55134", "55138"], "output": false }, - { "inputs": ["55138", "55138"], "output": true }, - { "inputs": ["55138", "55134"], "output": false } - ], - "eq_euint32_euint4": [ - { "inputs": ["1592167767", "2"], "output": false }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": false } - ], - "eq_euint32_euint8": [ - { "inputs": ["2371399582", "166"], "output": false }, - { "inputs": ["162", "166"], "output": false }, - { "inputs": ["166", "166"], "output": true }, - { "inputs": ["166", "162"], "output": false } - ], - "eq_euint32_euint16": [ - { "inputs": ["843782707", "34473"], "output": false }, - { "inputs": ["34469", "34473"], "output": false }, - { "inputs": ["34473", "34473"], "output": true }, - { "inputs": ["34473", "34469"], "output": false } - ], - "eq_euint32_euint32": [ - { "inputs": ["3899668665", "3823635226"], "output": false }, - { "inputs": ["3823635222", "3823635226"], "output": false }, - { "inputs": ["3823635226", "3823635226"], "output": true }, - { "inputs": ["3823635226", "3823635222"], "output": false } - ], - "eq_euint32_uint32": [ - { "inputs": ["3899668665", "2460864818"], "output": false }, - { "inputs": ["3823635222", "3823635226"], "output": false }, - { "inputs": ["3823635226", "3823635226"], "output": true }, - { "inputs": ["3823635226", "3823635222"], "output": false } - ], - "eq_uint32_euint32": [ - { "inputs": ["3310168424", "2460864818"], "output": false }, - { "inputs": ["3823635222", "3823635226"], "output": false }, - { "inputs": ["3823635226", "3823635226"], "output": true }, - { "inputs": ["3823635226", "3823635222"], "output": false } - ], - "eq_euint32_euint64": [ - { "inputs": ["3575591686", "18441139457541916589"], "output": false }, - { "inputs": ["3575591682", "3575591686"], "output": false }, - { "inputs": ["3575591686", "3575591686"], "output": true }, - { "inputs": ["3575591686", "3575591682"], "output": false } - ], - "eq_euint32_euint128": [ - { - "inputs": ["764411697", "340282366920938463463368167171281881439"], - "output": false - }, - { "inputs": ["764411693", "764411697"], "output": false }, - { "inputs": ["764411697", "764411697"], "output": true }, - { "inputs": ["764411697", "764411693"], "output": false } - ], - "eq_euint32_euint256": [ - { - "inputs": ["1808856605", "115792089237316195423570985008687907853269984665640564039457582106419349698079"], - "output": false - }, - { "inputs": ["1808856601", "1808856605"], "output": false }, - { "inputs": ["1808856605", "1808856605"], "output": true }, - { "inputs": ["1808856605", "1808856601"], "output": false } - ], - "eq_euint64_euint4": [ - { "inputs": ["18439903646396993533", "7"], "output": false }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": false } - ], - "eq_euint64_euint8": [ - { "inputs": ["18439031766765231937", "63"], "output": false }, - { "inputs": ["59", "63"], "output": false }, - { "inputs": ["63", "63"], "output": true }, - { "inputs": ["63", "59"], "output": false } - ], - "eq_euint64_euint16": [ - { "inputs": ["18445593277781135549", "65299"], "output": false }, - { "inputs": ["65295", "65299"], "output": false }, - { "inputs": ["65299", "65299"], "output": true }, - { "inputs": ["65299", "65295"], "output": false } - ], - "eq_euint64_euint32": [ - { "inputs": ["18443073273307378367", "1540281447"], "output": false }, - { "inputs": ["1540281443", "1540281447"], "output": false }, - { "inputs": ["1540281447", "1540281447"], "output": true }, - { "inputs": ["1540281447", "1540281443"], "output": false } - ], - "eq_euint64_euint64": [ - { - "inputs": ["18443282870504090991", "18446028700927461615"], - "output": false - }, - { - "inputs": ["18443282870504090987", "18443282870504090991"], - "output": false - }, - { - "inputs": ["18443282870504090991", "18443282870504090991"], - "output": true - }, - { - "inputs": ["18443282870504090991", "18443282870504090987"], - "output": false - } - ], - "eq_euint64_uint64": [ - { - "inputs": ["18443282870504090991", "18439130415590833625"], - "output": false - }, - { - "inputs": ["18443282870504090987", "18443282870504090991"], - "output": false - }, - { - "inputs": ["18443282870504090991", "18443282870504090991"], - "output": true - }, - { - "inputs": ["18443282870504090991", "18443282870504090987"], - "output": false - } - ], - "eq_uint64_euint64": [ - { - "inputs": ["18442875587397628573", "18439130415590833625"], - "output": false - }, - { - "inputs": ["18443282870504090987", "18443282870504090991"], - "output": false - }, - { - "inputs": ["18443282870504090991", "18443282870504090991"], - "output": true - }, - { - "inputs": ["18443282870504090991", "18443282870504090987"], - "output": false - } - ], - "eq_euint64_euint128": [ - { - "inputs": ["18440180042915486669", "340282366920938463463371210059252201113"], - "output": false - }, - { - "inputs": ["18440180042915486665", "18440180042915486669"], - "output": false - }, - { - "inputs": ["18440180042915486669", "18440180042915486669"], - "output": true - }, - { - "inputs": ["18440180042915486669", "18440180042915486665"], - "output": false - } - ], - "eq_euint64_euint256": [ - { - "inputs": [ - "18443851863635995939", - "115792089237316195423570985008687907853269984665640564039457575030888379042775" - ], - "output": false - }, - { - "inputs": ["18443851863635995935", "18443851863635995939"], - "output": false - }, - { - "inputs": ["18443851863635995939", "18443851863635995939"], - "output": true - }, - { - "inputs": ["18443851863635995939", "18443851863635995935"], - "output": false - } - ], - "eq_euint128_euint4": [ - { - "inputs": ["340282366920938463463369794780094019941", "2"], - "output": false - }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": false } - ], - "eq_euint128_euint8": [ - { - "inputs": ["340282366920938463463368012116669397375", "111"], - "output": false - }, - { "inputs": ["107", "111"], "output": false }, - { "inputs": ["111", "111"], "output": true }, - { "inputs": ["111", "107"], "output": false } - ], - "eq_euint128_euint16": [ - { - "inputs": ["340282366920938463463365947218770561253", "63555"], - "output": false - }, - { "inputs": ["63551", "63555"], "output": false }, - { "inputs": ["63555", "63555"], "output": true }, - { "inputs": ["63555", "63551"], "output": false } - ], - "eq_euint128_euint32": [ - { - "inputs": ["340282366920938463463365905779679562131", "1923235589"], - "output": false - }, - { "inputs": ["1923235585", "1923235589"], "output": false }, - { "inputs": ["1923235589", "1923235589"], "output": true }, - { "inputs": ["1923235589", "1923235585"], "output": false } - ], - "eq_euint128_euint64": [ - { - "inputs": ["340282366920938463463373700954879453501", "18443047059286955551"], - "output": false - }, - { - "inputs": ["18443047059286955547", "18443047059286955551"], - "output": false - }, - { - "inputs": ["18443047059286955551", "18443047059286955551"], - "output": true - }, - { - "inputs": ["18443047059286955551", "18443047059286955547"], - "output": false - } - ], - "eq_euint128_euint128": [ - { - "inputs": ["340282366920938463463371368021216956093", "340282366920938463463370243874611927705"], - "output": false - }, - { - "inputs": ["340282366920938463463370243874611927701", "340282366920938463463370243874611927705"], - "output": false - }, - { - "inputs": ["340282366920938463463370243874611927705", "340282366920938463463370243874611927705"], - "output": true - }, - { - "inputs": ["340282366920938463463370243874611927705", "340282366920938463463370243874611927701"], - "output": false - } - ], - "eq_euint128_uint128": [ - { - "inputs": ["340282366920938463463371368021216956093", "340282366920938463463373345909663104587"], - "output": false - }, - { - "inputs": ["340282366920938463463370243874611927701", "340282366920938463463370243874611927705"], - "output": false - }, - { - "inputs": ["340282366920938463463370243874611927705", "340282366920938463463370243874611927705"], - "output": true - }, - { - "inputs": ["340282366920938463463370243874611927705", "340282366920938463463370243874611927701"], - "output": false - } - ], - "eq_uint128_euint128": [ - { - "inputs": ["340282366920938463463369712474902223435", "340282366920938463463373345909663104587"], - "output": false - }, - { - "inputs": ["340282366920938463463370243874611927701", "340282366920938463463370243874611927705"], - "output": false - }, - { - "inputs": ["340282366920938463463370243874611927705", "340282366920938463463370243874611927705"], - "output": true - }, - { - "inputs": ["340282366920938463463370243874611927705", "340282366920938463463370243874611927701"], - "output": false - } - ], - "eq_euint128_euint256": [ - { - "inputs": [ - "340282366920938463463367588896596491863", - "115792089237316195423570985008687907853269984665640564039457578982740222216241" - ], - "output": false - }, - { - "inputs": ["340282366920938463463367588896596491859", "340282366920938463463367588896596491863"], - "output": false - }, - { - "inputs": ["340282366920938463463367588896596491863", "340282366920938463463367588896596491863"], - "output": true - }, - { - "inputs": ["340282366920938463463367588896596491863", "340282366920938463463367588896596491859"], - "output": false - } - ], - "eq_euint256_euint4": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457581942293222963611", "1"], - "output": false - }, - { "inputs": ["4", "8"], "output": false }, - { "inputs": ["8", "8"], "output": true }, - { "inputs": ["8", "4"], "output": false } - ], - "eq_euint256_euint8": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457581724603808654415", "213"], - "output": false - }, - { "inputs": ["209", "213"], "output": false }, - { "inputs": ["213", "213"], "output": true }, - { "inputs": ["213", "209"], "output": false } - ], - "eq_euint256_euint16": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457581937945784624293", "42555"], - "output": false - }, - { "inputs": ["42551", "42555"], "output": false }, - { "inputs": ["42555", "42555"], "output": true }, - { "inputs": ["42555", "42551"], "output": false } - ], - "eq_euint256_euint32": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457580556825298662935", "2172668277"], - "output": false - }, - { "inputs": ["2172668273", "2172668277"], "output": false }, - { "inputs": ["2172668277", "2172668277"], "output": true }, - { "inputs": ["2172668277", "2172668273"], "output": false } - ], - "eq_euint256_euint64": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579655327337947495", - "18438962761364358079" - ], - "output": false - }, - { - "inputs": ["18438962761364358075", "18438962761364358079"], - "output": false - }, - { - "inputs": ["18438962761364358079", "18438962761364358079"], - "output": true - }, - { - "inputs": ["18438962761364358079", "18438962761364358075"], - "output": false - } - ], - "eq_euint256_euint128": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457583147947133304483", - "340282366920938463463373080930672512019" - ], - "output": false - }, - { - "inputs": ["340282366920938463463373080930672512015", "340282366920938463463373080930672512019"], - "output": false - }, - { - "inputs": ["340282366920938463463373080930672512019", "340282366920938463463373080930672512019"], - "output": true - }, - { - "inputs": ["340282366920938463463373080930672512019", "340282366920938463463373080930672512015"], - "output": false - } - ], - "eq_euint256_euint256": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579028937132718443", - "115792089237316195423570985008687907853269984665640564039457575281612927984431" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457575281612927984427", - "115792089237316195423570985008687907853269984665640564039457575281612927984431" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457575281612927984431", - "115792089237316195423570985008687907853269984665640564039457575281612927984431" - ], - "output": true - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457575281612927984431", - "115792089237316195423570985008687907853269984665640564039457575281612927984427" - ], - "output": false - } - ], - "eq_euint256_uint256": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579028937132718443", - "115792089237316195423570985008687907853269984665640564039457576393900678416361" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457575281612927984427", - "115792089237316195423570985008687907853269984665640564039457575281612927984431" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457575281612927984431", - "115792089237316195423570985008687907853269984665640564039457575281612927984431" - ], - "output": true - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457575281612927984431", - "115792089237316195423570985008687907853269984665640564039457575281612927984427" - ], - "output": false - } - ], - "eq_uint256_euint256": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577173439170014457", - "115792089237316195423570985008687907853269984665640564039457576393900678416361" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457575281612927984427", - "115792089237316195423570985008687907853269984665640564039457575281612927984431" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457575281612927984431", - "115792089237316195423570985008687907853269984665640564039457575281612927984431" - ], - "output": true - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457575281612927984431", - "115792089237316195423570985008687907853269984665640564039457575281612927984427" - ], - "output": false - } - ], - "ne_euint4_euint4": [ - { "inputs": ["1", "9"], "output": true }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } - ], - "ne_euint4_euint8": [ - { "inputs": ["8", "128"], "output": true }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } - ], - "ne_euint4_uint8": [ - { "inputs": ["8", "9"], "output": true }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } - ], - "ne_euint4_euint16": [ - { "inputs": ["14", "35568"], "output": true }, - { "inputs": ["10", "14"], "output": true }, - { "inputs": ["14", "14"], "output": false }, - { "inputs": ["14", "10"], "output": true } - ], - "ne_euint4_euint32": [ - { "inputs": ["5", "2818677977"], "output": true }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } - ], - "ne_euint4_euint64": [ - { "inputs": ["7", "18446555094221865045"], "output": true }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } - ], - "ne_euint4_euint128": [ - { - "inputs": ["13", "340282366920938463463368725666766226609"], - "output": true - }, - { "inputs": ["9", "13"], "output": true }, - { "inputs": ["13", "13"], "output": false }, - { "inputs": ["13", "9"], "output": true } - ], - "ne_euint4_euint256": [ - { - "inputs": ["14", "115792089237316195423570985008687907853269984665640564039457581114073806378677"], - "output": true - }, - { "inputs": ["10", "14"], "output": true }, - { "inputs": ["14", "14"], "output": false }, - { "inputs": ["14", "10"], "output": true } - ], - "ne_euint8_euint4": [ - { "inputs": ["27", "13"], "output": true }, - { "inputs": ["9", "13"], "output": true }, - { "inputs": ["13", "13"], "output": false }, - { "inputs": ["13", "9"], "output": true } - ], - "ne_uint8_euint4": [ - { "inputs": ["9", "13"], "output": true }, - { "inputs": ["9", "13"], "output": true }, - { "inputs": ["13", "13"], "output": false }, - { "inputs": ["13", "9"], "output": true } - ], - "ne_euint8_euint8": [ - { "inputs": ["197", "245"], "output": true }, - { "inputs": ["193", "197"], "output": true }, - { "inputs": ["197", "197"], "output": false }, - { "inputs": ["197", "193"], "output": true } - ], - "ne_euint8_uint8": [ - { "inputs": ["197", "40"], "output": true }, - { "inputs": ["193", "197"], "output": true }, - { "inputs": ["197", "197"], "output": false }, - { "inputs": ["197", "193"], "output": true } - ], - "ne_uint8_euint8": [ - { "inputs": ["243", "40"], "output": true }, - { "inputs": ["193", "197"], "output": true }, - { "inputs": ["197", "197"], "output": false }, - { "inputs": ["197", "193"], "output": true } - ], - "ne_euint8_euint16": [ - { "inputs": ["128", "47128"], "output": true }, - { "inputs": ["124", "128"], "output": true }, - { "inputs": ["128", "128"], "output": false }, - { "inputs": ["128", "124"], "output": true } - ], - "ne_euint8_euint32": [ - { "inputs": ["134", "943645708"], "output": true }, - { "inputs": ["130", "134"], "output": true }, - { "inputs": ["134", "134"], "output": false }, - { "inputs": ["134", "130"], "output": true } - ], - "ne_euint8_euint64": [ - { "inputs": ["99", "18445356789087657925"], "output": true }, - { "inputs": ["95", "99"], "output": true }, - { "inputs": ["99", "99"], "output": false }, - { "inputs": ["99", "95"], "output": true } - ], - "ne_euint8_euint128": [ - { - "inputs": ["226", "340282366920938463463366961237977601965"], - "output": true - }, - { "inputs": ["222", "226"], "output": true }, - { "inputs": ["226", "226"], "output": false }, - { "inputs": ["226", "222"], "output": true } - ], - "ne_euint8_euint256": [ - { - "inputs": ["214", "115792089237316195423570985008687907853269984665640564039457580955238657941683"], - "output": true - }, - { "inputs": ["210", "214"], "output": true }, - { "inputs": ["214", "214"], "output": false }, - { "inputs": ["214", "210"], "output": true } - ], - "ne_euint16_euint4": [ - { "inputs": ["26709", "5"], "output": true }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } - ], - "ne_euint16_euint8": [ - { "inputs": ["13794", "3"], "output": true }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } - ], - "ne_euint16_euint16": [ - { "inputs": ["16378", "60161"], "output": true }, - { "inputs": ["16374", "16378"], "output": true }, - { "inputs": ["16378", "16378"], "output": false }, - { "inputs": ["16378", "16374"], "output": true } - ], - "ne_euint16_uint16": [ - { "inputs": ["16378", "35706"], "output": true }, - { "inputs": ["16374", "16378"], "output": true }, - { "inputs": ["16378", "16378"], "output": false }, - { "inputs": ["16378", "16374"], "output": true } - ], - "ne_uint16_euint16": [ - { "inputs": ["43595", "35706"], "output": true }, - { "inputs": ["16374", "16378"], "output": true }, - { "inputs": ["16378", "16378"], "output": false }, - { "inputs": ["16378", "16374"], "output": true } - ], - "ne_euint16_euint32": [ - { "inputs": ["30095", "2933999842"], "output": true }, - { "inputs": ["30091", "30095"], "output": true }, - { "inputs": ["30095", "30095"], "output": false }, - { "inputs": ["30095", "30091"], "output": true } - ], - "ne_euint16_euint64": [ - { "inputs": ["9855", "18438572273104866201"], "output": true }, - { "inputs": ["9851", "9855"], "output": true }, - { "inputs": ["9855", "9855"], "output": false }, - { "inputs": ["9855", "9851"], "output": true } - ], - "ne_euint16_euint128": [ - { - "inputs": ["58939", "340282366920938463463367826166753900405"], - "output": true - }, - { "inputs": ["58935", "58939"], "output": true }, - { "inputs": ["58939", "58939"], "output": false }, - { "inputs": ["58939", "58935"], "output": true } - ], - "ne_euint16_euint256": [ - { - "inputs": ["41071", "115792089237316195423570985008687907853269984665640564039457577958679700892209"], - "output": true - }, - { "inputs": ["41067", "41071"], "output": true }, - { "inputs": ["41071", "41071"], "output": false }, - { "inputs": ["41071", "41067"], "output": true } - ], - "ne_euint32_euint4": [ - { "inputs": ["2761853602", "13"], "output": true }, - { "inputs": ["9", "13"], "output": true }, - { "inputs": ["13", "13"], "output": false }, - { "inputs": ["13", "9"], "output": true } - ], - "ne_euint32_euint8": [ - { "inputs": ["1535914080", "80"], "output": true }, - { "inputs": ["76", "80"], "output": true }, - { "inputs": ["80", "80"], "output": false }, - { "inputs": ["80", "76"], "output": true } - ], - "ne_euint32_euint16": [ - { "inputs": ["3735850389", "7960"], "output": true }, - { "inputs": ["7956", "7960"], "output": true }, - { "inputs": ["7960", "7960"], "output": false }, - { "inputs": ["7960", "7956"], "output": true } - ], - "ne_euint32_euint32": [ - { "inputs": ["440396727", "1222940316"], "output": true }, - { "inputs": ["440396723", "440396727"], "output": true }, - { "inputs": ["440396727", "440396727"], "output": false }, - { "inputs": ["440396727", "440396723"], "output": true } - ], - "ne_euint32_uint32": [ - { "inputs": ["440396727", "826320072"], "output": true }, - { "inputs": ["440396723", "440396727"], "output": true }, - { "inputs": ["440396727", "440396727"], "output": false }, - { "inputs": ["440396727", "440396723"], "output": true } - ], - "ne_uint32_euint32": [ - { "inputs": ["3496297299", "826320072"], "output": true }, - { "inputs": ["440396723", "440396727"], "output": true }, - { "inputs": ["440396727", "440396727"], "output": false }, - { "inputs": ["440396727", "440396723"], "output": true } - ], - "ne_euint32_euint64": [ - { "inputs": ["1132249413", "18438312419950369711"], "output": true }, - { "inputs": ["1132249409", "1132249413"], "output": true }, - { "inputs": ["1132249413", "1132249413"], "output": false }, - { "inputs": ["1132249413", "1132249409"], "output": true } - ], - "ne_euint32_euint128": [ - { - "inputs": ["3303815983", "340282366920938463463373693800095408137"], - "output": true - }, - { "inputs": ["3303815979", "3303815983"], "output": true }, - { "inputs": ["3303815983", "3303815983"], "output": false }, - { "inputs": ["3303815983", "3303815979"], "output": true } - ], - "ne_euint32_euint256": [ - { - "inputs": ["3268569536", "115792089237316195423570985008687907853269984665640564039457577368549107012293"], - "output": true - }, - { "inputs": ["3268569532", "3268569536"], "output": true }, - { "inputs": ["3268569536", "3268569536"], "output": false }, - { "inputs": ["3268569536", "3268569532"], "output": true } - ], - "ne_euint64_euint4": [ - { "inputs": ["18443746789087798257", "2"], "output": true }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } - ], - "ne_euint64_euint8": [ - { "inputs": ["18443274666908974803", "120"], "output": true }, - { "inputs": ["116", "120"], "output": true }, - { "inputs": ["120", "120"], "output": false }, - { "inputs": ["120", "116"], "output": true } - ], - "ne_euint64_euint16": [ - { "inputs": ["18446683880931020495", "9122"], "output": true }, - { "inputs": ["9118", "9122"], "output": true }, - { "inputs": ["9122", "9122"], "output": false }, - { "inputs": ["9122", "9118"], "output": true } - ], - "ne_euint64_euint32": [ - { "inputs": ["18443424543399945811", "2475089443"], "output": true }, - { "inputs": ["2475089439", "2475089443"], "output": true }, - { "inputs": ["2475089443", "2475089443"], "output": false }, - { "inputs": ["2475089443", "2475089439"], "output": true } - ], - "ne_euint64_euint64": [ - { - "inputs": ["18445289136242885897", "18441860560804132295"], - "output": true - }, - { - "inputs": ["18441860560804132291", "18441860560804132295"], - "output": true - }, - { - "inputs": ["18441860560804132295", "18441860560804132295"], - "output": false - }, - { - "inputs": ["18441860560804132295", "18441860560804132291"], - "output": true - } - ], - "ne_euint64_uint64": [ - { - "inputs": ["18445289136242885897", "18440743017590143725"], - "output": true - }, - { - "inputs": ["18441860560804132291", "18441860560804132295"], - "output": true - }, - { - "inputs": ["18441860560804132295", "18441860560804132295"], - "output": false - }, - { - "inputs": ["18441860560804132295", "18441860560804132291"], - "output": true - } - ], - "ne_uint64_euint64": [ - { - "inputs": ["18442171622930650065", "18440743017590143725"], - "output": true - }, - { - "inputs": ["18441860560804132291", "18441860560804132295"], - "output": true - }, - { - "inputs": ["18441860560804132295", "18441860560804132295"], - "output": false - }, - { - "inputs": ["18441860560804132295", "18441860560804132291"], - "output": true - } - ], - "ne_euint64_euint128": [ - { - "inputs": ["18439484097328106945", "340282366920938463463374251414120336649"], - "output": true - }, - { - "inputs": ["18439484097328106941", "18439484097328106945"], - "output": true - }, - { - "inputs": ["18439484097328106945", "18439484097328106945"], - "output": false - }, - { - "inputs": ["18439484097328106945", "18439484097328106941"], - "output": true - } - ], - "ne_euint64_euint256": [ - { - "inputs": [ - "18446211817960475589", - "115792089237316195423570985008687907853269984665640564039457576433191959532665" - ], - "output": true - }, - { - "inputs": ["18446211817960475585", "18446211817960475589"], - "output": true - }, - { - "inputs": ["18446211817960475589", "18446211817960475589"], - "output": false - }, - { - "inputs": ["18446211817960475589", "18446211817960475585"], - "output": true - } - ], - "ne_euint128_euint4": [ - { - "inputs": ["340282366920938463463371595006609590711", "5"], - "output": true - }, - { "inputs": ["4", "8"], "output": true }, - { "inputs": ["8", "8"], "output": false }, - { "inputs": ["8", "4"], "output": true } - ], - "ne_euint128_euint8": [ - { - "inputs": ["340282366920938463463374264796523764465", "244"], - "output": true - }, - { "inputs": ["240", "244"], "output": true }, - { "inputs": ["244", "244"], "output": false }, - { "inputs": ["244", "240"], "output": true } - ], - "ne_euint128_euint16": [ - { - "inputs": ["340282366920938463463370265865713339199", "54670"], - "output": true - }, - { "inputs": ["54666", "54670"], "output": true }, - { "inputs": ["54670", "54670"], "output": false }, - { "inputs": ["54670", "54666"], "output": true } - ], - "ne_euint128_euint32": [ - { - "inputs": ["340282366920938463463374155295872552931", "1145053382"], - "output": true - }, - { "inputs": ["1145053378", "1145053382"], "output": true }, - { "inputs": ["1145053382", "1145053382"], "output": false }, - { "inputs": ["1145053382", "1145053378"], "output": true } - ], - "ne_euint128_euint64": [ - { - "inputs": ["340282366920938463463367381041406724807", "18441880962783858343"], - "output": true - }, - { - "inputs": ["18441880962783858339", "18441880962783858343"], - "output": true - }, - { - "inputs": ["18441880962783858343", "18441880962783858343"], - "output": false - }, - { - "inputs": ["18441880962783858343", "18441880962783858339"], - "output": true - } - ], - "ne_euint128_euint128": [ - { - "inputs": ["340282366920938463463366690564024700303", "340282366920938463463366105643215363065"], - "output": true - }, - { - "inputs": ["340282366920938463463366105643215363061", "340282366920938463463366105643215363065"], - "output": true - }, - { - "inputs": ["340282366920938463463366105643215363065", "340282366920938463463366105643215363065"], - "output": false - }, - { - "inputs": ["340282366920938463463366105643215363065", "340282366920938463463366105643215363061"], - "output": true - } - ], - "ne_euint128_uint128": [ - { - "inputs": ["340282366920938463463366690564024700303", "340282366920938463463373212539976330723"], - "output": true - }, - { - "inputs": ["340282366920938463463366105643215363061", "340282366920938463463366105643215363065"], - "output": true - }, - { - "inputs": ["340282366920938463463366105643215363065", "340282366920938463463366105643215363065"], - "output": false - }, - { - "inputs": ["340282366920938463463366105643215363065", "340282366920938463463366105643215363061"], - "output": true - } - ], - "ne_uint128_euint128": [ - { - "inputs": ["340282366920938463463372802578174510491", "340282366920938463463373212539976330723"], - "output": true - }, - { - "inputs": ["340282366920938463463366105643215363061", "340282366920938463463366105643215363065"], - "output": true - }, - { - "inputs": ["340282366920938463463366105643215363065", "340282366920938463463366105643215363065"], - "output": false - }, - { - "inputs": ["340282366920938463463366105643215363065", "340282366920938463463366105643215363061"], - "output": true - } - ], - "ne_euint128_euint256": [ - { - "inputs": [ - "340282366920938463463374144988236257799", - "115792089237316195423570985008687907853269984665640564039457582794848891263301" - ], - "output": true - }, - { - "inputs": ["340282366920938463463374144988236257795", "340282366920938463463374144988236257799"], - "output": true - }, - { - "inputs": ["340282366920938463463374144988236257799", "340282366920938463463374144988236257799"], - "output": false - }, - { - "inputs": ["340282366920938463463374144988236257799", "340282366920938463463374144988236257795"], - "output": true - } - ], - "ne_euint256_euint4": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457577394215847356385", "12"], - "output": true - }, - { "inputs": ["8", "12"], "output": true }, - { "inputs": ["12", "12"], "output": false }, - { "inputs": ["12", "8"], "output": true } - ], - "ne_euint256_euint8": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457577306800788645475", "79"], - "output": true - }, - { "inputs": ["75", "79"], "output": true }, - { "inputs": ["79", "79"], "output": false }, - { "inputs": ["79", "75"], "output": true } - ], - "ne_euint256_euint16": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457575904968867077761", "30382"], - "output": true - }, - { "inputs": ["30378", "30382"], "output": true }, - { "inputs": ["30382", "30382"], "output": false }, - { "inputs": ["30382", "30378"], "output": true } - ], - "ne_euint256_euint32": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457583230004924210357", "3013060698"], - "output": true - }, - { "inputs": ["3013060694", "3013060698"], "output": true }, - { "inputs": ["3013060698", "3013060698"], "output": false }, - { "inputs": ["3013060698", "3013060694"], "output": true } - ], - "ne_euint256_euint64": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457578997655721966093", - "18437968835725654059" - ], - "output": true - }, - { - "inputs": ["18437968835725654055", "18437968835725654059"], - "output": true - }, - { - "inputs": ["18437968835725654059", "18437968835725654059"], - "output": false - }, - { - "inputs": ["18437968835725654059", "18437968835725654055"], - "output": true - } - ], - "ne_euint256_euint128": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457576673614745401783", - "340282366920938463463373230674573043227" - ], - "output": true - }, - { - "inputs": ["340282366920938463463373230674573043223", "340282366920938463463373230674573043227"], - "output": true - }, - { - "inputs": ["340282366920938463463373230674573043227", "340282366920938463463373230674573043227"], - "output": false - }, - { - "inputs": ["340282366920938463463373230674573043227", "340282366920938463463373230674573043223"], - "output": true - } - ], - "ne_euint256_euint256": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457581421114730215071", - "115792089237316195423570985008687907853269984665640564039457577745710288733723" - ], - "output": true - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577745710288733719", - "115792089237316195423570985008687907853269984665640564039457577745710288733723" - ], - "output": true - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577745710288733723", - "115792089237316195423570985008687907853269984665640564039457577745710288733723" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577745710288733723", - "115792089237316195423570985008687907853269984665640564039457577745710288733719" - ], - "output": true - } - ], - "ne_euint256_uint256": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457581421114730215071", - "115792089237316195423570985008687907853269984665640564039457583491257588609271" - ], - "output": true - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577745710288733719", - "115792089237316195423570985008687907853269984665640564039457577745710288733723" - ], - "output": true - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577745710288733723", - "115792089237316195423570985008687907853269984665640564039457577745710288733723" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577745710288733723", - "115792089237316195423570985008687907853269984665640564039457577745710288733719" - ], - "output": true - } - ], - "ne_uint256_euint256": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457583026693216867801", - "115792089237316195423570985008687907853269984665640564039457583491257588609271" - ], - "output": true - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577745710288733719", - "115792089237316195423570985008687907853269984665640564039457577745710288733723" - ], - "output": true - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577745710288733723", - "115792089237316195423570985008687907853269984665640564039457577745710288733723" - ], - "output": false - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577745710288733723", - "115792089237316195423570985008687907853269984665640564039457577745710288733719" - ], - "output": true - } - ], - "shl_euint4_uint8": [ - { "inputs": ["1", "2"], "output": "4" }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "8" } - ], - "shl_euint8_euint8": [ - { "inputs": ["44", "4"], "output": "192" }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "shl_euint8_uint8": [ - { "inputs": ["44", "4"], "output": "192" }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "shl_euint16_euint8": [ - { "inputs": ["10029", "5"], "output": "58784" }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "shl_euint16_uint8": [ - { "inputs": ["10029", "5"], "output": "58784" }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "shl_euint32_euint8": [ - { "inputs": ["3189891720", "4"], "output": "3793627264" }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "shl_euint32_uint8": [ - { "inputs": ["3189891720", "4"], "output": "3793627264" }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "shl_euint64_euint8": [ - { - "inputs": ["18438852048643145403", "6"], - "output": "17941654469459553984" - }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "shl_euint64_uint8": [ - { - "inputs": ["18438852048643145403", "6"], - "output": "17941654469459553984" - }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "shl_euint128_euint8": [ - { - "inputs": ["340282366920938463463366293596486217477", "5"], - "output": "340282366920938463463108564702744404128" - }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "shl_euint128_uint8": [ - { - "inputs": ["340282366920938463463366293596486217477", "5"], - "output": "340282366920938463463108564702744404128" - }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "shl_euint256_euint8": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457578572299000463425", "7"], - "output": "115792089237316195423570985008687907853269984665640564039456888249304595046528" - }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "shl_euint256_uint8": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457578572299000463425", "7"], - "output": "115792089237316195423570985008687907853269984665640564039456888249304595046528" - }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "shr_euint4_uint8": [ - { "inputs": ["4", "7"], "output": "0" }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "8" } - ], - "shr_euint8_euint8": [ - { "inputs": ["160", "3"], "output": "20" }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "0" } - ], - "shr_euint8_uint8": [ - { "inputs": ["160", "3"], "output": "20" }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "0" } - ], - "shr_euint16_euint8": [ - { "inputs": ["63034", "6"], "output": "984" }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "0" } - ], - "shr_euint16_uint8": [ - { "inputs": ["63034", "6"], "output": "984" }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "0" } - ], - "shr_euint32_euint8": [ - { "inputs": ["1720949149", "4"], "output": "107559321" }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "0" } - ], - "shr_euint32_uint8": [ - { "inputs": ["1720949149", "4"], "output": "107559321" }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "0" } - ], - "shr_euint64_euint8": [ - { "inputs": ["18444486134915793097", "6"], "output": "288195095858059267" }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "0" } - ], - "shr_euint64_uint8": [ - { "inputs": ["18444486134915793097", "6"], "output": "288195095858059267" }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "0" } - ], - "shr_euint128_euint8": [ - { - "inputs": ["340282366920938463463368208225205051841", "2"], - "output": "85070591730234615865842052056301262960" - }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "0" } - ], - "shr_euint128_uint8": [ - { - "inputs": ["340282366920938463463368208225205051841", "2"], - "output": "85070591730234615865842052056301262960" - }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "0" } - ], - "shr_euint256_euint8": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457578470671649972655", "2"], - "output": "28948022309329048855892746252171976963317496166410141009864394617667912493163" - }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "0" } - ], - "shr_euint256_uint8": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457578470671649972655", "2"], - "output": "28948022309329048855892746252171976963317496166410141009864394617667912493163" - }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "0" } - ], - "rotl_euint4_uint8": [ - { "inputs": ["1", "2"], "output": "4" }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "8" } - ], - "rotl_euint8_euint8": [ - { "inputs": ["150", "4"], "output": "105" }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "rotl_euint8_uint8": [ - { "inputs": ["150", "4"], "output": "105" }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "rotl_euint16_euint8": [ - { "inputs": ["34007", "4"], "output": "19832" }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "rotl_euint16_uint8": [ - { "inputs": ["34007", "4"], "output": "19832" }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "rotl_euint32_euint8": [ - { "inputs": ["10430463", "3"], "output": "83443704" }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "rotl_euint32_uint8": [ - { "inputs": ["10430463", "3"], "output": "83443704" }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "rotl_euint64_euint8": [ - { - "inputs": ["18440494415218168649", "7"], - "output": "17646787786812531967" - }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "rotl_euint64_uint8": [ - { - "inputs": ["18440494415218168649", "7"], - "output": "17646787786812531967" - }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "rotl_euint128_euint8": [ - { - "inputs": ["340282366920938463463369231473752264653", "3"], - "output": "340282366920938463463331599767640637039" - }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "rotl_euint128_uint8": [ - { - "inputs": ["340282366920938463463369231473752264653", "3"], - "output": "340282366920938463463331599767640637039" - }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "rotl_euint256_euint8": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457582882208711886349", "7"], - "output": "115792089237316195423570985008687907853269984665640564039457439917747657180927" - }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "rotl_euint256_uint8": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457582882208711886349", "7"], - "output": "115792089237316195423570985008687907853269984665640564039457439917747657180927" - }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "rotr_euint4_uint8": [ - { "inputs": ["14", "1"], "output": "7" }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "8" } - ], - "rotr_euint8_euint8": [ - { "inputs": ["52", "6"], "output": "208" }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "rotr_euint8_uint8": [ - { "inputs": ["52", "6"], "output": "208" }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "128" } - ], - "rotr_euint16_euint8": [ - { "inputs": ["32201", "3"], "output": "12217" }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "32768" } - ], - "rotr_euint16_uint8": [ - { "inputs": ["32201", "3"], "output": "12217" }, - { "inputs": ["4", "8"], "output": "1024" }, - { "inputs": ["8", "8"], "output": "2048" }, - { "inputs": ["8", "4"], "output": "32768" } - ], - "rotr_euint32_euint8": [ - { "inputs": ["3489309750", "7"], "output": "1839199560" }, - { "inputs": ["4", "8"], "output": "67108864" }, - { "inputs": ["8", "8"], "output": "134217728" }, - { "inputs": ["8", "4"], "output": "2147483648" } - ], - "rotr_euint32_uint8": [ - { "inputs": ["3489309750", "7"], "output": "1839199560" }, - { "inputs": ["4", "8"], "output": "67108864" }, - { "inputs": ["8", "8"], "output": "134217728" }, - { "inputs": ["8", "4"], "output": "2147483648" } - ], - "rotr_euint64_euint8": [ - { - "inputs": ["18444475066789617897", "3"], - "output": "4611402392562396189" - }, - { "inputs": ["4", "8"], "output": "288230376151711744" }, - { "inputs": ["8", "8"], "output": "576460752303423488" }, - { "inputs": ["8", "4"], "output": "9223372036854775808" } - ], - "rotr_euint64_uint8": [ - { - "inputs": ["18444475066789617897", "3"], - "output": "4611402392562396189" - }, - { "inputs": ["4", "8"], "output": "288230376151711744" }, - { "inputs": ["8", "8"], "output": "576460752303423488" }, - { "inputs": ["8", "4"], "output": "9223372036854775808" } - ], - "rotr_euint128_euint8": [ - { - "inputs": ["340282366920938463463366872490223703215", "2"], - "output": "340282366920938463463372673696382084395" - }, - { "inputs": ["4", "8"], "output": "5316911983139663491615228241121378304" }, - { - "inputs": ["8", "8"], - "output": "10633823966279326983230456482242756608" - }, - { - "inputs": ["8", "4"], - "output": "170141183460469231731687303715884105728" - } - ], - "rotr_euint128_uint8": [ - { - "inputs": ["340282366920938463463366872490223703215", "2"], - "output": "340282366920938463463372673696382084395" - }, - { "inputs": ["4", "8"], "output": "5316911983139663491615228241121378304" }, - { - "inputs": ["8", "8"], - "output": "10633823966279326983230456482242756608" - }, - { - "inputs": ["8", "4"], - "output": "170141183460469231731687303715884105728" - } - ], - "rotr_euint256_euint8": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457581545102921797223", "4"], - "output": "57896044618658097711785492504343953926634992332820282019728791850030926829798" - }, - { - "inputs": ["4", "8"], - "output": "1809251394333065553493296640760748560207343510400633813116524750123642650624" - }, - { - "inputs": ["8", "8"], - "output": "3618502788666131106986593281521497120414687020801267626233049500247285301248" - }, - { - "inputs": ["8", "4"], - "output": "57896044618658097711785492504343953926634992332820282019728792003956564819968" - } - ], - "rotr_euint256_uint8": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457581545102921797223", "4"], - "output": "57896044618658097711785492504343953926634992332820282019728791850030926829798" - }, - { - "inputs": ["4", "8"], - "output": "1809251394333065553493296640760748560207343510400633813116524750123642650624" - }, - { - "inputs": ["8", "8"], - "output": "3618502788666131106986593281521497120414687020801267626233049500247285301248" - }, - { - "inputs": ["8", "4"], - "output": "57896044618658097711785492504343953926634992332820282019728792003956564819968" - } - ], - "max_euint4_euint4": [ - { "inputs": ["9", "13"], "output": "13" }, - { "inputs": ["5", "9"], "output": "9" }, - { "inputs": ["9", "9"], "output": "9" }, - { "inputs": ["9", "5"], "output": "9" } - ], - "max_euint4_euint8": [ - { "inputs": ["14", "226"], "output": "226" }, - { "inputs": ["10", "14"], "output": "14" }, - { "inputs": ["14", "14"], "output": "14" }, - { "inputs": ["14", "10"], "output": "14" } - ], - "max_euint4_uint8": [ - { "inputs": ["14", "7"], "output": "14" }, - { "inputs": ["10", "14"], "output": "14" }, - { "inputs": ["14", "14"], "output": "14" }, - { "inputs": ["14", "10"], "output": "14" } - ], - "max_euint4_euint16": [ - { "inputs": ["14", "33411"], "output": "33411" }, - { "inputs": ["10", "14"], "output": "14" }, - { "inputs": ["14", "14"], "output": "14" }, - { "inputs": ["14", "10"], "output": "14" } - ], - "max_euint4_euint32": [ - { "inputs": ["12", "623453237"], "output": "623453237" }, - { "inputs": ["8", "12"], "output": "12" }, - { "inputs": ["12", "12"], "output": "12" }, - { "inputs": ["12", "8"], "output": "12" } - ], - "max_euint4_euint64": [ - { - "inputs": ["9", "18439762941056895609"], - "output": "18439762941056895609" - }, - { "inputs": ["5", "9"], "output": "9" }, - { "inputs": ["9", "9"], "output": "9" }, - { "inputs": ["9", "5"], "output": "9" } - ], - "max_euint4_euint128": [ - { - "inputs": ["1", "340282366920938463463366284713062311837"], - "output": "340282366920938463463366284713062311837" - }, - { "inputs": ["4", "8"], "output": "8" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "8" } - ], - "max_euint4_euint256": [ - { - "inputs": ["9", "115792089237316195423570985008687907853269984665640564039457577693528211281505"], - "output": "115792089237316195423570985008687907853269984665640564039457577693528211281505" - }, - { "inputs": ["5", "9"], "output": "9" }, - { "inputs": ["9", "9"], "output": "9" }, - { "inputs": ["9", "5"], "output": "9" } - ], - "max_euint8_euint4": [ - { "inputs": ["62", "13"], "output": "62" }, - { "inputs": ["9", "13"], "output": "13" }, - { "inputs": ["13", "13"], "output": "13" }, - { "inputs": ["13", "9"], "output": "13" } - ], - "max_uint8_euint4": [ - { "inputs": ["14", "13"], "output": "14" }, - { "inputs": ["9", "13"], "output": "13" }, - { "inputs": ["13", "13"], "output": "13" }, - { "inputs": ["13", "9"], "output": "13" } - ], - "max_euint8_euint8": [ - { "inputs": ["17", "182"], "output": "182" }, - { "inputs": ["13", "17"], "output": "17" }, - { "inputs": ["17", "17"], "output": "17" }, - { "inputs": ["17", "13"], "output": "17" } - ], - "max_euint8_uint8": [ - { "inputs": ["17", "83"], "output": "83" }, - { "inputs": ["13", "17"], "output": "17" }, - { "inputs": ["17", "17"], "output": "17" }, - { "inputs": ["17", "13"], "output": "17" } - ], - "max_uint8_euint8": [ - { "inputs": ["46", "83"], "output": "83" }, - { "inputs": ["13", "17"], "output": "17" }, - { "inputs": ["17", "17"], "output": "17" }, - { "inputs": ["17", "13"], "output": "17" } - ], - "max_euint8_euint16": [ - { "inputs": ["252", "21942"], "output": "21942" }, - { "inputs": ["248", "252"], "output": "252" }, - { "inputs": ["252", "252"], "output": "252" }, - { "inputs": ["252", "248"], "output": "252" } - ], - "max_euint8_euint32": [ - { "inputs": ["31", "3976371021"], "output": "3976371021" }, - { "inputs": ["27", "31"], "output": "31" }, - { "inputs": ["31", "31"], "output": "31" }, - { "inputs": ["31", "27"], "output": "31" } - ], - "max_euint8_euint64": [ - { - "inputs": ["217", "18441870389911940983"], - "output": "18441870389911940983" - }, - { "inputs": ["213", "217"], "output": "217" }, - { "inputs": ["217", "217"], "output": "217" }, - { "inputs": ["217", "213"], "output": "217" } - ], - "max_euint8_euint128": [ - { - "inputs": ["109", "340282366920938463463369292859038505161"], - "output": "340282366920938463463369292859038505161" - }, - { "inputs": ["105", "109"], "output": "109" }, - { "inputs": ["109", "109"], "output": "109" }, - { "inputs": ["109", "105"], "output": "109" } - ], - "max_euint8_euint256": [ - { - "inputs": ["187", "115792089237316195423570985008687907853269984665640564039457583763268749719689"], - "output": "115792089237316195423570985008687907853269984665640564039457583763268749719689" - }, - { "inputs": ["183", "187"], "output": "187" }, - { "inputs": ["187", "187"], "output": "187" }, - { "inputs": ["187", "183"], "output": "187" } - ], - "max_euint16_euint4": [ - { "inputs": ["22967", "8"], "output": "22967" }, - { "inputs": ["4", "8"], "output": "8" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "8" } - ], - "max_euint16_euint8": [ - { "inputs": ["22246", "39"], "output": "22246" }, - { "inputs": ["35", "39"], "output": "39" }, - { "inputs": ["39", "39"], "output": "39" }, - { "inputs": ["39", "35"], "output": "39" } - ], - "max_euint16_euint16": [ - { "inputs": ["37775", "22432"], "output": "37775" }, - { "inputs": ["22428", "22432"], "output": "22432" }, - { "inputs": ["22432", "22432"], "output": "22432" }, - { "inputs": ["22432", "22428"], "output": "22432" } - ], - "max_euint16_uint16": [ - { "inputs": ["37775", "25405"], "output": "37775" }, - { "inputs": ["22428", "22432"], "output": "22432" }, - { "inputs": ["22432", "22432"], "output": "22432" }, - { "inputs": ["22432", "22428"], "output": "22432" } - ], - "max_uint16_euint16": [ - { "inputs": ["1122", "25405"], "output": "25405" }, - { "inputs": ["22428", "22432"], "output": "22432" }, - { "inputs": ["22432", "22432"], "output": "22432" }, - { "inputs": ["22432", "22428"], "output": "22432" } - ], - "max_euint16_euint32": [ - { "inputs": ["6434", "2918687585"], "output": "2918687585" }, - { "inputs": ["6430", "6434"], "output": "6434" }, - { "inputs": ["6434", "6434"], "output": "6434" }, - { "inputs": ["6434", "6430"], "output": "6434" } - ], - "max_euint16_euint64": [ - { - "inputs": ["43725", "18443087667786395005"], - "output": "18443087667786395005" - }, - { "inputs": ["43721", "43725"], "output": "43725" }, - { "inputs": ["43725", "43725"], "output": "43725" }, - { "inputs": ["43725", "43721"], "output": "43725" } - ], - "max_euint16_euint128": [ - { - "inputs": ["41694", "340282366920938463463370312817461607687"], - "output": "340282366920938463463370312817461607687" - }, - { "inputs": ["41690", "41694"], "output": "41694" }, - { "inputs": ["41694", "41694"], "output": "41694" }, - { "inputs": ["41694", "41690"], "output": "41694" } - ], - "max_euint16_euint256": [ - { - "inputs": ["35663", "115792089237316195423570985008687907853269984665640564039457581066242393293579"], - "output": "115792089237316195423570985008687907853269984665640564039457581066242393293579" - }, - { "inputs": ["35659", "35663"], "output": "35663" }, - { "inputs": ["35663", "35663"], "output": "35663" }, - { "inputs": ["35663", "35659"], "output": "35663" } - ], - "max_euint32_euint4": [ - { "inputs": ["1089745104", "2"], "output": "1089745104" }, - { "inputs": ["4", "8"], "output": "8" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "8" } - ], - "max_euint32_euint8": [ - { "inputs": ["2231185000", "65"], "output": "2231185000" }, - { "inputs": ["61", "65"], "output": "65" }, - { "inputs": ["65", "65"], "output": "65" }, - { "inputs": ["65", "61"], "output": "65" } - ], - "max_euint32_euint16": [ - { "inputs": ["1606859063", "42684"], "output": "1606859063" }, - { "inputs": ["42680", "42684"], "output": "42684" }, - { "inputs": ["42684", "42684"], "output": "42684" }, - { "inputs": ["42684", "42680"], "output": "42684" } - ], - "max_euint32_euint32": [ - { "inputs": ["1310408559", "1943659319"], "output": "1943659319" }, - { "inputs": ["1310408555", "1310408559"], "output": "1310408559" }, - { "inputs": ["1310408559", "1310408559"], "output": "1310408559" }, - { "inputs": ["1310408559", "1310408555"], "output": "1310408559" } - ], - "max_euint32_uint32": [ - { "inputs": ["1310408559", "1676413628"], "output": "1676413628" }, - { "inputs": ["1310408555", "1310408559"], "output": "1310408559" }, - { "inputs": ["1310408559", "1310408559"], "output": "1310408559" }, - { "inputs": ["1310408559", "1310408555"], "output": "1310408559" } - ], - "max_uint32_euint32": [ - { "inputs": ["870136392", "1676413628"], "output": "1676413628" }, - { "inputs": ["1310408555", "1310408559"], "output": "1310408559" }, - { "inputs": ["1310408559", "1310408559"], "output": "1310408559" }, - { "inputs": ["1310408559", "1310408555"], "output": "1310408559" } - ], - "max_euint32_euint64": [ - { - "inputs": ["1980815436", "18446246159979986155"], - "output": "18446246159979986155" - }, - { "inputs": ["1980815432", "1980815436"], "output": "1980815436" }, - { "inputs": ["1980815436", "1980815436"], "output": "1980815436" }, - { "inputs": ["1980815436", "1980815432"], "output": "1980815436" } - ], - "max_euint32_euint128": [ - { - "inputs": ["731106649", "340282366920938463463370948491424745963"], - "output": "340282366920938463463370948491424745963" - }, - { "inputs": ["731106645", "731106649"], "output": "731106649" }, - { "inputs": ["731106649", "731106649"], "output": "731106649" }, - { "inputs": ["731106649", "731106645"], "output": "731106649" } - ], - "max_euint32_euint256": [ - { - "inputs": ["2079496081", "115792089237316195423570985008687907853269984665640564039457579470316273335423"], - "output": "115792089237316195423570985008687907853269984665640564039457579470316273335423" - }, - { "inputs": ["2079496077", "2079496081"], "output": "2079496081" }, - { "inputs": ["2079496081", "2079496081"], "output": "2079496081" }, - { "inputs": ["2079496081", "2079496077"], "output": "2079496081" } - ], - "max_euint64_euint4": [ - { - "inputs": ["18446600326518934469", "12"], - "output": "18446600326518934469" - }, - { "inputs": ["8", "12"], "output": "12" }, - { "inputs": ["12", "12"], "output": "12" }, - { "inputs": ["12", "8"], "output": "12" } - ], - "max_euint64_euint8": [ - { - "inputs": ["18437818308322976495", "86"], - "output": "18437818308322976495" - }, - { "inputs": ["82", "86"], "output": "86" }, - { "inputs": ["86", "86"], "output": "86" }, - { "inputs": ["86", "82"], "output": "86" } - ], - "max_euint64_euint16": [ - { - "inputs": ["18446109140882718991", "19434"], - "output": "18446109140882718991" - }, - { "inputs": ["19430", "19434"], "output": "19434" }, - { "inputs": ["19434", "19434"], "output": "19434" }, - { "inputs": ["19434", "19430"], "output": "19434" } - ], - "max_euint64_euint32": [ - { - "inputs": ["18438142521959169981", "4265760124"], - "output": "18438142521959169981" - }, - { "inputs": ["4265760120", "4265760124"], "output": "4265760124" }, - { "inputs": ["4265760124", "4265760124"], "output": "4265760124" }, - { "inputs": ["4265760124", "4265760120"], "output": "4265760124" } - ], - "max_euint64_euint64": [ - { - "inputs": ["18445852065991763771", "18440937538047974893"], - "output": "18445852065991763771" - }, - { - "inputs": ["18440937538047974889", "18440937538047974893"], - "output": "18440937538047974893" - }, - { - "inputs": ["18440937538047974893", "18440937538047974893"], - "output": "18440937538047974893" - }, - { - "inputs": ["18440937538047974893", "18440937538047974889"], - "output": "18440937538047974893" - } - ], - "max_euint64_uint64": [ - { - "inputs": ["18445852065991763771", "18440623444591001569"], - "output": "18445852065991763771" - }, - { - "inputs": ["18440937538047974889", "18440937538047974893"], - "output": "18440937538047974893" - }, - { - "inputs": ["18440937538047974893", "18440937538047974893"], - "output": "18440937538047974893" - }, - { - "inputs": ["18440937538047974893", "18440937538047974889"], - "output": "18440937538047974893" - } - ], - "max_uint64_euint64": [ - { - "inputs": ["18444013465281910433", "18440623444591001569"], - "output": "18444013465281910433" - }, - { - "inputs": ["18440937538047974889", "18440937538047974893"], - "output": "18440937538047974893" - }, - { - "inputs": ["18440937538047974893", "18440937538047974893"], - "output": "18440937538047974893" - }, - { - "inputs": ["18440937538047974893", "18440937538047974889"], - "output": "18440937538047974893" - } - ], - "max_euint64_euint128": [ - { - "inputs": ["18444589551829336117", "340282366920938463463371310064926977589"], - "output": "340282366920938463463371310064926977589" - }, - { - "inputs": ["18444589551829336113", "18444589551829336117"], - "output": "18444589551829336117" - }, - { - "inputs": ["18444589551829336117", "18444589551829336117"], - "output": "18444589551829336117" - }, - { - "inputs": ["18444589551829336117", "18444589551829336113"], - "output": "18444589551829336117" - } - ], - "max_euint64_euint256": [ - { - "inputs": [ - "18437962634473522913", - "115792089237316195423570985008687907853269984665640564039457582464243297466475" - ], - "output": "115792089237316195423570985008687907853269984665640564039457582464243297466475" - }, - { - "inputs": ["18437962634473522909", "18437962634473522913"], - "output": "18437962634473522913" - }, - { - "inputs": ["18437962634473522913", "18437962634473522913"], - "output": "18437962634473522913" - }, - { - "inputs": ["18437962634473522913", "18437962634473522909"], - "output": "18437962634473522913" - } - ], - "max_euint128_euint4": [ - { - "inputs": ["340282366920938463463368883145053125641", "8"], - "output": "340282366920938463463368883145053125641" - }, - { "inputs": ["4", "8"], "output": "8" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "8" } - ], - "max_euint128_euint8": [ - { - "inputs": ["340282366920938463463369691386082749829", "49"], - "output": "340282366920938463463369691386082749829" - }, - { "inputs": ["45", "49"], "output": "49" }, - { "inputs": ["49", "49"], "output": "49" }, - { "inputs": ["49", "45"], "output": "49" } - ], - "max_euint128_euint16": [ - { - "inputs": ["340282366920938463463370317782456018271", "38332"], - "output": "340282366920938463463370317782456018271" - }, - { "inputs": ["38328", "38332"], "output": "38332" }, - { "inputs": ["38332", "38332"], "output": "38332" }, - { "inputs": ["38332", "38328"], "output": "38332" } - ], - "max_euint128_euint32": [ - { - "inputs": ["340282366920938463463374411933353920761", "2226263511"], - "output": "340282366920938463463374411933353920761" - }, - { "inputs": ["2226263507", "2226263511"], "output": "2226263511" }, - { "inputs": ["2226263511", "2226263511"], "output": "2226263511" }, - { "inputs": ["2226263511", "2226263507"], "output": "2226263511" } - ], - "max_euint128_euint64": [ - { - "inputs": ["340282366920938463463373867307519267223", "18442144243272238465"], - "output": "340282366920938463463373867307519267223" - }, - { - "inputs": ["18442144243272238461", "18442144243272238465"], - "output": "18442144243272238465" - }, - { - "inputs": ["18442144243272238465", "18442144243272238465"], - "output": "18442144243272238465" - }, - { - "inputs": ["18442144243272238465", "18442144243272238461"], - "output": "18442144243272238465" - } - ], - "max_euint128_euint128": [ - { - "inputs": ["340282366920938463463374311959896511759", "340282366920938463463367499312160836031"], - "output": "340282366920938463463374311959896511759" - }, - { - "inputs": ["340282366920938463463367499312160836027", "340282366920938463463367499312160836031"], - "output": "340282366920938463463367499312160836031" - }, - { - "inputs": ["340282366920938463463367499312160836031", "340282366920938463463367499312160836031"], - "output": "340282366920938463463367499312160836031" - }, - { - "inputs": ["340282366920938463463367499312160836031", "340282366920938463463367499312160836027"], - "output": "340282366920938463463367499312160836031" - } - ], - "max_euint128_uint128": [ - { - "inputs": ["340282366920938463463374311959896511759", "340282366920938463463371397781663603615"], - "output": "340282366920938463463374311959896511759" - }, - { - "inputs": ["340282366920938463463367499312160836027", "340282366920938463463367499312160836031"], - "output": "340282366920938463463367499312160836031" - }, - { - "inputs": ["340282366920938463463367499312160836031", "340282366920938463463367499312160836031"], - "output": "340282366920938463463367499312160836031" - }, - { - "inputs": ["340282366920938463463367499312160836031", "340282366920938463463367499312160836027"], - "output": "340282366920938463463367499312160836031" - } - ], - "max_uint128_euint128": [ - { - "inputs": ["340282366920938463463370589299931927619", "340282366920938463463371397781663603615"], - "output": "340282366920938463463371397781663603615" - }, - { - "inputs": ["340282366920938463463367499312160836027", "340282366920938463463367499312160836031"], - "output": "340282366920938463463367499312160836031" - }, - { - "inputs": ["340282366920938463463367499312160836031", "340282366920938463463367499312160836031"], - "output": "340282366920938463463367499312160836031" - }, - { - "inputs": ["340282366920938463463367499312160836031", "340282366920938463463367499312160836027"], - "output": "340282366920938463463367499312160836031" - } - ], - "max_euint128_euint256": [ - { - "inputs": [ - "340282366920938463463373789765297113341", - "115792089237316195423570985008687907853269984665640564039457579894549860743867" - ], - "output": "115792089237316195423570985008687907853269984665640564039457579894549860743867" - }, - { - "inputs": ["340282366920938463463373789765297113337", "340282366920938463463373789765297113341"], - "output": "340282366920938463463373789765297113341" - }, - { - "inputs": ["340282366920938463463373789765297113341", "340282366920938463463373789765297113341"], - "output": "340282366920938463463373789765297113341" - }, - { - "inputs": ["340282366920938463463373789765297113341", "340282366920938463463373789765297113337"], - "output": "340282366920938463463373789765297113341" - } - ], - "max_euint256_euint4": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457577303760309863037", "1"], - "output": "115792089237316195423570985008687907853269984665640564039457577303760309863037" - }, - { "inputs": ["4", "8"], "output": "8" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "8" } - ], - "max_euint256_euint8": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457581923844171729579", "237"], - "output": "115792089237316195423570985008687907853269984665640564039457581923844171729579" - }, - { "inputs": ["233", "237"], "output": "237" }, - { "inputs": ["237", "237"], "output": "237" }, - { "inputs": ["237", "233"], "output": "237" } - ], - "max_euint256_euint16": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457580891899920920375", "31998"], - "output": "115792089237316195423570985008687907853269984665640564039457580891899920920375" - }, - { "inputs": ["31994", "31998"], "output": "31998" }, - { "inputs": ["31998", "31998"], "output": "31998" }, - { "inputs": ["31998", "31994"], "output": "31998" } - ], - "max_euint256_euint32": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457581701635304814489", "4274177144"], - "output": "115792089237316195423570985008687907853269984665640564039457581701635304814489" - }, - { "inputs": ["4274177140", "4274177144"], "output": "4274177144" }, - { "inputs": ["4274177144", "4274177144"], "output": "4274177144" }, - { "inputs": ["4274177144", "4274177140"], "output": "4274177144" } - ], - "max_euint256_euint64": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457583257576614099953", - "18438250957457099341" - ], - "output": "115792089237316195423570985008687907853269984665640564039457583257576614099953" - }, - { - "inputs": ["18438250957457099337", "18438250957457099341"], - "output": "18438250957457099341" - }, - { - "inputs": ["18438250957457099341", "18438250957457099341"], - "output": "18438250957457099341" - }, - { - "inputs": ["18438250957457099341", "18438250957457099337"], - "output": "18438250957457099341" - } - ], - "max_euint256_euint128": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457580295384680552043", - "340282366920938463463368511201134180813" - ], - "output": "115792089237316195423570985008687907853269984665640564039457580295384680552043" - }, - { - "inputs": ["340282366920938463463368511201134180809", "340282366920938463463368511201134180813"], - "output": "340282366920938463463368511201134180813" - }, - { - "inputs": ["340282366920938463463368511201134180813", "340282366920938463463368511201134180813"], - "output": "340282366920938463463368511201134180813" - }, - { - "inputs": ["340282366920938463463368511201134180813", "340282366920938463463368511201134180809"], - "output": "340282366920938463463368511201134180813" - } - ], - "max_euint256_euint256": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577915867722108039", - "115792089237316195423570985008687907853269984665640564039457577809030115355409" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577915867722108039" - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577809030115355405", - "115792089237316195423570985008687907853269984665640564039457577809030115355409" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577809030115355409" - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577809030115355409", - "115792089237316195423570985008687907853269984665640564039457577809030115355409" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577809030115355409" - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577809030115355409", - "115792089237316195423570985008687907853269984665640564039457577809030115355405" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577809030115355409" - } - ], - "max_euint256_uint256": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577915867722108039", - "115792089237316195423570985008687907853269984665640564039457582764130067775401" - ], - "output": "115792089237316195423570985008687907853269984665640564039457582764130067775401" - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577809030115355405", - "115792089237316195423570985008687907853269984665640564039457577809030115355409" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577809030115355409" - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577809030115355409", - "115792089237316195423570985008687907853269984665640564039457577809030115355409" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577809030115355409" - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577809030115355409", - "115792089237316195423570985008687907853269984665640564039457577809030115355405" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577809030115355409" - } - ], - "max_uint256_euint256": [ - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457582906409122638869", - "115792089237316195423570985008687907853269984665640564039457582764130067775401" - ], - "output": "115792089237316195423570985008687907853269984665640564039457582906409122638869" - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577809030115355405", - "115792089237316195423570985008687907853269984665640564039457577809030115355409" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577809030115355409" - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577809030115355409", - "115792089237316195423570985008687907853269984665640564039457577809030115355409" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577809030115355409" - }, - { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577809030115355409", - "115792089237316195423570985008687907853269984665640564039457577809030115355405" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577809030115355409" - } - ], - "min_euint4_euint4": [ - { "inputs": ["14", "13"], "output": "13" }, - { "inputs": ["9", "13"], "output": "9" }, - { "inputs": ["13", "13"], "output": "13" }, - { "inputs": ["13", "9"], "output": "9" } + "shl_euint32_euint8": [ + { "inputs": ["536647875", "6"], "output": "4280692928" }, + { "inputs": ["2", "6"], "output": "128" }, + { "inputs": ["6", "6"], "output": "384" }, + { "inputs": ["6", "2"], "output": "24" } ], - "min_euint4_euint8": [ - { "inputs": ["5", "254"], "output": "5" }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "4" } + "shl_euint32_uint8": [ + { "inputs": ["536647875", "6"], "output": "4280692928" }, + { "inputs": ["2", "6"], "output": "128" }, + { "inputs": ["6", "6"], "output": "384" }, + { "inputs": ["6", "2"], "output": "24" } ], - "min_euint4_uint8": [ - { "inputs": ["5", "5"], "output": "5" }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "4" } + "shl_euint64_euint8": [ + { "inputs": ["18440834351691220481", "5"], "output": "18257632969122955296" }, + { "inputs": ["1", "5"], "output": "32" }, + { "inputs": ["5", "5"], "output": "160" }, + { "inputs": ["5", "1"], "output": "10" } ], - "min_euint4_euint16": [ - { "inputs": ["1", "50108"], "output": "1" }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "4" } + "shl_euint64_uint8": [ + { "inputs": ["18440834351691220481", "5"], "output": "18257632969122955296" }, + { "inputs": ["1", "5"], "output": "32" }, + { "inputs": ["5", "5"], "output": "160" }, + { "inputs": ["5", "1"], "output": "10" } ], - "min_euint4_euint32": [ - { "inputs": ["9", "2831156674"], "output": "9" }, - { "inputs": ["5", "9"], "output": "5" }, - { "inputs": ["9", "9"], "output": "9" }, - { "inputs": ["9", "5"], "output": "5" } + "shl_euint128_euint8": [ + { "inputs": ["340282366920938463463373575129710291167", "6"], "output": "340282366920938463463308540100061312960" }, + { "inputs": ["2", "6"], "output": "128" }, + { "inputs": ["6", "6"], "output": "384" }, + { "inputs": ["6", "2"], "output": "24" } ], - "min_euint4_euint64": [ - { "inputs": ["12", "18440035039683442233"], "output": "12" }, - { "inputs": ["8", "12"], "output": "8" }, - { "inputs": ["12", "12"], "output": "12" }, - { "inputs": ["12", "8"], "output": "8" } + "shl_euint128_uint8": [ + { "inputs": ["340282366920938463463373575129710291167", "6"], "output": "340282366920938463463308540100061312960" }, + { "inputs": ["2", "6"], "output": "128" }, + { "inputs": ["6", "6"], "output": "384" }, + { "inputs": ["6", "2"], "output": "24" } ], - "min_euint4_euint128": [ + "shl_euint256_euint8": [ { - "inputs": ["14", "340282366920938463463373484167219835469"], - "output": "14" + "inputs": ["115792089237316195423570985008687907853269984665640564039457576929290919789355", "6"], + "output": "115792089237316195423570985008687907853269984665640564039457130976091699202752" }, - { "inputs": ["10", "14"], "output": "10" }, - { "inputs": ["14", "14"], "output": "14" }, - { "inputs": ["14", "10"], "output": "10" } + { "inputs": ["2", "6"], "output": "128" }, + { "inputs": ["6", "6"], "output": "384" }, + { "inputs": ["6", "2"], "output": "24" } ], - "min_euint4_euint256": [ + "shl_euint256_uint8": [ { - "inputs": ["1", "115792089237316195423570985008687907853269984665640564039457580584483222103041"], - "output": "1" + "inputs": ["115792089237316195423570985008687907853269984665640564039457576929290919789355", "6"], + "output": "115792089237316195423570985008687907853269984665640564039457130976091699202752" }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "4" } + { "inputs": ["2", "6"], "output": "128" }, + { "inputs": ["6", "6"], "output": "384" }, + { "inputs": ["6", "2"], "output": "24" } ], - "min_euint8_euint4": [ - { "inputs": ["51", "11"], "output": "11" }, - { "inputs": ["7", "11"], "output": "7" }, - { "inputs": ["11", "11"], "output": "11" }, - { "inputs": ["11", "7"], "output": "7" } + "shr_euint8_euint8": [ + { "inputs": ["244", "6"], "output": "3" }, + { "inputs": ["2", "6"], "output": "0" }, + { "inputs": ["6", "6"], "output": "0" }, + { "inputs": ["6", "2"], "output": "1" } ], - "min_uint8_euint4": [ - { "inputs": ["5", "11"], "output": "5" }, - { "inputs": ["7", "11"], "output": "7" }, - { "inputs": ["11", "11"], "output": "11" }, - { "inputs": ["11", "7"], "output": "7" } + "shr_euint8_uint8": [ + { "inputs": ["244", "6"], "output": "3" }, + { "inputs": ["2", "6"], "output": "0" }, + { "inputs": ["6", "6"], "output": "0" }, + { "inputs": ["6", "2"], "output": "1" } ], - "min_euint8_euint8": [ - { "inputs": ["183", "84"], "output": "84" }, - { "inputs": ["80", "84"], "output": "80" }, - { "inputs": ["84", "84"], "output": "84" }, - { "inputs": ["84", "80"], "output": "80" } + "shr_euint16_euint8": [ + { "inputs": ["27664", "10"], "output": "27" }, + { "inputs": ["6", "10"], "output": "0" }, + { "inputs": ["10", "10"], "output": "0" }, + { "inputs": ["10", "6"], "output": "0" } ], - "min_euint8_uint8": [ - { "inputs": ["183", "152"], "output": "152" }, - { "inputs": ["80", "84"], "output": "80" }, - { "inputs": ["84", "84"], "output": "84" }, - { "inputs": ["84", "80"], "output": "80" } + "shr_euint16_uint8": [ + { "inputs": ["27664", "10"], "output": "27" }, + { "inputs": ["6", "10"], "output": "0" }, + { "inputs": ["10", "10"], "output": "0" }, + { "inputs": ["10", "6"], "output": "0" } ], - "min_uint8_euint8": [ - { "inputs": ["22", "152"], "output": "22" }, - { "inputs": ["80", "84"], "output": "80" }, - { "inputs": ["84", "84"], "output": "84" }, - { "inputs": ["84", "80"], "output": "80" } + "shr_euint32_euint8": [ + { "inputs": ["272280898", "5"], "output": "8508778" }, + { "inputs": ["1", "5"], "output": "0" }, + { "inputs": ["5", "5"], "output": "0" }, + { "inputs": ["5", "1"], "output": "2" } ], - "min_euint8_euint16": [ - { "inputs": ["83", "49187"], "output": "83" }, - { "inputs": ["79", "83"], "output": "79" }, - { "inputs": ["83", "83"], "output": "83" }, - { "inputs": ["83", "79"], "output": "79" } + "shr_euint32_uint8": [ + { "inputs": ["272280898", "5"], "output": "8508778" }, + { "inputs": ["1", "5"], "output": "0" }, + { "inputs": ["5", "5"], "output": "0" }, + { "inputs": ["5", "1"], "output": "2" } ], - "min_euint8_euint32": [ - { "inputs": ["248", "4182541699"], "output": "248" }, - { "inputs": ["244", "248"], "output": "244" }, - { "inputs": ["248", "248"], "output": "248" }, - { "inputs": ["248", "244"], "output": "244" } + "shr_euint64_euint8": [ + { "inputs": ["18445060784337686237", "5"], "output": "576408149510552694" }, + { "inputs": ["1", "5"], "output": "0" }, + { "inputs": ["5", "5"], "output": "0" }, + { "inputs": ["5", "1"], "output": "2" } ], - "min_euint8_euint64": [ - { "inputs": ["6", "18443833870782244811"], "output": "6" }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "4" } + "shr_euint64_uint8": [ + { "inputs": ["18445060784337686237", "5"], "output": "576408149510552694" }, + { "inputs": ["1", "5"], "output": "0" }, + { "inputs": ["5", "5"], "output": "0" }, + { "inputs": ["5", "1"], "output": "2" } ], - "min_euint8_euint128": [ + "shr_euint128_euint8": [ + { "inputs": ["340282366920938463463373356694427307467", "10"], "output": "332306998946228968225950543646901667" }, + { "inputs": ["6", "10"], "output": "0" }, + { "inputs": ["10", "10"], "output": "0" }, + { "inputs": ["10", "6"], "output": "0" } + ], + "shr_euint128_uint8": [ + { "inputs": ["340282366920938463463373356694427307467", "10"], "output": "332306998946228968225950543646901667" }, + { "inputs": ["6", "10"], "output": "0" }, + { "inputs": ["10", "10"], "output": "0" }, + { "inputs": ["10", "6"], "output": "0" } + ], + "shr_euint256_euint8": [ { - "inputs": ["143", "340282366920938463463368314352737250889"], - "output": "143" + "inputs": ["115792089237316195423570985008687907853269984665640564039457579011871979623501", "8"], + "output": "452312848583266388373324160190187140051835877600158453279131168015124920404" }, - { "inputs": ["139", "143"], "output": "139" }, - { "inputs": ["143", "143"], "output": "143" }, - { "inputs": ["143", "139"], "output": "139" } + { "inputs": ["4", "8"], "output": "0" }, + { "inputs": ["8", "8"], "output": "0" }, + { "inputs": ["8", "4"], "output": "0" } ], - "min_euint8_euint256": [ + "shr_euint256_uint8": [ { - "inputs": ["227", "115792089237316195423570985008687907853269984665640564039457575642377411188527"], - "output": "227" + "inputs": ["115792089237316195423570985008687907853269984665640564039457579011871979623501", "8"], + "output": "452312848583266388373324160190187140051835877600158453279131168015124920404" }, - { "inputs": ["223", "227"], "output": "223" }, - { "inputs": ["227", "227"], "output": "227" }, - { "inputs": ["227", "223"], "output": "223" } + { "inputs": ["4", "8"], "output": "0" }, + { "inputs": ["8", "8"], "output": "0" }, + { "inputs": ["8", "4"], "output": "0" } ], - "min_euint16_euint4": [ - { "inputs": ["35993", "14"], "output": "14" }, - { "inputs": ["10", "14"], "output": "10" }, - { "inputs": ["14", "14"], "output": "14" }, - { "inputs": ["14", "10"], "output": "10" } + "rotl_euint8_euint8": [ + { "inputs": ["116", "6"], "output": "29" }, + { "inputs": ["2", "6"], "output": "128" }, + { "inputs": ["6", "6"], "output": "129" }, + { "inputs": ["6", "2"], "output": "24" } ], - "min_euint16_euint8": [ - { "inputs": ["16954", "238"], "output": "238" }, - { "inputs": ["234", "238"], "output": "234" }, - { "inputs": ["238", "238"], "output": "238" }, - { "inputs": ["238", "234"], "output": "234" } + "rotl_euint8_uint8": [ + { "inputs": ["116", "6"], "output": "29" }, + { "inputs": ["2", "6"], "output": "128" }, + { "inputs": ["6", "6"], "output": "129" }, + { "inputs": ["6", "2"], "output": "24" } ], - "min_euint16_euint16": [ - { "inputs": ["32718", "8269"], "output": "8269" }, - { "inputs": ["8265", "8269"], "output": "8265" }, - { "inputs": ["8269", "8269"], "output": "8269" }, - { "inputs": ["8269", "8265"], "output": "8265" } + "rotl_euint16_euint8": [ + { "inputs": ["44236", "8"], "output": "52396" }, + { "inputs": ["4", "8"], "output": "1024" }, + { "inputs": ["8", "8"], "output": "2048" }, + { "inputs": ["8", "4"], "output": "128" } ], - "min_euint16_uint16": [ - { "inputs": ["32718", "54097"], "output": "32718" }, - { "inputs": ["8265", "8269"], "output": "8265" }, - { "inputs": ["8269", "8269"], "output": "8269" }, - { "inputs": ["8269", "8265"], "output": "8265" } + "rotl_euint16_uint8": [ + { "inputs": ["44236", "8"], "output": "52396" }, + { "inputs": ["4", "8"], "output": "1024" }, + { "inputs": ["8", "8"], "output": "2048" }, + { "inputs": ["8", "4"], "output": "128" } ], - "min_uint16_euint16": [ - { "inputs": ["24240", "54097"], "output": "24240" }, - { "inputs": ["8265", "8269"], "output": "8265" }, - { "inputs": ["8269", "8269"], "output": "8269" }, - { "inputs": ["8269", "8265"], "output": "8265" } + "rotl_euint32_euint8": [ + { "inputs": ["587399454", "11"], "output": "403239192" }, + { "inputs": ["7", "11"], "output": "14336" }, + { "inputs": ["11", "11"], "output": "22528" }, + { "inputs": ["11", "7"], "output": "1408" } ], - "min_euint16_euint32": [ - { "inputs": ["8199", "2465008600"], "output": "8199" }, - { "inputs": ["8195", "8199"], "output": "8195" }, - { "inputs": ["8199", "8199"], "output": "8199" }, - { "inputs": ["8199", "8195"], "output": "8195" } + "rotl_euint32_uint8": [ + { "inputs": ["587399454", "11"], "output": "403239192" }, + { "inputs": ["7", "11"], "output": "14336" }, + { "inputs": ["11", "11"], "output": "22528" }, + { "inputs": ["11", "7"], "output": "1408" } ], - "min_euint16_euint64": [ - { "inputs": ["64768", "18439640713575288835"], "output": "64768" }, - { "inputs": ["64764", "64768"], "output": "64764" }, - { "inputs": ["64768", "64768"], "output": "64768" }, - { "inputs": ["64768", "64764"], "output": "64764" } + "rotl_euint64_euint8": [ + { "inputs": ["18439126259574689571", "5"], "output": "18202974021393966207" }, + { "inputs": ["1", "5"], "output": "32" }, + { "inputs": ["5", "5"], "output": "160" }, + { "inputs": ["5", "1"], "output": "10" } ], - "min_euint16_euint128": [ + "rotl_euint64_uint8": [ + { "inputs": ["18439126259574689571", "5"], "output": "18202974021393966207" }, + { "inputs": ["1", "5"], "output": "32" }, + { "inputs": ["5", "5"], "output": "160" }, + { "inputs": ["5", "1"], "output": "10" } + ], + "rotl_euint128_euint8": [ + { "inputs": ["340282366920938463463365849001189339843", "7"], "output": "340282366920938463462253528317672645119" }, + { "inputs": ["3", "7"], "output": "384" }, + { "inputs": ["7", "7"], "output": "896" }, + { "inputs": ["7", "3"], "output": "56" } + ], + "rotl_euint128_uint8": [ + { "inputs": ["340282366920938463463365849001189339843", "7"], "output": "340282366920938463462253528317672645119" }, + { "inputs": ["3", "7"], "output": "384" }, + { "inputs": ["7", "7"], "output": "896" }, + { "inputs": ["7", "3"], "output": "56" } + ], + "rotl_euint256_euint8": [ { - "inputs": ["47213", "340282366920938463463367215507048923025"], - "output": "47213" + "inputs": ["115792089237316195423570985008687907853269984665640564039457579789296280023579", "11"], + "output": "115792089237316195423570985008687907853269984665640564039448944280605115342847" }, - { "inputs": ["47209", "47213"], "output": "47209" }, - { "inputs": ["47213", "47213"], "output": "47213" }, - { "inputs": ["47213", "47209"], "output": "47209" } + { "inputs": ["7", "11"], "output": "14336" }, + { "inputs": ["11", "11"], "output": "22528" }, + { "inputs": ["11", "7"], "output": "1408" } ], - "min_euint16_euint256": [ + "rotl_euint256_uint8": [ { - "inputs": ["56701", "115792089237316195423570985008687907853269984665640564039457576701213568693639"], - "output": "56701" + "inputs": ["115792089237316195423570985008687907853269984665640564039457579789296280023579", "11"], + "output": "115792089237316195423570985008687907853269984665640564039448944280605115342847" }, - { "inputs": ["56697", "56701"], "output": "56697" }, - { "inputs": ["56701", "56701"], "output": "56701" }, - { "inputs": ["56701", "56697"], "output": "56697" } + { "inputs": ["7", "11"], "output": "14336" }, + { "inputs": ["11", "11"], "output": "22528" }, + { "inputs": ["11", "7"], "output": "1408" } ], - "min_euint32_euint4": [ - { "inputs": ["52471261", "11"], "output": "11" }, - { "inputs": ["7", "11"], "output": "7" }, - { "inputs": ["11", "11"], "output": "11" }, - { "inputs": ["11", "7"], "output": "7" } + "rotr_euint8_euint8": [ + { "inputs": ["19", "7"], "output": "38" }, + { "inputs": ["3", "7"], "output": "6" }, + { "inputs": ["7", "7"], "output": "14" }, + { "inputs": ["7", "3"], "output": "224" } ], - "min_euint32_euint8": [ - { "inputs": ["2070023085", "28"], "output": "28" }, - { "inputs": ["24", "28"], "output": "24" }, - { "inputs": ["28", "28"], "output": "28" }, - { "inputs": ["28", "24"], "output": "24" } + "rotr_euint8_uint8": [ + { "inputs": ["19", "7"], "output": "38" }, + { "inputs": ["3", "7"], "output": "6" }, + { "inputs": ["7", "7"], "output": "14" }, + { "inputs": ["7", "3"], "output": "224" } ], - "min_euint32_euint16": [ - { "inputs": ["3265803083", "25661"], "output": "25661" }, - { "inputs": ["25657", "25661"], "output": "25657" }, - { "inputs": ["25661", "25661"], "output": "25661" }, - { "inputs": ["25661", "25657"], "output": "25657" } + "rotr_euint16_euint8": [ + { "inputs": ["12746", "8"], "output": "51761" }, + { "inputs": ["4", "8"], "output": "1024" }, + { "inputs": ["8", "8"], "output": "2048" }, + { "inputs": ["8", "4"], "output": "32768" } ], - "min_euint32_euint32": [ - { "inputs": ["3167993396", "3198148813"], "output": "3167993396" }, - { "inputs": ["3167993392", "3167993396"], "output": "3167993392" }, - { "inputs": ["3167993396", "3167993396"], "output": "3167993396" }, - { "inputs": ["3167993396", "3167993392"], "output": "3167993392" } + "rotr_euint16_uint8": [ + { "inputs": ["12746", "8"], "output": "51761" }, + { "inputs": ["4", "8"], "output": "1024" }, + { "inputs": ["8", "8"], "output": "2048" }, + { "inputs": ["8", "4"], "output": "32768" } ], - "min_euint32_uint32": [ - { "inputs": ["3167993396", "1826176221"], "output": "1826176221" }, - { "inputs": ["3167993392", "3167993396"], "output": "3167993392" }, - { "inputs": ["3167993396", "3167993396"], "output": "3167993396" }, - { "inputs": ["3167993396", "3167993392"], "output": "3167993392" } + "rotr_euint32_euint8": [ + { "inputs": ["2022494991", "5"], "output": "2076468888" }, + { "inputs": ["1", "5"], "output": "134217728" }, + { "inputs": ["5", "5"], "output": "671088640" }, + { "inputs": ["5", "1"], "output": "2147483650" } ], - "min_uint32_euint32": [ - { "inputs": ["591129059", "1826176221"], "output": "591129059" }, - { "inputs": ["3167993392", "3167993396"], "output": "3167993392" }, - { "inputs": ["3167993396", "3167993396"], "output": "3167993396" }, - { "inputs": ["3167993396", "3167993392"], "output": "3167993392" } + "rotr_euint32_uint8": [ + { "inputs": ["2022494991", "5"], "output": "2076468888" }, + { "inputs": ["1", "5"], "output": "134217728" }, + { "inputs": ["5", "5"], "output": "671088640" }, + { "inputs": ["5", "1"], "output": "2147483650" } ], - "min_euint32_euint64": [ + "rotr_euint64_euint8": [ + { "inputs": ["18445728965433613275", "9"], "output": "17149705398393497325" }, + { "inputs": ["5", "9"], "output": "180143985094819840" }, + { "inputs": ["9", "9"], "output": "324259173170675712" }, + { "inputs": ["9", "5"], "output": "5188146770730811392" } + ], + "rotr_euint64_uint8": [ + { "inputs": ["18445728965433613275", "9"], "output": "17149705398393497325" }, + { "inputs": ["5", "9"], "output": "180143985094819840" }, + { "inputs": ["9", "9"], "output": "324259173170675712" }, + { "inputs": ["9", "5"], "output": "5188146770730811392" } + ], + "rotr_euint128_euint8": [ { - "inputs": ["1841925700", "18442933982305840083"], - "output": "1841925700" + "inputs": ["340282366920938463463366513634762362699", "11"], + "output": "310374737015777856323038944623411139233" }, - { "inputs": ["1841925696", "1841925700"], "output": "1841925696" }, - { "inputs": ["1841925700", "1841925700"], "output": "1841925700" }, - { "inputs": ["1841925700", "1841925696"], "output": "1841925696" } + { "inputs": ["7", "11"], "output": "1163074496311801388790831177745301504" }, + { "inputs": ["11", "11"], "output": "1827688494204259325242734707885473792" }, + { "inputs": ["11", "7"], "output": "29243015907268149203883755326167580672" } ], - "min_euint32_euint128": [ + "rotr_euint128_uint8": [ { - "inputs": ["4003399201", "340282366920938463463365902462339741051"], - "output": "4003399201" + "inputs": ["340282366920938463463366513634762362699", "11"], + "output": "310374737015777856323038944623411139233" }, - { "inputs": ["4003399197", "4003399201"], "output": "4003399197" }, - { "inputs": ["4003399201", "4003399201"], "output": "4003399201" }, - { "inputs": ["4003399201", "4003399197"], "output": "4003399197" } + { "inputs": ["7", "11"], "output": "1163074496311801388790831177745301504" }, + { "inputs": ["11", "11"], "output": "1827688494204259325242734707885473792" }, + { "inputs": ["11", "7"], "output": "29243015907268149203883755326167580672" } ], - "min_euint32_euint256": [ + "rotr_euint256_euint8": [ { - "inputs": ["3608929890", "115792089237316195423570985008687907853269984665640564039457579751481725336191"], - "output": "3608929890" + "inputs": ["115792089237316195423570985008687907853269984665640564039457578799181290915297", "8"], + "output": "102222703779818203772371260202982293651714908337635810441083648361639201015237" }, - { "inputs": ["3608929886", "3608929890"], "output": "3608929886" }, - { "inputs": ["3608929890", "3608929890"], "output": "3608929890" }, - { "inputs": ["3608929890", "3608929886"], "output": "3608929886" } + { "inputs": ["4", "8"], "output": "1809251394333065553493296640760748560207343510400633813116524750123642650624" }, + { "inputs": ["8", "8"], "output": "3618502788666131106986593281521497120414687020801267626233049500247285301248" }, + { "inputs": ["8", "4"], "output": "57896044618658097711785492504343953926634992332820282019728792003956564819968" } ], - "min_euint64_euint4": [ - { "inputs": ["18440660497360576819", "14"], "output": "14" }, - { "inputs": ["10", "14"], "output": "10" }, - { "inputs": ["14", "14"], "output": "14" }, - { "inputs": ["14", "10"], "output": "10" } + "rotr_euint256_uint8": [ + { + "inputs": ["115792089237316195423570985008687907853269984665640564039457578799181290915297", "8"], + "output": "102222703779818203772371260202982293651714908337635810441083648361639201015237" + }, + { "inputs": ["4", "8"], "output": "1809251394333065553493296640760748560207343510400633813116524750123642650624" }, + { "inputs": ["8", "8"], "output": "3618502788666131106986593281521497120414687020801267626233049500247285301248" }, + { "inputs": ["8", "4"], "output": "57896044618658097711785492504343953926634992332820282019728792003956564819968" } ], - "min_euint64_euint8": [ - { "inputs": ["18442702391560231447", "64"], "output": "64" }, - { "inputs": ["60", "64"], "output": "60" }, - { "inputs": ["64", "64"], "output": "64" }, - { "inputs": ["64", "60"], "output": "60" } + "max_euint8_euint8": [ + { "inputs": ["166", "20"], "output": "166" }, + { "inputs": ["16", "20"], "output": "20" }, + { "inputs": ["20", "20"], "output": "20" }, + { "inputs": ["20", "16"], "output": "20" } ], - "min_euint64_euint16": [ - { "inputs": ["18440389921895932333", "42816"], "output": "42816" }, - { "inputs": ["42812", "42816"], "output": "42812" }, - { "inputs": ["42816", "42816"], "output": "42816" }, - { "inputs": ["42816", "42812"], "output": "42812" } + "max_euint8_uint8": [ + { "inputs": ["166", "212"], "output": "212" }, + { "inputs": ["16", "20"], "output": "20" }, + { "inputs": ["20", "20"], "output": "20" }, + { "inputs": ["20", "16"], "output": "20" } ], - "min_euint64_euint32": [ - { - "inputs": ["18439611592084278651", "1078993829"], - "output": "1078993829" - }, - { "inputs": ["1078993825", "1078993829"], "output": "1078993825" }, - { "inputs": ["1078993829", "1078993829"], "output": "1078993829" }, - { "inputs": ["1078993829", "1078993825"], "output": "1078993825" } + "max_uint8_euint8": [ + { "inputs": ["168", "212"], "output": "212" }, + { "inputs": ["16", "20"], "output": "20" }, + { "inputs": ["20", "20"], "output": "20" }, + { "inputs": ["20", "16"], "output": "20" } ], - "min_euint64_euint64": [ - { - "inputs": ["18438422972288340001", "18441615262395055283"], - "output": "18438422972288340001" - }, - { - "inputs": ["18438422972288339997", "18438422972288340001"], - "output": "18438422972288339997" - }, - { - "inputs": ["18438422972288340001", "18438422972288340001"], - "output": "18438422972288340001" - }, - { - "inputs": ["18438422972288340001", "18438422972288339997"], - "output": "18438422972288339997" - } + "max_euint8_euint16": [ + { "inputs": ["217", "23312"], "output": "23312" }, + { "inputs": ["213", "217"], "output": "217" }, + { "inputs": ["217", "217"], "output": "217" }, + { "inputs": ["217", "213"], "output": "217" } ], - "min_euint64_uint64": [ - { - "inputs": ["18438422972288340001", "18439986643027034037"], - "output": "18438422972288340001" - }, - { - "inputs": ["18438422972288339997", "18438422972288340001"], - "output": "18438422972288339997" - }, - { - "inputs": ["18438422972288340001", "18438422972288340001"], - "output": "18438422972288340001" - }, - { - "inputs": ["18438422972288340001", "18438422972288339997"], - "output": "18438422972288339997" - } + "max_euint8_euint32": [ + { "inputs": ["203", "502854939"], "output": "502854939" }, + { "inputs": ["199", "203"], "output": "203" }, + { "inputs": ["203", "203"], "output": "203" }, + { "inputs": ["203", "199"], "output": "203" } ], - "min_uint64_euint64": [ - { - "inputs": ["18443338893508802671", "18439986643027034037"], - "output": "18439986643027034037" - }, - { - "inputs": ["18438422972288339997", "18438422972288340001"], - "output": "18438422972288339997" - }, - { - "inputs": ["18438422972288340001", "18438422972288340001"], - "output": "18438422972288340001" - }, - { - "inputs": ["18438422972288340001", "18438422972288339997"], - "output": "18438422972288339997" - } + "max_euint8_euint64": [ + { "inputs": ["63", "18438848244742951375"], "output": "18438848244742951375" }, + { "inputs": ["59", "63"], "output": "63" }, + { "inputs": ["63", "63"], "output": "63" }, + { "inputs": ["63", "59"], "output": "63" } ], - "min_euint64_euint128": [ - { - "inputs": ["18444900314492723695", "340282366920938463463367540489775579127"], - "output": "18444900314492723695" - }, - { - "inputs": ["18444900314492723691", "18444900314492723695"], - "output": "18444900314492723691" - }, + "max_euint8_euint128": [ { - "inputs": ["18444900314492723695", "18444900314492723695"], - "output": "18444900314492723695" + "inputs": ["215", "340282366920938463463373550930118782323"], + "output": "340282366920938463463373550930118782323" }, - { - "inputs": ["18444900314492723695", "18444900314492723691"], - "output": "18444900314492723691" - } + { "inputs": ["211", "215"], "output": "215" }, + { "inputs": ["215", "215"], "output": "215" }, + { "inputs": ["215", "211"], "output": "215" } ], - "min_euint64_euint256": [ - { - "inputs": [ - "18446426094775234589", - "115792089237316195423570985008687907853269984665640564039457578688132986416989" - ], - "output": "18446426094775234589" - }, - { - "inputs": ["18446426094775234585", "18446426094775234589"], - "output": "18446426094775234585" - }, - { - "inputs": ["18446426094775234589", "18446426094775234589"], - "output": "18446426094775234589" - }, - { - "inputs": ["18446426094775234589", "18446426094775234585"], - "output": "18446426094775234585" - } + "max_euint16_euint8": [ + { "inputs": ["28612", "151"], "output": "28612" }, + { "inputs": ["147", "151"], "output": "151" }, + { "inputs": ["151", "151"], "output": "151" }, + { "inputs": ["151", "147"], "output": "151" } ], - "min_euint128_euint4": [ - { - "inputs": ["340282366920938463463373617043976262819", "6"], - "output": "6" - }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "4" } + "max_euint16_euint16": [ + { "inputs": ["17068", "18009"], "output": "18009" }, + { "inputs": ["17064", "17068"], "output": "17068" }, + { "inputs": ["17068", "17068"], "output": "17068" }, + { "inputs": ["17068", "17064"], "output": "17068" } ], - "min_euint128_euint8": [ - { - "inputs": ["340282366920938463463366071622027178861", "33"], - "output": "33" - }, - { "inputs": ["29", "33"], "output": "29" }, - { "inputs": ["33", "33"], "output": "33" }, - { "inputs": ["33", "29"], "output": "29" } + "max_euint16_uint16": [ + { "inputs": ["17068", "8539"], "output": "17068" }, + { "inputs": ["17064", "17068"], "output": "17068" }, + { "inputs": ["17068", "17068"], "output": "17068" }, + { "inputs": ["17068", "17064"], "output": "17068" } ], - "min_euint128_euint16": [ - { - "inputs": ["340282366920938463463368542801038101753", "9714"], - "output": "9714" - }, - { "inputs": ["9710", "9714"], "output": "9710" }, - { "inputs": ["9714", "9714"], "output": "9714" }, - { "inputs": ["9714", "9710"], "output": "9710" } + "max_uint16_euint16": [ + { "inputs": ["30271", "8539"], "output": "30271" }, + { "inputs": ["17064", "17068"], "output": "17068" }, + { "inputs": ["17068", "17068"], "output": "17068" }, + { "inputs": ["17068", "17064"], "output": "17068" } ], - "min_euint128_euint32": [ - { - "inputs": ["340282366920938463463373948652081205153", "4076998775"], - "output": "4076998775" - }, - { "inputs": ["4076998771", "4076998775"], "output": "4076998771" }, - { "inputs": ["4076998775", "4076998775"], "output": "4076998775" }, - { "inputs": ["4076998775", "4076998771"], "output": "4076998771" } + "max_euint16_euint32": [ + { "inputs": ["52184", "2551254604"], "output": "2551254604" }, + { "inputs": ["52180", "52184"], "output": "52184" }, + { "inputs": ["52184", "52184"], "output": "52184" }, + { "inputs": ["52184", "52180"], "output": "52184" } ], - "min_euint128_euint64": [ - { - "inputs": ["340282366920938463463372700048433567093", "18437970528445398453"], - "output": "18437970528445398453" - }, - { - "inputs": ["18437970528445398449", "18437970528445398453"], - "output": "18437970528445398449" - }, - { - "inputs": ["18437970528445398453", "18437970528445398453"], - "output": "18437970528445398453" - }, - { - "inputs": ["18437970528445398453", "18437970528445398449"], - "output": "18437970528445398449" - } + "max_euint16_euint64": [ + { "inputs": ["45650", "18443380955982510061"], "output": "18443380955982510061" }, + { "inputs": ["45646", "45650"], "output": "45650" }, + { "inputs": ["45650", "45650"], "output": "45650" }, + { "inputs": ["45650", "45646"], "output": "45650" } ], - "min_euint128_euint128": [ - { - "inputs": ["340282366920938463463369507025632955721", "340282366920938463463371759125181075731"], - "output": "340282366920938463463369507025632955721" - }, - { - "inputs": ["340282366920938463463369507025632955717", "340282366920938463463369507025632955721"], - "output": "340282366920938463463369507025632955717" - }, + "max_euint16_euint128": [ { - "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369507025632955721"], - "output": "340282366920938463463369507025632955721" + "inputs": ["32245", "340282366920938463463369907157098786517"], + "output": "340282366920938463463369907157098786517" }, - { - "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369507025632955717"], - "output": "340282366920938463463369507025632955717" - } + { "inputs": ["32241", "32245"], "output": "32245" }, + { "inputs": ["32245", "32245"], "output": "32245" }, + { "inputs": ["32245", "32241"], "output": "32245" } ], - "min_euint128_uint128": [ - { - "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369479362880511843"], - "output": "340282366920938463463369479362880511843" - }, - { - "inputs": ["340282366920938463463369507025632955717", "340282366920938463463369507025632955721"], - "output": "340282366920938463463369507025632955717" - }, - { - "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369507025632955721"], - "output": "340282366920938463463369507025632955721" - }, - { - "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369507025632955717"], - "output": "340282366920938463463369507025632955717" - } + "max_euint32_euint8": [ + { "inputs": ["1832123093", "57"], "output": "1832123093" }, + { "inputs": ["53", "57"], "output": "57" }, + { "inputs": ["57", "57"], "output": "57" }, + { "inputs": ["57", "53"], "output": "57" } ], - "min_uint128_euint128": [ - { - "inputs": ["340282366920938463463367460119738968177", "340282366920938463463369479362880511843"], - "output": "340282366920938463463367460119738968177" - }, - { - "inputs": ["340282366920938463463369507025632955717", "340282366920938463463369507025632955721"], - "output": "340282366920938463463369507025632955717" - }, - { - "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369507025632955721"], - "output": "340282366920938463463369507025632955721" - }, - { - "inputs": ["340282366920938463463369507025632955721", "340282366920938463463369507025632955717"], - "output": "340282366920938463463369507025632955717" - } + "max_euint32_euint16": [ + { "inputs": ["1971096130", "30955"], "output": "1971096130" }, + { "inputs": ["30951", "30955"], "output": "30955" }, + { "inputs": ["30955", "30955"], "output": "30955" }, + { "inputs": ["30955", "30951"], "output": "30955" } ], - "min_euint128_euint256": [ - { - "inputs": [ - "340282366920938463463370734691749234713", - "115792089237316195423570985008687907853269984665640564039457579316332311519059" - ], - "output": "340282366920938463463370734691749234713" - }, + "max_euint32_euint32": [ + { "inputs": ["1111285408", "1468018395"], "output": "1468018395" }, + { "inputs": ["1111285404", "1111285408"], "output": "1111285408" }, + { "inputs": ["1111285408", "1111285408"], "output": "1111285408" }, + { "inputs": ["1111285408", "1111285404"], "output": "1111285408" } + ], + "max_euint32_uint32": [ + { "inputs": ["1111285408", "157510714"], "output": "1111285408" }, + { "inputs": ["1111285404", "1111285408"], "output": "1111285408" }, + { "inputs": ["1111285408", "1111285408"], "output": "1111285408" }, + { "inputs": ["1111285408", "1111285404"], "output": "1111285408" } + ], + "max_uint32_euint32": [ + { "inputs": ["1534833675", "157510714"], "output": "1534833675" }, + { "inputs": ["1111285404", "1111285408"], "output": "1111285408" }, + { "inputs": ["1111285408", "1111285408"], "output": "1111285408" }, + { "inputs": ["1111285408", "1111285404"], "output": "1111285408" } + ], + "max_euint32_euint64": [ + { "inputs": ["4121627983", "18440188940990837761"], "output": "18440188940990837761" }, + { "inputs": ["4121627979", "4121627983"], "output": "4121627983" }, + { "inputs": ["4121627983", "4121627983"], "output": "4121627983" }, + { "inputs": ["4121627983", "4121627979"], "output": "4121627983" } + ], + "max_euint32_euint128": [ { - "inputs": ["340282366920938463463370734691749234709", "340282366920938463463370734691749234713"], - "output": "340282366920938463463370734691749234709" + "inputs": ["1638043044", "340282366920938463463373345166616370285"], + "output": "340282366920938463463373345166616370285" }, + { "inputs": ["1638043040", "1638043044"], "output": "1638043044" }, + { "inputs": ["1638043044", "1638043044"], "output": "1638043044" }, + { "inputs": ["1638043044", "1638043040"], "output": "1638043044" } + ], + "max_euint64_euint8": [ + { "inputs": ["18446553796219413509", "69"], "output": "18446553796219413509" }, + { "inputs": ["65", "69"], "output": "69" }, + { "inputs": ["69", "69"], "output": "69" }, + { "inputs": ["69", "65"], "output": "69" } + ], + "max_euint64_euint16": [ + { "inputs": ["18443205129263445461", "38932"], "output": "18443205129263445461" }, + { "inputs": ["38928", "38932"], "output": "38932" }, + { "inputs": ["38932", "38932"], "output": "38932" }, + { "inputs": ["38932", "38928"], "output": "38932" } + ], + "max_euint64_euint32": [ + { "inputs": ["18440634337042381043", "968789992"], "output": "18440634337042381043" }, + { "inputs": ["968789988", "968789992"], "output": "968789992" }, + { "inputs": ["968789992", "968789992"], "output": "968789992" }, + { "inputs": ["968789992", "968789988"], "output": "968789992" } + ], + "max_euint64_euint64": [ + { "inputs": ["18443514427752092745", "18446437364100294561"], "output": "18446437364100294561" }, + { "inputs": ["18443514427752092741", "18443514427752092745"], "output": "18443514427752092745" }, + { "inputs": ["18443514427752092745", "18443514427752092745"], "output": "18443514427752092745" }, + { "inputs": ["18443514427752092745", "18443514427752092741"], "output": "18443514427752092745" } + ], + "max_euint64_uint64": [ + { "inputs": ["18443514427752092745", "18437760209363742615"], "output": "18443514427752092745" }, + { "inputs": ["18443514427752092741", "18443514427752092745"], "output": "18443514427752092745" }, + { "inputs": ["18443514427752092745", "18443514427752092745"], "output": "18443514427752092745" }, + { "inputs": ["18443514427752092745", "18443514427752092741"], "output": "18443514427752092745" } + ], + "max_uint64_euint64": [ + { "inputs": ["18438545823899258273", "18437760209363742615"], "output": "18438545823899258273" }, + { "inputs": ["18443514427752092741", "18443514427752092745"], "output": "18443514427752092745" }, + { "inputs": ["18443514427752092745", "18443514427752092745"], "output": "18443514427752092745" }, + { "inputs": ["18443514427752092745", "18443514427752092741"], "output": "18443514427752092745" } + ], + "max_euint64_euint128": [ { - "inputs": ["340282366920938463463370734691749234713", "340282366920938463463370734691749234713"], - "output": "340282366920938463463370734691749234713" + "inputs": ["18443352120644278875", "340282366920938463463373501137757590061"], + "output": "340282366920938463463373501137757590061" }, - { - "inputs": ["340282366920938463463370734691749234713", "340282366920938463463370734691749234709"], - "output": "340282366920938463463370734691749234709" - } + { "inputs": ["18443352120644278871", "18443352120644278875"], "output": "18443352120644278875" }, + { "inputs": ["18443352120644278875", "18443352120644278875"], "output": "18443352120644278875" }, + { "inputs": ["18443352120644278875", "18443352120644278871"], "output": "18443352120644278875" } ], - "min_euint256_euint4": [ + "max_euint128_euint8": [ { - "inputs": ["115792089237316195423570985008687907853269984665640564039457582664799758938101", "2"], - "output": "2" + "inputs": ["340282366920938463463368285268040857997", "11"], + "output": "340282366920938463463368285268040857997" }, - { "inputs": ["4", "8"], "output": "4" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "4" } + { "inputs": ["7", "11"], "output": "11" }, + { "inputs": ["11", "11"], "output": "11" }, + { "inputs": ["11", "7"], "output": "11" } ], - "min_euint256_euint8": [ + "max_euint128_euint16": [ { - "inputs": ["115792089237316195423570985008687907853269984665640564039457577026640283682165", "103"], - "output": "103" + "inputs": ["340282366920938463463369253152804843011", "38370"], + "output": "340282366920938463463369253152804843011" }, - { "inputs": ["99", "103"], "output": "99" }, - { "inputs": ["103", "103"], "output": "103" }, - { "inputs": ["103", "99"], "output": "99" } + { "inputs": ["38366", "38370"], "output": "38370" }, + { "inputs": ["38370", "38370"], "output": "38370" }, + { "inputs": ["38370", "38366"], "output": "38370" } ], - "min_euint256_euint16": [ + "max_euint128_euint32": [ { - "inputs": ["115792089237316195423570985008687907853269984665640564039457579076951559173157", "24679"], - "output": "24679" + "inputs": ["340282366920938463463373978996566189733", "775867564"], + "output": "340282366920938463463373978996566189733" }, - { "inputs": ["24675", "24679"], "output": "24675" }, - { "inputs": ["24679", "24679"], "output": "24679" }, - { "inputs": ["24679", "24675"], "output": "24675" } + { "inputs": ["775867560", "775867564"], "output": "775867564" }, + { "inputs": ["775867564", "775867564"], "output": "775867564" }, + { "inputs": ["775867564", "775867560"], "output": "775867564" } ], - "min_euint256_euint32": [ + "max_euint128_euint64": [ { - "inputs": ["115792089237316195423570985008687907853269984665640564039457582240718630307135", "1248940496"], - "output": "1248940496" + "inputs": ["340282366920938463463370063546147795319", "18443766124830926111"], + "output": "340282366920938463463370063546147795319" }, - { "inputs": ["1248940492", "1248940496"], "output": "1248940492" }, - { "inputs": ["1248940496", "1248940496"], "output": "1248940496" }, - { "inputs": ["1248940496", "1248940492"], "output": "1248940492" } + { "inputs": ["18443766124830926107", "18443766124830926111"], "output": "18443766124830926111" }, + { "inputs": ["18443766124830926111", "18443766124830926111"], "output": "18443766124830926111" }, + { "inputs": ["18443766124830926111", "18443766124830926107"], "output": "18443766124830926111" } ], - "min_euint256_euint64": [ + "max_euint128_euint128": [ { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579813847565218665", - "18443636668516069273" - ], - "output": "18443636668516069273" + "inputs": ["340282366920938463463371653258208863533", "340282366920938463463370968840298051555"], + "output": "340282366920938463463371653258208863533" }, { - "inputs": ["18443636668516069269", "18443636668516069273"], - "output": "18443636668516069269" + "inputs": ["340282366920938463463370968840298051551", "340282366920938463463370968840298051555"], + "output": "340282366920938463463370968840298051555" }, { - "inputs": ["18443636668516069273", "18443636668516069273"], - "output": "18443636668516069273" + "inputs": ["340282366920938463463370968840298051555", "340282366920938463463370968840298051555"], + "output": "340282366920938463463370968840298051555" }, { - "inputs": ["18443636668516069273", "18443636668516069269"], - "output": "18443636668516069269" + "inputs": ["340282366920938463463370968840298051555", "340282366920938463463370968840298051551"], + "output": "340282366920938463463370968840298051555" } ], - "min_euint256_euint128": [ + "max_euint128_uint128": [ { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457578748486524440321", - "340282366920938463463370032475222092647" - ], - "output": "340282366920938463463370032475222092647" + "inputs": ["340282366920938463463371653258208863533", "340282366920938463463367360139414099303"], + "output": "340282366920938463463371653258208863533" }, { - "inputs": ["340282366920938463463370032475222092643", "340282366920938463463370032475222092647"], - "output": "340282366920938463463370032475222092643" + "inputs": ["340282366920938463463370968840298051551", "340282366920938463463370968840298051555"], + "output": "340282366920938463463370968840298051555" }, { - "inputs": ["340282366920938463463370032475222092647", "340282366920938463463370032475222092647"], - "output": "340282366920938463463370032475222092647" + "inputs": ["340282366920938463463370968840298051555", "340282366920938463463370968840298051555"], + "output": "340282366920938463463370968840298051555" }, { - "inputs": ["340282366920938463463370032475222092647", "340282366920938463463370032475222092643"], - "output": "340282366920938463463370032475222092643" + "inputs": ["340282366920938463463370968840298051555", "340282366920938463463370968840298051551"], + "output": "340282366920938463463370968840298051555" } ], - "min_euint256_euint256": [ + "max_uint128_euint128": [ { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579091097262441647", - "115792089237316195423570985008687907853269984665640564039457577447088911778291" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577447088911778291" + "inputs": ["340282366920938463463370933025225338383", "340282366920938463463367360139414099303"], + "output": "340282366920938463463370933025225338383" }, { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577447088911778287", - "115792089237316195423570985008687907853269984665640564039457577447088911778291" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577447088911778287" + "inputs": ["340282366920938463463370968840298051551", "340282366920938463463370968840298051555"], + "output": "340282366920938463463370968840298051555" }, { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577447088911778291", - "115792089237316195423570985008687907853269984665640564039457577447088911778291" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577447088911778291" + "inputs": ["340282366920938463463370968840298051555", "340282366920938463463370968840298051555"], + "output": "340282366920938463463370968840298051555" }, { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577447088911778291", - "115792089237316195423570985008687907853269984665640564039457577447088911778287" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577447088911778287" + "inputs": ["340282366920938463463370968840298051555", "340282366920938463463370968840298051551"], + "output": "340282366920938463463370968840298051555" } ], - "min_euint256_uint256": [ + "min_euint8_euint8": [ + { "inputs": ["5", "94"], "output": "5" }, + { "inputs": ["1", "5"], "output": "1" }, + { "inputs": ["5", "5"], "output": "5" }, + { "inputs": ["5", "1"], "output": "1" } + ], + "min_euint8_uint8": [ + { "inputs": ["5", "222"], "output": "5" }, + { "inputs": ["1", "5"], "output": "1" }, + { "inputs": ["5", "5"], "output": "5" }, + { "inputs": ["5", "1"], "output": "1" } + ], + "min_uint8_euint8": [ + { "inputs": ["100", "222"], "output": "100" }, + { "inputs": ["1", "5"], "output": "1" }, + { "inputs": ["5", "5"], "output": "5" }, + { "inputs": ["5", "1"], "output": "1" } + ], + "min_euint8_euint16": [ + { "inputs": ["71", "62226"], "output": "71" }, + { "inputs": ["67", "71"], "output": "67" }, + { "inputs": ["71", "71"], "output": "71" }, + { "inputs": ["71", "67"], "output": "67" } + ], + "min_euint8_euint32": [ + { "inputs": ["115", "3649653427"], "output": "115" }, + { "inputs": ["111", "115"], "output": "111" }, + { "inputs": ["115", "115"], "output": "115" }, + { "inputs": ["115", "111"], "output": "111" } + ], + "min_euint8_euint64": [ + { "inputs": ["246", "18446404363111074591"], "output": "246" }, + { "inputs": ["242", "246"], "output": "242" }, + { "inputs": ["246", "246"], "output": "246" }, + { "inputs": ["246", "242"], "output": "242" } + ], + "min_euint8_euint128": [ + { "inputs": ["223", "340282366920938463463368229480911464197"], "output": "223" }, + { "inputs": ["219", "223"], "output": "219" }, + { "inputs": ["223", "223"], "output": "223" }, + { "inputs": ["223", "219"], "output": "219" } + ], + "min_euint16_euint8": [ + { "inputs": ["39843", "89"], "output": "89" }, + { "inputs": ["85", "89"], "output": "85" }, + { "inputs": ["89", "89"], "output": "89" }, + { "inputs": ["89", "85"], "output": "85" } + ], + "min_euint16_euint16": [ + { "inputs": ["50897", "58138"], "output": "50897" }, + { "inputs": ["50893", "50897"], "output": "50893" }, + { "inputs": ["50897", "50897"], "output": "50897" }, + { "inputs": ["50897", "50893"], "output": "50893" } + ], + "min_euint16_uint16": [ + { "inputs": ["50897", "20045"], "output": "20045" }, + { "inputs": ["50893", "50897"], "output": "50893" }, + { "inputs": ["50897", "50897"], "output": "50897" }, + { "inputs": ["50897", "50893"], "output": "50893" } + ], + "min_uint16_euint16": [ + { "inputs": ["11583", "20045"], "output": "11583" }, + { "inputs": ["50893", "50897"], "output": "50893" }, + { "inputs": ["50897", "50897"], "output": "50897" }, + { "inputs": ["50897", "50893"], "output": "50893" } + ], + "min_euint16_euint32": [ + { "inputs": ["58755", "67367322"], "output": "58755" }, + { "inputs": ["58751", "58755"], "output": "58751" }, + { "inputs": ["58755", "58755"], "output": "58755" }, + { "inputs": ["58755", "58751"], "output": "58751" } + ], + "min_euint16_euint64": [ + { "inputs": ["50387", "18445977919369665915"], "output": "50387" }, + { "inputs": ["50383", "50387"], "output": "50383" }, + { "inputs": ["50387", "50387"], "output": "50387" }, + { "inputs": ["50387", "50383"], "output": "50383" } + ], + "min_euint16_euint128": [ + { "inputs": ["29616", "340282366920938463463367422769313704665"], "output": "29616" }, + { "inputs": ["29612", "29616"], "output": "29612" }, + { "inputs": ["29616", "29616"], "output": "29616" }, + { "inputs": ["29616", "29612"], "output": "29612" } + ], + "min_euint32_euint8": [ + { "inputs": ["2911299036", "115"], "output": "115" }, + { "inputs": ["111", "115"], "output": "111" }, + { "inputs": ["115", "115"], "output": "115" }, + { "inputs": ["115", "111"], "output": "111" } + ], + "min_euint32_euint16": [ + { "inputs": ["2985245986", "41059"], "output": "41059" }, + { "inputs": ["41055", "41059"], "output": "41055" }, + { "inputs": ["41059", "41059"], "output": "41059" }, + { "inputs": ["41059", "41055"], "output": "41055" } + ], + "min_euint32_euint32": [ + { "inputs": ["2363742011", "3101638953"], "output": "2363742011" }, + { "inputs": ["2363742007", "2363742011"], "output": "2363742007" }, + { "inputs": ["2363742011", "2363742011"], "output": "2363742011" }, + { "inputs": ["2363742011", "2363742007"], "output": "2363742007" } + ], + "min_euint32_uint32": [ + { "inputs": ["2363742011", "3618800071"], "output": "2363742011" }, + { "inputs": ["2363742007", "2363742011"], "output": "2363742007" }, + { "inputs": ["2363742011", "2363742011"], "output": "2363742011" }, + { "inputs": ["2363742011", "2363742007"], "output": "2363742007" } + ], + "min_uint32_euint32": [ + { "inputs": ["2231682517", "3618800071"], "output": "2231682517" }, + { "inputs": ["2363742007", "2363742011"], "output": "2363742007" }, + { "inputs": ["2363742011", "2363742011"], "output": "2363742011" }, + { "inputs": ["2363742011", "2363742007"], "output": "2363742007" } + ], + "min_euint32_euint64": [ + { "inputs": ["3266256672", "18442926303942638115"], "output": "3266256672" }, + { "inputs": ["3266256668", "3266256672"], "output": "3266256668" }, + { "inputs": ["3266256672", "3266256672"], "output": "3266256672" }, + { "inputs": ["3266256672", "3266256668"], "output": "3266256668" } + ], + "min_euint32_euint128": [ + { "inputs": ["1272668212", "340282366920938463463365917978294533779"], "output": "1272668212" }, + { "inputs": ["1272668208", "1272668212"], "output": "1272668208" }, + { "inputs": ["1272668212", "1272668212"], "output": "1272668212" }, + { "inputs": ["1272668212", "1272668208"], "output": "1272668208" } + ], + "min_euint64_euint8": [ + { "inputs": ["18444864539684113527", "36"], "output": "36" }, + { "inputs": ["32", "36"], "output": "32" }, + { "inputs": ["36", "36"], "output": "36" }, + { "inputs": ["36", "32"], "output": "32" } + ], + "min_euint64_euint16": [ + { "inputs": ["18441909548593762639", "26786"], "output": "26786" }, + { "inputs": ["26782", "26786"], "output": "26782" }, + { "inputs": ["26786", "26786"], "output": "26786" }, + { "inputs": ["26786", "26782"], "output": "26782" } + ], + "min_euint64_euint32": [ + { "inputs": ["18440819197772093501", "2859803946"], "output": "2859803946" }, + { "inputs": ["2859803942", "2859803946"], "output": "2859803942" }, + { "inputs": ["2859803946", "2859803946"], "output": "2859803946" }, + { "inputs": ["2859803946", "2859803942"], "output": "2859803942" } + ], + "min_euint64_euint64": [ + { "inputs": ["18438886511426456891", "18438679415295839677"], "output": "18438679415295839677" }, + { "inputs": ["18438679415295839673", "18438679415295839677"], "output": "18438679415295839673" }, + { "inputs": ["18438679415295839677", "18438679415295839677"], "output": "18438679415295839677" }, + { "inputs": ["18438679415295839677", "18438679415295839673"], "output": "18438679415295839673" } + ], + "min_euint64_uint64": [ + { "inputs": ["18438886511426456891", "18446056373033911953"], "output": "18438886511426456891" }, + { "inputs": ["18438679415295839673", "18438679415295839677"], "output": "18438679415295839673" }, + { "inputs": ["18438679415295839677", "18438679415295839677"], "output": "18438679415295839677" }, + { "inputs": ["18438679415295839677", "18438679415295839673"], "output": "18438679415295839673" } + ], + "min_uint64_euint64": [ + { "inputs": ["18443815332668757211", "18446056373033911953"], "output": "18443815332668757211" }, + { "inputs": ["18438679415295839673", "18438679415295839677"], "output": "18438679415295839673" }, + { "inputs": ["18438679415295839677", "18438679415295839677"], "output": "18438679415295839677" }, + { "inputs": ["18438679415295839677", "18438679415295839673"], "output": "18438679415295839673" } + ], + "min_euint64_euint128": [ + { "inputs": ["18437853064342725623", "340282366920938463463366902421007843513"], "output": "18437853064342725623" }, + { "inputs": ["18437853064342725619", "18437853064342725623"], "output": "18437853064342725619" }, + { "inputs": ["18437853064342725623", "18437853064342725623"], "output": "18437853064342725623" }, + { "inputs": ["18437853064342725623", "18437853064342725619"], "output": "18437853064342725619" } + ], + "min_euint128_euint8": [ + { "inputs": ["340282366920938463463366954403490483747", "164"], "output": "164" }, + { "inputs": ["160", "164"], "output": "160" }, + { "inputs": ["164", "164"], "output": "164" }, + { "inputs": ["164", "160"], "output": "160" } + ], + "min_euint128_euint16": [ + { "inputs": ["340282366920938463463365866423334975565", "54190"], "output": "54190" }, + { "inputs": ["54186", "54190"], "output": "54186" }, + { "inputs": ["54190", "54190"], "output": "54190" }, + { "inputs": ["54190", "54186"], "output": "54186" } + ], + "min_euint128_euint32": [ + { "inputs": ["340282366920938463463372744919331078259", "2646000906"], "output": "2646000906" }, + { "inputs": ["2646000902", "2646000906"], "output": "2646000902" }, + { "inputs": ["2646000906", "2646000906"], "output": "2646000906" }, + { "inputs": ["2646000906", "2646000902"], "output": "2646000902" } + ], + "min_euint128_euint64": [ + { "inputs": ["340282366920938463463373789043727203267", "18443285746617922891"], "output": "18443285746617922891" }, + { "inputs": ["18443285746617922887", "18443285746617922891"], "output": "18443285746617922887" }, + { "inputs": ["18443285746617922891", "18443285746617922891"], "output": "18443285746617922891" }, + { "inputs": ["18443285746617922891", "18443285746617922887"], "output": "18443285746617922887" } + ], + "min_euint128_euint128": [ { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579091097262441647", - "115792089237316195423570985008687907853269984665640564039457576915935387349417" - ], - "output": "115792089237316195423570985008687907853269984665640564039457576915935387349417" + "inputs": ["340282366920938463463374347198146062157", "340282366920938463463366234158375035823"], + "output": "340282366920938463463366234158375035823" }, { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577447088911778287", - "115792089237316195423570985008687907853269984665640564039457577447088911778291" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577447088911778287" + "inputs": ["340282366920938463463366234158375035819", "340282366920938463463366234158375035823"], + "output": "340282366920938463463366234158375035819" }, { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577447088911778291", - "115792089237316195423570985008687907853269984665640564039457577447088911778291" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577447088911778291" + "inputs": ["340282366920938463463366234158375035823", "340282366920938463463366234158375035823"], + "output": "340282366920938463463366234158375035823" }, { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577447088911778291", - "115792089237316195423570985008687907853269984665640564039457577447088911778287" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577447088911778287" + "inputs": ["340282366920938463463366234158375035823", "340282366920938463463366234158375035819"], + "output": "340282366920938463463366234158375035819" } ], - "min_uint256_euint256": [ + "min_euint128_uint128": [ { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579127166009597401", - "115792089237316195423570985008687907853269984665640564039457576915935387349417" - ], - "output": "115792089237316195423570985008687907853269984665640564039457576915935387349417" + "inputs": ["340282366920938463463374347198146062157", "340282366920938463463373481796046413735"], + "output": "340282366920938463463373481796046413735" }, { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577447088911778287", - "115792089237316195423570985008687907853269984665640564039457577447088911778291" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577447088911778287" + "inputs": ["340282366920938463463366234158375035819", "340282366920938463463366234158375035823"], + "output": "340282366920938463463366234158375035819" }, { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577447088911778291", - "115792089237316195423570985008687907853269984665640564039457577447088911778291" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577447088911778291" + "inputs": ["340282366920938463463366234158375035823", "340282366920938463463366234158375035823"], + "output": "340282366920938463463366234158375035823" }, { - "inputs": [ - "115792089237316195423570985008687907853269984665640564039457577447088911778291", - "115792089237316195423570985008687907853269984665640564039457577447088911778287" - ], - "output": "115792089237316195423570985008687907853269984665640564039457577447088911778287" + "inputs": ["340282366920938463463366234158375035823", "340282366920938463463366234158375035819"], + "output": "340282366920938463463366234158375035819" } ], - "or_euint4_euint4": [ - { "inputs": ["10", "6"], "output": "14" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "12" } - ], - "or_euint4_euint8": [ - { "inputs": ["8", "185"], "output": "185" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "12" } - ], - "or_euint4_uint8": [ - { "inputs": ["8", "9"], "output": "9" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "12" } - ], - "or_euint4_euint16": [ - { "inputs": ["9", "28733"], "output": "28733" }, - { "inputs": ["5", "9"], "output": "13" }, - { "inputs": ["9", "9"], "output": "9" }, - { "inputs": ["9", "5"], "output": "13" } - ], - "or_euint4_euint32": [ - { "inputs": ["13", "371092847"], "output": "371092847" }, - { "inputs": ["9", "13"], "output": "13" }, - { "inputs": ["13", "13"], "output": "13" }, - { "inputs": ["13", "9"], "output": "13" } - ], - "or_euint4_euint64": [ + "min_uint128_euint128": [ { - "inputs": ["14", "18440698678220010551"], - "output": "18440698678220010559" + "inputs": ["340282366920938463463366250910262946961", "340282366920938463463373481796046413735"], + "output": "340282366920938463463366250910262946961" }, - { "inputs": ["10", "14"], "output": "14" }, - { "inputs": ["14", "14"], "output": "14" }, - { "inputs": ["14", "10"], "output": "14" } - ], - "or_euint4_euint128": [ { - "inputs": ["4", "340282366920938463463366343089484611447"], - "output": "340282366920938463463366343089484611447" + "inputs": ["340282366920938463463366234158375035819", "340282366920938463463366234158375035823"], + "output": "340282366920938463463366234158375035819" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "12" } - ], - "or_euint4_euint256": [ { - "inputs": ["8", "115792089237316195423570985008687907853269984665640564039457583166606888282231"], - "output": "115792089237316195423570985008687907853269984665640564039457583166606888282239" + "inputs": ["340282366920938463463366234158375035823", "340282366920938463463366234158375035823"], + "output": "340282366920938463463366234158375035823" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "12" } - ], - "or_euint8_euint4": [ - { "inputs": ["189", "3"], "output": "191" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "12" } - ], - "or_uint8_euint4": [ - { "inputs": ["13", "3"], "output": "15" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "12" } + { + "inputs": ["340282366920938463463366234158375035823", "340282366920938463463366234158375035819"], + "output": "340282366920938463463366234158375035819" + } ], "or_euint8_euint8": [ - { "inputs": ["189", "251"], "output": "255" }, - { "inputs": ["185", "189"], "output": "189" }, - { "inputs": ["189", "189"], "output": "189" }, - { "inputs": ["189", "185"], "output": "189" } + { "inputs": ["59", "209"], "output": "251" }, + { "inputs": ["55", "59"], "output": "63" }, + { "inputs": ["59", "59"], "output": "59" }, + { "inputs": ["59", "55"], "output": "63" } ], "or_euint8_uint8": [ - { "inputs": ["189", "140"], "output": "189" }, - { "inputs": ["185", "189"], "output": "189" }, - { "inputs": ["189", "189"], "output": "189" }, - { "inputs": ["189", "185"], "output": "189" } + { "inputs": ["59", "152"], "output": "187" }, + { "inputs": ["55", "59"], "output": "63" }, + { "inputs": ["59", "59"], "output": "59" }, + { "inputs": ["59", "55"], "output": "63" } ], "or_uint8_euint8": [ - { "inputs": ["139", "140"], "output": "143" }, - { "inputs": ["185", "189"], "output": "189" }, - { "inputs": ["189", "189"], "output": "189" }, - { "inputs": ["189", "185"], "output": "189" } + { "inputs": ["29", "152"], "output": "157" }, + { "inputs": ["55", "59"], "output": "63" }, + { "inputs": ["59", "59"], "output": "59" }, + { "inputs": ["59", "55"], "output": "63" } ], "or_euint8_euint16": [ - { "inputs": ["20", "28056"], "output": "28060" }, - { "inputs": ["16", "20"], "output": "20" }, - { "inputs": ["20", "20"], "output": "20" }, - { "inputs": ["20", "16"], "output": "20" } + { "inputs": ["91", "18997"], "output": "19071" }, + { "inputs": ["87", "91"], "output": "95" }, + { "inputs": ["91", "91"], "output": "91" }, + { "inputs": ["91", "87"], "output": "95" } ], "or_euint8_euint32": [ - { "inputs": ["64", "694910711"], "output": "694910711" }, - { "inputs": ["60", "64"], "output": "124" }, - { "inputs": ["64", "64"], "output": "64" }, - { "inputs": ["64", "60"], "output": "124" } + { "inputs": ["109", "3896202142"], "output": "3896202239" }, + { "inputs": ["105", "109"], "output": "109" }, + { "inputs": ["109", "109"], "output": "109" }, + { "inputs": ["109", "105"], "output": "109" } ], "or_euint8_euint64": [ - { - "inputs": ["22", "18446578065470955215"], - "output": "18446578065470955231" - }, - { "inputs": ["18", "22"], "output": "22" }, - { "inputs": ["22", "22"], "output": "22" }, - { "inputs": ["22", "18"], "output": "22" } + { "inputs": ["5", "18442045891205554511"], "output": "18442045891205554511" }, + { "inputs": ["1", "5"], "output": "5" }, + { "inputs": ["5", "5"], "output": "5" }, + { "inputs": ["5", "1"], "output": "5" } ], "or_euint8_euint128": [ { - "inputs": ["1", "340282366920938463463371478178042182733"], - "output": "340282366920938463463371478178042182733" + "inputs": ["25", "340282366920938463463368666690137973057"], + "output": "340282366920938463463368666690137973081" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "12" } + { "inputs": ["21", "25"], "output": "29" }, + { "inputs": ["25", "25"], "output": "25" }, + { "inputs": ["25", "21"], "output": "29" } ], "or_euint8_euint256": [ { - "inputs": ["46", "115792089237316195423570985008687907853269984665640564039457582375126935756687"], - "output": "115792089237316195423570985008687907853269984665640564039457582375126935756719" + "inputs": ["140", "115792089237316195423570985008687907853269984665640564039457579612495540474315"], + "output": "115792089237316195423570985008687907853269984665640564039457579612495540474319" }, - { "inputs": ["42", "46"], "output": "46" }, - { "inputs": ["46", "46"], "output": "46" }, - { "inputs": ["46", "42"], "output": "46" } - ], - "or_euint16_euint4": [ - { "inputs": ["31310", "6"], "output": "31310" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "12" } + { "inputs": ["136", "140"], "output": "140" }, + { "inputs": ["140", "140"], "output": "140" }, + { "inputs": ["140", "136"], "output": "140" } ], "or_euint16_euint8": [ - { "inputs": ["20350", "200"], "output": "20478" }, - { "inputs": ["196", "200"], "output": "204" }, - { "inputs": ["200", "200"], "output": "200" }, - { "inputs": ["200", "196"], "output": "204" } + { "inputs": ["29676", "239"], "output": "29679" }, + { "inputs": ["235", "239"], "output": "239" }, + { "inputs": ["239", "239"], "output": "239" }, + { "inputs": ["239", "235"], "output": "239" } ], "or_euint16_euint16": [ - { "inputs": ["41436", "37567"], "output": "46079" }, - { "inputs": ["37563", "37567"], "output": "37567" }, - { "inputs": ["37567", "37567"], "output": "37567" }, - { "inputs": ["37567", "37563"], "output": "37567" } + { "inputs": ["43168", "54107"], "output": "64507" }, + { "inputs": ["43164", "43168"], "output": "43196" }, + { "inputs": ["43168", "43168"], "output": "43168" }, + { "inputs": ["43168", "43164"], "output": "43196" } ], "or_euint16_uint16": [ - { "inputs": ["41436", "27184"], "output": "60412" }, - { "inputs": ["37563", "37567"], "output": "37567" }, - { "inputs": ["37567", "37567"], "output": "37567" }, - { "inputs": ["37567", "37563"], "output": "37567" } + { "inputs": ["43168", "31747"], "output": "64675" }, + { "inputs": ["43164", "43168"], "output": "43196" }, + { "inputs": ["43168", "43168"], "output": "43168" }, + { "inputs": ["43168", "43164"], "output": "43196" } ], "or_uint16_euint16": [ - { "inputs": ["65174", "27184"], "output": "65206" }, - { "inputs": ["37563", "37567"], "output": "37567" }, - { "inputs": ["37567", "37567"], "output": "37567" }, - { "inputs": ["37567", "37563"], "output": "37567" } + { "inputs": ["14818", "31747"], "output": "32227" }, + { "inputs": ["43164", "43168"], "output": "43196" }, + { "inputs": ["43168", "43168"], "output": "43168" }, + { "inputs": ["43168", "43164"], "output": "43196" } ], "or_euint16_euint32": [ - { "inputs": ["36595", "3887874863"], "output": "3887910911" }, - { "inputs": ["36591", "36595"], "output": "36607" }, - { "inputs": ["36595", "36595"], "output": "36595" }, - { "inputs": ["36595", "36591"], "output": "36607" } + { "inputs": ["45553", "2411793936"], "output": "2411839473" }, + { "inputs": ["45549", "45553"], "output": "45565" }, + { "inputs": ["45553", "45553"], "output": "45553" }, + { "inputs": ["45553", "45549"], "output": "45565" } ], "or_euint16_euint64": [ - { - "inputs": ["8318", "18443891473910549169"], - "output": "18443891473910557439" - }, - { "inputs": ["8314", "8318"], "output": "8318" }, - { "inputs": ["8318", "8318"], "output": "8318" }, - { "inputs": ["8318", "8314"], "output": "8318" } + { "inputs": ["45956", "18441360101730141031"], "output": "18441360101730153447" }, + { "inputs": ["45952", "45956"], "output": "45956" }, + { "inputs": ["45956", "45956"], "output": "45956" }, + { "inputs": ["45956", "45952"], "output": "45956" } ], "or_euint16_euint128": [ { - "inputs": ["65101", "340282366920938463463368378388212688025"], - "output": "340282366920938463463368378388212743901" + "inputs": ["48228", "340282366920938463463366444804288690097"], + "output": "340282366920938463463366444804288724981" }, - { "inputs": ["65097", "65101"], "output": "65101" }, - { "inputs": ["65101", "65101"], "output": "65101" }, - { "inputs": ["65101", "65097"], "output": "65101" } + { "inputs": ["48224", "48228"], "output": "48228" }, + { "inputs": ["48228", "48228"], "output": "48228" }, + { "inputs": ["48228", "48224"], "output": "48228" } ], "or_euint16_euint256": [ { - "inputs": ["31079", "115792089237316195423570985008687907853269984665640564039457575275996784888971"], - "output": "115792089237316195423570985008687907853269984665640564039457575275996784917999" + "inputs": ["18915", "115792089237316195423570985008687907853269984665640564039457581639912897398873"], + "output": "115792089237316195423570985008687907853269984665640564039457581639912897399291" }, - { "inputs": ["31075", "31079"], "output": "31079" }, - { "inputs": ["31079", "31079"], "output": "31079" }, - { "inputs": ["31079", "31075"], "output": "31079" } - ], - "or_euint32_euint4": [ - { "inputs": ["1671920698", "3"], "output": "1671920699" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "12" } + { "inputs": ["18911", "18915"], "output": "18943" }, + { "inputs": ["18915", "18915"], "output": "18915" }, + { "inputs": ["18915", "18911"], "output": "18943" } ], "or_euint32_euint8": [ - { "inputs": ["143668880", "184"], "output": "143668920" }, - { "inputs": ["180", "184"], "output": "188" }, - { "inputs": ["184", "184"], "output": "184" }, - { "inputs": ["184", "180"], "output": "188" } + { "inputs": ["309129679", "17"], "output": "309129695" }, + { "inputs": ["13", "17"], "output": "29" }, + { "inputs": ["17", "17"], "output": "17" }, + { "inputs": ["17", "13"], "output": "29" } ], "or_euint32_euint16": [ - { "inputs": ["68701034", "41103"], "output": "68742127" }, - { "inputs": ["41099", "41103"], "output": "41103" }, - { "inputs": ["41103", "41103"], "output": "41103" }, - { "inputs": ["41103", "41099"], "output": "41103" } + { "inputs": ["1785984553", "61539"], "output": "1785984619" }, + { "inputs": ["61535", "61539"], "output": "61567" }, + { "inputs": ["61539", "61539"], "output": "61539" }, + { "inputs": ["61539", "61535"], "output": "61567" } ], "or_euint32_euint32": [ - { "inputs": ["1707541891", "1244554527"], "output": "1877960095" }, - { "inputs": ["1244554523", "1244554527"], "output": "1244554527" }, - { "inputs": ["1244554527", "1244554527"], "output": "1244554527" }, - { "inputs": ["1244554527", "1244554523"], "output": "1244554527" } + { "inputs": ["3399195297", "1029184528"], "output": "4292583089" }, + { "inputs": ["1029184524", "1029184528"], "output": "1029184540" }, + { "inputs": ["1029184528", "1029184528"], "output": "1029184528" }, + { "inputs": ["1029184528", "1029184524"], "output": "1029184540" } ], "or_euint32_uint32": [ - { "inputs": ["1707541891", "1007760424"], "output": "2111255979" }, - { "inputs": ["1244554523", "1244554527"], "output": "1244554527" }, - { "inputs": ["1244554527", "1244554527"], "output": "1244554527" }, - { "inputs": ["1244554527", "1244554523"], "output": "1244554527" } + { "inputs": ["3399195297", "1177852772"], "output": "3468663781" }, + { "inputs": ["1029184524", "1029184528"], "output": "1029184540" }, + { "inputs": ["1029184528", "1029184528"], "output": "1029184528" }, + { "inputs": ["1029184528", "1029184524"], "output": "1029184540" } ], "or_uint32_euint32": [ - { "inputs": ["1405809228", "1007760424"], "output": "2145121900" }, - { "inputs": ["1244554523", "1244554527"], "output": "1244554527" }, - { "inputs": ["1244554527", "1244554527"], "output": "1244554527" }, - { "inputs": ["1244554527", "1244554523"], "output": "1244554527" } + { "inputs": ["1381919827", "1177852772"], "output": "1451163511" }, + { "inputs": ["1029184524", "1029184528"], "output": "1029184540" }, + { "inputs": ["1029184528", "1029184528"], "output": "1029184528" }, + { "inputs": ["1029184528", "1029184524"], "output": "1029184540" } ], "or_euint32_euint64": [ - { - "inputs": ["1546853992", "18445417582546475671"], - "output": "18445417583755615999" - }, - { "inputs": ["1546853988", "1546853992"], "output": "1546853996" }, - { "inputs": ["1546853992", "1546853992"], "output": "1546853992" }, - { "inputs": ["1546853992", "1546853988"], "output": "1546853996" } + { "inputs": ["3895790584", "18439106778552670699"], "output": "18439106779761941499" }, + { "inputs": ["3895790580", "3895790584"], "output": "3895790588" }, + { "inputs": ["3895790584", "3895790584"], "output": "3895790584" }, + { "inputs": ["3895790584", "3895790580"], "output": "3895790588" } ], "or_euint32_euint128": [ { - "inputs": ["1775515615", "340282366920938463463365726409727391809"], - "output": "340282366920938463463365726409758064607" + "inputs": ["923282932", "340282366920938463463368259129034235697"], + "output": "340282366920938463463368259129587892213" }, - { "inputs": ["1775515611", "1775515615"], "output": "1775515615" }, - { "inputs": ["1775515615", "1775515615"], "output": "1775515615" }, - { "inputs": ["1775515615", "1775515611"], "output": "1775515615" } + { "inputs": ["923282928", "923282932"], "output": "923282932" }, + { "inputs": ["923282932", "923282932"], "output": "923282932" }, + { "inputs": ["923282932", "923282928"], "output": "923282932" } ], "or_euint32_euint256": [ { - "inputs": ["2321952704", "115792089237316195423570985008687907853269984665640564039457581516412469896587"], - "output": "115792089237316195423570985008687907853269984665640564039457581516414655131595" + "inputs": ["620379825", "115792089237316195423570985008687907853269984665640564039457575514941056441555"], + "output": "115792089237316195423570985008687907853269984665640564039457575514941668949747" }, - { "inputs": ["2321952700", "2321952704"], "output": "2321952764" }, - { "inputs": ["2321952704", "2321952704"], "output": "2321952704" }, - { "inputs": ["2321952704", "2321952700"], "output": "2321952764" } - ], - "or_euint64_euint4": [ - { - "inputs": ["18443718017569117131", "9"], - "output": "18443718017569117131" - }, - { "inputs": ["5", "9"], "output": "13" }, - { "inputs": ["9", "9"], "output": "9" }, - { "inputs": ["9", "5"], "output": "13" } + { "inputs": ["620379821", "620379825"], "output": "620379837" }, + { "inputs": ["620379825", "620379825"], "output": "620379825" }, + { "inputs": ["620379825", "620379821"], "output": "620379837" } ], "or_euint64_euint8": [ - { - "inputs": ["18442034297780989323", "254"], - "output": "18442034297780989439" - }, - { "inputs": ["250", "254"], "output": "254" }, - { "inputs": ["254", "254"], "output": "254" }, - { "inputs": ["254", "250"], "output": "254" } + { "inputs": ["18442607195167316625", "250"], "output": "18442607195167316731" }, + { "inputs": ["246", "250"], "output": "254" }, + { "inputs": ["250", "250"], "output": "250" }, + { "inputs": ["250", "246"], "output": "254" } ], "or_euint64_euint16": [ - { - "inputs": ["18445256696814040973", "63476"], - "output": "18445256696814041085" - }, - { "inputs": ["63472", "63476"], "output": "63476" }, - { "inputs": ["63476", "63476"], "output": "63476" }, - { "inputs": ["63476", "63472"], "output": "63476" } + { "inputs": ["18446104028672117741", "29827"], "output": "18446104028672131055" }, + { "inputs": ["29823", "29827"], "output": "29951" }, + { "inputs": ["29827", "29827"], "output": "29827" }, + { "inputs": ["29827", "29823"], "output": "29951" } ], "or_euint64_euint32": [ - { - "inputs": ["18441305633946386479", "1651927522"], - "output": "18441305635594103279" - }, - { "inputs": ["1651927518", "1651927522"], "output": "1651927550" }, - { "inputs": ["1651927522", "1651927522"], "output": "1651927522" }, - { "inputs": ["1651927522", "1651927518"], "output": "1651927550" } + { "inputs": ["18442052870866579889", "3203353953"], "output": "18442052873115139569" }, + { "inputs": ["3203353949", "3203353953"], "output": "3203353981" }, + { "inputs": ["3203353953", "3203353953"], "output": "3203353953" }, + { "inputs": ["3203353953", "3203353949"], "output": "3203353981" } ], "or_euint64_euint64": [ - { - "inputs": ["18445851190683093315", "18440297605680046453"], - "output": "18446141532670781815" - }, - { - "inputs": ["18440297605680046449", "18440297605680046453"], - "output": "18440297605680046453" - }, - { - "inputs": ["18440297605680046453", "18440297605680046453"], - "output": "18440297605680046453" - }, - { - "inputs": ["18440297605680046453", "18440297605680046449"], - "output": "18440297605680046453" - } + { "inputs": ["18439204230628381013", "18446517249435350017"], "output": "18446523885701412181" }, + { "inputs": ["18439204230628381009", "18439204230628381013"], "output": "18439204230628381013" }, + { "inputs": ["18439204230628381013", "18439204230628381013"], "output": "18439204230628381013" }, + { "inputs": ["18439204230628381013", "18439204230628381009"], "output": "18439204230628381013" } ], "or_euint64_uint64": [ - { - "inputs": ["18445851190683093315", "18441158928097514419"], - "output": "18445895250664217587" - }, - { - "inputs": ["18440297605680046449", "18440297605680046453"], - "output": "18440297605680046453" - }, - { - "inputs": ["18440297605680046453", "18440297605680046453"], - "output": "18440297605680046453" - }, - { - "inputs": ["18440297605680046453", "18440297605680046449"], - "output": "18440297605680046453" - } + { "inputs": ["18439204230628381013", "18440280264532561421"], "output": "18441466140862193501" }, + { "inputs": ["18439204230628381009", "18439204230628381013"], "output": "18439204230628381013" }, + { "inputs": ["18439204230628381013", "18439204230628381013"], "output": "18439204230628381013" }, + { "inputs": ["18439204230628381013", "18439204230628381009"], "output": "18439204230628381013" } ], "or_uint64_euint64": [ - { - "inputs": ["18444816838000851275", "18441158928097514419"], - "output": "18445951836858858491" - }, - { - "inputs": ["18440297605680046449", "18440297605680046453"], - "output": "18440297605680046453" - }, - { - "inputs": ["18440297605680046453", "18440297605680046453"], - "output": "18440297605680046453" - }, - { - "inputs": ["18440297605680046453", "18440297605680046449"], - "output": "18440297605680046453" - } + { "inputs": ["18438149835268698903", "18440280264532561421"], "output": "18440410577204297503" }, + { "inputs": ["18439204230628381009", "18439204230628381013"], "output": "18439204230628381013" }, + { "inputs": ["18439204230628381013", "18439204230628381013"], "output": "18439204230628381013" }, + { "inputs": ["18439204230628381013", "18439204230628381009"], "output": "18439204230628381013" } ], "or_euint64_euint128": [ { - "inputs": ["18444253937643069461", "340282366920938463463369573351070308735"], - "output": "340282366920938463463374396049659246975" - }, - { - "inputs": ["18444253937643069457", "18444253937643069461"], - "output": "18444253937643069461" - }, - { - "inputs": ["18444253937643069461", "18444253937643069461"], - "output": "18444253937643069461" + "inputs": ["18439808401040298079", "340282366920938463463369994963635847267"], + "output": "340282366920938463463370065344392581247" }, - { - "inputs": ["18444253937643069461", "18444253937643069457"], - "output": "18444253937643069461" - } + { "inputs": ["18439808401040298075", "18439808401040298079"], "output": "18439808401040298079" }, + { "inputs": ["18439808401040298079", "18439808401040298079"], "output": "18439808401040298079" }, + { "inputs": ["18439808401040298079", "18439808401040298075"], "output": "18439808401040298079" } ], "or_euint64_euint256": [ { "inputs": [ - "18444891827197945405", - "115792089237316195423570985008687907853269984665640564039457581376324451236725" + "18445372121162025887", + "115792089237316195423570985008687907853269984665640564039457581568271978845147" ], - "output": "115792089237316195423570985008687907853269984665640564039457583990276981260157" - }, - { - "inputs": ["18444891827197945401", "18444891827197945405"], - "output": "18444891827197945405" - }, - { - "inputs": ["18444891827197945405", "18444891827197945405"], - "output": "18444891827197945405" - }, - { - "inputs": ["18444891827197945405", "18444891827197945401"], - "output": "18444891827197945405" - } - ], - "or_euint128_euint4": [ - { - "inputs": ["340282366920938463463366694641055128577", "12"], - "output": "340282366920938463463366694641055128589" + "output": "115792089237316195423570985008687907853269984665640564039457583855355485739999" }, - { "inputs": ["8", "12"], "output": "12" }, - { "inputs": ["12", "12"], "output": "12" }, - { "inputs": ["12", "8"], "output": "12" } + { "inputs": ["18445372121162025883", "18445372121162025887"], "output": "18445372121162025887" }, + { "inputs": ["18445372121162025887", "18445372121162025887"], "output": "18445372121162025887" }, + { "inputs": ["18445372121162025887", "18445372121162025883"], "output": "18445372121162025887" } ], "or_euint128_euint8": [ { - "inputs": ["340282366920938463463374227521343598445", "112"], - "output": "340282366920938463463374227521343598461" + "inputs": ["340282366920938463463368844026157882929", "126"], + "output": "340282366920938463463368844026157883007" }, - { "inputs": ["108", "112"], "output": "124" }, - { "inputs": ["112", "112"], "output": "112" }, - { "inputs": ["112", "108"], "output": "124" } + { "inputs": ["122", "126"], "output": "126" }, + { "inputs": ["126", "126"], "output": "126" }, + { "inputs": ["126", "122"], "output": "126" } ], "or_euint128_euint16": [ { - "inputs": ["340282366920938463463366623321205018087", "7136"], - "output": "340282366920938463463366623321205022695" + "inputs": ["340282366920938463463373794208472062471", "15965"], + "output": "340282366920938463463373794208472071775" }, - { "inputs": ["7132", "7136"], "output": "7164" }, - { "inputs": ["7136", "7136"], "output": "7136" }, - { "inputs": ["7136", "7132"], "output": "7164" } + { "inputs": ["15961", "15965"], "output": "15965" }, + { "inputs": ["15965", "15965"], "output": "15965" }, + { "inputs": ["15965", "15961"], "output": "15965" } ], "or_euint128_euint32": [ { - "inputs": ["340282366920938463463370714852003960045", "1823556556"], - "output": "340282366920938463463370714853213034477" + "inputs": ["340282366920938463463366760374006284435", "3212180291"], + "output": "340282366920938463463366760376193907667" }, - { "inputs": ["1823556552", "1823556556"], "output": "1823556556" }, - { "inputs": ["1823556556", "1823556556"], "output": "1823556556" }, - { "inputs": ["1823556556", "1823556552"], "output": "1823556556" } + { "inputs": ["3212180287", "3212180291"], "output": "3212180351" }, + { "inputs": ["3212180291", "3212180291"], "output": "3212180291" }, + { "inputs": ["3212180291", "3212180287"], "output": "3212180351" } ], "or_euint128_euint64": [ { - "inputs": ["340282366920938463463370949519145006273", "18439052795332501691"], - "output": "340282366920938463463372265437599364347" + "inputs": ["340282366920938463463372997255297253115", "18440417527967153359"], + "output": "340282366920938463463373419477561409279" }, - { - "inputs": ["18439052795332501687", "18439052795332501691"], - "output": "18439052795332501695" - }, - { - "inputs": ["18439052795332501691", "18439052795332501691"], - "output": "18439052795332501691" - }, - { - "inputs": ["18439052795332501691", "18439052795332501687"], - "output": "18439052795332501695" - } + { "inputs": ["18440417527967153355", "18440417527967153359"], "output": "18440417527967153359" }, + { "inputs": ["18440417527967153359", "18440417527967153359"], "output": "18440417527967153359" }, + { "inputs": ["18440417527967153359", "18440417527967153355"], "output": "18440417527967153359" } ], "or_euint128_euint128": [ { - "inputs": ["340282366920938463463367655063545859643", "340282366920938463463373469661379852713"], - "output": "340282366920938463463374605231434923963" + "inputs": ["340282366920938463463367973639886352277", "340282366920938463463373408562324333175"], + "output": "340282366920938463463373481239669272567" }, { - "inputs": ["340282366920938463463367655063545859639", "340282366920938463463367655063545859643"], - "output": "340282366920938463463367655063545859647" + "inputs": ["340282366920938463463367973639886352273", "340282366920938463463367973639886352277"], + "output": "340282366920938463463367973639886352277" }, { - "inputs": ["340282366920938463463367655063545859643", "340282366920938463463367655063545859643"], - "output": "340282366920938463463367655063545859643" + "inputs": ["340282366920938463463367973639886352277", "340282366920938463463367973639886352277"], + "output": "340282366920938463463367973639886352277" }, { - "inputs": ["340282366920938463463367655063545859643", "340282366920938463463367655063545859639"], - "output": "340282366920938463463367655063545859647" + "inputs": ["340282366920938463463367973639886352277", "340282366920938463463367973639886352273"], + "output": "340282366920938463463367973639886352277" } ], "or_euint128_uint128": [ { - "inputs": ["340282366920938463463367655063545859643", "340282366920938463463373853783183776929"], - "output": "340282366920938463463374430271410986683" + "inputs": ["340282366920938463463367973639886352277", "340282366920938463463372078426336895175"], + "output": "340282366920938463463374449084913922007" }, { - "inputs": ["340282366920938463463367655063545859639", "340282366920938463463367655063545859643"], - "output": "340282366920938463463367655063545859647" + "inputs": ["340282366920938463463367973639886352273", "340282366920938463463367973639886352277"], + "output": "340282366920938463463367973639886352277" }, { - "inputs": ["340282366920938463463367655063545859643", "340282366920938463463367655063545859643"], - "output": "340282366920938463463367655063545859643" + "inputs": ["340282366920938463463367973639886352277", "340282366920938463463367973639886352277"], + "output": "340282366920938463463367973639886352277" }, { - "inputs": ["340282366920938463463367655063545859643", "340282366920938463463367655063545859639"], - "output": "340282366920938463463367655063545859647" + "inputs": ["340282366920938463463367973639886352277", "340282366920938463463367973639886352273"], + "output": "340282366920938463463367973639886352277" } ], "or_uint128_euint128": [ { - "inputs": ["340282366920938463463370547981929977503", "340282366920938463463373853783183776929"], - "output": "340282366920938463463373996101960916671" + "inputs": ["340282366920938463463370869965119625787", "340282366920938463463372078426336895175"], + "output": "340282366920938463463372280776004319999" }, { - "inputs": ["340282366920938463463367655063545859639", "340282366920938463463367655063545859643"], - "output": "340282366920938463463367655063545859647" + "inputs": ["340282366920938463463367973639886352273", "340282366920938463463367973639886352277"], + "output": "340282366920938463463367973639886352277" }, { - "inputs": ["340282366920938463463367655063545859643", "340282366920938463463367655063545859643"], - "output": "340282366920938463463367655063545859643" + "inputs": ["340282366920938463463367973639886352277", "340282366920938463463367973639886352277"], + "output": "340282366920938463463367973639886352277" }, { - "inputs": ["340282366920938463463367655063545859643", "340282366920938463463367655063545859639"], - "output": "340282366920938463463367655063545859647" + "inputs": ["340282366920938463463367973639886352277", "340282366920938463463367973639886352273"], + "output": "340282366920938463463367973639886352277" } ], "or_euint128_euint256": [ { "inputs": [ - "340282366920938463463366429103695675815", - "115792089237316195423570985008687907853269984665640564039457583383018428109749" + "340282366920938463463370592793364741513", + "115792089237316195423570985008687907853269984665640564039457575365028110815269" ], - "output": "115792089237316195423570985008687907853269984665640564039457583999099276579767" + "output": "115792089237316195423570985008687907853269984665640564039457580067227697118637" }, { - "inputs": ["340282366920938463463366429103695675811", "340282366920938463463366429103695675815"], - "output": "340282366920938463463366429103695675815" + "inputs": ["340282366920938463463370592793364741509", "340282366920938463463370592793364741513"], + "output": "340282366920938463463370592793364741517" }, { - "inputs": ["340282366920938463463366429103695675815", "340282366920938463463366429103695675815"], - "output": "340282366920938463463366429103695675815" + "inputs": ["340282366920938463463370592793364741513", "340282366920938463463370592793364741513"], + "output": "340282366920938463463370592793364741513" }, { - "inputs": ["340282366920938463463366429103695675815", "340282366920938463463366429103695675811"], - "output": "340282366920938463463366429103695675815" + "inputs": ["340282366920938463463370592793364741513", "340282366920938463463370592793364741509"], + "output": "340282366920938463463370592793364741517" } ], - "or_euint256_euint4": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457579810763114124559", "14"], - "output": "115792089237316195423570985008687907853269984665640564039457579810763114124559" - }, - { "inputs": ["10", "14"], "output": "14" }, - { "inputs": ["14", "14"], "output": "14" }, - { "inputs": ["14", "10"], "output": "14" } - ], "or_euint256_euint8": [ { - "inputs": ["115792089237316195423570985008687907853269984665640564039457579600697842114421", "25"], - "output": "115792089237316195423570985008687907853269984665640564039457579600697842114429" + "inputs": ["115792089237316195423570985008687907853269984665640564039457579738555654455331", "241"], + "output": "115792089237316195423570985008687907853269984665640564039457579738555654455539" }, - { "inputs": ["21", "25"], "output": "29" }, - { "inputs": ["25", "25"], "output": "25" }, - { "inputs": ["25", "21"], "output": "29" } + { "inputs": ["237", "241"], "output": "253" }, + { "inputs": ["241", "241"], "output": "241" }, + { "inputs": ["241", "237"], "output": "253" } ], "or_euint256_euint16": [ { - "inputs": ["115792089237316195423570985008687907853269984665640564039457582624616109811381", "9754"], - "output": "115792089237316195423570985008687907853269984665640564039457582624616109811391" + "inputs": ["115792089237316195423570985008687907853269984665640564039457582400956106326175", "2467"], + "output": "115792089237316195423570985008687907853269984665640564039457582400956106328511" }, - { "inputs": ["9750", "9754"], "output": "9758" }, - { "inputs": ["9754", "9754"], "output": "9754" }, - { "inputs": ["9754", "9750"], "output": "9758" } + { "inputs": ["2463", "2467"], "output": "2495" }, + { "inputs": ["2467", "2467"], "output": "2467" }, + { "inputs": ["2467", "2463"], "output": "2495" } ], "or_euint256_euint32": [ { - "inputs": ["115792089237316195423570985008687907853269984665640564039457577374322978195673", "2490018786"], - "output": "115792089237316195423570985008687907853269984665640564039457577374323247328251" + "inputs": ["115792089237316195423570985008687907853269984665640564039457575166382437368667", "2756406099"], + "output": "115792089237316195423570985008687907853269984665640564039457575166382438050651" }, - { "inputs": ["2490018782", "2490018786"], "output": "2490018814" }, - { "inputs": ["2490018786", "2490018786"], "output": "2490018786" }, - { "inputs": ["2490018786", "2490018782"], "output": "2490018814" } + { "inputs": ["2756406095", "2756406099"], "output": "2756406111" }, + { "inputs": ["2756406099", "2756406099"], "output": "2756406099" }, + { "inputs": ["2756406099", "2756406095"], "output": "2756406111" } ], "or_euint256_euint64": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457575138878497255467", - "18441296418739792919" + "115792089237316195423570985008687907853269984665640564039457578301213693969761", + "18442298922648667695" ], - "output": "115792089237316195423570985008687907853269984665640564039457578657599316786239" - }, - { - "inputs": ["18441296418739792915", "18441296418739792919"], - "output": "18441296418739792919" - }, - { - "inputs": ["18441296418739792919", "18441296418739792919"], - "output": "18441296418739792919" + "output": "115792089237316195423570985008687907853269984665640564039457582809350954485615" }, - { - "inputs": ["18441296418739792919", "18441296418739792915"], - "output": "18441296418739792919" - } + { "inputs": ["18442298922648667691", "18442298922648667695"], "output": "18442298922648667695" }, + { "inputs": ["18442298922648667695", "18442298922648667695"], "output": "18442298922648667695" }, + { "inputs": ["18442298922648667695", "18442298922648667691"], "output": "18442298922648667695" } ], "or_euint256_euint128": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457581776378743047187", - "340282366920938463463373551062299472959" + "115792089237316195423570985008687907853269984665640564039457576313606965689143", + "340282366920938463463373716438933384693" ], - "output": "115792089237316195423570985008687907853269984665640564039457582951827808547903" + "output": "115792089237316195423570985008687907853269984665640564039457583163169279180791" }, { - "inputs": ["340282366920938463463373551062299472955", "340282366920938463463373551062299472959"], - "output": "340282366920938463463373551062299472959" + "inputs": ["340282366920938463463373716438933384689", "340282366920938463463373716438933384693"], + "output": "340282366920938463463373716438933384693" }, { - "inputs": ["340282366920938463463373551062299472959", "340282366920938463463373551062299472959"], - "output": "340282366920938463463373551062299472959" + "inputs": ["340282366920938463463373716438933384693", "340282366920938463463373716438933384693"], + "output": "340282366920938463463373716438933384693" }, { - "inputs": ["340282366920938463463373551062299472959", "340282366920938463463373551062299472955"], - "output": "340282366920938463463373551062299472959" + "inputs": ["340282366920938463463373716438933384693", "340282366920938463463373716438933384689"], + "output": "340282366920938463463373716438933384693" } ], "or_euint256_euint256": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579093390716184697", - "115792089237316195423570985008687907853269984665640564039457580393822758166581" + "115792089237316195423570985008687907853269984665640564039457575511418560546631", + "115792089237316195423570985008687907853269984665640564039457578871901605463825" ], - "output": "115792089237316195423570985008687907853269984665640564039457583914753535699069" + "output": "115792089237316195423570985008687907853269984665640564039457578889668045277015" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579093390716184693", - "115792089237316195423570985008687907853269984665640564039457579093390716184697" + "115792089237316195423570985008687907853269984665640564039457575511418560546627", + "115792089237316195423570985008687907853269984665640564039457575511418560546631" ], - "output": "115792089237316195423570985008687907853269984665640564039457579093390716184701" + "output": "115792089237316195423570985008687907853269984665640564039457575511418560546631" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579093390716184697", - "115792089237316195423570985008687907853269984665640564039457579093390716184697" + "115792089237316195423570985008687907853269984665640564039457575511418560546631", + "115792089237316195423570985008687907853269984665640564039457575511418560546631" ], - "output": "115792089237316195423570985008687907853269984665640564039457579093390716184697" + "output": "115792089237316195423570985008687907853269984665640564039457575511418560546631" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579093390716184697", - "115792089237316195423570985008687907853269984665640564039457579093390716184693" + "115792089237316195423570985008687907853269984665640564039457575511418560546631", + "115792089237316195423570985008687907853269984665640564039457575511418560546627" ], - "output": "115792089237316195423570985008687907853269984665640564039457579093390716184701" + "output": "115792089237316195423570985008687907853269984665640564039457575511418560546631" } ], "or_euint256_uint256": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579093390716184697", - "115792089237316195423570985008687907853269984665640564039457575617602160724601" + "115792089237316195423570985008687907853269984665640564039457575511418560546631", + "115792089237316195423570985008687907853269984665640564039457575694966830631815" ], - "output": "115792089237316195423570985008687907853269984665640564039457579147311516134009" + "output": "115792089237316195423570985008687907853269984665640564039457576117250750910407" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579093390716184693", - "115792089237316195423570985008687907853269984665640564039457579093390716184697" + "115792089237316195423570985008687907853269984665640564039457575511418560546627", + "115792089237316195423570985008687907853269984665640564039457575511418560546631" ], - "output": "115792089237316195423570985008687907853269984665640564039457579093390716184701" + "output": "115792089237316195423570985008687907853269984665640564039457575511418560546631" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579093390716184697", - "115792089237316195423570985008687907853269984665640564039457579093390716184697" + "115792089237316195423570985008687907853269984665640564039457575511418560546631", + "115792089237316195423570985008687907853269984665640564039457575511418560546631" ], - "output": "115792089237316195423570985008687907853269984665640564039457579093390716184697" + "output": "115792089237316195423570985008687907853269984665640564039457575511418560546631" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579093390716184697", - "115792089237316195423570985008687907853269984665640564039457579093390716184693" + "115792089237316195423570985008687907853269984665640564039457575511418560546631", + "115792089237316195423570985008687907853269984665640564039457575511418560546627" ], - "output": "115792089237316195423570985008687907853269984665640564039457579093390716184701" + "output": "115792089237316195423570985008687907853269984665640564039457575511418560546631" } ], "or_uint256_euint256": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457580060042571469423", - "115792089237316195423570985008687907853269984665640564039457575617602160724601" + "115792089237316195423570985008687907853269984665640564039457581607253803157155", + "115792089237316195423570985008687907853269984665640564039457575694966830631815" ], - "output": "115792089237316195423570985008687907853269984665640564039457580622993567439487" + "output": "115792089237316195423570985008687907853269984665640564039457581615375791935399" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579093390716184693", - "115792089237316195423570985008687907853269984665640564039457579093390716184697" + "115792089237316195423570985008687907853269984665640564039457575511418560546627", + "115792089237316195423570985008687907853269984665640564039457575511418560546631" ], - "output": "115792089237316195423570985008687907853269984665640564039457579093390716184701" + "output": "115792089237316195423570985008687907853269984665640564039457575511418560546631" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579093390716184697", - "115792089237316195423570985008687907853269984665640564039457579093390716184697" + "115792089237316195423570985008687907853269984665640564039457575511418560546631", + "115792089237316195423570985008687907853269984665640564039457575511418560546631" ], - "output": "115792089237316195423570985008687907853269984665640564039457579093390716184697" + "output": "115792089237316195423570985008687907853269984665640564039457575511418560546631" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579093390716184697", - "115792089237316195423570985008687907853269984665640564039457579093390716184693" + "115792089237316195423570985008687907853269984665640564039457575511418560546631", + "115792089237316195423570985008687907853269984665640564039457575511418560546627" ], - "output": "115792089237316195423570985008687907853269984665640564039457579093390716184701" + "output": "115792089237316195423570985008687907853269984665640564039457575511418560546631" } ], - "and_euint4_euint4": [ - { "inputs": ["14", "7"], "output": "6" }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "0" } - ], - "and_euint4_euint8": [ - { "inputs": ["10", "116"], "output": "0" }, - { "inputs": ["6", "10"], "output": "2" }, - { "inputs": ["10", "10"], "output": "10" }, - { "inputs": ["10", "6"], "output": "2" } - ], - "and_euint4_uint8": [ - { "inputs": ["10", "4"], "output": "0" }, - { "inputs": ["6", "10"], "output": "2" }, - { "inputs": ["10", "10"], "output": "10" }, - { "inputs": ["10", "6"], "output": "2" } - ], - "and_euint4_euint16": [ - { "inputs": ["3", "65312"], "output": "0" }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "0" } - ], - "and_euint4_euint32": [ - { "inputs": ["6", "3666388192"], "output": "0" }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "0" } - ], - "and_euint4_euint64": [ - { "inputs": ["6", "18438764365497303935"], "output": "6" }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "0" } - ], - "and_euint4_euint128": [ - { - "inputs": ["8", "340282366920938463463367802109078157213"], - "output": "8" - }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "0" } - ], - "and_euint4_euint256": [ - { - "inputs": ["3", "115792089237316195423570985008687907853269984665640564039457581650107790454269"], - "output": "1" - }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "0" } - ], - "and_euint8_euint4": [ - { "inputs": ["118", "5"], "output": "4" }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "0" } - ], - "and_uint8_euint4": [ - { "inputs": ["12", "5"], "output": "4" }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "0" } - ], "and_euint8_euint8": [ - { "inputs": ["183", "135"], "output": "135" }, - { "inputs": ["131", "135"], "output": "131" }, - { "inputs": ["135", "135"], "output": "135" }, - { "inputs": ["135", "131"], "output": "131" } + { "inputs": ["182", "207"], "output": "134" }, + { "inputs": ["178", "182"], "output": "178" }, + { "inputs": ["182", "182"], "output": "182" }, + { "inputs": ["182", "178"], "output": "178" } ], "and_euint8_uint8": [ - { "inputs": ["183", "70"], "output": "6" }, - { "inputs": ["131", "135"], "output": "131" }, - { "inputs": ["135", "135"], "output": "135" }, - { "inputs": ["135", "131"], "output": "131" } + { "inputs": ["182", "36"], "output": "36" }, + { "inputs": ["178", "182"], "output": "178" }, + { "inputs": ["182", "182"], "output": "182" }, + { "inputs": ["182", "178"], "output": "178" } ], "and_uint8_euint8": [ - { "inputs": ["146", "70"], "output": "2" }, - { "inputs": ["131", "135"], "output": "131" }, - { "inputs": ["135", "135"], "output": "135" }, - { "inputs": ["135", "131"], "output": "131" } + { "inputs": ["250", "36"], "output": "32" }, + { "inputs": ["178", "182"], "output": "178" }, + { "inputs": ["182", "182"], "output": "182" }, + { "inputs": ["182", "178"], "output": "178" } ], "and_euint8_euint16": [ - { "inputs": ["225", "29113"], "output": "161" }, - { "inputs": ["221", "225"], "output": "193" }, - { "inputs": ["225", "225"], "output": "225" }, - { "inputs": ["225", "221"], "output": "193" } + { "inputs": ["42", "1532"], "output": "40" }, + { "inputs": ["38", "42"], "output": "34" }, + { "inputs": ["42", "42"], "output": "42" }, + { "inputs": ["42", "38"], "output": "34" } ], "and_euint8_euint32": [ - { "inputs": ["114", "3684671928"], "output": "48" }, - { "inputs": ["110", "114"], "output": "98" }, - { "inputs": ["114", "114"], "output": "114" }, - { "inputs": ["114", "110"], "output": "98" } + { "inputs": ["227", "3104118975"], "output": "163" }, + { "inputs": ["223", "227"], "output": "195" }, + { "inputs": ["227", "227"], "output": "227" }, + { "inputs": ["227", "223"], "output": "195" } ], "and_euint8_euint64": [ - { "inputs": ["203", "18443868996555285517"], "output": "9" }, - { "inputs": ["199", "203"], "output": "195" }, - { "inputs": ["203", "203"], "output": "203" }, - { "inputs": ["203", "199"], "output": "195" } + { "inputs": ["204", "18446087437199200009"], "output": "8" }, + { "inputs": ["200", "204"], "output": "200" }, + { "inputs": ["204", "204"], "output": "204" }, + { "inputs": ["204", "200"], "output": "200" } ], "and_euint8_euint128": [ - { - "inputs": ["72", "340282366920938463463369134248162755643"], - "output": "8" - }, - { "inputs": ["68", "72"], "output": "64" }, - { "inputs": ["72", "72"], "output": "72" }, - { "inputs": ["72", "68"], "output": "64" } + { "inputs": ["155", "340282366920938463463368804304214082311"], "output": "3" }, + { "inputs": ["151", "155"], "output": "147" }, + { "inputs": ["155", "155"], "output": "155" }, + { "inputs": ["155", "151"], "output": "147" } ], "and_euint8_euint256": [ { - "inputs": ["180", "115792089237316195423570985008687907853269984665640564039457579349353950071771"], - "output": "144" + "inputs": ["42", "115792089237316195423570985008687907853269984665640564039457577651272650989457"], + "output": "0" }, - { "inputs": ["176", "180"], "output": "176" }, - { "inputs": ["180", "180"], "output": "180" }, - { "inputs": ["180", "176"], "output": "176" } - ], - "and_euint16_euint4": [ - { "inputs": ["57634", "7"], "output": "2" }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "0" } + { "inputs": ["38", "42"], "output": "34" }, + { "inputs": ["42", "42"], "output": "42" }, + { "inputs": ["42", "38"], "output": "34" } ], "and_euint16_euint8": [ - { "inputs": ["41347", "138"], "output": "130" }, - { "inputs": ["134", "138"], "output": "130" }, - { "inputs": ["138", "138"], "output": "138" }, - { "inputs": ["138", "134"], "output": "130" } + { "inputs": ["54056", "78"], "output": "8" }, + { "inputs": ["74", "78"], "output": "74" }, + { "inputs": ["78", "78"], "output": "78" }, + { "inputs": ["78", "74"], "output": "74" } ], "and_euint16_euint16": [ - { "inputs": ["25969", "38750"], "output": "1360" }, - { "inputs": ["25965", "25969"], "output": "25953" }, - { "inputs": ["25969", "25969"], "output": "25969" }, - { "inputs": ["25969", "25965"], "output": "25953" } + { "inputs": ["51553", "6608"], "output": "2368" }, + { "inputs": ["6604", "6608"], "output": "6592" }, + { "inputs": ["6608", "6608"], "output": "6608" }, + { "inputs": ["6608", "6604"], "output": "6592" } ], "and_euint16_uint16": [ - { "inputs": ["25969", "39616"], "output": "64" }, - { "inputs": ["25965", "25969"], "output": "25953" }, - { "inputs": ["25969", "25969"], "output": "25969" }, - { "inputs": ["25969", "25965"], "output": "25953" } + { "inputs": ["51553", "37836"], "output": "33088" }, + { "inputs": ["6604", "6608"], "output": "6592" }, + { "inputs": ["6608", "6608"], "output": "6608" }, + { "inputs": ["6608", "6604"], "output": "6592" } ], "and_uint16_euint16": [ - { "inputs": ["12551", "39616"], "output": "4096" }, - { "inputs": ["25965", "25969"], "output": "25953" }, - { "inputs": ["25969", "25969"], "output": "25969" }, - { "inputs": ["25969", "25965"], "output": "25953" } + { "inputs": ["50633", "37836"], "output": "33224" }, + { "inputs": ["6604", "6608"], "output": "6592" }, + { "inputs": ["6608", "6608"], "output": "6608" }, + { "inputs": ["6608", "6604"], "output": "6592" } ], "and_euint16_euint32": [ - { "inputs": ["10444", "4022047212"], "output": "204" }, - { "inputs": ["10440", "10444"], "output": "10440" }, - { "inputs": ["10444", "10444"], "output": "10444" }, - { "inputs": ["10444", "10440"], "output": "10440" } + { "inputs": ["22607", "4099102931"], "output": "22595" }, + { "inputs": ["22603", "22607"], "output": "22603" }, + { "inputs": ["22607", "22607"], "output": "22607" }, + { "inputs": ["22607", "22603"], "output": "22603" } ], "and_euint16_euint64": [ - { "inputs": ["46498", "18443921867836499841"], "output": "9600" }, - { "inputs": ["46494", "46498"], "output": "46466" }, - { "inputs": ["46498", "46498"], "output": "46498" }, - { "inputs": ["46498", "46494"], "output": "46466" } + { "inputs": ["64951", "18440364349971397123"], "output": "30723" }, + { "inputs": ["64947", "64951"], "output": "64947" }, + { "inputs": ["64951", "64951"], "output": "64951" }, + { "inputs": ["64951", "64947"], "output": "64947" } ], "and_euint16_euint128": [ - { - "inputs": ["10041", "340282366920938463463370138658990657653"], - "output": "49" - }, - { "inputs": ["10037", "10041"], "output": "10033" }, - { "inputs": ["10041", "10041"], "output": "10041" }, - { "inputs": ["10041", "10037"], "output": "10033" } + { "inputs": ["37759", "340282366920938463463367553221714545659"], "output": "33659" }, + { "inputs": ["37755", "37759"], "output": "37755" }, + { "inputs": ["37759", "37759"], "output": "37759" }, + { "inputs": ["37759", "37755"], "output": "37755" } ], "and_euint16_euint256": [ { - "inputs": ["12579", "115792089237316195423570985008687907853269984665640564039457582458858424079051"], - "output": "4099" + "inputs": ["47702", "115792089237316195423570985008687907853269984665640564039457577392266346754851"], + "output": "45570" }, - { "inputs": ["12575", "12579"], "output": "12547" }, - { "inputs": ["12579", "12579"], "output": "12579" }, - { "inputs": ["12579", "12575"], "output": "12547" } - ], - "and_euint32_euint4": [ - { "inputs": ["3337809992", "2"], "output": "0" }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "0" } + { "inputs": ["47698", "47702"], "output": "47698" }, + { "inputs": ["47702", "47702"], "output": "47702" }, + { "inputs": ["47702", "47698"], "output": "47698" } ], "and_euint32_euint8": [ - { "inputs": ["2846739700", "34"], "output": "32" }, - { "inputs": ["30", "34"], "output": "2" }, - { "inputs": ["34", "34"], "output": "34" }, - { "inputs": ["34", "30"], "output": "2" } + { "inputs": ["2651840207", "124"], "output": "76" }, + { "inputs": ["120", "124"], "output": "120" }, + { "inputs": ["124", "124"], "output": "124" }, + { "inputs": ["124", "120"], "output": "120" } ], "and_euint32_euint16": [ - { "inputs": ["1681139161", "6880"], "output": "192" }, - { "inputs": ["6876", "6880"], "output": "6848" }, - { "inputs": ["6880", "6880"], "output": "6880" }, - { "inputs": ["6880", "6876"], "output": "6848" } + { "inputs": ["3078519461", "62005"], "output": "29221" }, + { "inputs": ["62001", "62005"], "output": "62001" }, + { "inputs": ["62005", "62005"], "output": "62005" }, + { "inputs": ["62005", "62001"], "output": "62001" } ], "and_euint32_euint32": [ - { "inputs": ["3317288822", "1342588191"], "output": "1073759510" }, - { "inputs": ["1342588187", "1342588191"], "output": "1342588187" }, - { "inputs": ["1342588191", "1342588191"], "output": "1342588191" }, - { "inputs": ["1342588191", "1342588187"], "output": "1342588187" } + { "inputs": ["1959308387", "1176503682"], "output": "1140851714" }, + { "inputs": ["1176503678", "1176503682"], "output": "1176503554" }, + { "inputs": ["1176503682", "1176503682"], "output": "1176503682" }, + { "inputs": ["1176503682", "1176503678"], "output": "1176503554" } ], "and_euint32_uint32": [ - { "inputs": ["3317288822", "510484248"], "output": "69816080" }, - { "inputs": ["1342588187", "1342588191"], "output": "1342588187" }, - { "inputs": ["1342588191", "1342588191"], "output": "1342588191" }, - { "inputs": ["1342588191", "1342588187"], "output": "1342588187" } + { "inputs": ["1959308387", "1269006579"], "output": "1082163299" }, + { "inputs": ["1176503678", "1176503682"], "output": "1176503554" }, + { "inputs": ["1176503682", "1176503682"], "output": "1176503682" }, + { "inputs": ["1176503682", "1176503678"], "output": "1176503554" } ], "and_uint32_euint32": [ - { "inputs": ["3731064608", "510484248"], "output": "509675264" }, - { "inputs": ["1342588187", "1342588191"], "output": "1342588187" }, - { "inputs": ["1342588191", "1342588191"], "output": "1342588191" }, - { "inputs": ["1342588191", "1342588187"], "output": "1342588187" } + { "inputs": ["1988477686", "1269006579"], "output": "1115783410" }, + { "inputs": ["1176503678", "1176503682"], "output": "1176503554" }, + { "inputs": ["1176503682", "1176503682"], "output": "1176503682" }, + { "inputs": ["1176503682", "1176503678"], "output": "1176503554" } ], "and_euint32_euint64": [ - { - "inputs": ["1745478480", "18442616126135451977"], - "output": "1208074560" - }, - { "inputs": ["1745478476", "1745478480"], "output": "1745478464" }, - { "inputs": ["1745478480", "1745478480"], "output": "1745478480" }, - { "inputs": ["1745478480", "1745478476"], "output": "1745478464" } + { "inputs": ["1678538930", "18441748142385928443"], "output": "6322" }, + { "inputs": ["1678538926", "1678538930"], "output": "1678538914" }, + { "inputs": ["1678538930", "1678538930"], "output": "1678538930" }, + { "inputs": ["1678538930", "1678538926"], "output": "1678538914" } ], "and_euint32_euint128": [ - { - "inputs": ["2659354872", "340282366920938463463373182215335994821"], - "output": "2424307904" - }, - { "inputs": ["2659354868", "2659354872"], "output": "2659354864" }, - { "inputs": ["2659354872", "2659354872"], "output": "2659354872" }, - { "inputs": ["2659354872", "2659354868"], "output": "2659354864" } + { "inputs": ["2622851861", "340282366920938463463366361910586667207"], "output": "2622750725" }, + { "inputs": ["2622851857", "2622851861"], "output": "2622851857" }, + { "inputs": ["2622851861", "2622851861"], "output": "2622851861" }, + { "inputs": ["2622851861", "2622851857"], "output": "2622851857" } ], "and_euint32_euint256": [ { - "inputs": ["3994882895", "115792089237316195423570985008687907853269984665640564039457577397354470817443"], - "output": "1310528003" + "inputs": ["4122902264", "115792089237316195423570985008687907853269984665640564039457578681562623480967"], + "output": "1612715136" }, - { "inputs": ["3994882891", "3994882895"], "output": "3994882891" }, - { "inputs": ["3994882895", "3994882895"], "output": "3994882895" }, - { "inputs": ["3994882895", "3994882891"], "output": "3994882891" } - ], - "and_euint64_euint4": [ - { "inputs": ["18438614995227733505", "14"], "output": "0" }, - { "inputs": ["10", "14"], "output": "10" }, - { "inputs": ["14", "14"], "output": "14" }, - { "inputs": ["14", "10"], "output": "10" } + { "inputs": ["4122902260", "4122902264"], "output": "4122902256" }, + { "inputs": ["4122902264", "4122902264"], "output": "4122902264" }, + { "inputs": ["4122902264", "4122902260"], "output": "4122902256" } ], "and_euint64_euint8": [ - { "inputs": ["18443952274371967793", "221"], "output": "17" }, - { "inputs": ["217", "221"], "output": "217" }, - { "inputs": ["221", "221"], "output": "221" }, - { "inputs": ["221", "217"], "output": "217" } + { "inputs": ["18445336448958163829", "80"], "output": "80" }, + { "inputs": ["76", "80"], "output": "64" }, + { "inputs": ["80", "80"], "output": "80" }, + { "inputs": ["80", "76"], "output": "64" } ], "and_euint64_euint16": [ - { "inputs": ["18443322659758757933", "48184"], "output": "6184" }, - { "inputs": ["48180", "48184"], "output": "48176" }, - { "inputs": ["48184", "48184"], "output": "48184" }, - { "inputs": ["48184", "48180"], "output": "48176" } + { "inputs": ["18443558097291537231", "58032"], "output": "25088" }, + { "inputs": ["58028", "58032"], "output": "58016" }, + { "inputs": ["58032", "58032"], "output": "58032" }, + { "inputs": ["58032", "58028"], "output": "58016" } ], "and_euint64_euint32": [ - { "inputs": ["18439406521573141853", "840706883"], "output": "33564993" }, - { "inputs": ["840706879", "840706883"], "output": "840706819" }, - { "inputs": ["840706883", "840706883"], "output": "840706883" }, - { "inputs": ["840706883", "840706879"], "output": "840706819" } + { "inputs": ["18440439597562633705", "3219301923"], "output": "2193654817" }, + { "inputs": ["3219301919", "3219301923"], "output": "3219301891" }, + { "inputs": ["3219301923", "3219301923"], "output": "3219301923" }, + { "inputs": ["3219301923", "3219301919"], "output": "3219301891" } ], "and_euint64_euint64": [ - { - "inputs": ["18444124970074897317", "18442657213736743287"], - "output": "18442294351260348709" - }, - { - "inputs": ["18442657213736743283", "18442657213736743287"], - "output": "18442657213736743283" - }, - { - "inputs": ["18442657213736743287", "18442657213736743287"], - "output": "18442657213736743287" - }, - { - "inputs": ["18442657213736743287", "18442657213736743283"], - "output": "18442657213736743283" - } + { "inputs": ["18443152712699204701", "18441578468539377377"], "output": "18438059753226634305" }, + { "inputs": ["18441578468539377373", "18441578468539377377"], "output": "18441578468539377345" }, + { "inputs": ["18441578468539377377", "18441578468539377377"], "output": "18441578468539377377" }, + { "inputs": ["18441578468539377377", "18441578468539377373"], "output": "18441578468539377345" } ], "and_euint64_uint64": [ - { - "inputs": ["18444124970074897317", "18444452212053822561"], - "output": "18444089373216524321" - }, - { - "inputs": ["18442657213736743283", "18442657213736743287"], - "output": "18442657213736743283" - }, - { - "inputs": ["18442657213736743287", "18442657213736743287"], - "output": "18442657213736743287" - }, - { - "inputs": ["18442657213736743287", "18442657213736743283"], - "output": "18442657213736743283" - } + { "inputs": ["18443152712699204701", "18440874291885668569"], "output": "18438622136105062489" }, + { "inputs": ["18441578468539377373", "18441578468539377377"], "output": "18441578468539377345" }, + { "inputs": ["18441578468539377377", "18441578468539377377"], "output": "18441578468539377377" }, + { "inputs": ["18441578468539377377", "18441578468539377373"], "output": "18441578468539377345" } ], "and_uint64_euint64": [ - { - "inputs": ["18445812436048048525", "18444452212053822561"], - "output": "18443525253958221825" - }, - { - "inputs": ["18442657213736743283", "18442657213736743287"], - "output": "18442657213736743283" - }, - { - "inputs": ["18442657213736743287", "18442657213736743287"], - "output": "18442657213736743287" - }, - { - "inputs": ["18442657213736743287", "18442657213736743283"], - "output": "18442657213736743283" - } + { "inputs": ["18441440491717389785", "18440874291885668569"], "output": "18440305756727175385" }, + { "inputs": ["18441578468539377373", "18441578468539377377"], "output": "18441578468539377345" }, + { "inputs": ["18441578468539377377", "18441578468539377377"], "output": "18441578468539377377" }, + { "inputs": ["18441578468539377377", "18441578468539377373"], "output": "18441578468539377345" } ], "and_euint64_euint128": [ - { - "inputs": ["18438964653643998977", "340282366920938463463371580179294281733"], - "output": "18438894284827860993" - }, - { - "inputs": ["18438964653643998973", "18438964653643998977"], - "output": "18438964653643998721" - }, - { - "inputs": ["18438964653643998977", "18438964653643998977"], - "output": "18438964653643998977" - }, - { - "inputs": ["18438964653643998977", "18438964653643998973"], - "output": "18438964653643998721" - } + { "inputs": ["18438387467653828847", "340282366920938463463374174020748711189"], "output": "18438376309186105349" }, + { "inputs": ["18438387467653828843", "18438387467653828847"], "output": "18438387467653828843" }, + { "inputs": ["18438387467653828847", "18438387467653828847"], "output": "18438387467653828847" }, + { "inputs": ["18438387467653828847", "18438387467653828843"], "output": "18438387467653828843" } ], "and_euint64_euint256": [ { "inputs": [ - "18443960605514453875", - "115792089237316195423570985008687907853269984665640564039457575145704576396421" + "18441364737258412591", + "115792089237316195423570985008687907853269984665640564039457579211948514379883" ], - "output": "18437737227820728321" - }, - { - "inputs": ["18443960605514453871", "18443960605514453875"], - "output": "18443960605514453859" - }, - { - "inputs": ["18443960605514453875", "18443960605514453875"], - "output": "18443960605514453875" + "output": "18441363064348510251" }, - { - "inputs": ["18443960605514453875", "18443960605514453871"], - "output": "18443960605514453859" - } - ], - "and_euint128_euint4": [ - { - "inputs": ["340282366920938463463372547368360839357", "10"], - "output": "8" - }, - { "inputs": ["6", "10"], "output": "2" }, - { "inputs": ["10", "10"], "output": "10" }, - { "inputs": ["10", "6"], "output": "2" } + { "inputs": ["18441364737258412587", "18441364737258412591"], "output": "18441364737258412587" }, + { "inputs": ["18441364737258412591", "18441364737258412591"], "output": "18441364737258412591" }, + { "inputs": ["18441364737258412591", "18441364737258412587"], "output": "18441364737258412587" } ], "and_euint128_euint8": [ - { - "inputs": ["340282366920938463463366313789187731763", "114"], - "output": "50" - }, - { "inputs": ["110", "114"], "output": "98" }, - { "inputs": ["114", "114"], "output": "114" }, - { "inputs": ["114", "110"], "output": "98" } + { "inputs": ["340282366920938463463365867564260229031", "217"], "output": "129" }, + { "inputs": ["213", "217"], "output": "209" }, + { "inputs": ["217", "217"], "output": "217" }, + { "inputs": ["217", "213"], "output": "209" } ], "and_euint128_euint16": [ - { - "inputs": ["340282366920938463463371274545487982339", "11460"], - "output": "11264" - }, - { "inputs": ["11456", "11460"], "output": "11456" }, - { "inputs": ["11460", "11460"], "output": "11460" }, - { "inputs": ["11460", "11456"], "output": "11456" } + { "inputs": ["340282366920938463463365765641210095213", "31262"], "output": "25100" }, + { "inputs": ["31258", "31262"], "output": "31258" }, + { "inputs": ["31262", "31262"], "output": "31262" }, + { "inputs": ["31262", "31258"], "output": "31258" } ], "and_euint128_euint32": [ - { - "inputs": ["340282366920938463463372796408614652419", "1038177724"], - "output": "272629760" - }, - { "inputs": ["1038177720", "1038177724"], "output": "1038177720" }, - { "inputs": ["1038177724", "1038177724"], "output": "1038177724" }, - { "inputs": ["1038177724", "1038177720"], "output": "1038177720" } + { "inputs": ["340282366920938463463371305899922622607", "1492469506"], "output": "270598146" }, + { "inputs": ["1492469502", "1492469506"], "output": "1492469250" }, + { "inputs": ["1492469506", "1492469506"], "output": "1492469506" }, + { "inputs": ["1492469506", "1492469502"], "output": "1492469250" } ], "and_euint128_euint64": [ - { - "inputs": ["340282366920938463463368706571541146173", "18442558600081086197"], - "output": "18438019519441568309" - }, - { - "inputs": ["18442558600081086193", "18442558600081086197"], - "output": "18442558600081086193" - }, - { - "inputs": ["18442558600081086197", "18442558600081086197"], - "output": "18442558600081086197" - }, - { - "inputs": ["18442558600081086197", "18442558600081086193"], - "output": "18442558600081086193" - } + { "inputs": ["340282366920938463463368247036920545449", "18446508001815775137"], "output": "18440306712975065249" }, + { "inputs": ["18446508001815775133", "18446508001815775137"], "output": "18446508001815775105" }, + { "inputs": ["18446508001815775137", "18446508001815775137"], "output": "18446508001815775137" }, + { "inputs": ["18446508001815775137", "18446508001815775133"], "output": "18446508001815775105" } ], "and_euint128_euint128": [ { - "inputs": ["340282366920938463463365754576278416105", "340282366920938463463366665489173165177"], - "output": "340282366920938463463365750145734418537" + "inputs": ["340282366920938463463369745046443089155", "340282366920938463463366676813923717833"], + "output": "340282366920938463463366322771112431617" }, { - "inputs": ["340282366920938463463365754576278416101", "340282366920938463463365754576278416105"], - "output": "340282366920938463463365754576278416097" + "inputs": ["340282366920938463463366676813923717829", "340282366920938463463366676813923717833"], + "output": "340282366920938463463366676813923717825" }, { - "inputs": ["340282366920938463463365754576278416105", "340282366920938463463365754576278416105"], - "output": "340282366920938463463365754576278416105" + "inputs": ["340282366920938463463366676813923717833", "340282366920938463463366676813923717833"], + "output": "340282366920938463463366676813923717833" }, { - "inputs": ["340282366920938463463365754576278416105", "340282366920938463463365754576278416101"], - "output": "340282366920938463463365754576278416097" + "inputs": ["340282366920938463463366676813923717833", "340282366920938463463366676813923717829"], + "output": "340282366920938463463366676813923717825" } ], "and_euint128_uint128": [ { - "inputs": ["340282366920938463463365754576278416105", "340282366920938463463366410191459861233"], - "output": "340282366920938463463365741001161851617" + "inputs": ["340282366920938463463369745046443089155", "340282366920938463463372913593993655583"], + "output": "340282366920938463463368055607890498819" }, { - "inputs": ["340282366920938463463365754576278416101", "340282366920938463463365754576278416105"], - "output": "340282366920938463463365754576278416097" + "inputs": ["340282366920938463463366676813923717829", "340282366920938463463366676813923717833"], + "output": "340282366920938463463366676813923717825" }, { - "inputs": ["340282366920938463463365754576278416105", "340282366920938463463365754576278416105"], - "output": "340282366920938463463365754576278416105" + "inputs": ["340282366920938463463366676813923717833", "340282366920938463463366676813923717833"], + "output": "340282366920938463463366676813923717833" }, { - "inputs": ["340282366920938463463365754576278416105", "340282366920938463463365754576278416101"], - "output": "340282366920938463463365754576278416097" + "inputs": ["340282366920938463463366676813923717833", "340282366920938463463366676813923717829"], + "output": "340282366920938463463366676813923717825" } ], "and_uint128_euint128": [ { - "inputs": ["340282366920938463463371836375477224759", "340282366920938463463366410191459861233"], - "output": "340282366920938463463366199075542663217" + "inputs": ["340282366920938463463368707751448688247", "340282366920938463463372913593993655583"], + "output": "340282366920938463463368144797162288151" }, { - "inputs": ["340282366920938463463365754576278416101", "340282366920938463463365754576278416105"], - "output": "340282366920938463463365754576278416097" + "inputs": ["340282366920938463463366676813923717829", "340282366920938463463366676813923717833"], + "output": "340282366920938463463366676813923717825" }, { - "inputs": ["340282366920938463463365754576278416105", "340282366920938463463365754576278416105"], - "output": "340282366920938463463365754576278416105" + "inputs": ["340282366920938463463366676813923717833", "340282366920938463463366676813923717833"], + "output": "340282366920938463463366676813923717833" }, { - "inputs": ["340282366920938463463365754576278416105", "340282366920938463463365754576278416101"], - "output": "340282366920938463463365754576278416097" + "inputs": ["340282366920938463463366676813923717833", "340282366920938463463366676813923717829"], + "output": "340282366920938463463366676813923717825" } ], "and_euint128_euint256": [ { "inputs": [ - "340282366920938463463366718158519885511", - "115792089237316195423570985008687907853269984665640564039457581748247155679323" + "340282366920938463463370491370380892517", + "115792089237316195423570985008687907853269984665640564039457575544061447121739" ], - "output": "340282366920938463463366717989234606147" + "output": "340282366920938463463365987409974004033" }, { - "inputs": ["340282366920938463463366718158519885507", "340282366920938463463366718158519885511"], - "output": "340282366920938463463366718158519885507" + "inputs": ["340282366920938463463370491370380892513", "340282366920938463463370491370380892517"], + "output": "340282366920938463463370491370380892513" }, { - "inputs": ["340282366920938463463366718158519885511", "340282366920938463463366718158519885511"], - "output": "340282366920938463463366718158519885511" + "inputs": ["340282366920938463463370491370380892517", "340282366920938463463370491370380892517"], + "output": "340282366920938463463370491370380892517" }, { - "inputs": ["340282366920938463463366718158519885511", "340282366920938463463366718158519885507"], - "output": "340282366920938463463366718158519885507" + "inputs": ["340282366920938463463370491370380892517", "340282366920938463463370491370380892513"], + "output": "340282366920938463463370491370380892513" } ], - "and_euint256_euint4": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457579364828919798977", "5"], - "output": "1" - }, - { "inputs": ["4", "8"], "output": "0" }, - { "inputs": ["8", "8"], "output": "8" }, - { "inputs": ["8", "4"], "output": "0" } - ], "and_euint256_euint8": [ { - "inputs": ["115792089237316195423570985008687907853269984665640564039457580200311934752389", "160"], - "output": "128" + "inputs": ["115792089237316195423570985008687907853269984665640564039457578847515196383383", "122"], + "output": "18" }, - { "inputs": ["156", "160"], "output": "128" }, - { "inputs": ["160", "160"], "output": "160" }, - { "inputs": ["160", "156"], "output": "128" } + { "inputs": ["118", "122"], "output": "114" }, + { "inputs": ["122", "122"], "output": "122" }, + { "inputs": ["122", "118"], "output": "114" } ], "and_euint256_euint16": [ { - "inputs": ["115792089237316195423570985008687907853269984665640564039457581238581042328907", "21842"], - "output": "5442" + "inputs": ["115792089237316195423570985008687907853269984665640564039457578959040980212179", "3719"], + "output": "2179" }, - { "inputs": ["21838", "21842"], "output": "21826" }, - { "inputs": ["21842", "21842"], "output": "21842" }, - { "inputs": ["21842", "21838"], "output": "21826" } + { "inputs": ["3715", "3719"], "output": "3715" }, + { "inputs": ["3719", "3719"], "output": "3719" }, + { "inputs": ["3719", "3715"], "output": "3715" } ], "and_euint256_euint32": [ { - "inputs": ["115792089237316195423570985008687907853269984665640564039457579114687562092581", "2312861009"], - "output": "1642497" + "inputs": ["115792089237316195423570985008687907853269984665640564039457581410539728684543", "1908843924"], + "output": "1627784596" }, - { "inputs": ["2312861005", "2312861009"], "output": "2312860993" }, - { "inputs": ["2312861009", "2312861009"], "output": "2312861009" }, - { "inputs": ["2312861009", "2312861005"], "output": "2312860993" } + { "inputs": ["1908843920", "1908843924"], "output": "1908843920" }, + { "inputs": ["1908843924", "1908843924"], "output": "1908843924" }, + { "inputs": ["1908843924", "1908843920"], "output": "1908843920" } ], "and_euint256_euint64": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457578396814970518645", - "18439393076952901085" + "115792089237316195423570985008687907853269984665640564039457578968135921984651", + "18438736803094316955" ], - "output": "18438862826454918229" - }, - { - "inputs": ["18439393076952901081", "18439393076952901085"], - "output": "18439393076952901081" + "output": "18438308929827652747" }, - { - "inputs": ["18439393076952901085", "18439393076952901085"], - "output": "18439393076952901085" - }, - { - "inputs": ["18439393076952901085", "18439393076952901081"], - "output": "18439393076952901081" - } + { "inputs": ["18438736803094316951", "18438736803094316955"], "output": "18438736803094316947" }, + { "inputs": ["18438736803094316955", "18438736803094316955"], "output": "18438736803094316955" }, + { "inputs": ["18438736803094316955", "18438736803094316951"], "output": "18438736803094316947" } ], "and_euint256_euint128": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457582929951159672455", - "340282366920938463463365847322826293787" + "115792089237316195423570985008687907853269984665640564039457581909581796035357", + "340282366920938463463371993104961863275" ], - "output": "340282366920938463463365636070292242947" + "output": "340282366920938463463370246768822405641" }, { - "inputs": ["340282366920938463463365847322826293783", "340282366920938463463365847322826293787"], - "output": "340282366920938463463365847322826293779" + "inputs": ["340282366920938463463371993104961863271", "340282366920938463463371993104961863275"], + "output": "340282366920938463463371993104961863267" }, { - "inputs": ["340282366920938463463365847322826293787", "340282366920938463463365847322826293787"], - "output": "340282366920938463463365847322826293787" + "inputs": ["340282366920938463463371993104961863275", "340282366920938463463371993104961863275"], + "output": "340282366920938463463371993104961863275" }, { - "inputs": ["340282366920938463463365847322826293787", "340282366920938463463365847322826293783"], - "output": "340282366920938463463365847322826293779" + "inputs": ["340282366920938463463371993104961863275", "340282366920938463463371993104961863271"], + "output": "340282366920938463463371993104961863267" } ], "and_euint256_euint256": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457580473854578773963", - "115792089237316195423570985008687907853269984665640564039457579064265044491325" + "115792089237316195423570985008687907853269984665640564039457580013471136059815", + "115792089237316195423570985008687907853269984665640564039457582488161429300931" ], - "output": "115792089237316195423570985008687907853269984665640564039457575671150140541961" + "output": "115792089237316195423570985008687907853269984665640564039457579654960482680963" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579064265044491321", - "115792089237316195423570985008687907853269984665640564039457579064265044491325" + "115792089237316195423570985008687907853269984665640564039457580013471136059811", + "115792089237316195423570985008687907853269984665640564039457580013471136059815" ], - "output": "115792089237316195423570985008687907853269984665640564039457579064265044491321" + "output": "115792089237316195423570985008687907853269984665640564039457580013471136059811" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579064265044491325", - "115792089237316195423570985008687907853269984665640564039457579064265044491325" + "115792089237316195423570985008687907853269984665640564039457580013471136059815", + "115792089237316195423570985008687907853269984665640564039457580013471136059815" ], - "output": "115792089237316195423570985008687907853269984665640564039457579064265044491325" + "output": "115792089237316195423570985008687907853269984665640564039457580013471136059815" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579064265044491325", - "115792089237316195423570985008687907853269984665640564039457579064265044491321" + "115792089237316195423570985008687907853269984665640564039457580013471136059815", + "115792089237316195423570985008687907853269984665640564039457580013471136059811" ], - "output": "115792089237316195423570985008687907853269984665640564039457579064265044491321" + "output": "115792089237316195423570985008687907853269984665640564039457580013471136059811" } ], "and_euint256_uint256": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457580473854578773963", - "115792089237316195423570985008687907853269984665640564039457581816489991853517" + "115792089237316195423570985008687907853269984665640564039457580013471136059815", + "115792089237316195423570985008687907853269984665640564039457580818662615118501" ], - "output": "115792089237316195423570985008687907853269984665640564039457579557951374476745" + "output": "115792089237316195423570985008687907853269984665640564039457579657146690244773" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579064265044491321", - "115792089237316195423570985008687907853269984665640564039457579064265044491325" + "115792089237316195423570985008687907853269984665640564039457580013471136059811", + "115792089237316195423570985008687907853269984665640564039457580013471136059815" ], - "output": "115792089237316195423570985008687907853269984665640564039457579064265044491321" + "output": "115792089237316195423570985008687907853269984665640564039457580013471136059811" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579064265044491325", - "115792089237316195423570985008687907853269984665640564039457579064265044491325" + "115792089237316195423570985008687907853269984665640564039457580013471136059815", + "115792089237316195423570985008687907853269984665640564039457580013471136059815" ], - "output": "115792089237316195423570985008687907853269984665640564039457579064265044491325" + "output": "115792089237316195423570985008687907853269984665640564039457580013471136059815" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579064265044491325", - "115792089237316195423570985008687907853269984665640564039457579064265044491321" + "115792089237316195423570985008687907853269984665640564039457580013471136059815", + "115792089237316195423570985008687907853269984665640564039457580013471136059811" ], - "output": "115792089237316195423570985008687907853269984665640564039457579064265044491321" + "output": "115792089237316195423570985008687907853269984665640564039457580013471136059811" } ], "and_uint256_euint256": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457576516611416206839", - "115792089237316195423570985008687907853269984665640564039457581816489991853517" + "115792089237316195423570985008687907853269984665640564039457576603363054084755", + "115792089237316195423570985008687907853269984665640564039457580818662615118501" ], - "output": "115792089237316195423570985008687907853269984665640564039457575038788798842309" + "output": "115792089237316195423570985008687907853269984665640564039457576303637687329409" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579064265044491321", - "115792089237316195423570985008687907853269984665640564039457579064265044491325" + "115792089237316195423570985008687907853269984665640564039457580013471136059811", + "115792089237316195423570985008687907853269984665640564039457580013471136059815" ], - "output": "115792089237316195423570985008687907853269984665640564039457579064265044491321" + "output": "115792089237316195423570985008687907853269984665640564039457580013471136059811" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579064265044491325", - "115792089237316195423570985008687907853269984665640564039457579064265044491325" + "115792089237316195423570985008687907853269984665640564039457580013471136059815", + "115792089237316195423570985008687907853269984665640564039457580013471136059815" ], - "output": "115792089237316195423570985008687907853269984665640564039457579064265044491325" + "output": "115792089237316195423570985008687907853269984665640564039457580013471136059815" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579064265044491325", - "115792089237316195423570985008687907853269984665640564039457579064265044491321" + "115792089237316195423570985008687907853269984665640564039457580013471136059815", + "115792089237316195423570985008687907853269984665640564039457580013471136059811" ], - "output": "115792089237316195423570985008687907853269984665640564039457579064265044491321" + "output": "115792089237316195423570985008687907853269984665640564039457580013471136059811" } ], - "xor_euint4_euint4": [ - { "inputs": ["9", "4"], "output": "13" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "12" } - ], - "xor_euint4_euint8": [ - { "inputs": ["10", "103"], "output": "109" }, - { "inputs": ["6", "10"], "output": "12" }, - { "inputs": ["10", "10"], "output": "0" }, - { "inputs": ["10", "6"], "output": "12" } - ], - "xor_euint4_uint8": [ - { "inputs": ["10", "12"], "output": "6" }, - { "inputs": ["6", "10"], "output": "12" }, - { "inputs": ["10", "10"], "output": "0" }, - { "inputs": ["10", "6"], "output": "12" } - ], - "xor_euint4_euint16": [ - { "inputs": ["14", "11463"], "output": "11465" }, - { "inputs": ["10", "14"], "output": "4" }, - { "inputs": ["14", "14"], "output": "0" }, - { "inputs": ["14", "10"], "output": "4" } - ], - "xor_euint4_euint32": [ - { "inputs": ["1", "1939413163"], "output": "1939413162" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "12" } - ], - "xor_euint4_euint64": [ - { - "inputs": ["2", "18438078325844207475"], - "output": "18438078325844207473" - }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "12" } - ], - "xor_euint4_euint128": [ - { - "inputs": ["13", "340282366920938463463366123999290070707"], - "output": "340282366920938463463366123999290070718" - }, - { "inputs": ["9", "13"], "output": "4" }, - { "inputs": ["13", "13"], "output": "0" }, - { "inputs": ["13", "9"], "output": "4" } - ], - "xor_euint4_euint256": [ - { - "inputs": ["5", "115792089237316195423570985008687907853269984665640564039457578855535245251769"], - "output": "115792089237316195423570985008687907853269984665640564039457578855535245251772" - }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "12" } - ], - "xor_euint8_euint4": [ - { "inputs": ["104", "4"], "output": "108" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "12" } - ], - "xor_uint8_euint4": [ - { "inputs": ["1", "4"], "output": "5" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "12" } - ], "xor_euint8_euint8": [ - { "inputs": ["234", "150"], "output": "124" }, - { "inputs": ["146", "150"], "output": "4" }, - { "inputs": ["150", "150"], "output": "0" }, - { "inputs": ["150", "146"], "output": "4" } + { "inputs": ["158", "120"], "output": "230" }, + { "inputs": ["116", "120"], "output": "12" }, + { "inputs": ["120", "120"], "output": "0" }, + { "inputs": ["120", "116"], "output": "12" } ], "xor_euint8_uint8": [ - { "inputs": ["234", "201"], "output": "35" }, - { "inputs": ["146", "150"], "output": "4" }, - { "inputs": ["150", "150"], "output": "0" }, - { "inputs": ["150", "146"], "output": "4" } + { "inputs": ["158", "163"], "output": "61" }, + { "inputs": ["116", "120"], "output": "12" }, + { "inputs": ["120", "120"], "output": "0" }, + { "inputs": ["120", "116"], "output": "12" } ], "xor_uint8_euint8": [ - { "inputs": ["181", "201"], "output": "124" }, - { "inputs": ["146", "150"], "output": "4" }, - { "inputs": ["150", "150"], "output": "0" }, - { "inputs": ["150", "146"], "output": "4" } + { "inputs": ["73", "163"], "output": "234" }, + { "inputs": ["116", "120"], "output": "12" }, + { "inputs": ["120", "120"], "output": "0" }, + { "inputs": ["120", "116"], "output": "12" } ], "xor_euint8_euint16": [ - { "inputs": ["233", "6463"], "output": "6614" }, - { "inputs": ["229", "233"], "output": "12" }, - { "inputs": ["233", "233"], "output": "0" }, - { "inputs": ["233", "229"], "output": "12" } + { "inputs": ["185", "53970"], "output": "53867" }, + { "inputs": ["181", "185"], "output": "12" }, + { "inputs": ["185", "185"], "output": "0" }, + { "inputs": ["185", "181"], "output": "12" } ], "xor_euint8_euint32": [ - { "inputs": ["200", "3474428988"], "output": "3474429172" }, - { "inputs": ["196", "200"], "output": "12" }, - { "inputs": ["200", "200"], "output": "0" }, - { "inputs": ["200", "196"], "output": "12" } + { "inputs": ["244", "845176871"], "output": "845177043" }, + { "inputs": ["240", "244"], "output": "4" }, + { "inputs": ["244", "244"], "output": "0" }, + { "inputs": ["244", "240"], "output": "4" } ], "xor_euint8_euint64": [ - { - "inputs": ["250", "18438760776575021013"], - "output": "18438760776575020847" - }, - { "inputs": ["246", "250"], "output": "12" }, - { "inputs": ["250", "250"], "output": "0" }, - { "inputs": ["250", "246"], "output": "12" } + { "inputs": ["235", "18441117557807197933"], "output": "18441117557807197702" }, + { "inputs": ["231", "235"], "output": "12" }, + { "inputs": ["235", "235"], "output": "0" }, + { "inputs": ["235", "231"], "output": "12" } ], "xor_euint8_euint128": [ { - "inputs": ["142", "340282366920938463463373089327559876459"], - "output": "340282366920938463463373089327559876581" + "inputs": ["214", "340282366920938463463373722455168720019"], + "output": "340282366920938463463373722455168719941" }, - { "inputs": ["138", "142"], "output": "4" }, - { "inputs": ["142", "142"], "output": "0" }, - { "inputs": ["142", "138"], "output": "4" } + { "inputs": ["210", "214"], "output": "4" }, + { "inputs": ["214", "214"], "output": "0" }, + { "inputs": ["214", "210"], "output": "4" } ], "xor_euint8_euint256": [ { - "inputs": ["244", "115792089237316195423570985008687907853269984665640564039457578624058101395789"], - "output": "115792089237316195423570985008687907853269984665640564039457578624058101395897" + "inputs": ["42", "115792089237316195423570985008687907853269984665640564039457576240232763524673"], + "output": "115792089237316195423570985008687907853269984665640564039457576240232763524715" }, - { "inputs": ["240", "244"], "output": "4" }, - { "inputs": ["244", "244"], "output": "0" }, - { "inputs": ["244", "240"], "output": "4" } - ], - "xor_euint16_euint4": [ - { "inputs": ["57076", "14"], "output": "57082" }, - { "inputs": ["10", "14"], "output": "4" }, - { "inputs": ["14", "14"], "output": "0" }, - { "inputs": ["14", "10"], "output": "4" } + { "inputs": ["38", "42"], "output": "12" }, + { "inputs": ["42", "42"], "output": "0" }, + { "inputs": ["42", "38"], "output": "12" } ], "xor_euint16_euint8": [ - { "inputs": ["14933", "231"], "output": "15026" }, - { "inputs": ["227", "231"], "output": "4" }, - { "inputs": ["231", "231"], "output": "0" }, - { "inputs": ["231", "227"], "output": "4" } + { "inputs": ["65432", "208"], "output": "65352" }, + { "inputs": ["204", "208"], "output": "28" }, + { "inputs": ["208", "208"], "output": "0" }, + { "inputs": ["208", "204"], "output": "28" } ], "xor_euint16_euint16": [ - { "inputs": ["65327", "25546"], "output": "40165" }, - { "inputs": ["25542", "25546"], "output": "12" }, - { "inputs": ["25546", "25546"], "output": "0" }, - { "inputs": ["25546", "25542"], "output": "12" } + { "inputs": ["46092", "37057"], "output": "9421" }, + { "inputs": ["37053", "37057"], "output": "124" }, + { "inputs": ["37057", "37057"], "output": "0" }, + { "inputs": ["37057", "37053"], "output": "124" } ], "xor_euint16_uint16": [ - { "inputs": ["65327", "31297"], "output": "34158" }, - { "inputs": ["25542", "25546"], "output": "12" }, - { "inputs": ["25546", "25546"], "output": "0" }, - { "inputs": ["25546", "25542"], "output": "12" } + { "inputs": ["46092", "1073"], "output": "45117" }, + { "inputs": ["37053", "37057"], "output": "124" }, + { "inputs": ["37057", "37057"], "output": "0" }, + { "inputs": ["37057", "37053"], "output": "124" } ], "xor_uint16_euint16": [ - { "inputs": ["33651", "31297"], "output": "63794" }, - { "inputs": ["25542", "25546"], "output": "12" }, - { "inputs": ["25546", "25546"], "output": "0" }, - { "inputs": ["25546", "25542"], "output": "12" } + { "inputs": ["2296", "1073"], "output": "3273" }, + { "inputs": ["37053", "37057"], "output": "124" }, + { "inputs": ["37057", "37057"], "output": "0" }, + { "inputs": ["37057", "37053"], "output": "124" } ], "xor_euint16_euint32": [ - { "inputs": ["23121", "1351735572"], "output": "1351713605" }, - { "inputs": ["23117", "23121"], "output": "28" }, - { "inputs": ["23121", "23121"], "output": "0" }, - { "inputs": ["23121", "23117"], "output": "28" } + { "inputs": ["24977", "2653061102"], "output": "2653036159" }, + { "inputs": ["24973", "24977"], "output": "28" }, + { "inputs": ["24977", "24977"], "output": "0" }, + { "inputs": ["24977", "24973"], "output": "28" } ], "xor_euint16_euint64": [ - { - "inputs": ["47675", "18446725910384356169"], - "output": "18446725910384382322" - }, - { "inputs": ["47671", "47675"], "output": "12" }, - { "inputs": ["47675", "47675"], "output": "0" }, - { "inputs": ["47675", "47671"], "output": "12" } + { "inputs": ["26906", "18446273583688071007"], "output": "18446273583688080965" }, + { "inputs": ["26902", "26906"], "output": "12" }, + { "inputs": ["26906", "26906"], "output": "0" }, + { "inputs": ["26906", "26902"], "output": "12" } ], "xor_euint16_euint128": [ { - "inputs": ["57137", "340282366920938463463372706296613530555"], - "output": "340282366920938463463372706296613549194" + "inputs": ["31773", "340282366920938463463374519024646895513"], + "output": "340282366920938463463374519024646900612" }, - { "inputs": ["57133", "57137"], "output": "28" }, - { "inputs": ["57137", "57137"], "output": "0" }, - { "inputs": ["57137", "57133"], "output": "28" } + { "inputs": ["31769", "31773"], "output": "4" }, + { "inputs": ["31773", "31773"], "output": "0" }, + { "inputs": ["31773", "31769"], "output": "4" } ], "xor_euint16_euint256": [ { - "inputs": ["21805", "115792089237316195423570985008687907853269984665640564039457581252703610907733"], - "output": "115792089237316195423570985008687907853269984665640564039457581252703610927480" + "inputs": ["64961", "115792089237316195423570985008687907853269984665640564039457583010934061132899"], + "output": "115792089237316195423570985008687907853269984665640564039457583010934061076898" }, - { "inputs": ["21801", "21805"], "output": "4" }, - { "inputs": ["21805", "21805"], "output": "0" }, - { "inputs": ["21805", "21801"], "output": "4" } - ], - "xor_euint32_euint4": [ - { "inputs": ["4009369108", "6"], "output": "4009369106" }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "12" } + { "inputs": ["64957", "64961"], "output": "124" }, + { "inputs": ["64961", "64961"], "output": "0" }, + { "inputs": ["64961", "64957"], "output": "124" } ], "xor_euint32_euint8": [ - { "inputs": ["1756250914", "211"], "output": "1756251121" }, - { "inputs": ["207", "211"], "output": "28" }, - { "inputs": ["211", "211"], "output": "0" }, - { "inputs": ["211", "207"], "output": "28" } + { "inputs": ["2413763875", "240"], "output": "2413764051" }, + { "inputs": ["236", "240"], "output": "28" }, + { "inputs": ["240", "240"], "output": "0" }, + { "inputs": ["240", "236"], "output": "28" } ], "xor_euint32_euint16": [ - { "inputs": ["3818112177", "23871"], "output": "3818101134" }, - { "inputs": ["23867", "23871"], "output": "4" }, - { "inputs": ["23871", "23871"], "output": "0" }, - { "inputs": ["23871", "23867"], "output": "4" } + { "inputs": ["1467834448", "57898"], "output": "1467843194" }, + { "inputs": ["57894", "57898"], "output": "12" }, + { "inputs": ["57898", "57898"], "output": "0" }, + { "inputs": ["57898", "57894"], "output": "12" } ], "xor_euint32_euint32": [ - { "inputs": ["3766539452", "3557659859"], "output": "881672303" }, - { "inputs": ["3557659855", "3557659859"], "output": "28" }, - { "inputs": ["3557659859", "3557659859"], "output": "0" }, - { "inputs": ["3557659859", "3557659855"], "output": "28" } + { "inputs": ["3377993976", "4278842792"], "output": "911338832" }, + { "inputs": ["3377993972", "3377993976"], "output": "12" }, + { "inputs": ["3377993976", "3377993976"], "output": "0" }, + { "inputs": ["3377993976", "3377993972"], "output": "12" } ], "xor_euint32_uint32": [ - { "inputs": ["3766539452", "3890491814"], "output": "124052762" }, - { "inputs": ["3557659855", "3557659859"], "output": "28" }, - { "inputs": ["3557659859", "3557659859"], "output": "0" }, - { "inputs": ["3557659859", "3557659855"], "output": "28" } + { "inputs": ["3377993976", "627641383"], "output": "3962639583" }, + { "inputs": ["3377993972", "3377993976"], "output": "12" }, + { "inputs": ["3377993976", "3377993976"], "output": "0" }, + { "inputs": ["3377993976", "3377993972"], "output": "12" } ], "xor_uint32_euint32": [ - { "inputs": ["1940474497", "3890491814"], "output": "2488105767" }, - { "inputs": ["3557659855", "3557659859"], "output": "28" }, - { "inputs": ["3557659859", "3557659859"], "output": "0" }, - { "inputs": ["3557659859", "3557659855"], "output": "28" } + { "inputs": ["1240260903", "627641383"], "output": "1820716288" }, + { "inputs": ["3377993972", "3377993976"], "output": "12" }, + { "inputs": ["3377993976", "3377993976"], "output": "0" }, + { "inputs": ["3377993976", "3377993972"], "output": "12" } ], "xor_euint32_euint64": [ - { - "inputs": ["390302983", "18441970713749353087"], - "output": "18441970713904316280" - }, - { "inputs": ["390302979", "390302983"], "output": "4" }, - { "inputs": ["390302983", "390302983"], "output": "0" }, - { "inputs": ["390302983", "390302979"], "output": "4" } + { "inputs": ["4050522939", "18443329956048890375"], "output": "18443329953621834044" }, + { "inputs": ["4050522935", "4050522939"], "output": "12" }, + { "inputs": ["4050522939", "4050522939"], "output": "0" }, + { "inputs": ["4050522939", "4050522935"], "output": "12" } ], "xor_euint32_euint128": [ { - "inputs": ["3049009589", "340282366920938463463368216078619273371"], - "output": "340282366920938463463368216080538425646" + "inputs": ["81119959", "340282366920938463463369030308267025683"], + "output": "340282366920938463463369030308185911236" }, - { "inputs": ["3049009585", "3049009589"], "output": "4" }, - { "inputs": ["3049009589", "3049009589"], "output": "0" }, - { "inputs": ["3049009589", "3049009585"], "output": "4" } + { "inputs": ["81119955", "81119959"], "output": "4" }, + { "inputs": ["81119959", "81119959"], "output": "0" }, + { "inputs": ["81119959", "81119955"], "output": "4" } ], "xor_euint32_euint256": [ { - "inputs": ["3706671686", "115792089237316195423570985008687907853269984665640564039457578090382088595177"], - "output": "115792089237316195423570985008687907853269984665640564039457578090383101310127" + "inputs": ["3057043367", "115792089237316195423570985008687907853269984665640564039457579515741701810133"], + "output": "115792089237316195423570985008687907853269984665640564039457579515739792007282" }, - { "inputs": ["3706671682", "3706671686"], "output": "4" }, - { "inputs": ["3706671686", "3706671686"], "output": "0" }, - { "inputs": ["3706671686", "3706671682"], "output": "4" } - ], - "xor_euint64_euint4": [ - { - "inputs": ["18442021950386427623", "8"], - "output": "18442021950386427631" - }, - { "inputs": ["4", "8"], "output": "12" }, - { "inputs": ["8", "8"], "output": "0" }, - { "inputs": ["8", "4"], "output": "12" } + { "inputs": ["3057043363", "3057043367"], "output": "4" }, + { "inputs": ["3057043367", "3057043367"], "output": "0" }, + { "inputs": ["3057043367", "3057043363"], "output": "4" } ], "xor_euint64_euint8": [ - { - "inputs": ["18439050232368801565", "12"], - "output": "18439050232368801553" - }, - { "inputs": ["8", "12"], "output": "4" }, - { "inputs": ["12", "12"], "output": "0" }, - { "inputs": ["12", "8"], "output": "4" } + { "inputs": ["18440676231314396733", "189"], "output": "18440676231314396800" }, + { "inputs": ["185", "189"], "output": "4" }, + { "inputs": ["189", "189"], "output": "0" }, + { "inputs": ["189", "185"], "output": "4" } ], "xor_euint64_euint16": [ - { - "inputs": ["18446196219353056271", "45319"], - "output": "18446196219353101576" - }, - { "inputs": ["45315", "45319"], "output": "4" }, - { "inputs": ["45319", "45319"], "output": "0" }, - { "inputs": ["45319", "45315"], "output": "4" } + { "inputs": ["18439021793151881271", "43493"], "output": "18439021793151924690" }, + { "inputs": ["43489", "43493"], "output": "4" }, + { "inputs": ["43493", "43493"], "output": "0" }, + { "inputs": ["43493", "43489"], "output": "4" } ], "xor_euint64_euint32": [ - { - "inputs": ["18440012895744339301", "1085979490"], - "output": "18440012896823678471" - }, - { "inputs": ["1085979486", "1085979490"], "output": "60" }, - { "inputs": ["1085979490", "1085979490"], "output": "0" }, - { "inputs": ["1085979490", "1085979486"], "output": "60" } + { "inputs": ["18440663103177932093", "3791211062"], "output": "18440663101548001035" }, + { "inputs": ["3791211058", "3791211062"], "output": "4" }, + { "inputs": ["3791211062", "3791211062"], "output": "0" }, + { "inputs": ["3791211062", "3791211058"], "output": "4" } ], "xor_euint64_euint64": [ - { - "inputs": ["18439520894560746701", "18440669858368892063"], - "output": "3444795783188562" - }, - { - "inputs": ["18439520894560746697", "18439520894560746701"], - "output": "4" - }, - { - "inputs": ["18439520894560746701", "18439520894560746701"], - "output": "0" - }, - { - "inputs": ["18439520894560746701", "18439520894560746697"], - "output": "4" - } + { "inputs": ["18444832974842050695", "18438487764916777001"], "output": "7774869280196782" }, + { "inputs": ["18438487764916776997", "18438487764916777001"], "output": "12" }, + { "inputs": ["18438487764916777001", "18438487764916777001"], "output": "0" }, + { "inputs": ["18438487764916777001", "18438487764916776997"], "output": "12" } ], "xor_euint64_uint64": [ - { - "inputs": ["18439520894560746701", "18445914762272407037"], - "output": "7700087946789168" - }, - { - "inputs": ["18439520894560746697", "18439520894560746701"], - "output": "4" - }, - { - "inputs": ["18439520894560746701", "18439520894560746701"], - "output": "0" - }, - { - "inputs": ["18439520894560746701", "18439520894560746697"], - "output": "4" - } + { "inputs": ["18444832974842050695", "18442676335217651613"], "output": "2455983816808218" }, + { "inputs": ["18438487764916776997", "18438487764916777001"], "output": "12" }, + { "inputs": ["18438487764916777001", "18438487764916777001"], "output": "0" }, + { "inputs": ["18438487764916777001", "18438487764916776997"], "output": "12" } ], "xor_uint64_euint64": [ - { - "inputs": ["18446426713533628951", "18445914762272407037"], - "output": "1076293857951722" - }, - { - "inputs": ["18439520894560746697", "18439520894560746701"], - "output": "4" - }, - { - "inputs": ["18439520894560746701", "18439520894560746701"], - "output": "0" - }, - { - "inputs": ["18439520894560746701", "18439520894560746697"], - "output": "4" - } + { "inputs": ["18443192470772559897", "18442676335217651613"], "output": "824358115745668" }, + { "inputs": ["18438487764916776997", "18438487764916777001"], "output": "12" }, + { "inputs": ["18438487764916777001", "18438487764916777001"], "output": "0" }, + { "inputs": ["18438487764916777001", "18438487764916776997"], "output": "12" } ], "xor_euint64_euint128": [ { - "inputs": ["18445744178466976977", "340282366920938463463371486789808692655"], - "output": "340282366920938463444930285940062611838" - }, - { - "inputs": ["18445744178466976973", "18445744178466976977"], - "output": "28" - }, - { - "inputs": ["18445744178466976977", "18445744178466976977"], - "output": "0" + "inputs": ["18445465942766938791", "340282366920938463463370598388828152857"], + "output": "340282366920938463444930876294806851262" }, - { - "inputs": ["18445744178466976977", "18445744178466976973"], - "output": "28" - } + { "inputs": ["18445465942766938787", "18445465942766938791"], "output": "4" }, + { "inputs": ["18445465942766938791", "18445465942766938791"], "output": "0" }, + { "inputs": ["18445465942766938791", "18445465942766938787"], "output": "4" } ], "xor_euint64_euint256": [ { "inputs": [ - "18438921176678700429", - "115792089237316195423570985008687907853269984665640564039457575984328616481271" + "18438685740876017079", + "115792089237316195423570985008687907853269984665640564039457575906566937833879" ], - "output": "115792089237316195423570985008687907853269984665640564039439139317222450136186" - }, - { - "inputs": ["18438921176678700425", "18438921176678700429"], - "output": "4" - }, - { - "inputs": ["18438921176678700429", "18438921176678700429"], - "output": "0" + "output": "115792089237316195423570985008687907853269984665640564039439137379440477166624" }, - { - "inputs": ["18438921176678700429", "18438921176678700425"], - "output": "4" - } - ], - "xor_euint128_euint4": [ - { - "inputs": ["340282366920938463463370996799476031467", "13"], - "output": "340282366920938463463370996799476031462" - }, - { "inputs": ["9", "13"], "output": "4" }, - { "inputs": ["13", "13"], "output": "0" }, - { "inputs": ["13", "9"], "output": "4" } + { "inputs": ["18438685740876017075", "18438685740876017079"], "output": "4" }, + { "inputs": ["18438685740876017079", "18438685740876017079"], "output": "0" }, + { "inputs": ["18438685740876017079", "18438685740876017075"], "output": "4" } ], "xor_euint128_euint8": [ { - "inputs": ["340282366920938463463373857001835170765", "82"], - "output": "340282366920938463463373857001835170719" + "inputs": ["340282366920938463463367246302542850465", "226"], + "output": "340282366920938463463367246302542850371" }, - { "inputs": ["78", "82"], "output": "28" }, - { "inputs": ["82", "82"], "output": "0" }, - { "inputs": ["82", "78"], "output": "28" } + { "inputs": ["222", "226"], "output": "60" }, + { "inputs": ["226", "226"], "output": "0" }, + { "inputs": ["226", "222"], "output": "60" } ], "xor_euint128_euint16": [ { - "inputs": ["340282366920938463463371581047560381685", "64364"], - "output": "340282366920938463463371581047560363929" + "inputs": ["340282366920938463463366026275822553493", "35641"], + "output": "340282366920938463463366026275822518956" }, - { "inputs": ["64360", "64364"], "output": "4" }, - { "inputs": ["64364", "64364"], "output": "0" }, - { "inputs": ["64364", "64360"], "output": "4" } + { "inputs": ["35637", "35641"], "output": "12" }, + { "inputs": ["35641", "35641"], "output": "0" }, + { "inputs": ["35641", "35637"], "output": "12" } ], "xor_euint128_euint32": [ { - "inputs": ["340282366920938463463372336872535218607", "2309231003"], - "output": "340282366920938463463372336874538256436" + "inputs": ["340282366920938463463374390436594311825", "1324067448"], + "output": "340282366920938463463374390435278899433" }, - { "inputs": ["2309230999", "2309231003"], "output": "12" }, - { "inputs": ["2309231003", "2309231003"], "output": "0" }, - { "inputs": ["2309231003", "2309230999"], "output": "12" } + { "inputs": ["1324067444", "1324067448"], "output": "12" }, + { "inputs": ["1324067448", "1324067448"], "output": "0" }, + { "inputs": ["1324067448", "1324067444"], "output": "12" } ], "xor_euint128_euint64": [ { - "inputs": ["340282366920938463463368977308831072123", "18442960701720483125"], - "output": "340282366920938463444935023814972271182" - }, - { - "inputs": ["18442960701720483121", "18442960701720483125"], - "output": "4" - }, - { - "inputs": ["18442960701720483125", "18442960701720483125"], - "output": "0" + "inputs": ["340282366920938463463373044287433022977", "18439290846979619291"], + "output": "340282366920938463444936860663680067546" }, - { - "inputs": ["18442960701720483125", "18442960701720483121"], - "output": "4" - } + { "inputs": ["18439290846979619287", "18439290846979619291"], "output": "12" }, + { "inputs": ["18439290846979619291", "18439290846979619291"], "output": "0" }, + { "inputs": ["18439290846979619291", "18439290846979619287"], "output": "12" } ], "xor_euint128_euint128": [ { - "inputs": ["340282366920938463463372080691181989981", "340282366920938463463368941059346865329"], - "output": "8122674366786796" - }, - { - "inputs": ["340282366920938463463368941059346865325", "340282366920938463463368941059346865329"], - "output": "28" - }, - { - "inputs": ["340282366920938463463368941059346865329", "340282366920938463463368941059346865329"], - "output": "0" + "inputs": ["340282366920938463463372476222006445329", "340282366920938463463369072223467498733"], + "output": "5691540006447612" }, - { - "inputs": ["340282366920938463463368941059346865329", "340282366920938463463368941059346865325"], - "output": "28" - } + { "inputs": ["340282366920938463463369072223467498729", "340282366920938463463369072223467498733"], "output": "4" }, + { "inputs": ["340282366920938463463369072223467498733", "340282366920938463463369072223467498733"], "output": "0" }, + { "inputs": ["340282366920938463463369072223467498733", "340282366920938463463369072223467498729"], "output": "4" } ], "xor_euint128_uint128": [ { - "inputs": ["340282366920938463463372080691181989981", "340282366920938463463368386031692563719"], - "output": "8690927368893786" - }, - { - "inputs": ["340282366920938463463368941059346865325", "340282366920938463463368941059346865329"], - "output": "28" + "inputs": ["340282366920938463463372476222006445329", "340282366920938463463373468952432333785"], + "output": "1012796517816008" }, - { - "inputs": ["340282366920938463463368941059346865329", "340282366920938463463368941059346865329"], - "output": "0" - }, - { - "inputs": ["340282366920938463463368941059346865329", "340282366920938463463368941059346865325"], - "output": "28" - } + { "inputs": ["340282366920938463463369072223467498729", "340282366920938463463369072223467498733"], "output": "4" }, + { "inputs": ["340282366920938463463369072223467498733", "340282366920938463463369072223467498733"], "output": "0" }, + { "inputs": ["340282366920938463463369072223467498733", "340282366920938463463369072223467498729"], "output": "4" } ], "xor_uint128_euint128": [ { - "inputs": ["340282366920938463463374269120313762865", "340282366920938463463368386031692563719"], - "output": "6519991538245942" - }, - { - "inputs": ["340282366920938463463368941059346865325", "340282366920938463463368941059346865329"], - "output": "28" - }, - { - "inputs": ["340282366920938463463368941059346865329", "340282366920938463463368941059346865329"], - "output": "0" + "inputs": ["340282366920938463463372287805843974749", "340282366920938463463373468952432333785"], + "output": "3438031652518276" }, - { - "inputs": ["340282366920938463463368941059346865329", "340282366920938463463368941059346865325"], - "output": "28" - } + { "inputs": ["340282366920938463463369072223467498729", "340282366920938463463369072223467498733"], "output": "4" }, + { "inputs": ["340282366920938463463369072223467498733", "340282366920938463463369072223467498733"], "output": "0" }, + { "inputs": ["340282366920938463463369072223467498733", "340282366920938463463369072223467498729"], "output": "4" } ], "xor_euint128_euint256": [ { "inputs": [ - "340282366920938463463370357504982561043", - "115792089237316195423570985008687907853269984665640564039457576209743222065387" + "340282366920938463463368947104295313045", + "115792089237316195423570985008687907853269984665640564039457579616542483510279" ], - "output": "115792089237316195423570985008687907852929702298719625575994215220393361046008" - }, - { - "inputs": ["340282366920938463463370357504982561039", "340282366920938463463370357504982561043"], - "output": "28" - }, - { - "inputs": ["340282366920938463463370357504982561043", "340282366920938463463370357504982561043"], - "output": "0" - }, - { - "inputs": ["340282366920938463463370357504982561043", "340282366920938463463370357504982561039"], - "output": "28" - } - ], - "xor_euint256_euint4": [ - { - "inputs": ["115792089237316195423570985008687907853269984665640564039457582453903191902895", "12"], - "output": "115792089237316195423570985008687907853269984665640564039457582453903191902883" + "output": "115792089237316195423570985008687907852929702298719625575994217147520419965586" }, - { "inputs": ["8", "12"], "output": "4" }, - { "inputs": ["12", "12"], "output": "0" }, - { "inputs": ["12", "8"], "output": "4" } + { "inputs": ["340282366920938463463368947104295313041", "340282366920938463463368947104295313045"], "output": "4" }, + { "inputs": ["340282366920938463463368947104295313045", "340282366920938463463368947104295313045"], "output": "0" }, + { "inputs": ["340282366920938463463368947104295313045", "340282366920938463463368947104295313041"], "output": "4" } ], "xor_euint256_euint8": [ { - "inputs": ["115792089237316195423570985008687907853269984665640564039457576224347045805665", "175"], - "output": "115792089237316195423570985008687907853269984665640564039457576224347045805774" + "inputs": ["115792089237316195423570985008687907853269984665640564039457581248874917299485", "194"], + "output": "115792089237316195423570985008687907853269984665640564039457581248874917299679" }, - { "inputs": ["171", "175"], "output": "4" }, - { "inputs": ["175", "175"], "output": "0" }, - { "inputs": ["175", "171"], "output": "4" } + { "inputs": ["190", "194"], "output": "124" }, + { "inputs": ["194", "194"], "output": "0" }, + { "inputs": ["194", "190"], "output": "124" } ], "xor_euint256_euint16": [ { - "inputs": ["115792089237316195423570985008687907853269984665640564039457583698273346637887", "24298"], - "output": "115792089237316195423570985008687907853269984665640564039457583698273346621141" + "inputs": ["115792089237316195423570985008687907853269984665640564039457580412632423144015", "21945"], + "output": "115792089237316195423570985008687907853269984665640564039457580412632423157750" }, - { "inputs": ["24294", "24298"], "output": "12" }, - { "inputs": ["24298", "24298"], "output": "0" }, - { "inputs": ["24298", "24294"], "output": "12" } + { "inputs": ["21941", "21945"], "output": "12" }, + { "inputs": ["21945", "21945"], "output": "0" }, + { "inputs": ["21945", "21941"], "output": "12" } ], "xor_euint256_euint32": [ { - "inputs": ["115792089237316195423570985008687907853269984665640564039457575870021368542809", "1137098251"], - "output": "115792089237316195423570985008687907853269984665640564039457575870020349413458" + "inputs": ["115792089237316195423570985008687907853269984665640564039457578374546596204863", "2278199067"], + "output": "115792089237316195423570985008687907853269984665640564039457578374544419724836" }, - { "inputs": ["1137098247", "1137098251"], "output": "12" }, - { "inputs": ["1137098251", "1137098251"], "output": "0" }, - { "inputs": ["1137098251", "1137098247"], "output": "12" } + { "inputs": ["2278199063", "2278199067"], "output": "12" }, + { "inputs": ["2278199067", "2278199067"], "output": "0" }, + { "inputs": ["2278199067", "2278199063"], "output": "12" } ], "xor_euint256_euint64": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457581449682348833995", - "18444753228810258299" + "115792089237316195423570985008687907853269984665640564039457575438756332602601", + "18445249364282530429" ], - "output": "115792089237316195423570985008687907853269984665640564039439141209004043664304" - }, - { - "inputs": ["18444753228810258295", "18444753228810258299"], - "output": "12" + "output": "115792089237316195423570985008687907853269984665640564039439144932883138469524" }, - { - "inputs": ["18444753228810258299", "18444753228810258299"], - "output": "0" - }, - { - "inputs": ["18444753228810258299", "18444753228810258295"], - "output": "12" - } + { "inputs": ["18445249364282530425", "18445249364282530429"], "output": "4" }, + { "inputs": ["18445249364282530429", "18445249364282530429"], "output": "0" }, + { "inputs": ["18445249364282530429", "18445249364282530425"], "output": "4" } ], "xor_euint256_euint128": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457582608158223098943", - "340282366920938463463373070389452427715" + "115792089237316195423570985008687907853269984665640564039457577776790242612405", + "340282366920938463463367642054200564437" ], - "output": "115792089237316195423570985008687907852929702298719625575994209836984672105980" - }, - { - "inputs": ["340282366920938463463373070389452427711", "340282366920938463463373070389452427715"], - "output": "124" - }, - { - "inputs": ["340282366920938463463373070389452427715", "340282366920938463463373070389452427715"], - "output": "0" + "output": "115792089237316195423570985008687907852929702298719625575994213514669417483872" }, - { - "inputs": ["340282366920938463463373070389452427715", "340282366920938463463373070389452427711"], - "output": "124" - } + { "inputs": ["340282366920938463463367642054200564433", "340282366920938463463367642054200564437"], "output": "4" }, + { "inputs": ["340282366920938463463367642054200564437", "340282366920938463463367642054200564437"], "output": "0" }, + { "inputs": ["340282366920938463463367642054200564437", "340282366920938463463367642054200564433"], "output": "4" } ], "xor_euint256_euint256": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457582495469225451093", - "115792089237316195423570985008687907853269984665640564039457581801761034193859" + "115792089237316195423570985008687907853269984665640564039457581150338084879721", + "115792089237316195423570985008687907853269984665640564039457580500287463074983" ], - "output": "714633272808854" + "output": "1777745829433806" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457581801761034193855", - "115792089237316195423570985008687907853269984665640564039457581801761034193859" + "115792089237316195423570985008687907853269984665640564039457580500287463074979", + "115792089237316195423570985008687907853269984665640564039457580500287463074983" ], - "output": "124" + "output": "4" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457581801761034193859", - "115792089237316195423570985008687907853269984665640564039457581801761034193859" + "115792089237316195423570985008687907853269984665640564039457580500287463074983", + "115792089237316195423570985008687907853269984665640564039457580500287463074983" ], "output": "0" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457581801761034193859", - "115792089237316195423570985008687907853269984665640564039457581801761034193855" + "115792089237316195423570985008687907853269984665640564039457580500287463074983", + "115792089237316195423570985008687907853269984665640564039457580500287463074979" ], - "output": "124" + "output": "4" } ], "xor_euint256_uint256": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457582495469225451093", - "115792089237316195423570985008687907853269984665640564039457579143464719512889" + "115792089237316195423570985008687907853269984665640564039457581150338084879721", + "115792089237316195423570985008687907853269984665640564039457581212641584667521" ], - "output": "5655612635835244" + "output": "1065134005642984" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457581801761034193855", - "115792089237316195423570985008687907853269984665640564039457581801761034193859" + "115792089237316195423570985008687907853269984665640564039457580500287463074979", + "115792089237316195423570985008687907853269984665640564039457580500287463074983" ], - "output": "124" + "output": "4" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457581801761034193859", - "115792089237316195423570985008687907853269984665640564039457581801761034193859" + "115792089237316195423570985008687907853269984665640564039457580500287463074983", + "115792089237316195423570985008687907853269984665640564039457580500287463074983" ], "output": "0" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457581801761034193859", - "115792089237316195423570985008687907853269984665640564039457581801761034193855" + "115792089237316195423570985008687907853269984665640564039457580500287463074983", + "115792089237316195423570985008687907853269984665640564039457580500287463074979" ], - "output": "124" + "output": "4" } ], "xor_uint256_euint256": [ { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457579014577469369511", - "115792089237316195423570985008687907853269984665640564039457579143464719512889" + "115792089237316195423570985008687907853269984665640564039457577854215512308841", + "115792089237316195423570985008687907853269984665640564039457581212641584667521" ], - "output": "269763301726622" + "output": "7936866560272360" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457581801761034193855", - "115792089237316195423570985008687907853269984665640564039457581801761034193859" + "115792089237316195423570985008687907853269984665640564039457580500287463074979", + "115792089237316195423570985008687907853269984665640564039457580500287463074983" ], - "output": "124" + "output": "4" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457581801761034193859", - "115792089237316195423570985008687907853269984665640564039457581801761034193859" + "115792089237316195423570985008687907853269984665640564039457580500287463074983", + "115792089237316195423570985008687907853269984665640564039457580500287463074983" ], "output": "0" }, { "inputs": [ - "115792089237316195423570985008687907853269984665640564039457581801761034193859", - "115792089237316195423570985008687907853269984665640564039457581801761034193855" + "115792089237316195423570985008687907853269984665640564039457580500287463074983", + "115792089237316195423570985008687907853269984665640564039457580500287463074979" ], - "output": "124" - } - ], - "not_euint4": [{ "inputs": ["4"], "output": "11" }], - "not_euint8": [{ "inputs": ["221"], "output": "34" }], - "not_euint16": [{ "inputs": ["1813"], "output": "63722" }], - "not_euint32": [{ "inputs": ["2456808918"], "output": "1838158377" }], - "not_euint64": [{ "inputs": ["18438471929660169839"], "output": "8272144049381776" }], - "not_euint128": [ - { - "inputs": ["340282366920938463463374264817331350741"], - "output": "342614436860714" + "output": "4" } ], + "not_euint8": [{ "inputs": ["210"], "output": "45" }], + "not_euint16": [{ "inputs": ["9709"], "output": "55826" }], + "not_euint32": [{ "inputs": ["3724598354"], "output": "570368941" }], + "not_euint64": [{ "inputs": ["18439682943248563297"], "output": "7061130460988318" }], + "not_euint128": [{ "inputs": ["340282366920938463463369959186847444641"], "output": "4648244920766814" }], "not_euint256": [ { - "inputs": ["115792089237316195423570985008687907853269984665640564039457581938347870429377"], - "output": "2069565259210558" - } - ], - "neg_euint4": [{ "inputs": ["7"], "output": "9" }], - "neg_euint8": [{ "inputs": ["211"], "output": "45" }], - "neg_euint16": [{ "inputs": ["26686"], "output": "38850" }], - "neg_euint32": [{ "inputs": ["3401457377"], "output": "893509919" }], - "neg_euint64": [{ "inputs": ["18441984683925217775"], "output": "4759389784333841" }], - "neg_euint128": [ - { - "inputs": ["340282366920938463463373162594455712433"], - "output": "1444837312499023" + "inputs": ["115792089237316195423570985008687907853269984665640564039457582674342522467067"], + "output": "1333570607172868" } ], + "neg_euint8": [{ "inputs": ["121"], "output": "135" }], + "neg_euint16": [{ "inputs": ["30932"], "output": "34604" }], + "neg_euint32": [{ "inputs": ["2861318487"], "output": "1433648809" }], + "neg_euint64": [{ "inputs": ["18443814105534461003"], "output": "2929968175090613" }], + "neg_euint128": [{ "inputs": ["340282366920938463463369494853461294495"], "output": "5112578306916961" }], "neg_euint256": [ { - "inputs": ["115792089237316195423570985008687907853269984665640564039457578680357072424439"], - "output": "5327556057215497" + "inputs": ["115792089237316195423570985008687907853269984665640564039457584002631652889055"], + "output": "5281476750881" } ] } diff --git a/contracts/codegen/payments.ts b/contracts/codegen/payments.ts index a924d86e..27565c9b 100644 --- a/contracts/codegen/payments.ts +++ b/contracts/codegen/payments.ts @@ -7,22 +7,24 @@ interface PriceData { }; } -export function generateFHEGasLimit(priceData: PriceData): string { +export function generateSolidityFHEGasLimit(priceData: PriceData): string { let output = `// SPDX-License-Identifier: BSD-3-Clause-Clear pragma solidity ^0.8.24; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol"; - import {tfheExecutorAdd} from "../addresses/TFHEExecutorAddress.sol"; + import {httpzExecutorAdd} from "../addresses/HTTPZExecutorAddress.sol"; + + import {FheType} from "./FheType.sol"; /** * @title FHEGasLimit * @notice This contract manages the amount of gas to be paid for FHE operations. */ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { - /// @notice Returned if the sender is not the TFHEExecutor. - error CallerMustBeTFHEExecutorContract(); + /// @notice Returned if the sender is not the HTTPZExecutor. + error CallerMustBeHTTPZExecutorContract(); /// @notice Returned if the block limit is higher than limit for FHE operation. error FHEGasBlockLimitExceeded(); @@ -45,21 +47,21 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { /// @notice Patch version of the contract. uint256 private constant PATCH_VERSION = 0; - /// @notice TFHEExecutor address. - address private constant tfheExecutorAddress = tfheExecutorAdd; + /// @notice HTTPZExecutor address. + address private constant httpzExecutorAddress = httpzExecutorAdd; /// @notice Gas block limit for FHEGas operation. uint256 private constant FHE_GAS_BLOCKLIMIT = 10_000_000; - /// @custom:storage-location erc7201:fhevm.storage.FHEGasLimit + /// @custom:storage-location erc7201:httpz.storage.FHEGasLimit struct FHEGasLimitStorage { uint256 lastBlock; uint256 currentBlockConsumption; } - /// @dev keccak256(abi.encode(uint256(keccak256("fhevm.storage.FHEGasLimit")) - 1)) & ~bytes32(uint256(0xff)) + /// keccak256(abi.encode(uint256(keccak256("httpz.storage.FHEGasLimit")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant FHEGasLimitStorageLocation = - 0xb5c80b3bbe0bcbcea690f6dbe62b32a45bd1ad263b78db2f25ef8414efe9bc00; + 0x17cabe3f71c2cdebfa03ba613a35f892b2ea48b8aebad7e046dd440ad1c34c00; /// @custom:oz-upgrades-unsafe-allow constructor constructor() { @@ -76,8 +78,8 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function ${functionName}(uint8 resultType, bytes1 scalarByte) external virtual { - if(msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function ${functionName}(FheType resultType, bytes1 scalarByte) external virtual { + if(msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); `; } else { @@ -85,8 +87,8 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @notice Computes the gas required for ${operation.charAt(0).toUpperCase() + operation.slice(1)}. * @param resultType Result type. */ - function ${functionName}(uint8 resultType) external virtual { - if(msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function ${functionName}(FheType resultType) external virtual { + if(msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); `; } @@ -114,11 +116,11 @@ ${generatePriceChecks(data.nonScalar)} return ( output + ` /** - * @notice Getter function for the TFHEExecutor contract address. - * @return tfheExecutorAddress Address of the TFHEExecutor. + * @notice Getter function for the HTTPZExecutor contract address. + * @return httpzExecutorAddress Address of the HTTPZExecutor. */ - function getTFHEExecutorAddress() public view virtual returns (address) { - return tfheExecutorAddress; + function getHTTPZExecutorAddress() public view virtual returns (address) { + return httpzExecutorAddress; } /** @@ -192,7 +194,7 @@ function generatePriceChecks(prices: { [key: string]: number }): string { return ( Object.entries(prices) .map( - ([resultType, price]) => ` if (resultType == ${resultType}) { + ([resultType, price]) => ` if (resultType == FheType.${resultType}) { _updateFunding(${price}); }`, ) diff --git a/contracts/codegen/templates.ts b/contracts/codegen/templates.ts index 5d3676eb..a2ca0c0a 100644 --- a/contracts/codegen/templates.ts +++ b/contracts/codegen/templates.ts @@ -1,69 +1,121 @@ import { assert } from 'console'; -import { Operator, OperatorArguments, ReturnType } from './common'; -import { ArgumentType, OverloadSignature } from './testgen'; +import { AdjustedFheType, AliasFheType, FheType, Operator, OperatorArguments, ReturnType } from './common'; import { getUint } from './utils'; -export function commonSolLib(): string { - return ` -type ebool is bytes32; -type euint4 is bytes32; -type euint8 is bytes32; -type euint16 is bytes32; -type euint32 is bytes32; -type euint64 is bytes32; -type euint128 is bytes32; -type euint256 is bytes32; -type eaddress is bytes32; -type ebytes64 is bytes32; -type ebytes128 is bytes32; -type ebytes256 is bytes32; -type einput is bytes32; - /** - * @title Common - * @notice This library contains all the values used to communicate types to the run time. + * Generates Solidity type aliases from an array of FHE types. + * + * This function filters the provided FHE types to include only those that are supported for + * binary or unary operations. It then maps these types to Solidity type aliases, where each + * type is represented as a `bytes32`. Additionally, it includes a predefined alias for + * `einput`, which is represented as `bytes32`. + * + * @param fheTypes - An array of FHE types to generate Solidity type aliases from. + * @returns A string containing the Solidity type aliases, each on a new line. */ -library Common { - - /// @notice Runtime type for encrypted boolean. - uint8 internal constant ebool_t = 0; - - /// @notice Runtime type for encrypted uint4. - uint8 internal constant euint4_t = 1; +export function createSolidityTypeAliasesFromFheTypes(fheTypes: FheType[]): string { + let res = fheTypes + .filter((fheType: FheType) => fheType.supportedOperators.length > 0) + .map((fheType: FheType) => `type e${fheType.type.toLowerCase()} is bytes32;`); + + res = res.concat( + fheTypes + .map((fheType: FheType) => + (fheType.aliases?.filter((fheTypeAlias: AliasFheType) => fheTypeAlias.supportedOperators.length > 0) ?? []).map( + (fheTypeAlias: AliasFheType) => `type e${fheTypeAlias.type.toLowerCase()} is bytes32;`, + ), + ) + .flat(), + ); - /// @notice Runtime type for encrypted uint8. - uint8 internal constant euint8_t = 2; + return res.concat(['type einput is bytes32;']).join('\n'); +} - /// @notice Runtime type for encrypted uint16. - uint8 internal constant euint16_t = 3; +/** + * Generates a Solidity enum definition from an array of FheType objects. + * + * @param {FheType[]} fheTypes - An array of FheType objects to be converted into a Solidity enum. + * @returns {string} A string representing the Solidity enum definition. + */ +export function createSolidityEnumFromFheTypes(fheTypes: FheType[]): string { + return `enum FheType { + ${fheTypes + .map((fheType: FheType, index: number) => `${fheType.type}${index < fheTypes.length - 1 ? ',' : ''}`) + .join('\n')} +}`; +} - /// @notice Runtime type for encrypted uint32. - uint8 internal constant euint32_t = 4; - /// @notice Runtime type for encrypted uint64. - uint8 internal constant euint64_t = 5; - /// @notice Runtime type for encrypted uint128. - uint8 internal constant euint128_t = 6; - /// @notice Runtime type for encrypted addresses. - uint8 internal constant euint160_t = 7; +export function generateSolidityFheType(fheTypes: FheType[]): string { + return ` + // SPDX-License-Identifier: BSD-3-Clause-Clear + pragma solidity ^0.8.24; - /// @notice Runtime type for encrypted uint256. - uint8 internal constant euint256_t = 8; + ${createSolidityEnumFromFheTypes(fheTypes)} +`; +} - /// @notice Runtime type for encrypted bytes64. - uint8 internal constant ebytes64_t = 9; +/** + * Generates an array of adjusted FHE (Fully Homomorphic Encryption) types based on the provided FHE types. + * + * This function processes an array of `FheType` objects and creates a new array of `AdjustedFheType` objects. + * It includes the original FHE types that have supported operators and also processes their aliases, if any, + * to include them in the adjusted array with additional alias-specific properties. + * + * @param fheTypes - An array of `FheType` objects to be adjusted. + * + * @returns An array of `AdjustedFheType` objects containing the adjusted FHE types and their aliases. + * + * @remarks + * - Only FHE types with supported operators are included in the result. + * - Aliases are processed separately and marked with the `isAlias` property. + * - The `aliasType` property indicates the original type for an alias. + * - The `clearMatchingTypeAlias` property is included for aliases to reference the original clear matching type. + */ +function generateAdjustedFheTypeArray(fheTypes: FheType[]): AdjustedFheType[] { + let adjustedFheTypes: AdjustedFheType[] = []; + + for (let i = 0; i < fheTypes.length; i++) { + const fheType = fheTypes[i]; + + if (fheType.supportedOperators.length > 0) { + adjustedFheTypes.push({ + type: fheType.type, + bitLength: fheType.bitLength, + supportedOperators: fheType.supportedOperators, + clearMatchingType: fheType.clearMatchingType, + value: fheType.value, + }); + } - /// @notice Runtime type for encrypted bytes128. - uint8 internal constant ebytes128_t = 10; + if (fheType.aliases !== undefined && fheType.aliases.length > 0) { + for (let i = 0; i < fheType.aliases.length; i++) { + if (fheType.aliases[i].supportedOperators.length > 0) { + adjustedFheTypes.push({ + type: fheType.aliases[i].type, + bitLength: fheType.bitLength, + supportedOperators: fheType.aliases[i].supportedOperators, + clearMatchingType: fheType.aliases[i].clearMatchingType, + value: fheType.value, + isAlias: true, + aliasType: fheType.type, + clearMatchingTypeAlias: fheType.clearMatchingType, + }); + } + } + } + } - /// @notice Runtime type for encrypted bytes256. - uint8 internal constant ebytes256_t = 11; -} -`; + return adjustedFheTypes; } -function binaryOperatorImpl(op: Operator): string { - const fname = operatorFheLibFunction(op); +/** + * Generates the implementation of a binary operator function for Impl.sol. + * + * @param op - The operator for which the implementation is generated. + * @returns The string representation of the binary operator function. + */ +function handleSolidityBinaryOperatorForImpl(op: Operator): string { const scalarArg = op.hasScalar && op.hasEncrypted ? ', bool scalar' : ''; const scalarByte = op.hasScalar ? '0x01' : '0x00'; const scalarSection = @@ -78,144 +130,106 @@ function binaryOperatorImpl(op: Operator): string { return ( ` /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function ${op.name}(bytes32 lhs, bytes32 rhs${scalarArg}) internal returns (bytes32 result) { ${scalarSection} - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).${fname}(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).${op.fheLibName}(lhs, rhs, scalarByte); }` + '\n' ); } -export function implSol(operators: Operator[]): string { +/** + * Generates the Solidity implementation (Impl.sol) library for FHE operations. + * + * @param operators - An array of Operator objects representing the supported operations. + * @returns A string containing the Solidity implementation library code. + */ +export function generateSolidityImplLib(operators: Operator[]): string { const res: string[] = []; - const coprocessorInterface = generateImplCoprocessorInterface(operators); - const aclInterface = generateACLInterface(); - const inputVerifierInterface = generateInputVerifierInterface(); - res.push(` // SPDX-License-Identifier: BSD-3-Clause-Clear pragma solidity ^0.8.24; -import "./TFHE.sol"; +import {FheType} from "../contracts/FheType.sol"; -${coprocessorInterface} +${generateImplCoprocessorInterface(operators)} -${aclInterface} +${generateACLInterface()} -${inputVerifierInterface} +${generateInputVerifierInterface()} /** * @title Impl * @notice This library is the core implementation for computing FHE operations (e.g. add, sub, xor). */ library Impl { - /// @dev keccak256(abi.encode(uint256(keccak256("fhevm.storage.FHEVMConfig")) - 1)) & ~bytes32(uint256(0xff)) - bytes32 private constant FHEVMConfigLocation = 0xed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea600; + /// keccak256(abi.encode(uint256(keccak256("httpz.storage.HTTPZConfig")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant HTTPZConfigLocation = 0x15b1d18ad3df4183245a6a11b17d9fa31dc4c35ffbf591bdfd0f9704a799c300; /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ - function getFHEVMConfig() internal pure returns (FHEVMConfigStruct storage $) { + function getHTTPZConfig() internal pure returns (HTTPZConfigStruct storage $) { assembly { - $.slot := FHEVMConfigLocation + $.slot := HTTPZConfigLocation } } /** - * @notice Sets the FHEVM addresses. - * @param fhevmConfig FHEVM config struct that contains contract addresses. + * @notice Sets the coprocessor addresses. + * @param httpzConfig HTTPZ config struct that contains contract addresses. */ - function setFHEVM(FHEVMConfigStruct memory fhevmConfig) internal { - FHEVMConfigStruct storage $ = getFHEVMConfig(); - $.ACLAddress = fhevmConfig.ACLAddress; - $.TFHEExecutorAddress = fhevmConfig.TFHEExecutorAddress; - $.KMSVerifierAddress = fhevmConfig.KMSVerifierAddress; - $.InputVerifierAddress = fhevmConfig.InputVerifierAddress; + function setCoprocessor(HTTPZConfigStruct memory httpzConfig) internal { + HTTPZConfigStruct storage $ = getHTTPZConfig(); + $.ACLAddress = httpzConfig.ACLAddress; + $.HTTPZExecutorAddress = httpzConfig.HTTPZExecutorAddress; + $.KMSVerifierAddress = httpzConfig.KMSVerifierAddress; + $.InputVerifierAddress = httpzConfig.InputVerifierAddress; } `); operators.forEach((op) => { switch (op.arguments) { case OperatorArguments.Binary: - res.push(binaryOperatorImpl(op)); + res.push(handleSolidityBinaryOperatorForImpl(op)); break; case OperatorArguments.Unary: - res.push(unaryOperatorImpl(op)); + res.push(handleUnaryOperatorForImpl(op)); break; } }); - res.push(implCustomMethods()); + res.push(generateCustomMethodsForImpl()); res.push('}\n'); return res.join(''); } -export function fhevmLibSol(operators: Operator[]): string { - const res: string[] = []; - - const fheLibInterface = generateImplFhevmLibInterface(operators); - - res.push(` -// SPDX-License-Identifier: BSD-3-Clause-Clear -pragma solidity ^0.8.24; - -${fheLibInterface} - -`); - - return res.join(''); -} - -function operatorFheLibFunction(op: Operator): string { - if (op.fheLibName) { - return op.fheLibName; - } - return `fhe${capitalizeFirstLetter(op.name)}`; -} - -function capitalizeFirstLetter(input: string): string { - const firstLetter = input.toUpperCase().charAt(0); - const theRest = input.substring(1); - return `${firstLetter}${theRest}`; -} - -function generateImplFhevmLibInterface(operators: Operator[]): string { - const res: string[] = []; - - res.push('interface FhevmLib {'); - res.push(fheLibCustomInterfaceFunctions()); - res.push('}'); - - return res.join('\n'); -} - function generateImplCoprocessorInterface(operators: Operator[]): string { const res: string[] = []; res.push(` /** - * @title FHEVMConfigStruct + * @title HTTPZConfigStruct * @notice This struct contains all addresses of core contracts, which are needed in a typical dApp. */ - struct FHEVMConfigStruct { + struct HTTPZConfigStruct { address ACLAddress; - address TFHEExecutorAddress; + address HTTPZExecutorAddress; address KMSVerifierAddress; address InputVerifierAddress; } /** - * @title ITFHEExecutor + * @title IHTTPZExecutor * @notice This interface contains all functions to conduct FHE operations. */ - interface ITFHEExecutor {`); + interface IHTTPZExecutor {`); operators.forEach((op) => { - let functionName = operatorFheLibFunction(op); const tail = 'external returns (bytes32 result);'; let functionArguments: string; switch (op.arguments) { @@ -224,24 +238,24 @@ function generateImplCoprocessorInterface(operators: Operator[]): string { res.push(` /** - * @notice Computes ${functionName} operation. + * @notice Computes ${op.fheLibName} operation. * @param lhs LHS. * @param rhs RHS. * @param scalarByte Scalar byte. * @return result Result. */ - function ${functionName}${functionArguments} ${tail}`); + function ${op.fheLibName}${functionArguments} ${tail}`); break; case OperatorArguments.Unary: functionArguments = '(bytes32 ct)'; res.push(` /** - * @notice Computes ${functionName} operation. + * @notice Computes ${op.fheLibName} operation. * @param ct Ct * @return result Result. */ - function ${functionName}${functionArguments} ${tail}`); + function ${op.fheLibName}${functionArguments} ${tail}`); break; } }); @@ -253,20 +267,6 @@ function generateImplCoprocessorInterface(operators: Operator[]): string { return res.join(''); } -function fheLibCustomInterfaceFunctions(): string { - return ` - /** - * @notice Verifies the ciphertext. - * @param inputHandle Input handle. - * @param callerAddress Address of the caller. - * @param inputProof Input proof. - * @param inputType Input type. - * @return result Result. - */ - function verifyCiphertext(bytes32 inputHandle, address callerAddress, address contractAddress, bytes memory inputProof, bytes1 inputType) external pure returns (bytes32 result); - `; -} - function coprocessorInterfaceCustomFunctions(): string { return ` /** @@ -277,7 +277,7 @@ function coprocessorInterfaceCustomFunctions(): string { * @param inputType Input type. * @return result Result. */ - function verifyCiphertext(bytes32 inputHandle, address callerAddress, bytes memory inputProof, bytes1 inputType) external returns (bytes32 result); + function verifyCiphertext(bytes32 inputHandle, address callerAddress, bytes memory inputProof, FheType inputType) external returns (bytes32 result); /** * @notice Performs the casting to a target type. @@ -285,7 +285,7 @@ function coprocessorInterfaceCustomFunctions(): string { * @param toType Target type. * @return result Result value of the target type. */ - function cast(bytes32 ct, bytes1 toType) external returns (bytes32 result); + function cast(bytes32 ct, FheType toType) external returns (bytes32 result); /** * @notice Does trivial encryption. @@ -293,7 +293,7 @@ function coprocessorInterfaceCustomFunctions(): string { * @param toType Target type. * @return result Result value of the target type. */ - function trivialEncrypt(uint256 ct, bytes1 toType) external returns (bytes32 result); + function trivialEncrypt(uint256 ct, FheType toType) external returns (bytes32 result); /** * @notice Does trivial encryption. @@ -301,7 +301,7 @@ function coprocessorInterfaceCustomFunctions(): string { * @param toType Target type. * @return result Result value of the target type. */ - function trivialEncrypt(bytes memory ct, bytes1 toType) external returns (bytes32 result); + function trivialEncrypt(bytes memory ct, FheType toType) external returns (bytes32 result); /** * @notice Computes FHEEq operation. @@ -335,7 +335,7 @@ function coprocessorInterfaceCustomFunctions(): string { * @param randType Type for the random result. * @return result Result. */ - function fheRand(bytes1 randType) external returns (bytes32 result); + function fheRand(FheType randType) external returns (bytes32 result); /** * @notice Computes FHERandBounded operation. @@ -343,7 +343,7 @@ function coprocessorInterfaceCustomFunctions(): string { * @param randType Type for the random result. * @return result Result. */ - function fheRandBounded(uint256 upperBound, bytes1 randType) external returns (bytes32 result); + function fheRandBounded(uint256 upperBound, FheType randType) external returns (bytes32 result); `; } @@ -373,10 +373,9 @@ function generateACLInterface(): string { */ function allow(bytes32 handle, address account) external; - /** * @dev This function removes the transient allowances, which could be useful for integration with - * Account Abstraction when bundling several UserOps calling the TFHEExecutorCoprocessor. + * Account Abstraction when bundling several UserOps calling the HTTPZExecutor Coprocessor. */ function cleanTransientStorage() external; @@ -408,242 +407,318 @@ function generateInputVerifierInterface(): string { /** * @dev This function removes the transient allowances, which could be useful for integration with - * Account Abstraction when bundling several UserOps calling the TFHEExecutorCoprocessor. + * Account Abstraction when bundling several UserOps calling the HTTPZExecutor Coprocessor. */ function cleanTransientStorage() external; } `; } -export function tfheSol( - operators: Operator[], - supportedBits: number[], - mocked: boolean, -): [string, OverloadSignature[]] { - const signatures: OverloadSignature[] = []; +export function generateSolidityHTTPZLib(operators: Operator[], fheTypes: FheType[]): string { const res: string[] = []; res.push(`// SPDX-License-Identifier: BSD-3-Clause-Clear -pragma solidity ^0.8.24; - -import "./Impl.sol"; - + pragma solidity ^0.8.24; -${commonSolLib()} + import "./Impl.sol"; + import {FheType} from "../contracts/FheType.sol"; + ${createSolidityTypeAliasesFromFheTypes(fheTypes)} -/** - * @title TFHE - * @notice This library is the interaction point for all smart contract developers - * that interact with TFHE. - */ -library TFHE { - -/// @notice Returned if the input's length is greater than 64 bytes. -error InputLengthAbove64Bytes(uint256 inputLength); + /** + * @title HTTPZ + * @notice This library is the interaction point for all smart contract developers + * that interact with the HTTPZ protocol. + */ + library HTTPZ { -/// @notice Returned if the input's length is greater than 128 bytes. -error InputLengthAbove128Bytes(uint256 inputLength); + /// @notice Returned if the input's length is greater than 64 bytes. + error InputLengthAbove64Bytes(uint256 inputLength); -/// @notice Returned if the input's length is greater than 256 bytes. -error InputLengthAbove256Bytes(uint256 inputLength); + /// @notice Returned if the input's length is greater than 128 bytes. + error InputLengthAbove128Bytes(uint256 inputLength); - /** - * @notice Sets the FHEVM addresses. - * @param fhevmConfig FHEVM config struct that contains contract addresses. - */ - function setFHEVM(FHEVMConfigStruct memory fhevmConfig) internal { - Impl.setFHEVM(fhevmConfig); - } -`); + /// @notice Returned if the input's length is greater than 256 bytes. + error InputLengthAbove256Bytes(uint256 inputLength); - if (mocked) { - res.push(` /** - * @dev Returns true if the encrypted bool is initialized and false otherwise. + * @notice Sets the coprocessor addresses. + * @param httpzConfig HTTPZ config struct that contains contract addresses. */ - function isInitialized(ebool /*v*/) internal pure returns (bool) { - return true; - } - `); - supportedBits.forEach((b) => { - res.push(` - /** - * @dev Returns true if the encrypted integer is initialized and false otherwise. - */ - function isInitialized(euint${b} /*v*/) internal pure returns (bool) { - return true; - } - `); - }); - } else { - res.push(` - /** - * @dev Returns true if the encrypted integer is initialized and false otherwise. - */ - function isInitialized(ebool v) internal pure returns (bool) { - return ebool.unwrap(v) != 0; + function setCoprocessor(HTTPZConfigStruct memory httpzConfig) internal { + Impl.setCoprocessor(httpzConfig); } `); - supportedBits.forEach((b) => { - res.push(` - /** - * @dev Returns true if the encrypted integer is initialized and false otherwise. - */ - function isInitialized(euint${b} v) internal pure returns (bool) { - return euint${b}.unwrap(v) != 0; - } - `); - }); - } - supportedBits.forEach((lhsBits) => { - supportedBits.forEach((rhsBits) => { + // 1. Exclude types that do not support any operators. + const adjustedFheTypes = generateAdjustedFheTypeArray(fheTypes); + + // 2. Generate isInitialized function for all supported types + adjustedFheTypes.forEach((fheType: AdjustedFheType) => { + res.push(handleSolidityTFHEIsInitialized(fheType)); + }); + + // 3. Handle encrypted operators for two encrypted types + adjustedFheTypes.forEach((lhsFheType: AdjustedFheType) => { + adjustedFheTypes.forEach((rhsFheType: AdjustedFheType) => { operators.forEach((operator) => { - if (!operator.shiftOperator && !operator.rotateOperator) - res.push(tfheEncryptedOperator(lhsBits, rhsBits, operator, signatures)); + res.push(handleSolidityTFHEEncryptedOperatorForTwoEncryptedTypes(lhsFheType, rhsFheType, operator)); }); }); + }); + + // 4. Handle scalar operators for all supported types + adjustedFheTypes.forEach((fheType: AdjustedFheType) => { operators.forEach((operator) => { - if (!operator.shiftOperator && !operator.rotateOperator) - res.push(tfheScalarOperator(lhsBits, lhsBits, operator, signatures)); + res.push(generateSolidityTFHEScalarOperator(fheType, operator)); }); }); - supportedBits.forEach((bits) => { + // 5. Handle shift & rotate operators for all supported types + adjustedFheTypes.forEach((fheType: AdjustedFheType) => { operators.forEach((operator) => { - if (operator.shiftOperator || operator.rotateOperator) - res.push(tfheShiftOperators(bits, operator, signatures, !!operator.rotateOperator, mocked)); + res.push(handleSolidityTFHEShiftOperator(fheType, operator)); }); }); - // TODO: Decide whether we want to have mixed-inputs for CMUX/Select - supportedBits.forEach((bits) => res.push(tfheSelect(bits))); - supportedBits.forEach((outputBits) => { - supportedBits.forEach((inputBits) => { - res.push(tfheAsEboolCustomCast(inputBits, outputBits)); + // 6. Handle ternary operator (i.e., select) for all supported types + adjustedFheTypes.forEach((fheType: AdjustedFheType) => res.push(handleSolidityTFHESelect(fheType))); + + // 7. Handle custom casting (1) between euint types and (2) between an euint type and ebool. + adjustedFheTypes.forEach((outputFheType: AdjustedFheType) => { + adjustedFheTypes.forEach((inputFheType: AdjustedFheType) => { + res.push(handleSolidityTFHECustomCastBetweenTwoEuint(inputFheType, outputFheType)); }); - res.push(tfheAsEboolUnaryCast(outputBits)); + res.push(handleSolidityTFHECustomCastBetweenEboolAndEuint(outputFheType)); }); - supportedBits.forEach((bits) => res.push(tfheUnaryOperators(bits, operators, signatures))); - supportedBits.forEach((bits) => res.push(tfheCustomUnaryOperators(bits, signatures, mocked))); - res.push(tfheCustomMethods()); + // 8. Handle unary operators for all supported types. + adjustedFheTypes.forEach((fheType: AdjustedFheType) => + res.push(handleSolidityTFHEUnaryOperators(fheType, operators)), + ); + + // 9. Handle conversion from plaintext and einput to all supported types (e.g., einput --> ebool, bytes memory --> ebytes64, uint32 --> euint32) + adjustedFheTypes.forEach((fheType: AdjustedFheType) => + res.push(handleSolidityTFHEConvertPlaintextAndEinputToRespectiveType(fheType)), + ); + + // 10. Handle rand/randBounded for all supported types + adjustedFheTypes.forEach((fheType: AdjustedFheType) => res.push(handleSolidityTFHERand(fheType))); - res.push(tfheAclMethods(supportedBits)); + // 11. Add padding to bytes for all ebytes types + adjustedFheTypes.forEach((fheType: AdjustedFheType) => res.push(handleTFHEPadToBytesForEbytes(fheType))); + + // 12. Push ACL Solidity methods + res.push(generateSolidityACLMethods(adjustedFheTypes)); res.push('}\n'); - return [res.join(''), signatures]; + return res.join(''); } -function tfheEncryptedOperator( - lhsBits: number, - rhsBits: number, +function handleSolidityTFHEEncryptedOperatorForTwoEncryptedTypes( + lhsFheType: AdjustedFheType, + rhsFheType: AdjustedFheType, operator: Operator, - signatures: OverloadSignature[], ): string { + const res: string[] = []; + + if (operator.shiftOperator || operator.rotateOperator) { + return ''; + } + if (!operator.hasEncrypted || operator.arguments != OperatorArguments.Binary) { return ''; } - const res: string[] = []; + if ( + !lhsFheType.supportedOperators.includes(operator.name) || + !rhsFheType.supportedOperators.includes(operator.name) + ) { + return ''; + } - const outputBits = Math.max(lhsBits, rhsBits); - const castLeftToRight = lhsBits < rhsBits; - const castRightToLeft = lhsBits > rhsBits; - const returnType = - operator.returnType == ReturnType.Uint - ? `euint${outputBits}` - : operator.returnType == ReturnType.Ebool - ? `ebool` - : assert(false, 'Unknown return type'); - const returnTypeOverload: ArgumentType = - operator.returnType == ReturnType.Uint ? ArgumentType.EUint : ArgumentType.Ebool; - const scalarFlag = operator.hasEncrypted && operator.hasScalar ? ', false' : ''; - - const leftExpr = castLeftToRight ? `asEuint${outputBits}(a)` : 'a'; - const rightExpr = castRightToLeft ? `asEuint${outputBits}(b)` : 'b'; - let implExpression = `Impl.${operator.name}(euint${outputBits}.unwrap(${leftExpr}), euint${outputBits}.unwrap(${rightExpr})${scalarFlag})`; - signatures.push({ - name: operator.name, - arguments: [ - { type: ArgumentType.EUint, bits: lhsBits }, - { type: ArgumentType.EUint, bits: rhsBits }, - ], - returnType: { type: returnTypeOverload, bits: outputBits }, - }); - res.push(` + if (lhsFheType.type.startsWith('Uint') && rhsFheType.type.startsWith('Uint')) { + // Determine the maximum number of bits between lhsBits and rhsBits + const outputBits = Math.max(lhsFheType.bitLength, rhsFheType.bitLength); + const castLeftToRight = lhsFheType.bitLength < rhsFheType.bitLength; + const castRightToLeft = lhsFheType.bitLength > rhsFheType.bitLength; + + const returnType = + operator.returnType == ReturnType.Euint + ? `euint${outputBits}` + : operator.returnType == ReturnType.Ebool + ? `ebool` + : assert(false, 'Unknown return type'); + + const scalarFlag = operator.hasEncrypted && operator.hasScalar ? ', false' : ''; + const leftExpr = castLeftToRight ? `asEuint${outputBits}(a)` : 'a'; + const rightExpr = castRightToLeft ? `asEuint${outputBits}(b)` : 'b'; + let implExpression = `Impl.${operator.name}(euint${outputBits}.unwrap(${leftExpr}), euint${outputBits}.unwrap(${rightExpr})${scalarFlag})`; + + res.push(` /** - * @dev Evaluates ${operator.name}(a, b) and returns the result. + * @dev Evaluates ${operator.name}(e${lhsFheType.type.toLowerCase()} a, e${rhsFheType.type.toLowerCase()} b) and returns the result. */ - function ${operator.name}(euint${lhsBits} a, euint${rhsBits} b) internal returns (${returnType}) { + function ${operator.name}(e${lhsFheType.type.toLowerCase()} a, e${rhsFheType.type.toLowerCase()} b) internal returns (${returnType}) { if (!isInitialized(a)) { - a = asEuint${lhsBits}(0); + a = asE${lhsFheType.type.toLowerCase()}(0); } if (!isInitialized(b)) { - b = asEuint${rhsBits}(0); + b = asE${rhsFheType.type.toLowerCase()}(0); } return ${returnType}.wrap(${implExpression}); } `); + } else if (lhsFheType.type === 'Bool' && rhsFheType.type === 'Bool') { + res.push(` + /** + * @dev Evaluates ${operator.name}(ebool a, ebool b) and returns the result. + */ + function ${operator.name}(ebool a, ebool b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEbool(false); + } + if (!isInitialized(b)) { + b = asEbool(false); + } + return ebool.wrap(Impl.${operator.name}(ebool.unwrap(a), ebool.unwrap(b), false)); + } +`); + } else if (lhsFheType.type == rhsFheType.type && rhsFheType.type.startsWith('Bytes')) { + const bytesLength = lhsFheType.bitLength / 8; + + res.push(` + /** + * @dev Evaluates ${operator.name}(e${lhsFheType.type.toLowerCase()} a, e${rhsFheType.type.toLowerCase()} b) and returns the result. + */ + function ${operator.name}(e${lhsFheType.type.toLowerCase()} a, e${rhsFheType.type.toLowerCase()} b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEbytes${bytesLength}(padToBytes${bytesLength}(hex"")); + } + if (!isInitialized(b)) { + b = asEbytes${bytesLength}(padToBytes${bytesLength}(hex"")); + } + return ebool.wrap(Impl.${operator.name}(e${lhsFheType.type.toLowerCase()}.unwrap(a), e${rhsFheType.type.toLowerCase()}.unwrap(b), false)); + } + `); + } else if (lhsFheType.type.startsWith('Address') && rhsFheType.type.startsWith('Address')) { + res.push(` + /** + * @dev Evaluates ${operator.name}(eaddress a, eaddress b) and returns the result. + */ + function ${operator.name}(eaddress a, eaddress b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEaddress(address(0)); + } + if (!isInitialized(b)) { + b = asEaddress(address(0)); + } + return ebool.wrap(Impl.${operator.name}(eaddress.unwrap(a), eaddress.unwrap(b), false)); + } + `); + } else if (lhsFheType.type.startsWith('Int') && rhsFheType.type.startsWith('Int')) { + throw new Error('Int types are not supported!'); + } return res.join(''); } -function tfheScalarOperator( - lhsBits: number, - rhsBits: number, - operator: Operator, - signatures: OverloadSignature[], -): string { +function generateSolidityTFHEScalarOperator(fheType: AdjustedFheType, operator: Operator): string { + const res: string[] = []; + + if (operator.shiftOperator || operator.rotateOperator) { + return ''; + } + if (operator.arguments != OperatorArguments.Binary) { return ''; } - if (!operator.hasScalar || lhsBits != rhsBits) { + if (!operator.hasScalar) { return ''; } - const res: string[] = []; + if (!fheType.supportedOperators.includes(operator.name)) { + return ''; + } - const outputBits = Math.max(lhsBits, rhsBits); const returnType = - operator.returnType == ReturnType.Uint - ? `euint${outputBits}` + operator.returnType == ReturnType.Euint + ? `e${fheType.type.toLowerCase()} ` : operator.returnType == ReturnType.Ebool ? `ebool` : assert(false, 'Unknown return type'); - const returnTypeOverload = operator.returnType == ReturnType.Uint ? ArgumentType.EUint : ArgumentType.Ebool; - var scalarFlag = operator.hasEncrypted && operator.hasScalar ? ', true' : ''; + + let scalarFlag = operator.hasEncrypted && operator.hasScalar ? ', true' : ''; const leftOpName = operator.leftScalarInvertOp ?? operator.name; - var implExpressionA = `Impl.${operator.name}(euint${outputBits}.unwrap(a), bytes32(uint256(b))${scalarFlag})`; - var implExpressionB = `Impl.${leftOpName}(euint${outputBits}.unwrap(b), bytes32(uint256(a))${scalarFlag})`; - var maybeEncryptLeft = ''; + + let implExpressionA; + + if (fheType.type == 'Bool') { + implExpressionA = `Impl.${operator.name}(e${fheType.type.toLowerCase()}.unwrap(a), bytes32(uint256(b?1:0))${scalarFlag})`; + } else if (fheType.type.startsWith('Bytes')) { + implExpressionA = `Impl.${operator.name}(e${fheType.type.toLowerCase()}.unwrap(a), b${scalarFlag})`; + } else if (fheType.type.startsWith('Int')) { + throw new Error('Int types are not supported!'); + } else { + implExpressionA = `Impl.${operator.name}(e${fheType.type.toLowerCase()}.unwrap(a), bytes32(uint256(${ + fheType.isAlias && fheType.clearMatchingTypeAlias !== undefined + ? `${fheType.clearMatchingTypeAlias.toLowerCase()}(b)` + : 'b' + }))${scalarFlag})`; + } + + let implExpressionB; + + if (fheType.type == 'Bool') { + implExpressionB = `Impl.${leftOpName}(e${fheType.type.toLowerCase()}.unwrap(b), bytes32(uint256(a?1:0))${scalarFlag})`; + } else if (fheType.type.startsWith('Bytes')) { + implExpressionB = `Impl.${leftOpName}(e${fheType.type.toLowerCase()}.unwrap(b), a${scalarFlag})`; + } else if (fheType.type.startsWith('Int')) { + throw new Error('Int types are not supported yet!'); + } else { + implExpressionB = `Impl.${leftOpName}(e${fheType.type.toLowerCase()}.unwrap(b), bytes32(uint256(${ + fheType.isAlias && fheType.clearMatchingTypeAlias !== undefined + ? `${fheType.clearMatchingTypeAlias.toLowerCase()}(a)` + : 'a' + }))${scalarFlag})`; + } + + let maybeEncryptLeft = ''; + if (operator.leftScalarEncrypt) { // workaround until tfhe-rs left scalar support: // do the trivial encryption and preserve order of operations scalarFlag = ', false'; - maybeEncryptLeft = `euint${outputBits} aEnc = asEuint${outputBits}(a);`; - implExpressionB = `Impl.${leftOpName}(euint${outputBits}.unwrap(aEnc), euint${outputBits}.unwrap(b)${scalarFlag})`; + maybeEncryptLeft = `e${fheType.type.toLowerCase()} aEnc = asE${fheType.type.toLowerCase()}(a);`; + implExpressionB = `Impl.${leftOpName}(e${fheType.type.toLowerCase()}.unwrap(aEnc), e${fheType.type.toLowerCase()}.unwrap(b)${scalarFlag})`; } - signatures.push({ - name: operator.name, - arguments: [ - { type: ArgumentType.EUint, bits: lhsBits }, - { type: ArgumentType.Uint, bits: rhsBits }, - ], - returnType: { type: returnTypeOverload, bits: outputBits }, - }); + + const clearMatchingType = + fheType.type === 'Address' + ? fheType.clearMatchingType + : fheType.isAlias && fheType.clearMatchingTypeAlias !== undefined + ? fheType.clearMatchingTypeAlias + : fheType.clearMatchingType; // rhs scalar res.push(` + /** - * @dev Evaluates ${operator.name}(a, b) and returns the result. + * @dev Evaluates ${operator.name}(e${fheType.type.toLowerCase()} a, ${clearMatchingType.toLowerCase()} b) and returns the result. */ - function ${operator.name}(euint${lhsBits} a, ${getUint(rhsBits)} b) internal returns (${returnType}) { + function ${operator.name}(e${fheType.type.toLowerCase()} a, ${clearMatchingType.toLowerCase()} b) internal returns (${returnType}) { if (!isInitialized(a)) { - a = asEuint${lhsBits}(0); + a = asE${fheType.type.toLowerCase()}(${ + fheType.type == 'Bool' + ? 'false' + : fheType.type.startsWith('Bytes') + ? `padToBytes${fheType.bitLength / 8}(hex"")` + : fheType.type == 'Address' + ? `${clearMatchingType.toLowerCase()}(0)` + : 0 + }); } return ${returnType}.wrap(${implExpressionA}); } @@ -651,24 +726,23 @@ function tfheScalarOperator( // lhs scalar if (!operator.leftScalarDisable) { - signatures.push({ - name: operator.name, - arguments: [ - { type: ArgumentType.Uint, bits: rhsBits }, - { type: ArgumentType.EUint, bits: lhsBits }, - ], - returnType: { type: returnTypeOverload, bits: outputBits }, - }); - res.push(` /** - * @dev Evaluates ${operator.name}(a, b) and returns the result. + * @dev Evaluates ${operator.name}(${clearMatchingType.toLowerCase()} a, e${fheType.type.toLowerCase()} b) and returns the result. */ - function ${operator.name}(${getUint(lhsBits)} a, euint${rhsBits} b) internal returns (${returnType}) { + function ${operator.name}(${clearMatchingType.toLowerCase()} a, e${fheType.type.toLowerCase()} b) internal returns (${returnType}) { ${maybeEncryptLeft} if (!isInitialized(b)) { - b = asEuint${rhsBits}(0); + b = asE${fheType.type.toLowerCase()}(${ + fheType.type == 'Bool' + ? 'false' + : fheType.type.startsWith('Bytes') + ? `padToBytes${fheType.bitLength / 8}(hex"")` + : fheType.type == 'Address' + ? `${clearMatchingType.toLowerCase()}(0)` + : 0 + }); } return ${returnType}.wrap(${implExpressionB}); } @@ -678,1221 +752,349 @@ function tfheScalarOperator( return res.join(''); } -function tfheShiftOperators( - inputBits: number, - operator: Operator, - signatures: OverloadSignature[], - rotate: boolean, - mocked: boolean, -): string { +function handleSolidityTFHEIsInitialized(fheType: AdjustedFheType): string { + return ` + /** + * @dev Returns true if the encrypted integer is initialized and false otherwise. + */ + function isInitialized(e${fheType.type.toLowerCase()} v) internal pure returns (bool) { + return e${fheType.type.toLowerCase()}.unwrap(v) != 0; + } + `; +} + +function handleSolidityTFHEShiftOperator(fheType: AdjustedFheType, operator: Operator): string { const res: string[] = []; - // Code and test for shift(euint{inputBits},euint8} - const outputBits = inputBits; - const lhsBits = inputBits; - const rhsBits = 8; - const castRightToLeft = lhsBits > rhsBits; - - const returnType = `euint${outputBits}`; - - const returnTypeOverload: ArgumentType = ArgumentType.EUint; - let scalarFlag = ', false'; - - const leftExpr = 'a'; - const rightExpr = castRightToLeft ? `asEuint${outputBits}(b)` : 'b'; - let implExpression: string; - if (mocked) { - if (rotate) { - implExpression = `Impl.${operator.name}(euint${outputBits}.unwrap(${leftExpr}), euint${outputBits}.unwrap(${rightExpr}) % ${lhsBits}, ${lhsBits}${scalarFlag})`; - } else { - implExpression = `Impl.${operator.name}(euint${outputBits}.unwrap(${leftExpr}), euint${outputBits}.unwrap(${rightExpr}) % ${lhsBits}${scalarFlag})`; - } - } else { - implExpression = `Impl.${operator.name}(euint${outputBits}.unwrap(${leftExpr}), euint${outputBits}.unwrap(${rightExpr})${scalarFlag})`; + if (!operator.shiftOperator && !operator.rotateOperator) { + return res.join(); } - if (inputBits >= 8) { - signatures.push({ - name: operator.name, - arguments: [ - { type: ArgumentType.EUint, bits: lhsBits }, - { type: ArgumentType.EUint, bits: rhsBits }, - ], - returnType: { type: returnTypeOverload, bits: outputBits }, - }); + if (fheType.supportedOperators.includes(operator.name)) { + const lhsBits = fheType.bitLength; + const rhsBits = 8; + const castRightToLeft = lhsBits > rhsBits; + + let scalarFlag = ', false'; + + const leftExpr = 'a'; + const rightExpr = castRightToLeft ? `asE${fheType.type.toLowerCase()}(b)` : 'b'; + let implExpression: string = `Impl.${operator.name}(e${fheType.type.toLowerCase()}.unwrap(${leftExpr}), e${fheType.type.toLowerCase()}.unwrap(${rightExpr})${scalarFlag})`; res.push(` /** - * @dev Evaluates ${operator.name}(a, b) and returns the result. + * @dev Evaluates ${operator.name}(euint${lhsBits} a, euint${rhsBits} b) and returns the result. */ - function ${operator.name}(euint${lhsBits} a, euint${rhsBits} b) internal returns (${returnType}) { + function ${operator.name}(euint${lhsBits} a, euint${rhsBits} b) internal returns (e${fheType.type.toLowerCase()}) { if (!isInitialized(a)) { a = asEuint${lhsBits}(0); } if (!isInitialized(b)) { b = asEuint${rhsBits}(0); } - return ${returnType}.wrap(${implExpression}); + return e${fheType.type.toLowerCase()}.wrap(${implExpression}); } `); - } - // Code and test for shift(euint{inputBits},uint8} - scalarFlag = ', true'; - implExpression = `Impl.${operator.name}(euint${outputBits}.unwrap(a), bytes32(uint256(b))${scalarFlag})`; - if (mocked) { - if (rotate) { - implExpression = `Impl.${operator.name}(euint${outputBits}.unwrap(a), bytes32(uint256(b)) % ${lhsBits}, ${lhsBits}${scalarFlag})`; - } else { - implExpression = `Impl.${operator.name}(euint${outputBits}.unwrap(a), bytes32(uint256(b)) % ${lhsBits}${scalarFlag})`; - } - } - signatures.push({ - name: operator.name, - arguments: [ - { type: ArgumentType.EUint, bits: lhsBits }, - { type: ArgumentType.Uint, bits: rhsBits }, - ], - returnType: { type: returnTypeOverload, bits: outputBits }, - }); - res.push(` + // Code and test for shift(euint{inputBits},uint8} + scalarFlag = ', true'; + implExpression = `Impl.${operator.name}(e${fheType.type.toLowerCase()}.unwrap(a), bytes32(uint256(b))${scalarFlag})`; + + res.push(` /** - * @dev Evaluates ${operator.name}(a, b) and returns the result. + * @dev Evaluates ${operator.name}(e${fheType.type.toLowerCase()} a, ${getUint(rhsBits)}) and returns the result. */ - function ${operator.name}(euint${lhsBits} a, ${getUint(rhsBits)} b) internal returns (${returnType}) { + function ${operator.name}(e${fheType.type.toLowerCase()} a, ${getUint(rhsBits)} b) internal returns (e${fheType.type.toLowerCase()}) { if (!isInitialized(a)) { - a = asEuint${lhsBits}(0); + a = asE${fheType.type.toLowerCase()}(0); } - return ${returnType}.wrap(${implExpression}); + return e${fheType.type.toLowerCase()}.wrap(${implExpression}); } `); + } return res.join(''); } -function tfheSelect(inputBits: number): string { - return ` +function handleSolidityTFHESelect(fheType: AdjustedFheType): string { + let res = ''; + + if (fheType.supportedOperators.includes('select')) { + res += ` /** * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. - * If 'control's value is 'false', the result has the same value as 'ifFalse'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. */ - function select(ebool control, euint${inputBits} a, euint${inputBits} b) internal returns (euint${inputBits}) { - return euint${inputBits}.wrap(Impl.select(ebool.unwrap(control), euint${inputBits}.unwrap(a), euint${inputBits}.unwrap(b))); + function select(ebool control, e${fheType.type.toLowerCase()} a, e${fheType.type.toLowerCase()} b) internal returns (e${fheType.type.toLowerCase()}) { + return e${fheType.type.toLowerCase()}.wrap(Impl.select(ebool.unwrap(control), e${fheType.type.toLowerCase()}.unwrap(a), e${fheType.type.toLowerCase()}.unwrap(b))); }`; + } + + return res; } -function tfheAsEboolCustomCast(inputBits: number, outputBits: number): string { - if (inputBits == outputBits) { +function handleSolidityTFHECustomCastBetweenTwoEuint( + inputFheType: AdjustedFheType, + outputFheType: AdjustedFheType, +): string { + if ( + inputFheType.type == outputFheType.type || + !inputFheType.type.startsWith('Uint') || + !outputFheType.type.startsWith('Uint') + ) { return ''; } return ` /** - * @dev Casts an encrypted integer from euint${inputBits} to euint${outputBits}. + * @dev Casts an encrypted integer from 'e${inputFheType.type.toLowerCase()}' to 'e${outputFheType.type.toLowerCase()}'. */ - function asEuint${outputBits}(euint${inputBits} value) internal returns (euint${outputBits}) { - return euint${outputBits}.wrap(Impl.cast(euint${inputBits}.unwrap(value), Common.euint${outputBits}_t)); + function asE${outputFheType.type.toLowerCase()}(e${inputFheType.type.toLowerCase()} value) internal returns (e${outputFheType.type.toLowerCase()}) { + return e${outputFheType.type.toLowerCase()}.wrap(Impl.cast(e${inputFheType.type.toLowerCase()}.unwrap(value), FheType.${outputFheType.type})); } `; } -function tfheAsEboolUnaryCast(bits: number): string { +function handleSolidityTFHECustomCastBetweenEboolAndEuint(fheType: AdjustedFheType): string { const res: string[] = []; - res.push(` - /** - * @dev Casts an encrypted integer from euint${bits} to ebool. - */ - function asEbool(euint${bits} value) internal returns (ebool) { - return ne(value, 0); - } - `); - if (bits == 8) { + if (fheType.type.startsWith('Uint')) { res.push(` /** - * @dev Converts an inputHandle with corresponding inputProof to an encrypted boolean. - */ - function asEbool(einput inputHandle, bytes memory inputProof) internal returns (ebool) { - return ebool.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebool_t)); + /** + * @dev Converts an 'ebool' to an 'e${fheType.type.toLowerCase()}'. + */ + function asE${fheType.type.toLowerCase()}(ebool b) internal returns (e${fheType.type.toLowerCase()}) { + return e${fheType.type.toLowerCase()}.wrap(Impl.cast(ebool.unwrap(b), FheType.${fheType.type})); } + `); - /** - * @dev Converts a plaintext value to an encrypted boolean. - */ - function asEbool(uint256 value) internal returns (ebool) { - return ebool.wrap(Impl.trivialEncrypt(value, Common.ebool_t)); + if (fheType.supportedOperators.includes('ne')) { + res.push(` + /** + * @dev Casts an encrypted integer from 'e${fheType.type.toLowerCase()}' to 'ebool'. + */ + function asEbool(e${fheType.type.toLowerCase()} value) internal returns (ebool) { + return ne(value, 0); + } + `); } + } - /** - * @dev Converts a plaintext boolean to an encrypted boolean. - */ - function asEbool(bool value) internal returns (ebool) { - if (value) { - return asEbool(uint256(1)); - } else { - return asEbool(uint256(0)); + return res.join(''); +} + +function handleSolidityTFHEUnaryOperators(fheType: AdjustedFheType, operators: Operator[]): string { + const res: string[] = []; + + operators.forEach((op) => { + if (op.arguments == OperatorArguments.Unary && fheType.supportedOperators.includes(op.name)) { + res.push(` + /** + * @dev Evaluates ${op.name}(e${fheType.type.toLowerCase()} value) and returns the result. + */ + function ${op.name}(e${fheType.type.toLowerCase()} value) internal returns (e${fheType.type.toLowerCase()}) { + return e${fheType.type.toLowerCase()}.wrap(Impl.${op.name}(e${fheType.type.toLowerCase()}.unwrap(value))); } + `); } + }); - /** - * @dev Converts an 'ebool' to an 'euint8'. - */ - function asEuint8(ebool value) internal returns (euint8) { - return euint8.wrap(Impl.cast(ebool.unwrap(value), Common.euint8_t)); - } + return res.join('\n'); +} - /** - * @dev Evaluates and(a, b) and returns the result. +/** + * Generates Solidity functions to convert plaintext and encrypted input handles to their respective encrypted types. + * + * @param {AdjustedFheType} fheType - The Fully Homomorphic Encryption (FHE) type information. + * @returns {string} - The Solidity code for the conversion functions. + * + * The generated functions include: + * - A function to convert an `einput` handle and its proof to an encrypted type. + * - If the type is `Bool`, an additional function to convert a plaintext boolean to an encrypted boolean. + * - If the type is `Bytes`, an additional function to convert plaintext bytes to the respective encrypted type. + * - For other types, a function to convert a plaintext value to the respective encrypted type. + */ +function handleSolidityTFHEConvertPlaintextAndEinputToRespectiveType(fheType: AdjustedFheType): string { + let result = ` + /** + * @dev Convert an inputHandle with corresponding inputProof to an encrypted e${fheType.type.toLowerCase()} integer. */ - function and(ebool a, ebool b) internal returns (ebool) { - return ebool.wrap(Impl.and(ebool.unwrap(a), ebool.unwrap(b), false)); + function asE${fheType.type.toLowerCase()}(einput inputHandle, bytes memory inputProof) internal returns (e${fheType.type.toLowerCase()}) { + return e${fheType.type.toLowerCase()}.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, FheType.${fheType.isAlias ? fheType.aliasType : fheType.type})); } - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(ebool a, bool b) internal returns (ebool) { - return ebool.wrap(Impl.and(ebool.unwrap(a), bytes32(uint256(b?1:0)), true)); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(bool a, ebool b) internal returns (ebool) { - return ebool.wrap(Impl.and(ebool.unwrap(b), bytes32(uint256(a?1:0)), true)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(ebool a, ebool b) internal returns (ebool) { - return ebool.wrap(Impl.or(ebool.unwrap(a), ebool.unwrap(b), false)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(ebool a, bool b) internal returns (ebool) { - return ebool.wrap(Impl.or(ebool.unwrap(a), bytes32(uint256(b?1:0)), true)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(bool a, ebool b) internal returns (ebool) { - return ebool.wrap(Impl.or(ebool.unwrap(b), bytes32(uint256(a?1:0)), true)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(ebool a, ebool b) internal returns (ebool) { - return ebool.wrap(Impl.xor(ebool.unwrap(a), ebool.unwrap(b), false)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(ebool a, bool b) internal returns (ebool) { - return ebool.wrap(Impl.xor(ebool.unwrap(a), bytes32(uint256(b?1:0)), true)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(bool a, ebool b) internal returns (ebool) { - return ebool.wrap(Impl.xor(ebool.unwrap(b), bytes32(uint256(a?1:0)), true)); - } - - function not(ebool a) internal returns (ebool) { - return ebool.wrap(Impl.not(ebool.unwrap(a))); - } - `); - } else { - res.push(` - /** - * @dev Converts an 'ebool' to an 'euint${bits}'. - */ - function asEuint${bits}(ebool b) internal returns (euint${bits}) { - return euint${bits}.wrap(Impl.cast(ebool.unwrap(b), Common.euint${bits}_t)); - } - `); - } - - return res.join(''); -} - -function tfheUnaryOperators(bits: number, operators: Operator[], signatures: OverloadSignature[]): string { - const res: string[] = []; - - operators.forEach((op) => { - if (op.arguments == OperatorArguments.Unary) { - signatures.push({ - name: op.name, - arguments: [{ type: ArgumentType.EUint, bits }], - returnType: { type: ArgumentType.EUint, bits }, - }); - - res.push(` - function ${op.name}(euint${bits} value) internal returns (euint${bits}) { - return euint${bits}.wrap(Impl.${op.name}(euint${bits}.unwrap(value))); - } - `); - } - }); - - return res.join('\n'); -} - -function tfheCustomUnaryOperators(bits: number, signatures: OverloadSignature[], mocked: boolean): string { - let result = ` - /** - * @dev Convert an inputHandle with corresponding inputProof to an encrypted euint${bits} integer. - */ - function asEuint${bits}(einput inputHandle, bytes memory inputProof) internal returns (euint${bits}) { - return euint${bits}.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint${bits}_t)); - } - - /** - * @dev Convert a plaintext value to an encrypted euint${bits} integer. - */ - function asEuint${bits}(uint256 value) internal returns (euint${bits}) { - return euint${bits}.wrap(Impl.trivialEncrypt(value, Common.euint${bits}_t)); - } - - `; - return result; -} - -function unaryOperatorImpl(op: Operator): string { - let fname = operatorFheLibFunction(op); - return ` - function ${op.name}(bytes32 ct) internal returns (bytes32 result) { - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).${fname}(ct); - } - `; -} - -function tfheAclMethods(supportedBits: number[]): string { - const res: string[] = []; - - res.push( - ` - /** - * @dev This function cleans the transient storage for the ACL (accounts) and the InputVerifier - * (input proofs). - * This could be useful for integration with Account Abstraction when bundling several - * UserOps calling the TFHEExecutorCoprocessor. - */ - function cleanTransientStorage() internal { - Impl.cleanTransientStorageACL(); - Impl.cleanTransientStorageInputVerifier(); - } - - /** - * @dev Returns whether the account is allowed to use the value. - */ - function isAllowed(ebool value, address account) internal view returns (bool) { - return Impl.isAllowed(ebool.unwrap(value), account); - } - `, - ); - - supportedBits.forEach((bits) => - res.push(` - /** - * @dev Returns whether the account is allowed to use the value. - */ - function isAllowed(euint${bits} value, address account) internal view returns (bool) { - return Impl.isAllowed(euint${bits}.unwrap(value), account); - }`), - ); - - res.push( - ` - /** - * @dev Returns whether the account is allowed to use the value. - */ - function isAllowed(eaddress value, address account) internal view returns(bool) { - return Impl.isAllowed(eaddress.unwrap(value), account); - } - - /** - * @dev Returns whether the account is allowed to use the value. - */ - function isAllowed(ebytes256 value, address account) internal view returns (bool) { - return Impl.isAllowed(ebytes256.unwrap(value), account); - } - - /** - * @dev Returns whether the sender is allowed to use the value. - */ - function isSenderAllowed(ebool value) internal view returns (bool) { - return Impl.isAllowed(ebool.unwrap(value), msg.sender); - } - `, - ); - - supportedBits.forEach((bits) => - res.push( - ` - /** - * @dev Returns whether the sender is allowed to use the value. - */ - function isSenderAllowed(euint${bits} value) internal view returns (bool) { - return Impl.isAllowed(euint${bits}.unwrap(value), msg.sender); - } - `, - ), - ); - - res.push( - ` - /** - * @dev Returns whether the sender is allowed to use the value. - */ - function isSenderAllowed(eaddress value) internal view returns(bool) { - return Impl.isAllowed(eaddress.unwrap(value), msg.sender); - } - - /** - * @dev Returns whether the sender is allowed to use the value. - */ - function isSenderAllowed(ebytes256 value) internal view returns(bool) { - return Impl.isAllowed(ebytes256.unwrap(value), msg.sender); - } - `, - ); - - res.push( - ` - function allow(ebool value, address account) internal { - Impl.allow(ebool.unwrap(value), account); - } - - function allowThis(ebool value) internal { - Impl.allow(ebool.unwrap(value), address(this)); - } - `, - ); - - supportedBits.forEach((bits) => - res.push( - ` - /** - * @dev Allows the use of value for the address account. - */ - function allow(euint${bits} value, address account) internal { - Impl.allow(euint${bits}.unwrap(value), account); - } - - /** - * @dev Allows the use of value for this address (address(this)). - */ - function allowThis(euint${bits} value) internal { - Impl.allow(euint${bits}.unwrap(value), address(this)); - } - \n`, - ), - ); - - res.push( - ` - /** - * @dev Allows the use of value for the address account. - */ - function allow(eaddress value, address account) internal { - Impl.allow(eaddress.unwrap(value), account); - } - - /** - * @dev Allows the use of value for this address (address(this)). - */ - function allowThis(eaddress value) internal { - Impl.allow(eaddress.unwrap(value), address(this)); - } - - /** - * @dev Allows the use of value for the address account. - */ - function allow(ebytes64 value, address account) internal { - Impl.allow(ebytes64.unwrap(value), account); - } - - /** - * @dev Allows the use of value for this address (address(this)). - */ - function allowThis(ebytes64 value) internal { - Impl.allow(ebytes64.unwrap(value), address(this)); - } - - /** - * @dev Allows the use of value for the address account. - */ - function allow(ebytes128 value, address account) internal { - Impl.allow(ebytes128.unwrap(value), account); - } - - /** - * @dev Allows the use of value for this address (address(this)). - */ - function allowThis(ebytes128 value) internal { - Impl.allow(ebytes128.unwrap(value), address(this)); - } - - /** - * @dev Allows the use of value for the address account. - */ - function allow(ebytes256 value, address account) internal { - Impl.allow(ebytes256.unwrap(value), account); - } - - /** - * @dev Allows the use of value for this address (address(this)). - */ - function allowThis(ebytes256 value) internal { - Impl.allow(ebytes256.unwrap(value), address(this)); - } - `, - ); - - res.push( - ` - /** - * @dev Allows the use of value by address account for this transaction. - */ - function allowTransient(ebool value, address account) internal { - Impl.allowTransient(ebool.unwrap(value), account); - } - `, - ); - - supportedBits.forEach((bits) => - res.push( - ` - /** - * @dev Allows the use of value by address account for this transaction. - */ - function allowTransient(euint${bits} value, address account) internal { - Impl.allowTransient(euint${bits}.unwrap(value), account); - } - \n`, - ), - ); - - res.push( - ` - /** - * @dev Allows the use of value by address account for this transaction. - */ - function allowTransient(eaddress value, address account) internal { - Impl.allowTransient(eaddress.unwrap(value), account); - } - - /** - * @dev Allows the use of value by address account for this transaction. - */ - function allowTransient(ebytes64 value, address account) internal { - Impl.allowTransient(ebytes64.unwrap(value), account); - } - - /** - * @dev Allows the use of value by address account for this transaction. - */ - function allowTransient(ebytes128 value, address account) internal { - Impl.allowTransient(ebytes128.unwrap(value), account); - } - - /** - * @dev Allows the use of value by address account for this transaction. - */ - function allowTransient(ebytes256 value, address account) internal { - Impl.allowTransient(ebytes256.unwrap(value), account); - } - `, - ); - - return res.join(''); -} - -function tfheCustomMethods(): string { - let result = ` - /** - * @dev Generates a random encrypted boolean. - */ - function randEbool() internal returns (ebool) { - return ebool.wrap(Impl.rand(Common.ebool_t)); - } - - /** - * @dev Generates a random encrypted 4-bit unsigned integer. - */ - function randEuint4() internal returns (euint4) { - return euint4.wrap(Impl.rand(Common.euint4_t)); - } - - /** - * @dev Generates a random encrypted 4-bit unsigned integer in the [0, upperBound) range. - * The upperBound must be a power of 2. - */ - function randEuint4(uint8 upperBound) internal returns (euint4) { - return euint4.wrap(Impl.randBounded(upperBound, Common.euint4_t)); - } - - /** - * @dev Generates a random encrypted 8-bit unsigned integer. - */ - function randEuint8() internal returns (euint8) { - return euint8.wrap(Impl.rand(Common.euint8_t)); - } - - /** - * @dev Generates a random encrypted 8-bit unsigned integer in the [0, upperBound) range. - * The upperBound must be a power of 2. - */ - function randEuint8(uint8 upperBound) internal returns (euint8) { - return euint8.wrap(Impl.randBounded(upperBound, Common.euint8_t)); - } - - /** - * @dev Generates a random encrypted 16-bit unsigned integer. - */ - function randEuint16() internal returns (euint16) { - return euint16.wrap(Impl.rand(Common.euint16_t)); - } - - /** - * @dev Generates a random encrypted 16-bit unsigned integer in the [0, upperBound) range. - * The upperBound must be a power of 2. - */ - function randEuint16(uint16 upperBound) internal returns (euint16) { - return euint16.wrap(Impl.randBounded(upperBound, Common.euint16_t)); - } - - /** - * @dev Generates a random encrypted 32-bit unsigned integer. - */ - function randEuint32() internal returns (euint32) { - return euint32.wrap(Impl.rand(Common.euint32_t)); - } - - /** - * @dev Generates a random encrypted 32-bit unsigned integer in the [0, upperBound) range. - * The upperBound must be a power of 2. - */ - function randEuint32(uint32 upperBound) internal returns (euint32) { - return euint32.wrap(Impl.randBounded(upperBound, Common.euint32_t)); - } - - /** - * @dev Generates a random encrypted 64-bit unsigned integer. - */ - function randEuint64() internal returns (euint64) { - return euint64.wrap(Impl.rand(Common.euint64_t)); - } - - /** - * @dev Generates a random encrypted 64-bit unsigned integer in the [0, upperBound) range. - * The upperBound must be a power of 2. - */ - function randEuint64(uint64 upperBound) internal returns (euint64) { - return euint64.wrap(Impl.randBounded(upperBound, Common.euint64_t)); - } - - /** - * @dev Generates a random encrypted 128-bit unsigned integer. - */ - function randEuint128() internal returns (euint128) { - return euint128.wrap(Impl.rand(Common.euint128_t)); - } - - /** - * @dev Generates a random encrypted 128-bit unsigned integer in the [0, upperBound) range. - * The upperBound must be a power of 2. - */ - function randEuint128(uint128 upperBound) internal returns (euint128) { - return euint128.wrap(Impl.randBounded(upperBound, Common.euint128_t)); - } - - /** - * @dev Generates a random encrypted 256-bit unsigned integer. - */ - function randEuint256() internal returns (euint256) { - return euint256.wrap(Impl.rand(Common.euint256_t)); - } - - /** - * @dev Generates a random encrypted 256-bit unsigned integer in the [0, upperBound) range. - * The upperBound must be a power of 2. - */ - function randEuint256(uint256 upperBound) internal returns (euint256) { - return euint256.wrap(Impl.randBounded(upperBound, Common.euint256_t)); - } - - /** - * @dev Generates a random encrypted 512-bit unsigned integer. - */ - function randEbytes64() internal returns (ebytes64) { - return ebytes64.wrap(Impl.rand(Common.ebytes64_t)); - } - - /** - * @dev Generates a random encrypted 1024-bit unsigned integer. - */ - function randEbytes128() internal returns (ebytes128) { - return ebytes128.wrap(Impl.rand(Common.ebytes128_t)); - } - - /** - * @dev Generates a random encrypted 2048-bit unsigned integer. - */ - function randEbytes256() internal returns (ebytes256) { - return ebytes256.wrap(Impl.rand(Common.ebytes256_t)); - } - - /** - * @dev Convert an inputHandle with corresponding inputProof to an encrypted eaddress. - */ - function asEaddress(einput inputHandle, bytes memory inputProof) internal returns (eaddress) { - return eaddress.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint160_t)); - } - - /** - * @dev Convert a plaintext value to an encrypted address. - */ - function asEaddress(address value) internal returns (eaddress) { - return eaddress.wrap(Impl.trivialEncrypt(uint160(value), Common.euint160_t)); - } - - - /** - * @dev Convert the given inputHandle and inputProof to an encrypted ebytes64 value. - */ - function asEbytes64(einput inputHandle, bytes memory inputProof) internal returns (ebytes64) { - return ebytes64.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebytes64_t)); - } - - /** - * @dev Left-pad a bytes array with zeros such that it becomes of length 64. - */ - function padToBytes64(bytes memory input) internal pure returns (bytes memory) { - uint256 inputLength = input.length; - - if (inputLength > 64) { - revert InputLengthAbove64Bytes(inputLength); - } - - bytes memory result = new bytes(64); - uint256 paddingLength = 64 - inputLength; - - for (uint256 i = 0; i < paddingLength; i++) { - result[i] = 0; - } - for (uint256 i = 0; i < inputLength; i++) { - result[paddingLength + i] = input[i]; - } - return result; - } - - /** - * @dev Convert a plaintext value - must be a bytes array of size 64 - to an encrypted Bytes64. - */ - function asEbytes64(bytes memory value) internal returns (ebytes64) { - return ebytes64.wrap(Impl.trivialEncrypt(value, Common.ebytes64_t)); - } - - /** - * @dev Convert the given inputHandle and inputProof to an encrypted ebytes128 value. - */ - function asEbytes128(einput inputHandle, bytes memory inputProof) internal returns (ebytes128) { - return ebytes128.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebytes128_t)); - } - - /** - * @dev Left-pad a bytes array with zeros such that it becomes of length 128. - */ - function padToBytes128(bytes memory input) internal pure returns (bytes memory) { - uint256 inputLength = input.length; - - if (inputLength > 128) { - revert InputLengthAbove128Bytes(inputLength); - } - - bytes memory result = new bytes(128); - uint256 paddingLength = 128 - inputLength; - for (uint256 i = 0; i < paddingLength; i++) { - result[i] = 0; - } - for (uint256 i = 0; i < inputLength; i++) { - result[paddingLength + i] = input[i]; - } - return result; - } - - /** - * @dev Convert a plaintext value - must be a bytes array of size 128 - to an encrypted Bytes128. - */ - function asEbytes128(bytes memory value) internal returns (ebytes128) { - return ebytes128.wrap(Impl.trivialEncrypt(value, Common.ebytes128_t)); - } - - /** - * @dev Convert the given inputHandle and inputProof to an encrypted ebytes256 value. - */ - function asEbytes256(einput inputHandle, bytes memory inputProof) internal returns (ebytes256) { - return ebytes256.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebytes256_t)); - } - - /** - * @dev Left-pad a bytes array with zeros such that it becomes of length 256. - */ - function padToBytes256(bytes memory input) internal pure returns (bytes memory) { - uint256 inputLength = input.length; - - if (inputLength > 256) { - revert InputLengthAbove256Bytes(inputLength); - } - - bytes memory result = new bytes(256); - uint256 paddingLength = 256 - inputLength; - for (uint256 i = 0; i < paddingLength; i++) { - result[i] = 0; - } - for (uint256 i = 0; i < inputLength; i++) { - result[paddingLength + i] = input[i]; - } - return result; - } - - /** - * @dev Convert a plaintext value - must be a bytes array of size 256 - to an encrypted Bytes256. - */ - function asEbytes256(bytes memory value) internal returns (ebytes256) { - return ebytes256.wrap(Impl.trivialEncrypt(value, Common.ebytes256_t)); - } - - /** - * @dev Returns true if the encrypted address is initialized and false otherwise. - */ - function isInitialized(eaddress v) internal pure returns (bool) { - return eaddress.unwrap(v) != 0; - } - - /** - * @dev Returns true if the encrypted value is initialized and false otherwise. - */ - function isInitialized(ebytes64 v) internal pure returns (bool) { - return ebytes64.unwrap(v) != 0; - } - - /** - * @dev Returns true if the encrypted value is initialized and false otherwise. - */ - function isInitialized(ebytes128 v) internal pure returns (bool) { - return ebytes128.unwrap(v) != 0; - } - - /** - * @dev Returns true if the encrypted value is initialized and false otherwise. - */ - function isInitialized(ebytes256 v) internal pure returns (bool) { - return ebytes256.unwrap(v) != 0; - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(ebool a, ebool b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbool(false); - } - if (!isInitialized(b)) { - b = asEbool(false); - } - return ebool.wrap(Impl.eq(ebool.unwrap(a), ebool.unwrap(b), false)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(ebool a, ebool b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbool(false); - } - if (!isInitialized(b)) { - b = asEbool(false); - } - return ebool.wrap(Impl.ne(ebool.unwrap(a), ebool.unwrap(b), false)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(ebool a, bool b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbool(false); - } - uint256 bProc = b?1:0; - return ebool.wrap(Impl.eq(ebool.unwrap(a), bytes32(bProc), true)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(bool b, ebool a) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbool(false); - } - uint256 bProc = b?1:0; - return ebool.wrap(Impl.eq(ebool.unwrap(a), bytes32(bProc), true)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(ebool a, bool b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbool(false); - } - uint256 bProc = b?1:0; - return ebool.wrap(Impl.ne(ebool.unwrap(a), bytes32(bProc), true)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(bool b, ebool a) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbool(false); - } - uint256 bProc = b?1:0; - return ebool.wrap(Impl.ne(ebool.unwrap(a), bytes32(bProc), true)); - } + `; - /** - * @dev Evaluates eq(a, b) and returns the result. + /// If boolean, add also the asEbool function that allows casting bool + if (fheType.type.startsWith('Bool')) { + result += ` + /** + * @dev Converts a plaintext boolean to an encrypted boolean. */ - function eq(eaddress a, eaddress b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEaddress(address(0)); - } - if (!isInitialized(b)) { - b = asEaddress(address(0)); - } - return ebool.wrap(Impl.eq(eaddress.unwrap(a), eaddress.unwrap(b), false)); + function asEbool(bool value) internal returns (ebool) { + return ebool.wrap(Impl.trivialEncrypt(value? 1 : 0, FheType.Bool)); } - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(eaddress a, eaddress b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEaddress(address(0)); - } - if (!isInitialized(b)) { - b = asEaddress(address(0)); - } - return ebool.wrap(Impl.ne(eaddress.unwrap(a), eaddress.unwrap(b), false)); - } + `; + } else if (fheType.type.startsWith('Bytes')) { + result += ` + /** + * @dev Convert the plaintext bytes to a e${fheType.type.toLowerCase()} value. + */ + function asE${fheType.type.toLowerCase()}(${fheType.clearMatchingTypeAlias} value) internal returns (e${fheType.type.toLowerCase()}) { + return e${fheType.type.toLowerCase()}.wrap(Impl.trivialEncrypt(value, FheType.${fheType.isAlias ? fheType.aliasType : fheType.type})); + } + `; + } else { + const value = + fheType.isAlias && fheType.clearMatchingTypeAlias !== undefined + ? `${fheType.clearMatchingTypeAlias.toLowerCase()}(value)` + : 'value'; + result += ` /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(eaddress a, address b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEaddress(address(0)); - } - bytes32 bProc = bytes32(uint256(uint160(b))); - return ebool.wrap(Impl.eq(eaddress.unwrap(a), bProc, true)); + * @dev Convert a plaintext value to an encrypted e${fheType.type.toLowerCase()} integer. + */ + function asE${fheType.type.toLowerCase()}(${fheType.clearMatchingType} value) internal returns (e${fheType.type.toLowerCase()}) { + return e${fheType.type.toLowerCase()}.wrap(Impl.trivialEncrypt(uint256(${value}), FheType.${fheType.isAlias ? fheType.aliasType : fheType.type})); } - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(address b, eaddress a) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEaddress(address(0)); - } - bytes32 bProc = bytes32(uint256(uint160(b))); - return ebool.wrap(Impl.eq(eaddress.unwrap(a), bProc, true)); - } + `; + } + return result; +} - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(eaddress a, address b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEaddress(address(0)); - } - bytes32 bProc = bytes32(uint256(uint160(b))); - return ebool.wrap(Impl.ne(eaddress.unwrap(a), bProc, true)); +/** + * Generates the implementation of a unary operator function. + * + * @param op - The operator for which the implementation is generated. + * @returns The string representation of the unary operator function. + */ +function handleUnaryOperatorForImpl(op: Operator): string { + return ` + function ${op.name}(bytes32 ct) internal returns (bytes32 result) { + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).${op.fheLibName}(ct); } + `; +} - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(address b, eaddress a) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEaddress(address(0)); - } - bytes32 bProc = bytes32(uint256(uint160(b))); - return ebool.wrap(Impl.ne(eaddress.unwrap(a), bProc, true)); - } +/** + * Generates Solidity ACL (Access Control List) methods for the provided FHE types. + * + * @param {AdjustedFheType[]} fheTypes - An array of FHE types for which to generate the ACL methods. + * @returns {string} A string containing the generated Solidity code for the ACL methods. + */ +function generateSolidityACLMethods(fheTypes: AdjustedFheType[]): string { + const res: string[] = []; + res.push( + ` /** - * @dev If 'control''s value is 'true', the result has the same value as 'a'. - * If 'control''s value is 'false', the result has the same value as 'b'. - */ - function select(ebool control, ebool a, ebool b) internal returns (ebool) { - return ebool.wrap(Impl.select(ebool.unwrap(control), ebool.unwrap(a), ebool.unwrap(b))); + * @dev This function cleans the transient storage for the ACL (accounts) and the InputVerifier + * (input proofs). + * This could be useful for integration with Account Abstraction when bundling several + * UserOps calling the HTTPZExecutor. + */ + function cleanTransientStorage() internal { + Impl.cleanTransientStorageACL(); + Impl.cleanTransientStorageInputVerifier(); } + `, + ); + fheTypes.forEach((fheType: AdjustedFheType) => + res.push(` /** - * @dev If 'control''s value is 'true', the result has the same value as 'a'. - * If 'control''s value is 'false', the result has the same value as 'b'. - */ - function select(ebool control, eaddress a, eaddress b) internal returns (eaddress) { - return eaddress.wrap(Impl.select(ebool.unwrap(control), eaddress.unwrap(a), eaddress.unwrap(b))); + * @dev Returns whether the account is allowed to use the value. + */ + function isAllowed(e${fheType.type.toLowerCase()} value, address account) internal view returns (bool) { + return Impl.isAllowed(e${fheType.type.toLowerCase()}.unwrap(value), account); } /** - * @dev If 'control''s value is 'true', the result has the same value as 'a'. - * If 'control''s value is 'false', the result has the same value as 'b'. + * @dev Returns whether the sender is allowed to use the value. */ - function select(ebool control, ebytes64 a, ebytes64 b) internal returns (ebytes64) { - return ebytes64.wrap(Impl.select(ebool.unwrap(control), ebytes64.unwrap(a), ebytes64.unwrap(b))); + function isSenderAllowed(e${fheType.type.toLowerCase()} value) internal view returns (bool) { + return Impl.isAllowed(e${fheType.type.toLowerCase()}.unwrap(value), msg.sender); } /** - * @dev If 'control''s value is 'true', the result has the same value as 'a'. - * If 'control''s value is 'false', the result has the same value as 'b'. - */ - function select(ebool control, ebytes128 a, ebytes128 b) internal returns (ebytes128) { - return ebytes128.wrap(Impl.select(ebool.unwrap(control), ebytes128.unwrap(a), ebytes128.unwrap(b))); - } - - /** - * @dev If 'control''s value is 'true', the result has the same value as 'a'. - * If 'control''s value is 'false', the result has the same value as 'b'. - */ - function select(ebool control, ebytes256 a, ebytes256 b) internal returns (ebytes256) { - return ebytes256.wrap(Impl.select(ebool.unwrap(control), ebytes256.unwrap(a), ebytes256.unwrap(b))); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(ebytes64 a, ebytes64 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes64(padToBytes64(hex'')); - } - if (!isInitialized(b)) { - b = asEbytes64(padToBytes64(hex'')); - } - return ebool.wrap(Impl.eq(ebytes64.unwrap(a), ebytes64.unwrap(b), false)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(ebytes64 a, bytes memory b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes64(padToBytes64(hex'')); - } - return ebool.wrap(Impl.eq(ebytes64.unwrap(a), b, true)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(bytes memory a, ebytes64 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEbytes64(padToBytes64(hex'')); - } - return ebool.wrap(Impl.eq(ebytes64.unwrap(b), a, true)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(ebytes64 a, ebytes64 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes64(padToBytes64(hex'')); - } - if (!isInitialized(b)) { - b = asEbytes64(padToBytes64(hex'')); - } - return ebool.wrap(Impl.ne(ebytes64.unwrap(a), ebytes64.unwrap(b), false)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(ebytes64 a, bytes memory b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes64(padToBytes64(hex'')); - } - return ebool.wrap(Impl.ne(ebytes64.unwrap(a), b, true)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(bytes memory a, ebytes64 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEbytes64(padToBytes64(hex'')); - } - return ebool.wrap(Impl.ne(ebytes64.unwrap(b), a, true)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(ebytes128 a, ebytes128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes128(padToBytes128(hex'')); - } - if (!isInitialized(b)) { - b = asEbytes128(padToBytes128(hex'')); - } - return ebool.wrap(Impl.eq(ebytes128.unwrap(a), ebytes128.unwrap(b), false)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(ebytes128 a, bytes memory b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes128(padToBytes128(hex'')); - } - return ebool.wrap(Impl.eq(ebytes128.unwrap(a), b, true)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(bytes memory a, ebytes128 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEbytes128(padToBytes128(hex'')); - } - return ebool.wrap(Impl.eq(ebytes128.unwrap(b), a, true)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(ebytes128 a, ebytes128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes128(padToBytes128(hex'')); - } - if (!isInitialized(b)) { - b = asEbytes128(padToBytes128(hex'')); - } - return ebool.wrap(Impl.ne(ebytes128.unwrap(a), ebytes128.unwrap(b), false)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Allows the use of value for the address account. */ - function ne(ebytes128 a, bytes memory b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes128(padToBytes128(hex'')); - } - return ebool.wrap(Impl.ne(ebytes128.unwrap(a), b, true)); + function allow(e${fheType.type.toLowerCase()} value, address account) internal returns(e${fheType.type.toLowerCase()}) { + Impl.allow(e${fheType.type.toLowerCase()}.unwrap(value), account); + return value; } - /** - * @dev Evaluates ne(a, b) and returns the result. + /** + * @dev Allows the use of value for this address (address(this)). */ - function ne(bytes memory a, ebytes128 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEbytes128(padToBytes128(hex'')); - } - return ebool.wrap(Impl.ne(ebytes128.unwrap(b), a, true)); + function allowThis(e${fheType.type.toLowerCase()} value) internal returns(e${fheType.type.toLowerCase()}) { + Impl.allow(e${fheType.type.toLowerCase()}.unwrap(value), address(this)); + return value; } - /** - * @dev Evaluates eq(a, b) and returns the result. + /** + * @dev Allows the use of value by address account for this transaction. */ - function eq(ebytes256 a, ebytes256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes256(padToBytes256(hex'')); - } - if (!isInitialized(b)) { - b = asEbytes256(padToBytes256(hex'')); - } - return ebool.wrap(Impl.eq(ebytes256.unwrap(a), ebytes256.unwrap(b), false)); + function allowTransient(e${fheType.type.toLowerCase()} value, address account) internal returns(e${fheType.type.toLowerCase()}) { + Impl.allowTransient(e${fheType.type.toLowerCase()}.unwrap(value), account); + return value; } - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(ebytes256 a, bytes memory b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes256(padToBytes256(hex'')); - } - return ebool.wrap(Impl.eq(ebytes256.unwrap(a), b, true)); - } + `), + ); - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(bytes memory a, ebytes256 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEbytes256(padToBytes256(hex'')); - } - return ebool.wrap(Impl.eq(ebytes256.unwrap(b), a, true)); - } + return res.join(''); +} - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(ebytes256 a, ebytes256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes256(padToBytes256(hex'')); - } - if (!isInitialized(b)) { - b = asEbytes256(padToBytes256(hex'')); - } - return ebool.wrap(Impl.ne(ebytes256.unwrap(a), ebytes256.unwrap(b), false)); - } +function handleTFHEPadToBytesForEbytes(fheType: AdjustedFheType): string { + if (!fheType.type.startsWith('Bytes')) { + return ''; + } - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(ebytes256 a, bytes memory b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes256(padToBytes256(hex'')); - } - return ebool.wrap(Impl.ne(ebytes256.unwrap(a), b, true)); - } + const bytesLength = fheType.bitLength / 8; - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(bytes memory a, ebytes256 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEbytes256(padToBytes256(hex'')); + return ` + /** + * @dev Left-pad a bytes array with zeros such that it becomes of length ${bytesLength}. + */ + function padToBytes${bytesLength}(bytes memory input) internal pure returns (bytes memory) { + uint256 inputLength = input.length; + + if (inputLength > ${bytesLength}) { + revert InputLengthAbove${bytesLength}Bytes(inputLength); + } + + bytes memory result = new bytes(${bytesLength}); + uint256 paddingLength = ${bytesLength} - inputLength; + + for (uint256 i = 0; i < paddingLength; i++) { + result[i] = 0; + } + + for (uint256 i = 0; i < inputLength; i++) { + result[paddingLength + i] = input[i]; + } + return result; } - return ebool.wrap(Impl.ne(ebytes256.unwrap(b), a, true)); - } -`; - return result; + `; } -function implCustomMethods(): string { +function generateCustomMethodsForImpl(): string { return ` /** * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. - * If 'control's value is 'false', the result has the same value as 'ifFalse'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. */ function select(bytes32 control, bytes32 ifTrue, bytes32 ifFalse) internal returns (bytes32 result) { - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheIfThenElse(control, ifTrue, ifFalse); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheIfThenElse(control, ifTrue, ifFalse); } /** - * @notice Verifies the ciphertext (TFHEExecutor) and allows transient (ACL). + * @notice Verifies the ciphertext (HTTPZExecutor) and allows transient (ACL). * @param inputHandle Input handle. * @param inputProof Input proof. * @param toType Input type. @@ -1901,10 +1103,10 @@ function implCustomMethods(): string { function verify( bytes32 inputHandle, bytes memory inputProof, - uint8 toType + FheType toType ) internal returns (bytes32 result) { - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).verifyCiphertext(inputHandle, msg.sender, inputProof, bytes1(toType)); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).verifyCiphertext(inputHandle, msg.sender, inputProof, toType); IACL($.ACLAddress).allowTransient(result, msg.sender); } @@ -1916,10 +1118,10 @@ function implCustomMethods(): string { */ function cast( bytes32 ciphertext, - uint8 toType + FheType toType ) internal returns (bytes32 result) { - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).cast(ciphertext, bytes1(toType)); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).cast(ciphertext, toType); } /** @@ -1930,10 +1132,10 @@ function implCustomMethods(): string { */ function trivialEncrypt( uint256 value, - uint8 toType + FheType toType ) internal returns (bytes32 result) { - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).trivialEncrypt(value, bytes1(toType)); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).trivialEncrypt(value, toType); } /** @@ -1944,10 +1146,10 @@ function implCustomMethods(): string { */ function trivialEncrypt( bytes memory value, - uint8 toType + FheType toType ) internal returns (bytes32 result) { - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).trivialEncrypt(value, bytes1(toType)); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).trivialEncrypt(value, toType); } /** @@ -1964,8 +1166,8 @@ function implCustomMethods(): string { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheEq(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheEq(lhs, rhs, scalarByte); } /** @@ -1982,18 +1184,18 @@ function implCustomMethods(): string { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheNe(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheNe(lhs, rhs, scalarByte); } - function rand(uint8 randType) internal returns(bytes32 result) { - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheRand(bytes1(randType)); + function rand(FheType randType) internal returns(bytes32 result) { + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheRand(randType); } - function randBounded(uint256 upperBound, uint8 randType) internal returns(bytes32 result) { - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheRandBounded(upperBound, bytes1(randType)); + function randBounded(uint256 upperBound, FheType randType) internal returns(bytes32 result) { + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheRandBounded(upperBound, randType); } /** @@ -2005,7 +1207,7 @@ function implCustomMethods(): string { * @param account Address of the account. */ function allowTransient(bytes32 handle, address account) internal { - FHEVMConfigStruct storage $ = getFHEVMConfig(); + HTTPZConfigStruct storage $ = getHTTPZConfig(); IACL($.ACLAddress).allowTransient(handle, account); } @@ -2017,26 +1219,26 @@ function implCustomMethods(): string { * @param account Address of the account. */ function allow(bytes32 handle, address account) internal { - FHEVMConfigStruct storage $ = getFHEVMConfig(); + HTTPZConfigStruct storage $ = getHTTPZConfig(); IACL($.ACLAddress).allow(handle, account); } /** * @dev This function removes the transient allowances in the ACL, which could be useful for integration - * with Account Abstraction when bundling several UserOps calling the TFHEExecutorCoprocessor. + * with Account Abstraction when bundling several UserOps calling the HTTPZExecutor Coprocessor. */ function cleanTransientStorageACL() internal { - FHEVMConfigStruct storage $ = getFHEVMConfig(); + HTTPZConfigStruct storage $ = getHTTPZConfig(); IACL($.ACLAddress).cleanTransientStorage(); } /** * @dev This function removes the transient proofs in the InputVerifier, which could be useful for integration - * with Account Abstraction when bundling several UserOps calling the TFHEExecutorCoprocessor. + * with Account Abstraction when bundling several UserOps calling the HTTPZExecutor Coprocessor. */ function cleanTransientStorageInputVerifier() internal { - FHEVMConfigStruct storage $ = getFHEVMConfig(); + HTTPZConfigStruct storage $ = getHTTPZConfig(); IInputVerifier($.InputVerifierAddress).cleanTransientStorage(); } @@ -2049,8 +1251,39 @@ function implCustomMethods(): string { * @return isAllowed Whether the account can access the handle. */ function isAllowed(bytes32 handle, address account) internal view returns (bool) { - FHEVMConfigStruct storage $ = getFHEVMConfig(); + HTTPZConfigStruct storage $ = getHTTPZConfig(); return IACL($.ACLAddress).isAllowed(handle, account); } `; } + +function handleSolidityTFHERand(fheType: AdjustedFheType): string { + let res = ''; + + if (fheType.supportedOperators.includes('rand')) { + res += ` + /** + * @dev Generates a random encrypted value. + */ + function randE${fheType.type.toLowerCase()}() internal returns (e${fheType.type.toLowerCase()}) { + return e${fheType.type.toLowerCase()}.wrap(Impl.rand(FheType.${fheType.isAlias ? fheType.aliasType : fheType.type})); + } + + `; + } + + if (fheType.supportedOperators.includes('randBounded')) { + res += ` + /** + * @dev Generates a random encrypted ${fheType.bitLength}-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. + */ + function randE${fheType.type.toLowerCase()}(uint${fheType.bitLength} upperBound) internal returns (e${fheType.type.toLowerCase()}) { + return e${fheType.type.toLowerCase()}.wrap(Impl.randBounded(upperBound, FheType.${fheType.isAlias ? fheType.aliasType : fheType.type})); + } + + `; + } + + return res; +} diff --git a/contracts/codegen/testgen.ts b/contracts/codegen/testgen.ts index 8cd4e929..70b3247b 100644 --- a/contracts/codegen/testgen.ts +++ b/contracts/codegen/testgen.ts @@ -1,48 +1,232 @@ import { strict as assert } from 'node:assert'; +import { + ArgumentType, + FheType, + FunctionType, + Operator, + OperatorArguments, + OverloadShard, + OverloadSignature, + ReturnType, +} from './common'; import { overloadTests } from './overloadTests'; import { getUint } from './utils'; -export enum ArgumentType { - Ebool, - EUint, - Uint, +export function generateSolidityOverloadTestFiles(operators: Operator[], fheTypes: FheType[]): OverloadSignature[] { + const signatures: OverloadSignature[] = []; + + // Exclude types that do not support any operators. + const adjustedFheTypes = fheTypes.filter((fheType: FheType) => fheType.supportedOperators.length > 0); + + // Generate overloads for encrypted operators with two encrypted types. + adjustedFheTypes.forEach((lhsFheType: FheType) => { + adjustedFheTypes.forEach((rhsFheType: FheType) => { + operators.forEach((operator) => { + generateOverloadsForTFHEEncryptedOperatorForTwoEncryptedTypes(lhsFheType, rhsFheType, operator, signatures); + }); + }); + }); + + // Generate overloads for scalar operators for all supported types. + adjustedFheTypes.forEach((fheType: FheType) => { + operators.forEach((operator) => { + generateOverloadsForTFHEScalarOperator(fheType, operator, signatures); + }); + }); + + // Generate overloads for handle shift & rotate operators for all supported types + adjustedFheTypes.forEach((fheType: FheType) => { + operators.forEach((operator) => { + generateOverloadsForTFHEShiftOperator(fheType, operator, signatures); + }); + }); + + // Generate overloads unary operators for all supported types. + adjustedFheTypes.forEach((fheType: FheType) => + generateOverloadsForTFHEUnaryOperators(fheType, operators, signatures), + ); + + // TODO Add tests for conversion from plaintext and einput to all supported types (e.g., einput --> ebool, bytes memory --> ebytes64, uint32 --> euint32) + return signatures; } -export type FunctionType = { - type: ArgumentType; - bits: number; -}; +function generateOverloadsForTFHEEncryptedOperatorForTwoEncryptedTypes( + lhsFheType: FheType, + rhsFheType: FheType, + operator: Operator, + signatures: OverloadSignature[], +) { + if (operator.shiftOperator || operator.rotateOperator) { + return; + } -export type OverloadSignature = { - name: string; - arguments: FunctionType[]; - returnType: FunctionType; - binaryOperator?: string; - unaryOperator?: string; -}; + if (!operator.hasEncrypted || operator.arguments != OperatorArguments.Binary) { + return; + } + + if ( + !lhsFheType.supportedOperators.includes(operator.name) || + !rhsFheType.supportedOperators.includes(operator.name) + ) { + return; + } + + if (lhsFheType.type.startsWith('Uint') && rhsFheType.type.startsWith('Uint')) { + // Determine the maximum number of bits between lhsBits and rhsBits + const outputBits = Math.max(lhsFheType.bitLength, rhsFheType.bitLength); + + const returnTypeOverload: ArgumentType = + operator.returnType == ReturnType.Euint ? ArgumentType.Euint : ArgumentType.Ebool; + + signatures.push({ + name: operator.name, + arguments: [ + { type: ArgumentType.Euint, bits: lhsFheType.bitLength }, + { type: ArgumentType.Euint, bits: rhsFheType.bitLength }, + ], + returnType: { type: returnTypeOverload, bits: outputBits }, + }); + } else if (lhsFheType.type == rhsFheType.type && rhsFheType.type.startsWith('Bytes')) { + // TODO + } else if (lhsFheType.type.startsWith('Int') && rhsFheType.type.startsWith('Int')) { + throw new Error('Eint types are not supported!'); + } +} -export type OverloadShard = { - shardNumber: number; - overloads: OverloadSignature[]; +function generateOverloadsForTFHEScalarOperator(fheType: FheType, operator: Operator, signatures: OverloadSignature[]) { + if (operator.shiftOperator || operator.rotateOperator) { + return; + } + + if (operator.arguments != OperatorArguments.Binary) { + return; + } + + if (!operator.hasScalar) { + return; + } + + if (!fheType.supportedOperators.includes(operator.name)) { + return; + } + + const outputBits = fheType.bitLength; + const returnTypeOverload = operator.returnType == ReturnType.Euint ? ArgumentType.Euint : ArgumentType.Ebool; + + if (fheType.type.startsWith('Uint')) { + signatures.push({ + name: operator.name, + arguments: [ + { type: ArgumentType.Euint, bits: outputBits }, + { type: ArgumentType.Uint, bits: outputBits }, + ], + returnType: { type: returnTypeOverload, bits: outputBits }, + }); + } + + // lhs scalar + if (!operator.leftScalarDisable) { + if (fheType.type.startsWith('Uint')) { + signatures.push({ + name: operator.name, + arguments: [ + { type: ArgumentType.Uint, bits: outputBits }, + { type: ArgumentType.Euint, bits: outputBits }, + ], + returnType: { type: returnTypeOverload, bits: outputBits }, + }); + } + } +} + +function generateOverloadsForTFHEShiftOperator(fheType: FheType, operator: Operator, signatures: OverloadSignature[]) { + if (!operator.shiftOperator && !operator.rotateOperator) { + return; + } + + if (fheType.supportedOperators.includes(operator.name)) { + const lhsBits = fheType.bitLength; + const rhsBits = 8; + + const returnTypeOverload: ArgumentType = ArgumentType.Euint; + + if (fheType.type.startsWith('Uint')) { + signatures.push({ + name: operator.name, + arguments: [ + { type: ArgumentType.Euint, bits: lhsBits }, + { type: ArgumentType.Euint, bits: rhsBits }, + ], + returnType: { type: returnTypeOverload, bits: fheType.bitLength }, + }); + } + + if (fheType.type.startsWith('Uint')) { + signatures.push({ + name: operator.name, + arguments: [ + { type: ArgumentType.Euint, bits: lhsBits }, + { type: ArgumentType.Uint, bits: rhsBits }, + ], + returnType: { type: returnTypeOverload, bits: fheType.bitLength }, + }); + } + } +} + +function generateOverloadsForTFHEUnaryOperators( + fheType: FheType, + operators: Operator[], + signatures: OverloadSignature[], +) { + operators.forEach((op) => { + if (op.arguments == OperatorArguments.Unary && fheType.supportedOperators.includes(op.name)) { + if (fheType.type.startsWith('Uint')) { + signatures.push({ + name: op.name, + arguments: [{ type: ArgumentType.Euint, bits: fheType.bitLength }], + returnType: { type: ArgumentType.Euint, bits: fheType.bitLength }, + }); + } + } + }); +} + +// TODO: generate automatically based on array of FheType +const stateVar = { + ebool: 'resEbool', + euint8: 'resEuint8', + euint16: 'resEuint16', + euint32: 'resEuint32', + euint64: 'resEuint64', + euint128: 'resEuint128', + euint256: 'resEuint256', + ebytes64: 'resEbytes64', + ebytes128: 'resEbytes128', + ebytes256: 'resEbytes256', }; /** + * Splits the provided overloads into multiple shards. + * + * @param overloads - The overloads to be split into shards. + * @returns An array of shards containing the split overloads. * This is done because there's a limit on how big - * of a smart contract you can deploy + * of a smart contract you can deploy. */ export function splitOverloadsToShards(overloads: OverloadSignature[]): OverloadShard[] { const MAX_SHARD_SIZE = 90; const res: OverloadShard[] = []; - var shardNo = 1; - var accumulator: OverloadSignature[] = []; + let shardNo = 1; + let accumulator: OverloadSignature[] = []; overloads.forEach((o) => { accumulator.push(o); if (accumulator.length >= MAX_SHARD_SIZE) { res.push({ shardNumber: shardNo, - overloads: Object.assign([], accumulator), + overloads: [...accumulator], }); shardNo++; accumulator = []; @@ -59,28 +243,40 @@ export function splitOverloadsToShards(overloads: OverloadSignature[]): Overload return res; } +/** + * Generates the first part of the test code for HTTPZ operations. + * + * This function dynamically creates TypeScript code for testing HTTPZ operations + * based on the provided shards and index split. It imports necessary modules, + * defines deployment functions for each shard, and sets up the test suite + * with the appropriate contracts and instances. + * + * @param {OverloadShard[]} shards - An array of OverloadShard objects representing the shards to be included in the test. + * @param {number} idxSplit - The index split value used to differentiate the test suite. + * @returns {string} The generated introductory test code as a string. + */ function generateIntroTestCode(shards: OverloadShard[], idxSplit: number): string { const intro: string[] = []; intro.push(` import { expect } from 'chai'; import { ethers } from 'hardhat'; - import { createInstances, decrypt4, decrypt8, decrypt16, decrypt32, decrypt64, decrypt128, decrypt256, decryptBool } from '../instance'; + import { createInstances, decrypt8, decrypt16, decrypt32, decrypt64, decrypt128, decrypt256, decryptBool } from '../instance'; import { getSigners, initSigners } from '../signers'; `); shards.forEach((os) => { intro.push(` - import type { TFHETestSuite${os.shardNumber} } from '../../types/contracts/tests/TFHETestSuite${os.shardNumber}'; + import type { HTTPZTestSuite${os.shardNumber} } from '../../types/contracts/tests/HTTPZTestSuite${os.shardNumber}'; `); }); shards.forEach((os) => { intro.push(` -async function deployTfheTestFixture${os.shardNumber}(): Promise { +async function deployHTTPZTestFixture${os.shardNumber}(): Promise { const signers = await getSigners(); const admin = signers.alice; - const contractFactory = await ethers.getContractFactory('TFHETestSuite${os.shardNumber}'); + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite${os.shardNumber}'); const contract = await contractFactory.connect(admin).deploy(); await contract.waitForDeployment(); @@ -90,7 +286,7 @@ async function deployTfheTestFixture${os.shardNumber}(): Promise { intro.push(` - const contract${os.shardNumber} = await deployTfheTestFixture${os.shardNumber}(); + const contract${os.shardNumber} = await deployHTTPZTestFixture${os.shardNumber}(); this.contract${os.shardNumber}Address = await contract${os.shardNumber}.getAddress(); this.contract${os.shardNumber} = contract${os.shardNumber}; `); @@ -113,7 +309,19 @@ async function deployTfheTestFixture${os.shardNumber}(): Promise sum + os.overloads.length, 0); let idxTsTest = 0; @@ -131,24 +339,28 @@ export function generateTestCode(shards: OverloadShard[], numTsSplits: number): const methodName = signatureContractMethodName(o); overloadUsages[methodName] = true; const tests = overloadTests[methodName] || []; - assert(tests.length > 0, `Overload ${methodName} has no tests, please add them.`); - var testIndex = 1; + + // Ensure that there are tests defined for each overload method. + assert(tests.length > 0, `Overload ${methodName} has no test, please add them.`); + + let testIndex = 1; tests.forEach((t) => { assert( t.inputs.length == o.arguments.length, `Test argument count is different to operator arguments, arguments: ${t.inputs}, expected count: ${o.arguments.length}`, ); + t.inputs.forEach((input, inputIndex) => ensureNumberAcceptableInBitRange(o.arguments[inputIndex].bits, input)); t.inputs.forEach((input, index) => ensureNumberAcceptableInBitRange(o.arguments[index].bits, input)); if (typeof t.output === 'number') { ensureNumberAcceptableInBitRange(o.returnType.bits, t.output); } const testArgs = t.inputs.join(', '); - let numEnc = 0; + let numEncryptedArgs = 0; const testArgsEncrypted = t.inputs .map((v, index) => { - if (o.arguments[index].type == ArgumentType.EUint) { - numEnc++; - return `encryptedAmount.handles[${numEnc - 1}]`; + if (o.arguments[index].type == ArgumentType.Euint) { + numEncryptedArgs++; + return `encryptedAmount.handles[${numEncryptedArgs - 1}]`; } else { return `${v}n`; } @@ -156,13 +368,13 @@ export function generateTestCode(shards: OverloadShard[], numTsSplits: number): .join(', '); const inputsAdd = t.inputs .map((v, index) => { - if (o.arguments[index].type == ArgumentType.EUint) { + if (o.arguments[index].type == ArgumentType.Euint) { return `input.add${o.arguments[index].bits}(${v}n);`; } }) .join('\n'); - let output = t.output.toString(); - if (typeof t.output === 'bigint') output += 'n'; + let expectedOutput = t.output.toString(); + if (typeof t.output === 'bigint') expectedOutput += 'n'; res.push(` it('${testName} test ${testIndex} (${testArgs})', async function () { @@ -171,8 +383,8 @@ export function generateTestCode(shards: OverloadShard[], numTsSplits: number): const encryptedAmount = await input.encrypt(); const tx = await this.contract${os.shardNumber}.${methodName}(${testArgsEncrypted}, encryptedAmount.inputProof); await tx.wait(); - const res = await decrypt${o.returnType.type === 1 ? o.returnType.bits : 'Bool'}(await this.contract${os.shardNumber}.res${o.returnType.type === 1 ? o.returnType.bits : 'b'}()); - expect(res).to.equal(${output}); + const res = await decrypt${o.returnType.type === 1 ? o.returnType.bits : 'Bool'}(await this.contract${os.shardNumber}.res${o.returnType.type === 1 ? `Euint${o.returnType.bits}` : 'Ebool'}()); + expect(res).to.equal(${expectedOutput}); }); `); testIndex++; @@ -188,67 +400,58 @@ export function generateTestCode(shards: OverloadShard[], numTsSplits: number): }); }); - for (let key in overloadTests) { - assert(overloadUsages[key], `No such overload '${key}' exists for which test data is defined`); - } - return listRes; } +/** + * Ensures that a given number or bigint falls within the acceptable range for a specified number of bits. + * + * @param bits - The number of bits that define the acceptable range. + * @param input - The number or bigint to be checked. + * @throws Will throw an error if the input is not within the range [0, 2^bits]. + */ function ensureNumberAcceptableInBitRange(bits: number, input: number | bigint) { - switch (bits) { - case 4: - ensureNumberInRange(bits, input, 0x00, 0xf); - break; - case 8: - ensureNumberInRange(bits, input, 0x00, 0xff); - break; - case 16: - ensureNumberInRange(bits, input, 0x00, 0xffff); - break; - case 32: - ensureNumberInRange(bits, input, 0x00, 0xffffffff); - break; - case 64: - ensureNumberInRange(bits, input, 0x00, 0xffffffffffffffff); - break; - case 128: - ensureNumberInRange(bits, input, 0n, BigInt(0xffffffffffffffffffffffffffffffff)); - break; - case 256: - ensureNumberInRange(bits, input, 0n, BigInt(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)); - break; - default: - assert(false, `TODO: add support for ${bits} numbers`); - } -} - -function ensureNumberInRange(bits: number, input: number | bigint, min: number | bigint, max: number | bigint) { - assert(input >= min && input <= max, `${bits} bit number ${input} doesn't fall into expected [${min}; ${max}] range`); + assert( + input >= 0 && input <= 2 ** bits, + `${bits} bit number ${input} doesn't fall into expected [${0}; ${2 ** bits}] range`, + ); } -export function generateSmartContract(os: OverloadShard): string { +/** + * Generates Solidity unit test contracts for a given OverloadShard. + * + * This function creates a Solidity contract named `HTTPZTestSuite` followed by the shard number. + * The contract includes several public variables of different encrypted types (ebool, euint8, euint16, euint32, euint64, euint128, euint256) + * and a constructor that sets the FHEVM configuration using the default configuration from `HTTPZConfig`. + * It also calls the `generateLibCallTest` function to add additional test logic to the contract. + * + * @param {OverloadShard} os - The overload shard for which the test contract is generated. + * @returns {string} The generated Solidity unit test contract as a string. + */ +export function generateSolidityUnitTestContracts(os: OverloadShard): string { const res: string[] = []; res.push(` // SPDX-License-Identifier: BSD-3-Clause-Clear pragma solidity ^0.8.24; - import "../../lib/TFHE.sol"; - import "../../lib/FHEVMConfig.sol"; - - contract TFHETestSuite${os.shardNumber} { - ebool public resb; - euint4 public res4; - euint8 public res8; - euint16 public res16; - euint32 public res32; - euint64 public res64; - euint128 public res128; - euint256 public res256; + import "../../lib/HTTPZ.sol"; + import "../../lib/HTTPZConfig.sol"; + + contract HTTPZTestSuite${os.shardNumber} { + ebool public resEbool; + euint8 public resEuint8; + euint16 public resEuint16; + euint32 public resEuint32; + euint64 public resEuint64; + euint128 public resEuint128; + euint256 public resEuint256; + ebytes64 public resEbytes64; + ebytes128 public resEbytes128; + ebytes256 public resEbytes256; constructor() { - TFHE.setFHEVM(FHEVMConfig.defaultConfig()); + HTTPZ.setCoprocessor(HTTPZConfig.defaultConfig()); } `); @@ -262,33 +465,32 @@ export function generateSmartContract(os: OverloadShard): string { return res.join(''); } -const stateVar = { - ebool: 'resb', - euint4: 'res4', - euint8: 'res8', - euint16: 'res16', - euint32: 'res32', - euint64: 'res64', - euint128: 'res128', - euint256: 'res256', -}; - +/** + * Generates a library call test function for the given overload shard. + * + * @param os - The overload shard containing the overloads to generate the test for. + * @param res - The array to which the generated test function code will be appended. + * + * This function iterates over the overloads in the provided overload shard and generates + * a Solidity function for each overload. The generated function includes the necessary + * argument processing, type casting, and the appropriate HTTPZ library call. The result + * of the library call is then allowed and assigned to the corresponding state variable. + */ function generateLibCallTest(os: OverloadShard, res: string[]) { os.overloads.forEach((o) => { const methodName = signatureContractMethodName(o); const args = signatureContractArguments(o); res.push(`function ${methodName}(${args}) public {`); - res.push('\n'); const procArgs: string[] = []; - var argName = 97; // letter 'a' in ascii + let argumentCharCode = 97; // letter 'a' in ascii o.arguments.forEach((a) => { - const arg = String.fromCharCode(argName); + const arg = String.fromCharCode(argumentCharCode); const argProc = `${arg}Proc`; procArgs.push(argProc); res.push(`${functionTypeToString(a)} ${argProc} = ${castExpressionToType(arg, a)};`); res.push('\n'); - argName++; + argumentCharCode++; }); const tfheArgs = procArgs.join(', '); @@ -302,16 +504,22 @@ function generateLibCallTest(os: OverloadShard, res: string[]) { res.push(`${functionTypeToEncryptedType(o.returnType)} result = ${o.unaryOperator}aProc;`); res.push('\n'); } else { - res.push(`${functionTypeToEncryptedType(o.returnType)} result = TFHE.${o.name}(${tfheArgs});`); + res.push(`${functionTypeToEncryptedType(o.returnType)} result = HTTPZ.${o.name}(${tfheArgs});`); res.push('\n'); } - res.push('TFHE.allowThis(result);'); + res.push('HTTPZ.allowThis(result);'); res.push(`${stateVar[functionTypeToEncryptedType(o.returnType) as keyof typeof stateVar]} = result; } `); }); } +/** + * Generates a unique method name for a contract method based on its signature. + * + * @param s - The overload signature of the contract method. + * @returns A string representing the unique method name, composed of the method name and its argument types joined by underscores. + */ export function signatureContractMethodName(s: OverloadSignature): string { const res: string[] = []; @@ -321,57 +529,114 @@ export function signatureContractMethodName(s: OverloadSignature): string { return res.join('_'); } +/** + * Generates a string representation of the contract arguments for a given overload signature. + * + * @param s - The overload signature containing the arguments to be converted. + * @returns A string representing the contract arguments, formatted as `type name`. + * + * The function iterates over the arguments of the provided overload signature, + * converts each argument type to a calldata type, and assigns a name starting + * from 'a' and incrementing for each subsequent argument. Additionally, it appends + * 'bytes calldata inputProof' to the end of the arguments list. + */ function signatureContractArguments(s: OverloadSignature): string { const res: string[] = []; - - var argName = 97; // letter 'a' in ascii + let argumentCharCode = 97; // letter 'a' in ascii s.arguments.forEach((a) => { - res.push(`${functionTypeToCalldataType(a)} ${String.fromCharCode(argName)}`); - argName++; + res.push(`${functionTypeToCalldataType(a)} ${String.fromCharCode(argumentCharCode)}`); + argumentCharCode++; }); res.push('bytes calldata inputProof'); return res.join(', '); } +/** + * Generates a string representation of a contract function signature with encrypted return type. + * + * @param s - The overload signature containing the function arguments and return type. + * @returns A string representing the function signature with encrypted return type. + */ function signatureContractEncryptedSignature(s: OverloadSignature): string { const res: string[] = []; - - var argName = 97; // letter 'a' in ascii + let argumentCharCode = 97; // letter 'a' in ascii s.arguments.forEach((a) => { res.push(`${functionTypeToString(a)}`); - argName++; + argumentCharCode++; }); const joined = res.join(', '); return `(${joined}) => ${functionTypeToEncryptedType(s.returnType)}`; } +/** + * Casts an expression to a specified type. + * + * @param argExpr - The expression to be casted as a string. + * @param outputType - The type to cast the expression to, represented as a FunctionType object. + * @returns The casted expression as a string. + * + * The function handles the following types: + * - `Euint`: Casts to an encrypted unsigned integer with a specified bit length. + * - `Uint`: Returns the expression as is. + * - `Ebool`: Casts to an encrypted boolean. + * - `Ebytes`: Casts to encrypted bytes with a specified byte length. + */ function castExpressionToType(argExpr: string, outputType: FunctionType): string { switch (outputType.type) { - case ArgumentType.EUint: - return `TFHE.asEuint${outputType.bits}(${argExpr}, inputProof)`; + case ArgumentType.Euint: + return `HTTPZ.asEuint${outputType.bits}(${argExpr}, inputProof)`; case ArgumentType.Uint: return argExpr; case ArgumentType.Ebool: - return `TFHE.asEbool(${argExpr})`; + return `HTTPZ.asEbool(${argExpr})`; + // case ArgumentType.Ebytes: + // return `HTTPZ.asEbytes${outputType.bits / 8}(${argExpr})`; } } +/** + * Converts a `FunctionType` to its corresponding calldata type string. + * + * @param t - The `FunctionType` object to convert. + * @returns The calldata type string corresponding to the given `FunctionType`. + * + * The conversion is based on the `type` property of the `FunctionType` object: + * - `ArgumentType.Euint`: Returns "einput". + * - `ArgumentType.Uint`: Returns the result of `getUint(t.bits)`. + * - `ArgumentType.Ebool`: Returns "einput". + * - `ArgumentType.Ebytes`: Returns "einput". + */ function functionTypeToCalldataType(t: FunctionType): string { switch (t.type) { - case ArgumentType.EUint: + case ArgumentType.Euint: return `einput`; case ArgumentType.Uint: return getUint(t.bits); case ArgumentType.Ebool: return `einput`; + // case ArgumentType.Ebytes: + // return `einput`; } } +/** + * Converts a given `FunctionType` to its corresponding encrypted type string. + * + * @param t - The `FunctionType` object to be converted. + * @returns The encrypted type string based on the `FunctionType`. + * + * The conversion rules are as follows: + * - If the type is `Euint` or `Ebytes`, it returns `ebytes` followed by the number of bytes (calculated as `t.bits / 8`). + * - If the type is `Uint`, it returns `euint` followed by the number of bits. + * - If the type is `Ebool`, it returns `ebool`. + */ function functionTypeToEncryptedType(t: FunctionType): string { switch (t.type) { - case ArgumentType.EUint: + case ArgumentType.Euint: + // case ArgumentType.Ebytes: + // return `ebytes${t.bits / 8}`; case ArgumentType.Uint: return `euint${t.bits}`; case ArgumentType.Ebool: @@ -379,13 +644,27 @@ function functionTypeToEncryptedType(t: FunctionType): string { } } +/** + * Converts a `FunctionType` object to its corresponding string representation. + * + * @param t - The `FunctionType` object to convert. + * @returns The string representation of the `FunctionType`. + * + * The conversion is based on the `type` property of the `FunctionType` object: + * - If `t.type` is `ArgumentType.Euint`, the result is `euint` followed by the number of bits. + * - If `t.type` is `ArgumentType.Uint`, the result is obtained from the `getUint` function with the number of bits. + * - If `t.type` is `ArgumentType.Ebool`, the result is `ebool`. + * - If `t.type` is `ArgumentType.Ebytes`, the result is `ebytes` followed by the number of bits. + */ function functionTypeToString(t: FunctionType): string { switch (t.type) { - case ArgumentType.EUint: + case ArgumentType.Euint: return `euint${t.bits}`; case ArgumentType.Uint: return getUint(t.bits); case ArgumentType.Ebool: return `ebool`; + // case ArgumentType.Ebytes: + // return `ebytes${t.bits}`; } } diff --git a/contracts/codegen/types.ts b/contracts/codegen/types.ts new file mode 100644 index 00000000..a31967f6 --- /dev/null +++ b/contracts/codegen/types.ts @@ -0,0 +1,1012 @@ +import { FheType } from './common'; + +/** + * A constant array containing all Fully Homomorphic Encryption (FHE) types. + * Each type is represented as an object with the following properties: + * + * - `type`: The name of the FHE type. + * - `value`: A unique numeric identifier for the FHE type. + * - `supportedOperators`: An array of strings representing the operators supported by the FHE type. + * - `bitLength`: The bit length of the FHE type. + * - `clearMatchingType`: The corresponding clear (non-encrypted) type in Solidity. + * - `aliases`: An optional array of alias types that are associated with this FHE type. + * + * The FHE types included that are currently implemented in the Solidity code generator are: + * + * - `Bool`: Boolean type with a bit length of 1. + * - `Uint8`: Unsigned integer type with a bit length of 8. + * - `Uint16`: Unsigned integer type with a bit length of 16. + * - `Uint32`: Unsigned integer type with a bit length of 32. + * - `Uint64`: Unsigned integer type with a bit length of 64. + * - `Uint128`: Unsigned integer type with a bit length of 128. + * - `Uint160`: Unsigned integer type with a bit length of 160. + * - `Uint256`: Unsigned integer type with a bit length of 256. + * - `Uint512`: Unsigned integer type with a bit length of 512. + * - `Uint1024`: Unsigned integer type with a bit length of 1024. + * - `Uint2048`: Unsigned integer type with a bit length of 2048. + */ +export const ALL_FHE_TYPES: FheType[] = [ + { + type: 'Bool', + value: 0, + supportedOperators: ['and', 'or', 'xor', 'eq', 'ne', 'not', 'select', 'rand'], + bitLength: 2, + clearMatchingType: 'bool', + }, + { + type: 'Uint4', + value: 1, + supportedOperators: [], + bitLength: 4, + clearMatchingType: 'uint8', + }, + { + type: 'Uint8', + value: 2, + supportedOperators: [ + 'add', + 'sub', + 'mul', + 'div', + 'rem', + 'and', + 'or', + 'xor', + 'shl', + 'shr', + 'rotl', + 'rotr', + 'eq', + 'ne', + 'ge', + 'gt', + 'le', + 'lt', + 'min', + 'max', + 'neg', + 'not', + 'select', + 'rand', + 'randBounded', + ], + bitLength: 8, + clearMatchingType: 'uint8', + aliases: [ + { + type: 'Bytes1', + supportedOperators: [], + clearMatchingType: 'bytes1', + }, + ], + }, + { + type: 'Uint16', + value: 3, + supportedOperators: [ + 'add', + 'sub', + 'mul', + 'div', + 'rem', + 'and', + 'or', + 'xor', + 'shl', + 'shr', + 'rotl', + 'rotr', + 'eq', + 'ne', + 'ge', + 'gt', + 'le', + 'lt', + 'min', + 'max', + 'neg', + 'not', + 'select', + 'rand', + 'randBounded', + ], + bitLength: 16, + clearMatchingType: 'uint16', + aliases: [ + { + type: 'Bytes2', + supportedOperators: [], + clearMatchingType: 'bytes2', + }, + ], + }, + { + type: 'Uint32', + value: 4, + supportedOperators: [ + 'add', + 'sub', + 'mul', + 'div', + 'rem', + 'and', + 'or', + 'xor', + 'shl', + 'shr', + 'rotl', + 'rotr', + 'eq', + 'ne', + 'ge', + 'gt', + 'le', + 'lt', + 'min', + 'max', + 'neg', + 'not', + 'select', + 'rand', + 'randBounded', + ], + bitLength: 32, + clearMatchingType: 'uint32', + aliases: [ + { + type: 'Bytes4', + supportedOperators: [], + clearMatchingType: '', + }, + ], + }, + { + type: 'Uint64', + value: 5, + supportedOperators: [ + 'add', + 'sub', + 'mul', + 'div', + 'rem', + 'and', + 'or', + 'xor', + 'shl', + 'shr', + 'rotl', + 'rotr', + 'eq', + 'ne', + 'ge', + 'gt', + 'le', + 'lt', + 'min', + 'max', + 'neg', + 'not', + 'select', + 'rand', + 'randBounded', + ], + bitLength: 64, + clearMatchingType: 'uint64', + aliases: [ + { + type: 'Bytes8', + supportedOperators: [], + clearMatchingType: 'bytes8', + }, + ], + }, + { + type: 'Uint128', + value: 6, + supportedOperators: [ + 'add', + 'sub', + 'mul', + 'div', + 'rem', + 'and', + 'or', + 'xor', + 'shl', + 'shr', + 'rotl', + 'rotr', + 'eq', + 'ne', + 'ge', + 'gt', + 'le', + 'lt', + 'min', + 'max', + 'neg', + 'not', + 'select', + 'rand', + 'randBounded', + ], + bitLength: 128, + clearMatchingType: 'uint128', + aliases: [ + { + type: 'Bytes16', + supportedOperators: [], + clearMatchingType: 'bytes16', + }, + ], + }, + { + type: 'Uint160', + value: 7, + supportedOperators: [], + bitLength: 160, + clearMatchingType: 'uint160', + aliases: [ + { + type: 'Address', + supportedOperators: ['eq', 'ne', 'select'], + clearMatchingType: 'address', + }, + { + type: 'Bytes20', + supportedOperators: [], + clearMatchingType: 'bytes20', + }, + ], + }, + { + type: 'Uint256', + value: 8, + supportedOperators: [ + 'and', + 'or', + 'xor', + 'shl', + 'shr', + 'rotl', + 'rotr', + 'eq', + 'ne', + 'neg', + 'not', + 'select', + 'rand', + 'randBounded', + ], + bitLength: 256, + clearMatchingType: 'uint256', + aliases: [ + { + type: 'Bytes32', + supportedOperators: [], + clearMatchingType: 'bytes32', + }, + ], + }, + { + type: 'Uint512', + value: 9, + supportedOperators: [], + bitLength: 512, + clearMatchingType: 'bytes memory', + aliases: [ + { + type: 'Bytes64', + supportedOperators: ['eq', 'ne', 'select', 'rand'], + clearMatchingType: '', + }, + ], + }, + { + type: 'Uint1024', + value: 10, + supportedOperators: [], + bitLength: 1024, + clearMatchingType: 'bytes memory', + aliases: [ + { + type: 'Bytes128', + supportedOperators: ['eq', 'ne', 'select', 'rand'], + clearMatchingType: '', + }, + ], + }, + { + type: 'Uint2048', + value: 11, + supportedOperators: [], + bitLength: 2048, + clearMatchingType: 'bytes memory', + aliases: [ + { + type: 'Bytes256', + supportedOperators: ['eq', 'ne', 'select', 'rand'], + clearMatchingType: '', + }, + ], + }, + { + type: 'Uint2', + value: 12, + supportedOperators: [], + bitLength: 2, + clearMatchingType: 'uint8', + }, + { + type: 'Uint6', + value: 13, + supportedOperators: [], + bitLength: 6, + clearMatchingType: 'uint8', + }, + { + type: 'Uint10', + value: 14, + supportedOperators: [], + bitLength: 10, + clearMatchingType: 'uint16', + }, + { + type: 'Uint12', + value: 15, + supportedOperators: [], + bitLength: 12, + clearMatchingType: 'uint16', + }, + { + type: 'Uint14', + value: 16, + supportedOperators: [], + bitLength: 14, + clearMatchingType: 'uint16', + }, + { + type: 'Int2', + value: 17, + supportedOperators: [], + bitLength: 2, + clearMatchingType: 'int8', + }, + { + type: 'Int4', + value: 18, + supportedOperators: [], + bitLength: 4, + clearMatchingType: 'int8', + }, + { + type: 'Int6', + value: 19, + supportedOperators: [], + bitLength: 6, + clearMatchingType: 'int8', + }, + { + type: 'Int8', + value: 20, + supportedOperators: [], + bitLength: 8, + clearMatchingType: 'int8', + }, + { + type: 'Int10', + value: 21, + supportedOperators: [], + bitLength: 10, + clearMatchingType: 'int16', + }, + { + type: 'Int12', + value: 22, + supportedOperators: [], + bitLength: 12, + clearMatchingType: 'int16', + }, + { + type: 'Int14', + value: 23, + supportedOperators: [], + bitLength: 14, + clearMatchingType: 'int16', + }, + { + type: 'Int16', + value: 24, + supportedOperators: [], + bitLength: 16, + clearMatchingType: 'int16', + }, + { + type: 'Int32', + value: 25, + supportedOperators: [], + bitLength: 32, + clearMatchingType: 'int32', + }, + { + type: 'Int64', + value: 26, + supportedOperators: [], + bitLength: 64, + clearMatchingType: 'int64', + }, + { + type: 'Int128', + value: 27, + supportedOperators: [], + bitLength: 128, + clearMatchingType: 'int128', + }, + { + type: 'Int160', + value: 28, + supportedOperators: [], + bitLength: 160, + clearMatchingType: 'int160', + }, + { + type: 'Int256', + value: 29, + supportedOperators: [], + bitLength: 256, + clearMatchingType: 'int256', + }, + { + type: 'AsciiString', + value: 30, + supportedOperators: [], + bitLength: 0, + clearMatchingType: 'string memory', + }, + { + type: 'Int512', + value: 31, + supportedOperators: [], + bitLength: 512, + clearMatchingType: 'bytes memory', + }, + { + type: 'Int1024', + value: 32, + supportedOperators: [], + bitLength: 1024, + clearMatchingType: 'bytes memory', + }, + { + type: 'Int2048', + value: 33, + supportedOperators: [], + bitLength: 2048, + clearMatchingType: 'bytes memory', + }, + { + type: 'Uint24', + value: 34, + supportedOperators: [], + bitLength: 24, + clearMatchingType: 'uint24', + aliases: [ + { + type: 'Bytes3', + supportedOperators: [], + clearMatchingType: 'bytes3', + }, + ], + }, + { + type: 'Uint40', + value: 35, + supportedOperators: [], + bitLength: 40, + clearMatchingType: 'uint40', + aliases: [ + { + type: 'Bytes5', + supportedOperators: [], + clearMatchingType: 'bytes5', + }, + ], + }, + { + type: 'Uint48', + value: 36, + supportedOperators: [], + bitLength: 48, + clearMatchingType: 'uint48', + aliases: [ + { + type: 'Bytes6', + supportedOperators: [], + clearMatchingType: 'bytes6', + }, + ], + }, + { + type: 'Uint56', + value: 37, + supportedOperators: [], + bitLength: 56, + clearMatchingType: 'uint56', + aliases: [ + { + type: 'Bytes7', + supportedOperators: [], + clearMatchingType: '', + }, + ], + }, + { + type: 'Uint72', + value: 38, + supportedOperators: [], + bitLength: 72, + clearMatchingType: 'uint72', + aliases: [ + { + type: 'Bytes9', + supportedOperators: [], + clearMatchingType: 'bytes9', + }, + ], + }, + { + type: 'Uint80', + value: 39, + supportedOperators: [], + bitLength: 80, + clearMatchingType: 'uint80', + aliases: [ + { + type: 'Bytes10', + supportedOperators: [], + clearMatchingType: 'bytes10', + }, + ], + }, + { + type: 'Uint88', + value: 40, + supportedOperators: [], + bitLength: 88, + clearMatchingType: 'uint88', + aliases: [ + { + type: 'Bytes11', + supportedOperators: [], + clearMatchingType: 'bytes11', + }, + ], + }, + { + type: 'Uint96', + value: 41, + supportedOperators: [], + bitLength: 96, + clearMatchingType: 'uint96', + aliases: [ + { + type: 'Bytes12', + supportedOperators: [], + clearMatchingType: 'bytes12', + }, + ], + }, + { + type: 'Uint104', + value: 42, + supportedOperators: [], + bitLength: 104, + clearMatchingType: 'uint104', + aliases: [ + { + type: 'Bytes13', + supportedOperators: [], + clearMatchingType: 'bytes13', + }, + ], + }, + { + type: 'Uint112', + value: 43, + supportedOperators: [], + bitLength: 112, + clearMatchingType: 'uint112', + aliases: [ + { + type: 'Bytes14', + supportedOperators: [], + clearMatchingType: 'bytes14', + }, + ], + }, + { + type: 'Uint120', + value: 44, + supportedOperators: [], + bitLength: 120, + clearMatchingType: 'uint120', + aliases: [ + { + type: 'Bytes15', + supportedOperators: [], + clearMatchingType: 'bytes15', + }, + ], + }, + { + type: 'Uint136', + value: 45, + supportedOperators: [], + bitLength: 136, + clearMatchingType: 'uint136', + aliases: [ + { + type: 'Bytes17', + supportedOperators: [], + clearMatchingType: 'bytes17', + }, + ], + }, + { + type: 'Uint144', + value: 46, + supportedOperators: [], + bitLength: 144, + clearMatchingType: 'uint144', + aliases: [ + { + type: 'Bytes18', + supportedOperators: [], + clearMatchingType: 'bytes18', + }, + ], + }, + { + type: 'Uint152', + value: 47, + supportedOperators: [], + bitLength: 152, + clearMatchingType: 'uint152', + aliases: [ + { + type: 'Bytes19', + supportedOperators: [], + clearMatchingType: 'bytes19', + }, + ], + }, + { + type: 'Uint168', + value: 48, + supportedOperators: [], + bitLength: 168, + clearMatchingType: 'uint168', + aliases: [ + { + type: 'Bytes21', + supportedOperators: [], + clearMatchingType: 'bytes21', + }, + ], + }, + { + type: 'Uint176', + value: 49, + supportedOperators: [], + bitLength: 176, + clearMatchingType: 'uint176', + aliases: [ + { + type: 'Bytes22', + supportedOperators: [], + clearMatchingType: 'bytes22', + }, + ], + }, + { + type: 'Uint184', + value: 50, + supportedOperators: [], + bitLength: 184, + clearMatchingType: 'uint184', + aliases: [ + { + type: 'Bytes23', + supportedOperators: [], + clearMatchingType: 'bytes23', + }, + ], + }, + { + type: 'Uint192', + value: 51, + supportedOperators: [], + bitLength: 192, + clearMatchingType: 'uint192', + aliases: [ + { + type: 'Bytes24', + supportedOperators: [], + clearMatchingType: '24', + }, + ], + }, + { + type: 'Uint200', + value: 52, + supportedOperators: [], + bitLength: 200, + clearMatchingType: 'uint200', + aliases: [ + { + type: 'Bytes25', + supportedOperators: [], + clearMatchingType: '25', + }, + ], + }, + { + type: 'Uint208', + value: 53, + supportedOperators: [], + bitLength: 208, + clearMatchingType: 'uint208', + aliases: [ + { + type: 'Bytes26', + supportedOperators: [], + clearMatchingType: '26', + }, + ], + }, + { + type: 'Uint216', + value: 54, + supportedOperators: [], + bitLength: 216, + clearMatchingType: 'uint216', + aliases: [ + { + type: 'Bytes27', + supportedOperators: [], + clearMatchingType: '27', + }, + ], + }, + { + type: 'Uint224', + value: 55, + supportedOperators: [], + bitLength: 224, + clearMatchingType: 'uint224', + aliases: [ + { + type: 'Bytes28', + supportedOperators: [], + clearMatchingType: '28', + }, + ], + }, + { + type: 'Uint232', + value: 56, + supportedOperators: [], + bitLength: 232, + clearMatchingType: 'uint232', + aliases: [ + { + type: 'Bytes29', + supportedOperators: [], + clearMatchingType: 'bytes29', + }, + ], + }, + { + type: 'Uint240', + value: 57, + supportedOperators: [], + bitLength: 240, + clearMatchingType: 'uint240', + aliases: [ + { + type: 'Bytes30', + supportedOperators: [], + clearMatchingType: 'bytes30', + }, + ], + }, + { + type: 'Uint248', + value: 58, + supportedOperators: [], + bitLength: 248, + clearMatchingType: 'uint248', + aliases: [ + { + type: 'Bytes31', + supportedOperators: [], + clearMatchingType: 'bytes31', + }, + ], + }, + { + type: 'Int24', + value: 59, + supportedOperators: [], + bitLength: 24, + clearMatchingType: 'int24', + }, + { + type: 'Int40', + value: 60, + supportedOperators: [], + bitLength: 40, + clearMatchingType: 'int40', + }, + { + type: 'Int48', + value: 61, + supportedOperators: [], + bitLength: 48, + clearMatchingType: 'int48', + }, + { + type: 'Int56', + value: 62, + supportedOperators: [], + bitLength: 56, + clearMatchingType: 'int56', + }, + { + type: 'Int72', + value: 63, + supportedOperators: [], + bitLength: 72, + clearMatchingType: 'int72', + }, + { + type: 'Int80', + value: 64, + supportedOperators: [], + bitLength: 80, + clearMatchingType: 'int80', + }, + { + type: 'Int88', + value: 65, + supportedOperators: [], + bitLength: 88, + clearMatchingType: 'int88', + }, + { + type: 'Int96', + value: 66, + supportedOperators: [], + bitLength: 96, + clearMatchingType: 'int96', + }, + { + type: 'Int104', + value: 67, + supportedOperators: [], + bitLength: 104, + clearMatchingType: 'int104', + }, + { + type: 'Int112', + value: 68, + supportedOperators: [], + bitLength: 112, + clearMatchingType: 'int112', + }, + { + type: 'Int120', + value: 69, + supportedOperators: [], + bitLength: 120, + clearMatchingType: 'int120', + }, + { + type: 'Int136', + value: 70, + supportedOperators: [], + bitLength: 136, + clearMatchingType: 'int136', + }, + { + type: 'Int144', + value: 71, + supportedOperators: [], + bitLength: 144, + clearMatchingType: 'int144', + }, + { + type: 'Int152', + value: 72, + supportedOperators: [], + bitLength: 152, + clearMatchingType: 'int152', + }, + { + type: 'Int168', + value: 73, + supportedOperators: [], + bitLength: 168, + clearMatchingType: 'int168', + }, + { + type: 'Int176', + value: 74, + supportedOperators: [], + bitLength: 176, + clearMatchingType: 'int176', + }, + { + type: 'Int184', + value: 75, + supportedOperators: [], + bitLength: 184, + clearMatchingType: 'int184', + }, + { + type: 'Int192', + value: 76, + supportedOperators: [], + bitLength: 192, + clearMatchingType: 'int192', + }, + { + type: 'Int200', + value: 77, + supportedOperators: [], + bitLength: 200, + clearMatchingType: 'int200', + }, + { + type: 'Int208', + value: 78, + supportedOperators: [], + bitLength: 208, + clearMatchingType: 'int208', + }, + { + type: 'Int216', + value: 79, + supportedOperators: [], + bitLength: 216, + clearMatchingType: 'int216', + }, + { + type: 'Int224', + value: 80, + supportedOperators: [], + bitLength: 224, + clearMatchingType: 'int224', + }, + { + type: 'Int232', + value: 81, + supportedOperators: [], + bitLength: 232, + clearMatchingType: 'int232', + }, + { + type: 'Int240', + value: 82, + supportedOperators: [], + bitLength: 240, + clearMatchingType: 'int240', + }, + { + type: 'Int248', + value: 83, + supportedOperators: [], + bitLength: 248, + clearMatchingType: 'int248', + }, +]; diff --git a/contracts/codegen/utils.ts b/contracts/codegen/utils.ts index 47d49d32..f318e25f 100644 --- a/contracts/codegen/utils.ts +++ b/contracts/codegen/utils.ts @@ -1,4 +1,45 @@ +/** + * Generates a string representing a uint type with the specified number of bits. + * + * @param bits - The number of bits for the uint type. Must be greater than 8. + * @returns A string representing the uint type with the specified number of bits. + * @throws Will throw an error if the number of bits is less than or equal to 8. + */ export const getUint = (bits: number) => { - if (bits <= 8) return 'uint8'; + if (bits < 8) throw new Error('Bits must be greater than 8'); return `uint${bits}`; }; +/** + * Finds the minimum value among a list of `bigint` numbers. + * + * @param args - An array of `bigint` values to compare. + * @returns The smallest `bigint` value from the provided arguments. + */ +export const findMinimumValueInBigIntArray = (...args: bigint[]) => { + return args.reduce((min, e) => (e < min ? e : min), args[0]); +}; + +/** + * Finds the maximum value among a list of `bigint` numbers. + * + * @param args - An array of `bigint` numbers to compare. + * @returns The largest `bigint` value from the provided arguments. + */ +export const findMaximumValueInBigIntArray = (...args: bigint[]) => { + return args.reduce((max, e) => (e > max ? e : max), args[0]); +}; + +/** + * Generates a random number within a specified bit range. + * + * @param bits - The number of bits to determine the range of the generated number. + * @param minValue - The minimum value to return. + * @returns A random BigInt number within the range defined by the number of bits and at least minValue. + */ +export const generateRandomNumber = (bits: number, minValue: bigint = 5n) => { + // @dev minValue is set at 5 to prevent underflows since tests would use smallest - 4n. + const power = BigInt(Math.pow(2, bits) - 1); + const maxRange = findMinimumValueInBigIntArray(power, BigInt(Number.MAX_SAFE_INTEGER)); + const subtract = findMaximumValueInBigIntArray(BigInt(Math.floor(Math.random() * Number(maxRange))), minValue); + return findMaximumValueInBigIntArray(power - subtract, minValue); +}; diff --git a/contracts/contracts/ACL.sol b/contracts/contracts/ACL.sol index 8e829c72..96a762a8 100644 --- a/contracts/contracts/ACL.sol +++ b/contracts/contracts/ACL.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.24; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol"; -import {tfheExecutorAdd} from "../addresses/TFHEExecutorAddress.sol"; +import {httpzExecutorAdd} from "../addresses/HTTPZExecutorAddress.sol"; /** * @title ACL @@ -63,7 +63,7 @@ contract ACL is UUPSUpgradeable, Ownable2StepUpgradeable { /// @param contractAddresses Contract addresses. event RevokedDelegation(address indexed caller, address indexed delegatee, address[] contractAddresses); - /// @custom:storage-location erc7201:fhevm.storage.ACL + /// @custom:storage-location erc7201:httpz.storage.ACL struct ACLStorage { mapping(bytes32 handle => mapping(address account => bool isAllowed)) persistedAllowedPairs; mapping(bytes32 handle => bool isAllowedForDecryption) allowedForDecryption; @@ -82,14 +82,14 @@ contract ACL is UUPSUpgradeable, Ownable2StepUpgradeable { /// @notice Patch version of the contract. uint256 private constant PATCH_VERSION = 0; - /// @notice TFHEExecutor address. - address private constant tfheExecutorAddress = tfheExecutorAdd; + /// @notice HTTPZExecutor address. + address private constant httpzExecutorAddress = httpzExecutorAdd; /// @notice maximum length of contractAddresses array during delegation. uint256 private constant MAX_NUM_CONTRACT_ADDRESSES = 10; - /// @dev keccak256(abi.encode(uint256(keccak256("fhevm.storage.ACL")) - 1)) & ~bytes32(uint256(0xff)) - bytes32 private constant ACLStorageLocation = 0xa688f31953c2015baaf8c0a488ee1ee22eb0e05273cc1fd31ea4cbee42febc00; + /// keccak256(abi.encode(uint256(keccak256("httpz.storage.ACL")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant ACLStorageLocation = 0xcaeeb749b0b652d94927794ec4f309146afb8975e723911d557314d9d3b87200; /// @custom:oz-upgrades-unsafe-allow constructor constructor() { @@ -141,7 +141,7 @@ contract ACL is UUPSUpgradeable, Ownable2StepUpgradeable { * @param account Address of the account. */ function allowTransient(bytes32 handle, address account) public virtual { - if (msg.sender != tfheExecutorAddress) { + if (msg.sender != httpzExecutorAddress) { if (!isAllowed(handle, msg.sender)) { revert SenderNotAllowed(msg.sender); } @@ -247,11 +247,11 @@ contract ACL is UUPSUpgradeable, Ownable2StepUpgradeable { } /** - * @notice Getter function for the TFHEExecutor contract address. - * @return tfheExecutorAddress Address of the TFHEExecutor. + * @notice Getter function for the HTTPZExecutor contract address. + * @return httpzExecutorAddress Address of the HTTPZExecutor. */ - function getTFHEExecutorAddress() public view virtual returns (address) { - return tfheExecutorAddress; + function getHTTPZExecutorAddress() public view virtual returns (address) { + return httpzExecutorAddress; } /** @@ -288,7 +288,7 @@ contract ACL is UUPSUpgradeable, Ownable2StepUpgradeable { /** * @dev This function removes the transient allowances, which could be useful for integration with - * Account Abstraction when bundling several UserOps calling the TFHEExecutorCoprocessor. + * Account Abstraction when bundling several UserOps calling the HTTPZExecutor Coprocessor. */ function cleanTransientStorage() external virtual { assembly { diff --git a/contracts/contracts/EIP712UpgradeableCrossChain.sol b/contracts/contracts/EIP712UpgradeableCrossChain.sol index 7094ff44..fdf28320 100644 --- a/contracts/contracts/EIP712UpgradeableCrossChain.sol +++ b/contracts/contracts/EIP712UpgradeableCrossChain.sol @@ -37,7 +37,7 @@ abstract contract EIP712UpgradeableCrossChain is Initializable, IERC5267 { bytes32 private constant TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); - /// @custom:storage-location fhevm.storage.EIP712UpgradeableCrossChain + /// @custom:storage-location httpz.storage.EIP712UpgradeableCrossChain struct EIP712Storage { /// @custom:oz-renamed-from _HASHED_NAME bytes32 _hashedName; @@ -49,9 +49,9 @@ abstract contract EIP712UpgradeableCrossChain is Initializable, IERC5267 { uint64 _chainIDSource; } - /// @dev keccak256(abi.encode(uint256(keccak256("fhevm.storage.EIP712UpgradeableCrossChain")) - 1)) & ~bytes32(uint256(0xff)) + /// keccak256(abi.encode(uint256(keccak256("httpz.storage.EIP712UpgradeableCrossChain")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant EIP712UpgradeableCrossChainLocation = - 0xe910845fd818f61127c84f3586776436a37dead33625056c65162537e3373600; + 0xfd601ba311512060d5d89e8cb10f24d6d2649ba5f9a3148780d80b96ebcac200; function _getEIP712Storage() private pure returns (EIP712Storage storage $) { assembly { diff --git a/contracts/contracts/FHEGasLimit.sol b/contracts/contracts/FHEGasLimit.sol index 3edb8155..247f63d7 100644 --- a/contracts/contracts/FHEGasLimit.sol +++ b/contracts/contracts/FHEGasLimit.sol @@ -4,15 +4,17 @@ pragma solidity ^0.8.24; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol"; -import {tfheExecutorAdd} from "../addresses/TFHEExecutorAddress.sol"; +import {httpzExecutorAdd} from "../addresses/HTTPZExecutorAddress.sol"; + +import {FheType} from "./FheType.sol"; /** * @title FHEGasLimit * @notice This contract manages the amount of gas to be paid for FHE operations. */ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { - /// @notice Returned if the sender is not the TFHEExecutor. - error CallerMustBeTFHEExecutorContract(); + /// @notice Returned if the sender is not the HTTPZExecutor. + error CallerMustBeHTTPZExecutorContract(); /// @notice Returned if the block limit is higher than limit for FHE operation. error FHEGasBlockLimitExceeded(); @@ -35,21 +37,21 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { /// @notice Patch version of the contract. uint256 private constant PATCH_VERSION = 0; - /// @notice TFHEExecutor address. - address private constant tfheExecutorAddress = tfheExecutorAdd; + /// @notice HTTPZExecutor address. + address private constant httpzExecutorAddress = httpzExecutorAdd; /// @notice Gas block limit for FHEGas operation. uint256 private constant FHE_GAS_BLOCKLIMIT = 10_000_000; - /// @custom:storage-location erc7201:fhevm.storage.FHEGasLimit + /// @custom:storage-location erc7201:httpz.storage.FHEGasLimit struct FHEGasLimitStorage { uint256 lastBlock; uint256 currentBlockConsumption; } - /// @dev keccak256(abi.encode(uint256(keccak256("fhevm.storage.FHEGasLimit")) - 1)) & ~bytes32(uint256(0xff)) + /// keccak256(abi.encode(uint256(keccak256("httpz.storage.FHEGasLimit")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant FHEGasLimitStorageLocation = - 0xb5c80b3bbe0bcbcea690f6dbe62b32a45bd1ad263b78db2f25ef8414efe9bc00; + 0x17cabe3f71c2cdebfa03ba613a35f892b2ea48b8aebad7e046dd440ad1c34c00; /// @custom:oz-upgrades-unsafe-allow constructor constructor() { @@ -61,42 +63,34 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function payForFheAdd(uint8 resultType, bytes1 scalarByte) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheAdd(FheType resultType, bytes1 scalarByte) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); if (scalarByte == 0x01) { - if (resultType == 1) { - _updateFunding(65000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(94000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(133000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(162000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(188000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(218000); - } else if (resultType == 8) { - _updateFunding(253000); } else { revert UnsupportedOperation(); } } else { - if (resultType == 1) { - _updateFunding(65000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(94000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(133000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(162000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(188000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(218000); - } else if (resultType == 8) { - _updateFunding(253000); } else { revert UnsupportedOperation(); } @@ -109,42 +103,34 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function payForFheSub(uint8 resultType, bytes1 scalarByte) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheSub(FheType resultType, bytes1 scalarByte) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); if (scalarByte == 0x01) { - if (resultType == 1) { - _updateFunding(65000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(94000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(133000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(162000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(188000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(218000); - } else if (resultType == 8) { - _updateFunding(253000); } else { revert UnsupportedOperation(); } } else { - if (resultType == 1) { - _updateFunding(65000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(94000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(133000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(162000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(188000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(218000); - } else if (resultType == 8) { - _updateFunding(253000); } else { revert UnsupportedOperation(); } @@ -157,42 +143,34 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function payForFheMul(uint8 resultType, bytes1 scalarByte) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheMul(FheType resultType, bytes1 scalarByte) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); if (scalarByte == 0x01) { - if (resultType == 1) { - _updateFunding(88000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(159000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(208000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(264000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(356000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(480000); - } else if (resultType == 8) { - _updateFunding(647000); } else { revert UnsupportedOperation(); } } else { - if (resultType == 1) { - _updateFunding(150000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(197000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(262000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(359000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(641000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(1145000); - } else if (resultType == 8) { - _updateFunding(2045000); } else { revert UnsupportedOperation(); } @@ -205,24 +183,20 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function payForFheDiv(uint8 resultType, bytes1 scalarByte) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheDiv(FheType resultType, bytes1 scalarByte) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); if (scalarByte != 0x01) revert OnlyScalarOperationsAreSupported(); - if (resultType == 1) { - _updateFunding(139000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(238000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(314000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(398000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(584000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(857000); - } else if (resultType == 8) { - _updateFunding(1258000); } else { revert UnsupportedOperation(); } @@ -234,24 +208,20 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function payForFheRem(uint8 resultType, bytes1 scalarByte) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheRem(FheType resultType, bytes1 scalarByte) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); if (scalarByte != 0x01) revert OnlyScalarOperationsAreSupported(); - if (resultType == 1) { - _updateFunding(286000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(460000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(622000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(805000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(1095000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(1499000); - } else if (resultType == 8) { - _updateFunding(2052000); } else { revert UnsupportedOperation(); } @@ -263,45 +233,41 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function payForFheBitAnd(uint8 resultType, bytes1 scalarByte) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheBitAnd(FheType resultType, bytes1 scalarByte) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); if (scalarByte == 0x01) { - if (resultType == 0) { + if (resultType == FheType.Bool) { _updateFunding(26000); - } else if (resultType == 1) { - _updateFunding(32000); - } else if (resultType == 2) { + } else if (resultType == FheType.Uint8) { _updateFunding(34000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(34000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(35000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(38000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(41000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(44000); } else { revert UnsupportedOperation(); } } else { - if (resultType == 0) { + if (resultType == FheType.Bool) { _updateFunding(26000); - } else if (resultType == 1) { - _updateFunding(32000); - } else if (resultType == 2) { + } else if (resultType == FheType.Uint8) { _updateFunding(34000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(34000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(35000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(38000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(41000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(44000); } else { revert UnsupportedOperation(); @@ -315,45 +281,41 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function payForFheBitOr(uint8 resultType, bytes1 scalarByte) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheBitOr(FheType resultType, bytes1 scalarByte) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); if (scalarByte == 0x01) { - if (resultType == 0) { + if (resultType == FheType.Bool) { _updateFunding(26000); - } else if (resultType == 1) { - _updateFunding(32000); - } else if (resultType == 2) { + } else if (resultType == FheType.Uint8) { _updateFunding(34000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(34000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(35000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(38000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(41000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(44000); } else { revert UnsupportedOperation(); } } else { - if (resultType == 0) { + if (resultType == FheType.Bool) { _updateFunding(26000); - } else if (resultType == 1) { - _updateFunding(32000); - } else if (resultType == 2) { + } else if (resultType == FheType.Uint8) { _updateFunding(34000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(34000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(35000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(38000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(41000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(44000); } else { revert UnsupportedOperation(); @@ -367,45 +329,41 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function payForFheBitXor(uint8 resultType, bytes1 scalarByte) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheBitXor(FheType resultType, bytes1 scalarByte) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); if (scalarByte == 0x01) { - if (resultType == 0) { + if (resultType == FheType.Bool) { _updateFunding(26000); - } else if (resultType == 1) { - _updateFunding(32000); - } else if (resultType == 2) { + } else if (resultType == FheType.Uint8) { _updateFunding(34000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(34000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(35000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(38000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(41000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(44000); } else { revert UnsupportedOperation(); } } else { - if (resultType == 0) { + if (resultType == FheType.Bool) { _updateFunding(26000); - } else if (resultType == 1) { - _updateFunding(32000); - } else if (resultType == 2) { + } else if (resultType == FheType.Uint8) { _updateFunding(34000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(34000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(35000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(38000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(41000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(44000); } else { revert UnsupportedOperation(); @@ -419,41 +377,37 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function payForFheShl(uint8 resultType, bytes1 scalarByte) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheShl(FheType resultType, bytes1 scalarByte) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); if (scalarByte == 0x01) { - if (resultType == 1) { - _updateFunding(35000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(35000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(35000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(35000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(38000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(41000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(44000); } else { revert UnsupportedOperation(); } } else { - if (resultType == 1) { - _updateFunding(116000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(133000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(153000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(183000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(227000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(282000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(350000); } else { revert UnsupportedOperation(); @@ -467,41 +421,37 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function payForFheShr(uint8 resultType, bytes1 scalarByte) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheShr(FheType resultType, bytes1 scalarByte) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); if (scalarByte == 0x01) { - if (resultType == 1) { + if (resultType == FheType.Uint8) { _updateFunding(35000); - } else if (resultType == 2) { + } else if (resultType == FheType.Uint16) { _updateFunding(35000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint32) { _updateFunding(35000); - } else if (resultType == 4) { - _updateFunding(35000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(38000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(41000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(44000); } else { revert UnsupportedOperation(); } } else { - if (resultType == 1) { - _updateFunding(116000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(133000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(153000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(183000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(227000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(282000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(350000); } else { revert UnsupportedOperation(); @@ -515,41 +465,37 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function payForFheRotl(uint8 resultType, bytes1 scalarByte) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheRotl(FheType resultType, bytes1 scalarByte) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); if (scalarByte == 0x01) { - if (resultType == 1) { - _updateFunding(35000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(35000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(35000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(35000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(38000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(41000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(44000); } else { revert UnsupportedOperation(); } } else { - if (resultType == 1) { - _updateFunding(116000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(133000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(153000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(183000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(227000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(282000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(350000); } else { revert UnsupportedOperation(); @@ -563,41 +509,37 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function payForFheRotr(uint8 resultType, bytes1 scalarByte) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheRotr(FheType resultType, bytes1 scalarByte) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); if (scalarByte == 0x01) { - if (resultType == 1) { - _updateFunding(35000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(35000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(35000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(35000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(38000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(41000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(44000); } else { revert UnsupportedOperation(); } } else { - if (resultType == 1) { - _updateFunding(116000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(133000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(153000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(183000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(227000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(282000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(350000); } else { revert UnsupportedOperation(); @@ -611,61 +553,57 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function payForFheEq(uint8 resultType, bytes1 scalarByte) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheEq(FheType resultType, bytes1 scalarByte) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); if (scalarByte == 0x01) { - if (resultType == 0) { + if (resultType == FheType.Bool) { _updateFunding(49000); - } else if (resultType == 1) { - _updateFunding(51000); - } else if (resultType == 2) { + } else if (resultType == FheType.Uint8) { _updateFunding(53000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(54000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(82000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(86000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(88000); - } else if (resultType == 7) { + } else if (resultType == FheType.Uint160) { _updateFunding(90000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(100000); - } else if (resultType == 9) { + } else if (resultType == FheType.Uint512) { _updateFunding(150000); - } else if (resultType == 10) { + } else if (resultType == FheType.Uint1024) { _updateFunding(200000); - } else if (resultType == 11) { + } else if (resultType == FheType.Uint2048) { _updateFunding(300000); } else { revert UnsupportedOperation(); } } else { - if (resultType == 0) { + if (resultType == FheType.Bool) { _updateFunding(49000); - } else if (resultType == 1) { - _updateFunding(51000); - } else if (resultType == 2) { + } else if (resultType == FheType.Uint8) { _updateFunding(53000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(54000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(82000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(86000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(88000); - } else if (resultType == 7) { + } else if (resultType == FheType.Uint160) { _updateFunding(90000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(100000); - } else if (resultType == 9) { + } else if (resultType == FheType.Uint512) { _updateFunding(150000); - } else if (resultType == 10) { + } else if (resultType == FheType.Uint1024) { _updateFunding(200000); - } else if (resultType == 11) { + } else if (resultType == FheType.Uint2048) { _updateFunding(300000); } else { revert UnsupportedOperation(); @@ -679,61 +617,57 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function payForFheNe(uint8 resultType, bytes1 scalarByte) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheNe(FheType resultType, bytes1 scalarByte) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); if (scalarByte == 0x01) { - if (resultType == 0) { + if (resultType == FheType.Bool) { _updateFunding(49000); - } else if (resultType == 1) { - _updateFunding(51000); - } else if (resultType == 2) { + } else if (resultType == FheType.Uint8) { _updateFunding(53000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(54000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(82000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(86000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(88000); - } else if (resultType == 7) { + } else if (resultType == FheType.Uint160) { _updateFunding(90000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(100000); - } else if (resultType == 9) { + } else if (resultType == FheType.Uint512) { _updateFunding(150000); - } else if (resultType == 10) { + } else if (resultType == FheType.Uint1024) { _updateFunding(200000); - } else if (resultType == 11) { + } else if (resultType == FheType.Uint2048) { _updateFunding(300000); } else { revert UnsupportedOperation(); } } else { - if (resultType == 0) { + if (resultType == FheType.Bool) { _updateFunding(49000); - } else if (resultType == 1) { - _updateFunding(51000); - } else if (resultType == 2) { + } else if (resultType == FheType.Uint8) { _updateFunding(53000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(54000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(82000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(86000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(88000); - } else if (resultType == 7) { + } else if (resultType == FheType.Uint160) { _updateFunding(90000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(100000); - } else if (resultType == 9) { + } else if (resultType == FheType.Uint512) { _updateFunding(150000); - } else if (resultType == 10) { + } else if (resultType == FheType.Uint1024) { _updateFunding(200000); - } else if (resultType == 11) { + } else if (resultType == FheType.Uint2048) { _updateFunding(300000); } else { revert UnsupportedOperation(); @@ -747,42 +681,34 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function payForFheGe(uint8 resultType, bytes1 scalarByte) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheGe(FheType resultType, bytes1 scalarByte) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); if (scalarByte == 0x01) { - if (resultType == 1) { - _updateFunding(70000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(82000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(105000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(128000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(156000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(190000); - } else if (resultType == 8) { - _updateFunding(231000); } else { revert UnsupportedOperation(); } } else { - if (resultType == 1) { - _updateFunding(70000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(82000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(105000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(128000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(156000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(190000); - } else if (resultType == 8) { - _updateFunding(231000); } else { revert UnsupportedOperation(); } @@ -795,42 +721,34 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function payForFheGt(uint8 resultType, bytes1 scalarByte) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheGt(FheType resultType, bytes1 scalarByte) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); if (scalarByte == 0x01) { - if (resultType == 1) { - _updateFunding(70000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(82000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(105000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(128000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(156000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(190000); - } else if (resultType == 8) { - _updateFunding(231000); } else { revert UnsupportedOperation(); } } else { - if (resultType == 1) { - _updateFunding(70000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(82000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(105000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(128000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(156000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(190000); - } else if (resultType == 8) { - _updateFunding(231000); } else { revert UnsupportedOperation(); } @@ -843,42 +761,34 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function payForFheLe(uint8 resultType, bytes1 scalarByte) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheLe(FheType resultType, bytes1 scalarByte) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); if (scalarByte == 0x01) { - if (resultType == 1) { - _updateFunding(70000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(82000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(105000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(128000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(156000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(190000); - } else if (resultType == 8) { - _updateFunding(231000); } else { revert UnsupportedOperation(); } } else { - if (resultType == 1) { - _updateFunding(70000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(82000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(105000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(128000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(156000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(190000); - } else if (resultType == 8) { - _updateFunding(231000); } else { revert UnsupportedOperation(); } @@ -891,42 +801,34 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function payForFheLt(uint8 resultType, bytes1 scalarByte) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheLt(FheType resultType, bytes1 scalarByte) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); if (scalarByte == 0x01) { - if (resultType == 1) { - _updateFunding(70000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(82000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(105000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(128000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(156000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(190000); - } else if (resultType == 8) { - _updateFunding(231000); } else { revert UnsupportedOperation(); } } else { - if (resultType == 1) { - _updateFunding(70000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(82000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(105000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(128000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(156000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(190000); - } else if (resultType == 8) { - _updateFunding(231000); } else { revert UnsupportedOperation(); } @@ -939,42 +841,34 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function payForFheMin(uint8 resultType, bytes1 scalarByte) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheMin(FheType resultType, bytes1 scalarByte) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); if (scalarByte == 0x01) { - if (resultType == 1) { - _updateFunding(121000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(128000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(150000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(164000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(192000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(225000); - } else if (resultType == 8) { - _updateFunding(264000); } else { revert UnsupportedOperation(); } } else { - if (resultType == 1) { - _updateFunding(121000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(128000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(153000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(183000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(210000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(241000); - } else if (resultType == 8) { - _updateFunding(277000); } else { revert UnsupportedOperation(); } @@ -987,42 +881,34 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @param resultType Result type. * @param scalarByte Scalar byte. */ - function payForFheMax(uint8 resultType, bytes1 scalarByte) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheMax(FheType resultType, bytes1 scalarByte) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); if (scalarByte == 0x01) { - if (resultType == 1) { - _updateFunding(121000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(128000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(150000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(164000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(192000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(225000); - } else if (resultType == 8) { - _updateFunding(264000); } else { revert UnsupportedOperation(); } } else { - if (resultType == 1) { - _updateFunding(121000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(128000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(153000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(183000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(210000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(241000); - } else if (resultType == 8) { - _updateFunding(277000); } else { revert UnsupportedOperation(); } @@ -1034,22 +920,20 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @notice Computes the gas required for FheNeg. * @param resultType Result type. */ - function payForFheNeg(uint8 resultType) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheNeg(FheType resultType) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); - if (resultType == 1) { - _updateFunding(60000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(95000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(131000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(160000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(199000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(248000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(309000); } else { revert UnsupportedOperation(); @@ -1061,24 +945,22 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @notice Computes the gas required for FheNot. * @param resultType Result type. */ - function payForFheNot(uint8 resultType) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheNot(FheType resultType) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); - if (resultType == 0) { + if (resultType == FheType.Bool) { _updateFunding(30000); - } else if (resultType == 1) { - _updateFunding(33000); - } else if (resultType == 2) { + } else if (resultType == FheType.Uint8) { _updateFunding(34000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(35000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(36000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(37000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(38000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(39000); } else { revert UnsupportedOperation(); @@ -1090,24 +972,22 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @notice Computes the gas required for Cast. * @param resultType Result type. */ - function payForCast(uint8 resultType) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForCast(FheType resultType) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); - if (resultType == 0) { - _updateFunding(200); - } else if (resultType == 1) { + if (resultType == FheType.Bool) { _updateFunding(200); - } else if (resultType == 2) { + } else if (resultType == FheType.Uint8) { _updateFunding(200); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(200); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(200); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(200); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(200); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(200); } else { revert UnsupportedOperation(); @@ -1119,32 +999,30 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @notice Computes the gas required for TrivialEncrypt. * @param resultType Result type. */ - function payForTrivialEncrypt(uint8 resultType) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForTrivialEncrypt(FheType resultType) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); - if (resultType == 0) { + if (resultType == FheType.Bool) { _updateFunding(100); - } else if (resultType == 1) { + } else if (resultType == FheType.Uint8) { _updateFunding(100); - } else if (resultType == 2) { - _updateFunding(100); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(200); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(300); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(600); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(650); - } else if (resultType == 7) { + } else if (resultType == FheType.Uint160) { _updateFunding(700); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(800); - } else if (resultType == 9) { + } else if (resultType == FheType.Uint512) { _updateFunding(1600); - } else if (resultType == 10) { + } else if (resultType == FheType.Uint1024) { _updateFunding(3200); - } else if (resultType == 11) { + } else if (resultType == FheType.Uint2048) { _updateFunding(6400); } else { revert UnsupportedOperation(); @@ -1156,32 +1034,30 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @notice Computes the gas required for IfThenElse. * @param resultType Result type. */ - function payForIfThenElse(uint8 resultType) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForIfThenElse(FheType resultType) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); - if (resultType == 0) { + if (resultType == FheType.Bool) { _updateFunding(43000); - } else if (resultType == 1) { - _updateFunding(45000); - } else if (resultType == 2) { + } else if (resultType == FheType.Uint8) { _updateFunding(47000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(47000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(50000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(53000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(70000); - } else if (resultType == 7) { + } else if (resultType == FheType.Uint160) { _updateFunding(80000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(90000); - } else if (resultType == 9) { + } else if (resultType == FheType.Uint512) { _updateFunding(150000); - } else if (resultType == 10) { + } else if (resultType == FheType.Uint1024) { _updateFunding(200000); - } else if (resultType == 11) { + } else if (resultType == FheType.Uint2048) { _updateFunding(300000); } else { revert UnsupportedOperation(); @@ -1193,30 +1069,28 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @notice Computes the gas required for FheRand. * @param resultType Result type. */ - function payForFheRand(uint8 resultType) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheRand(FheType resultType) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); - if (resultType == 0) { - _updateFunding(100000); - } else if (resultType == 1) { + if (resultType == FheType.Bool) { _updateFunding(100000); - } else if (resultType == 2) { + } else if (resultType == FheType.Uint8) { _updateFunding(100000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(100000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(100000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(100000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(100000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(100000); - } else if (resultType == 9) { + } else if (resultType == FheType.Uint512) { _updateFunding(200000); - } else if (resultType == 10) { + } else if (resultType == FheType.Uint1024) { _updateFunding(300000); - } else if (resultType == 11) { + } else if (resultType == FheType.Uint2048) { _updateFunding(400000); } else { revert UnsupportedOperation(); @@ -1228,22 +1102,20 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { * @notice Computes the gas required for FheRandBounded. * @param resultType Result type. */ - function payForFheRandBounded(uint8 resultType) external virtual { - if (msg.sender != tfheExecutorAddress) revert CallerMustBeTFHEExecutorContract(); + function payForFheRandBounded(FheType resultType) external virtual { + if (msg.sender != httpzExecutorAddress) revert CallerMustBeHTTPZExecutorContract(); _checkIfNewBlock(); - if (resultType == 1) { - _updateFunding(100000); - } else if (resultType == 2) { + if (resultType == FheType.Uint8) { _updateFunding(100000); - } else if (resultType == 3) { + } else if (resultType == FheType.Uint16) { _updateFunding(100000); - } else if (resultType == 4) { + } else if (resultType == FheType.Uint32) { _updateFunding(100000); - } else if (resultType == 5) { + } else if (resultType == FheType.Uint64) { _updateFunding(100000); - } else if (resultType == 6) { + } else if (resultType == FheType.Uint128) { _updateFunding(100000); - } else if (resultType == 8) { + } else if (resultType == FheType.Uint256) { _updateFunding(100000); } else { revert UnsupportedOperation(); @@ -1252,11 +1124,11 @@ contract FHEGasLimit is UUPSUpgradeable, Ownable2StepUpgradeable { } /** - * @notice Getter function for the TFHEExecutor contract address. - * @return tfheExecutorAddress Address of the TFHEExecutor. + * @notice Getter function for the HTTPZExecutor contract address. + * @return httpzExecutorAddress Address of the HTTPZExecutor. */ - function getTFHEExecutorAddress() public view virtual returns (address) { - return tfheExecutorAddress; + function getHTTPZExecutorAddress() public view virtual returns (address) { + return httpzExecutorAddress; } /** diff --git a/contracts/contracts/FheType.sol b/contracts/contracts/FheType.sol new file mode 100644 index 00000000..fc570e1d --- /dev/null +++ b/contracts/contracts/FheType.sol @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +pragma solidity ^0.8.24; + +enum FheType { + Bool, + Uint4, + Uint8, + Uint16, + Uint32, + Uint64, + Uint128, + Uint160, + Uint256, + Uint512, + Uint1024, + Uint2048, + Uint2, + Uint6, + Uint10, + Uint12, + Uint14, + Int2, + Int4, + Int6, + Int8, + Int10, + Int12, + Int14, + Int16, + Int32, + Int64, + Int128, + Int160, + Int256, + AsciiString, + Int512, + Int1024, + Int2048, + Uint24, + Uint40, + Uint48, + Uint56, + Uint72, + Uint80, + Uint88, + Uint96, + Uint104, + Uint112, + Uint120, + Uint136, + Uint144, + Uint152, + Uint168, + Uint176, + Uint184, + Uint192, + Uint200, + Uint208, + Uint216, + Uint224, + Uint232, + Uint240, + Uint248, + Int24, + Int40, + Int48, + Int56, + Int72, + Int80, + Int88, + Int96, + Int104, + Int112, + Int120, + Int136, + Int144, + Int152, + Int168, + Int176, + Int184, + Int192, + Int200, + Int208, + Int216, + Int224, + Int232, + Int240, + Int248 +} diff --git a/contracts/contracts/TFHEExecutor.sol b/contracts/contracts/HTTPZExecutor.sol similarity index 92% rename from contracts/contracts/TFHEExecutor.sol rename to contracts/contracts/HTTPZExecutor.sol index 562453f2..c75b433e 100644 --- a/contracts/contracts/TFHEExecutor.sol +++ b/contracts/contracts/HTTPZExecutor.sol @@ -1,15 +1,16 @@ // SPDX-License-Identifier: BSD-3-Clause-Clear pragma solidity ^0.8.24; -import {TFHEExecutorNoEvents} from "./TFHEExecutorNoEvents.sol"; +import {HTTPZExecutorNoEvents} from "./HTTPZExecutorNoEvents.sol"; +import {FheType} from "./FheType.sol"; /** - * @title TFHEExecutor - * @notice This contract inherits TFHEExecutorNoEvents and overrides its functions to emit - * events for all TFHE operations. + * @title HTTPZExecutor + * @notice This contract inherits HTTPZExecutorNoEvents and overrides its functions to emit + * events for all HTTPZ operations. * @dev This contract is deployed using an UUPS proxy. */ -contract TFHEExecutor is TFHEExecutorNoEvents { +contract HTTPZExecutor is HTTPZExecutorNoEvents { event FheAdd(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); event FheSub(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); event FheMul(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); @@ -39,15 +40,15 @@ contract TFHEExecutor is TFHEExecutorNoEvents { bytes32 inputHandle, address userAddress, bytes inputProof, - bytes1 inputType, + FheType inputType, bytes32 result ); - event Cast(address indexed caller, bytes32 ct, bytes1 toType, bytes32 result); - event TrivialEncrypt(address indexed caller, uint256 pt, bytes1 toType, bytes32 result); - event TrivialEncryptBytes(address indexed caller, bytes pt, bytes1 toType, bytes32 result); + event Cast(address indexed caller, bytes32 ct, FheType toType, bytes32 result); + event TrivialEncrypt(address indexed caller, uint256 pt, FheType toType, bytes32 result); + event TrivialEncryptBytes(address indexed caller, bytes pt, FheType toType, bytes32 result); event FheIfThenElse(address indexed caller, bytes32 control, bytes32 ifTrue, bytes32 ifFalse, bytes32 result); - event FheRand(address indexed caller, bytes1 randType, bytes16 seed, bytes32 result); - event FheRandBounded(address indexed caller, uint256 upperBound, bytes1 randType, bytes16 seed, bytes32 result); + event FheRand(address indexed caller, FheType randType, bytes16 seed, bytes32 result); + event FheRandBounded(address indexed caller, uint256 upperBound, FheType randType, bytes16 seed, bytes32 result); /// @custom:oz-upgrades-unsafe-allow constructor constructor() { @@ -359,7 +360,7 @@ contract TFHEExecutor is TFHEExecutorNoEvents { * @param randType Type for the random result. * @return result Result. */ - function fheRand(bytes1 randType) public virtual override returns (bytes32 result) { + function fheRand(FheType randType) public virtual override returns (bytes32 result) { bytes16 seed = _generateSeed(); result = _generateRand(randType, seed); emit FheRand(msg.sender, randType, seed, result); @@ -371,7 +372,7 @@ contract TFHEExecutor is TFHEExecutorNoEvents { * @param randType Type for the random result. * @return result Result. */ - function fheRandBounded(uint256 upperBound, bytes1 randType) public virtual override returns (bytes32 result) { + function fheRandBounded(uint256 upperBound, FheType randType) public virtual override returns (bytes32 result) { bytes16 seed = _generateSeed(); result = _generateRandBounded(upperBound, randType, seed); emit FheRandBounded(msg.sender, upperBound, randType, seed, result); @@ -383,7 +384,7 @@ contract TFHEExecutor is TFHEExecutorNoEvents { * @param toType Target type. * @return result Result value of the target type. */ - function cast(bytes32 ct, bytes1 toType) public virtual override returns (bytes32 result) { + function cast(bytes32 ct, FheType toType) public virtual override returns (bytes32 result) { result = super.cast(ct, toType); emit Cast(msg.sender, ct, toType, result); } @@ -394,7 +395,7 @@ contract TFHEExecutor is TFHEExecutorNoEvents { * @param toType Target type. * @return result Result value of the target type. */ - function trivialEncrypt(uint256 pt, bytes1 toType) public virtual override returns (bytes32 result) { + function trivialEncrypt(uint256 pt, FheType toType) public virtual override returns (bytes32 result) { result = super.trivialEncrypt(pt, toType); emit TrivialEncrypt(msg.sender, pt, toType, result); } @@ -406,7 +407,7 @@ contract TFHEExecutor is TFHEExecutorNoEvents { * @return result Result value of the target type. * @dev This is an overloaded function for ebytesXX types. */ - function trivialEncrypt(bytes memory pt, bytes1 toType) public virtual override returns (bytes32 result) { + function trivialEncrypt(bytes memory pt, FheType toType) public virtual override returns (bytes32 result) { result = super.trivialEncrypt(pt, toType); emit TrivialEncryptBytes(msg.sender, pt, toType, result); } @@ -423,7 +424,7 @@ contract TFHEExecutor is TFHEExecutorNoEvents { bytes32 inputHandle, address userAddress, bytes memory inputProof, - bytes1 inputType + FheType inputType ) public virtual override returns (bytes32 result) { result = super.verifyCiphertext(inputHandle, userAddress, inputProof, inputType); emit VerifyCiphertext(msg.sender, inputHandle, userAddress, inputProof, inputType, result); diff --git a/contracts/contracts/TFHEExecutorNoEvents.sol b/contracts/contracts/HTTPZExecutorNoEvents.sol similarity index 60% rename from contracts/contracts/TFHEExecutorNoEvents.sol rename to contracts/contracts/HTTPZExecutorNoEvents.sol index 0d985a7a..fdadebb9 100644 --- a/contracts/contracts/TFHEExecutorNoEvents.sol +++ b/contracts/contracts/HTTPZExecutorNoEvents.sol @@ -11,24 +11,26 @@ import {aclAdd} from "../addresses/ACLAddress.sol"; import {fheGasLimitAdd} from "../addresses/FHEGasLimitAddress.sol"; import {inputVerifierAdd} from "../addresses/InputVerifierAddress.sol"; +import {FheType} from "./FheType.sol"; + /** * @title IInputVerifier. */ interface IInputVerifier { function verifyCiphertext( - TFHEExecutorNoEvents.ContextUserInputs memory context, + HTTPZExecutorNoEvents.ContextUserInputs memory context, bytes32 inputHandle, bytes memory inputProof ) external returns (bytes32); } /** - * @title TFHEExecutorNoEvents. + * @title HTTPZExecutorNoEvents. * @notice This contract implements symbolic execution on the blockchain and one of its * main responsibilities is to deterministically generate ciphertext handles. * @dev This contract is deployed using an UUPS proxy. */ -contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { +contract HTTPZExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { /// @notice Returned when the handle is not allowed in the ACL for the account. /// @param handle Handle. /// @param account Address of the account. @@ -41,7 +43,7 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { error IncompatibleTypes(); /// @notice Returned if the length of the bytes is not as expected. - error InvalidByteLength(uint8 typeOf, uint256 length); + error InvalidByteLength(FheType typeOf, uint256 length); /// @notice Returned if the type is not the expected one. error InvalidType(); @@ -71,8 +73,8 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { address contractAddress; } - /// @custom:storage-location erc7201:fhevm.storage.TFHEExecutor - struct TFHEExecutorStorage { + /// @custom:storage-location erc7201:httpz.storage.HTTPZExecutor + struct HTTPZExecutorStorage { /// @dev Counter used for computing handles of randomness operators. It is also used for OPRF, which is used to /// generate pseudo-random ciphertexts. uint256 counterRand; @@ -113,7 +115,7 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { uint8 public constant HANDLE_VERSION = 0; /// @notice Name of the contract. - string private constant CONTRACT_NAME = "TFHEExecutor"; + string private constant CONTRACT_NAME = "HTTPZExecutor"; /// @notice Major version of the contract. uint256 private constant MAJOR_VERSION = 0; @@ -133,9 +135,9 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { /// @notice IInputVerifier. IInputVerifier private constant inputVerifier = IInputVerifier(inputVerifierAdd); - /// @dev keccak256(abi.encode(uint256(keccak256("fhevm.storage.TFHEExecutor")) - 1)) & ~bytes32(uint256(0xff)) - bytes32 private constant TFHEExecutorStorageLocation = - 0xa436a06f0efce5ea38c956a21e24202a59b3b746d48a23fb52b4a5bc33fe3e00; + /// keccak256(abi.encode(uint256(keccak256("httpz.storage.HTTPZExecutor")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant HTTPZExecutorStorageLocation = + 0x3d02b8d0de856b0609b3629cf5f3cd56c0504e3831cd53973d36422116206500; /// @custom:oz-upgrades-unsafe-allow constructor constructor() { @@ -150,9 +152,13 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheAdd(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); + uint256 supportedTypes = (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; fheGasLimit.payForFheAdd(lhsType, scalar); result = _binaryOp(Operators.fheAdd, lhs, rhs, scalar, lhsType); @@ -166,9 +172,13 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheSub(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); + uint256 supportedTypes = (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; fheGasLimit.payForFheSub(lhsType, scalar); result = _binaryOp(Operators.fheSub, lhs, rhs, scalar, lhsType); @@ -182,9 +192,13 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheMul(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); + uint256 supportedTypes = (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; fheGasLimit.payForFheMul(lhsType, scalar); result = _binaryOp(Operators.fheMul, lhs, rhs, scalar, lhsType); @@ -200,9 +214,13 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { function fheDiv(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { if (scalarByte & 0x01 != 0x01) revert IsNotScalar(); if (rhs == 0) revert DivisionByZero(); - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); + uint256 supportedTypes = (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; fheGasLimit.payForFheDiv(lhsType, scalar); result = _binaryOp(Operators.fheDiv, lhs, rhs, scalar, lhsType); @@ -218,9 +236,13 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { function fheRem(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { if (scalarByte & 0x01 != 0x01) revert IsNotScalar(); if (rhs == 0) revert DivisionByZero(); - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); + uint256 supportedTypes = (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; fheGasLimit.payForFheRem(lhsType, scalar); result = _binaryOp(Operators.fheRem, lhs, rhs, scalar, lhsType); @@ -234,9 +256,15 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheBitAnd(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); + uint256 supportedTypes = (1 << uint8(FheType.Bool)) + + (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)) + + (1 << uint8(FheType.Uint256)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; fheGasLimit.payForFheBitAnd(lhsType, scalar); result = _binaryOp(Operators.fheBitAnd, lhs, rhs, scalar, lhsType); @@ -250,9 +278,15 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheBitOr(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); + uint256 supportedTypes = (1 << uint8(FheType.Bool)) + + (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)) + + (1 << uint8(FheType.Uint256)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; fheGasLimit.payForFheBitOr(lhsType, scalar); result = _binaryOp(Operators.fheBitOr, lhs, rhs, scalar, lhsType); @@ -266,9 +300,15 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheBitXor(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); + uint256 supportedTypes = (1 << uint8(FheType.Bool)) + + (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)) + + (1 << uint8(FheType.Uint256)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; fheGasLimit.payForFheBitXor(lhsType, scalar); result = _binaryOp(Operators.fheBitXor, lhs, rhs, scalar, lhsType); @@ -282,9 +322,14 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheShl(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); + uint256 supportedTypes = (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)) + + (1 << uint8(FheType.Uint256)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; fheGasLimit.payForFheShl(lhsType, scalar); result = _binaryOp(Operators.fheShl, lhs, rhs, scalar, lhsType); @@ -298,9 +343,14 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheShr(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); + uint256 supportedTypes = (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)) + + (1 << uint8(FheType.Uint256)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; fheGasLimit.payForFheShr(lhsType, scalar); result = _binaryOp(Operators.fheShr, lhs, rhs, scalar, lhsType); @@ -314,9 +364,14 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheRotl(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); + uint256 supportedTypes = (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)) + + (1 << uint8(FheType.Uint256)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; fheGasLimit.payForFheRotl(lhsType, scalar); result = _binaryOp(Operators.fheRotl, lhs, rhs, scalar, lhsType); @@ -330,9 +385,14 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheRotr(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); + uint256 supportedTypes = (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)) + + (1 << uint8(FheType.Uint256)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; fheGasLimit.payForFheRotr(lhsType, scalar); result = _binaryOp(Operators.fheRotr, lhs, rhs, scalar, lhsType); @@ -346,26 +406,25 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheEq(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 0) + - (1 << 1) + - (1 << 2) + - (1 << 3) + - (1 << 4) + - (1 << 5) + - (1 << 6) + - (1 << 7) + - (1 << 8) + - (1 << 9) + - (1 << 10) + - (1 << 11); + uint256 supportedTypes = (1 << uint8(FheType.Bool)) + + (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)) + + (1 << uint8(FheType.Uint160)) + + (1 << uint8(FheType.Uint256)) + + (1 << uint8(FheType.Uint512)) + + (1 << uint8(FheType.Uint1024)) + + (1 << uint8(FheType.Uint2048)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; - if (scalar == 0x01 && lhsType > 8) revert IsScalar(); + if (scalar == 0x01 && uint8(lhsType) > 8) revert IsScalar(); fheGasLimit.payForFheEq(lhsType, scalar); - result = _binaryOp(Operators.fheEq, lhs, rhs, scalar, 0); + result = _binaryOp(Operators.fheEq, lhs, rhs, scalar, FheType.Bool); } /** @@ -376,9 +435,11 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheEq(bytes32 lhs, bytes memory rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 9) + (1 << 10) + (1 << 11); + uint256 supportedTypes = (1 << uint8(FheType.Uint512)) + + (1 << uint8(FheType.Uint1024)) + + (1 << uint8(FheType.Uint2048)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; if (scalar != 0x01) revert SecondOperandIsNotScalar(); @@ -388,7 +449,7 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { _checkByteLengthForEbytesTypes(rhs.length, lhsType); result = keccak256(abi.encodePacked(Operators.fheEq, lhs, rhs, scalar, acl, block.chainid)); - result = _appendType(result, 0); + result = _appendMetadataToPrehandle(result, FheType.Bool); acl.allowTransient(result, msg.sender); } @@ -400,26 +461,25 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheNe(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 0) + - (1 << 1) + - (1 << 2) + - (1 << 3) + - (1 << 4) + - (1 << 5) + - (1 << 6) + - (1 << 7) + - (1 << 8) + - (1 << 9) + - (1 << 10) + - (1 << 11); + uint256 supportedTypes = (1 << uint8(FheType.Bool)) + + (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)) + + (1 << uint8(FheType.Uint160)) + + (1 << uint8(FheType.Uint256)) + + (1 << uint8(FheType.Uint512)) + + (1 << uint8(FheType.Uint1024)) + + (1 << uint8(FheType.Uint2048)); + _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; - - if (scalar == 0x01 && lhsType > 8) revert IsScalar(); + if (scalar == 0x01 && uint8(lhsType) > 8) revert IsScalar(); fheGasLimit.payForFheNe(lhsType, scalar); - result = _binaryOp(Operators.fheNe, lhs, rhs, scalar, 0); + result = _binaryOp(Operators.fheNe, lhs, rhs, scalar, FheType.Bool); } /** @@ -430,9 +490,11 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheNe(bytes32 lhs, bytes memory rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 9) + (1 << 10) + (1 << 11); + uint256 supportedTypes = (1 << uint8(FheType.Uint512)) + + (1 << uint8(FheType.Uint1024)) + + (1 << uint8(FheType.Uint2048)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; if (scalar != 0x01) revert SecondOperandIsNotScalar(); @@ -440,7 +502,7 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { if (!acl.isAllowed(lhs, msg.sender)) revert ACLNotAllowed(lhs, msg.sender); _checkByteLengthForEbytesTypes(rhs.length, lhsType); result = keccak256(abi.encodePacked(Operators.fheNe, lhs, rhs, scalar, acl, block.chainid)); - result = _appendType(result, 0); + result = _appendMetadataToPrehandle(result, FheType.Bool); acl.allowTransient(result, msg.sender); } @@ -452,12 +514,16 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheGe(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); + uint256 supportedTypes = (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; fheGasLimit.payForFheGe(lhsType, scalar); - result = _binaryOp(Operators.fheGe, lhs, rhs, scalar, 0); + result = _binaryOp(Operators.fheGe, lhs, rhs, scalar, FheType.Bool); } /** @@ -468,12 +534,16 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheGt(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); + uint256 supportedTypes = (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; fheGasLimit.payForFheGt(lhsType, scalar); - result = _binaryOp(Operators.fheGt, lhs, rhs, scalar, 0); + result = _binaryOp(Operators.fheGt, lhs, rhs, scalar, FheType.Bool); } /** @@ -484,12 +554,16 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheLe(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); + uint256 supportedTypes = (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; fheGasLimit.payForFheLe(lhsType, scalar); - result = _binaryOp(Operators.fheLe, lhs, rhs, scalar, 0); + result = _binaryOp(Operators.fheLe, lhs, rhs, scalar, FheType.Bool); } /** @@ -500,12 +574,16 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheLt(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); + uint256 supportedTypes = (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; fheGasLimit.payForFheLt(lhsType, scalar); - result = _binaryOp(Operators.fheLt, lhs, rhs, scalar, 0); + result = _binaryOp(Operators.fheLt, lhs, rhs, scalar, FheType.Bool); } /** @@ -516,9 +594,13 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheMin(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); + uint256 supportedTypes = (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; fheGasLimit.payForFheMin(lhsType, scalar); result = _binaryOp(Operators.fheMin, lhs, rhs, scalar, lhsType); @@ -532,9 +614,13 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheMax(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); + uint256 supportedTypes = (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)); _requireType(lhs, supportedTypes); - uint8 lhsType = _typeOf(lhs); + FheType lhsType = _typeOf(lhs); bytes1 scalar = scalarByte & 0x01; fheGasLimit.payForFheMax(lhsType, scalar); result = _binaryOp(Operators.fheMax, lhs, rhs, scalar, lhsType); @@ -546,9 +632,14 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheNeg(bytes32 ct) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); + uint256 supportedTypes = (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)) + + (1 << uint8(FheType.Uint256)); _requireType(ct, supportedTypes); - uint8 typeCt = _typeOf(ct); + FheType typeCt = _typeOf(ct); fheGasLimit.payForFheNeg(typeCt); result = _unaryOp(Operators.fheNeg, ct); } @@ -559,9 +650,15 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheNot(bytes32 ct) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 0) + (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); + uint256 supportedTypes = (1 << uint8(FheType.Bool)) + + (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)) + + (1 << uint8(FheType.Uint256)); _requireType(ct, supportedTypes); - uint8 typeCt = _typeOf(ct); + FheType typeCt = _typeOf(ct); fheGasLimit.payForFheNot(typeCt); result = _unaryOp(Operators.fheNot, ct); } @@ -574,20 +671,19 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result. */ function fheIfThenElse(bytes32 control, bytes32 ifTrue, bytes32 ifFalse) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 0) + - (1 << 1) + - (1 << 2) + - (1 << 3) + - (1 << 4) + - (1 << 5) + - (1 << 6) + - (1 << 7) + - (1 << 8) + - (1 << 9) + - (1 << 10) + - (1 << 11); + uint256 supportedTypes = (1 << uint8(FheType.Bool)) + + (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)) + + (1 << uint8(FheType.Uint160)) + + (1 << uint8(FheType.Uint256)) + + (1 << uint8(FheType.Uint512)) + + (1 << uint8(FheType.Uint1024)) + + (1 << uint8(FheType.Uint2048)); _requireType(ifTrue, supportedTypes); - uint8 typeCt = _typeOf(ifTrue); + FheType typeCt = _typeOf(ifTrue); fheGasLimit.payForIfThenElse(typeCt); result = _ternaryOp(Operators.fheIfThenElse, control, ifTrue, ifFalse); } @@ -597,7 +693,7 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @param randType Type for the random result. * @return result Result. */ - function fheRand(bytes1 randType) public virtual returns (bytes32 result) { + function fheRand(FheType randType) public virtual returns (bytes32 result) { bytes16 seed = _generateSeed(); result = _generateRand(randType, seed); } @@ -608,7 +704,7 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @param randType Type for the random result. * @return result Result. */ - function fheRandBounded(uint256 upperBound, bytes1 randType) public virtual returns (bytes32 result) { + function fheRandBounded(uint256 upperBound, FheType randType) public virtual returns (bytes32 result) { bytes16 seed = _generateSeed(); result = _generateRandBounded(upperBound, randType, seed); } @@ -619,25 +715,30 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @param toType Target type. * @return result Result value of the target type. */ - function cast(bytes32 ct, bytes1 toType) public virtual returns (bytes32 result) { + function cast(bytes32 ct, FheType toType) public virtual returns (bytes32 result) { if (!acl.isAllowed(ct, msg.sender)) revert ACLNotAllowed(ct, msg.sender); - uint256 supportedTypesInput = (1 << 0) + - (1 << 1) + - (1 << 2) + - (1 << 3) + - (1 << 4) + - (1 << 5) + - (1 << 6) + - (1 << 8); + uint256 supportedTypesInput = (1 << uint8(FheType.Bool)) + + (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)) + + (1 << uint8(FheType.Uint256)); _requireType(ct, supportedTypesInput); - uint256 supportedTypesOutput = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); // @note: unsupported casting to ebool (use fheNe instead) + uint256 supportedTypesOutput = (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)) + + (1 << uint8(FheType.Uint256)); // @note: unsupported casting to ebool (use fheNe instead) if ((1 << uint8(toType)) & supportedTypesOutput == 0) revert UnsupportedType(); - uint8 typeCt = _typeOf(ct); + + FheType typeCt = _typeOf(ct); /// @dev It must not cast to same type. - if (bytes1(typeCt) == toType) revert InvalidType(); + if (typeCt == toType) revert InvalidType(); fheGasLimit.payForCast(typeCt); result = keccak256(abi.encodePacked(Operators.cast, ct, toType, acl, block.chainid)); - result = _appendType(result, uint8(toType)); + result = _appendMetadataToPrehandle(result, toType); acl.allowTransient(result, msg.sender); } @@ -647,21 +748,20 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @param toType Target type. * @return result Result value of the target type. */ - function trivialEncrypt(uint256 pt, bytes1 toType) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 0) + - (1 << 1) + - (1 << 2) + - (1 << 3) + - (1 << 4) + - (1 << 5) + - (1 << 6) + - (1 << 7) + - (1 << 8); - uint8 toT = uint8(toType); - if ((1 << toT) & supportedTypes == 0) revert UnsupportedType(); - fheGasLimit.payForTrivialEncrypt(toT); + function trivialEncrypt(uint256 pt, FheType toType) public virtual returns (bytes32 result) { + uint256 supportedTypes = (1 << uint8(FheType.Bool)) + + (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)) + + (1 << uint8(FheType.Uint160)) + + (1 << uint8(FheType.Uint256)); + + if ((1 << uint8(toType)) & supportedTypes == 0) revert UnsupportedType(); + fheGasLimit.payForTrivialEncrypt(toType); result = keccak256(abi.encodePacked(Operators.trivialEncrypt, pt, toType, acl, block.chainid)); - result = _appendType(result, toT); + result = _appendMetadataToPrehandle(result, toType); acl.allowTransient(result, msg.sender); } @@ -672,14 +772,16 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { * @return result Result value of the target type. * @dev This is an overloaded function for ebytesXX types. */ - function trivialEncrypt(bytes memory pt, bytes1 toType) public virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 9) + (1 << 10) + (1 << 11); - uint8 toT = uint8(toType); - if ((1 << toT) & supportedTypes == 0) revert UnsupportedType(); - fheGasLimit.payForTrivialEncrypt(toT); - _checkByteLengthForEbytesTypes(pt.length, toT); + function trivialEncrypt(bytes memory pt, FheType toType) public virtual returns (bytes32 result) { + uint256 supportedTypes = (1 << uint8(FheType.Uint512)) + + (1 << uint8(FheType.Uint1024)) + + (1 << uint8(FheType.Uint2048)); + + if (((1 << uint8(toType)) & supportedTypes == 0)) revert UnsupportedType(); + fheGasLimit.payForTrivialEncrypt(toType); + _checkByteLengthForEbytesTypes(pt.length, toType); result = keccak256(abi.encodePacked(Operators.trivialEncrypt, pt, toType, acl, block.chainid)); - result = _appendType(result, toT); + result = _appendMetadataToPrehandle(result, toType); acl.allowTransient(result, msg.sender); } @@ -695,14 +797,14 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { bytes32 inputHandle, address userAddress, bytes memory inputProof, - bytes1 inputType + FheType inputType ) public virtual returns (bytes32 result) { ContextUserInputs memory contextUserInputs = ContextUserInputs({ userAddress: userAddress, contractAddress: msg.sender }); - uint8 typeCt = _typeOf(inputHandle); - if (uint8(inputType) != typeCt) revert InvalidType(); + FheType typeCt = _typeOf(inputHandle); + if (inputType != typeCt) revert InvalidType(); result = inputVerifier.verifyCiphertext(contextUserInputs, inputHandle, inputProof); acl.allowTransient(result, msg.sender); } @@ -748,44 +850,55 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { } /** - * @dev Handle format for user inputs is: keccak256(keccak256(CiphertextFHEList)||index_handle)[0:29] || index_handle || handle_type || handle_version - * Other handles format (fhe ops results) is: keccak256(keccak256(rawCiphertextFHEList)||index_handle)[0:30] || handle_type || handle_version + * @dev Handle format for user inputs and ops results are as such: + * keccak256(keccak256(CiphertextFHEList)||index_handle)[0:20] || index_handle[21] || chainID [22:29] || handle_type [30] || handle_version [31] + * If the handle stems from computation, the index_handle must be set to 0xff. * The CiphertextFHEList actually contains: 1 byte (= N) for size of handles_list, N bytes for the handles_types : 1 per handle, then the original fhe160list raw ciphertext */ - function _typeOf(bytes32 handle) internal pure virtual returns (uint8 typeCt) { - typeCt = uint8(handle[30]); - } - - function _appendType(bytes32 prehandle, uint8 handleType) internal pure virtual returns (bytes32 result) { - result = prehandle & 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000; - result = result | (bytes32(uint256(handleType)) << 8); + function _typeOf(bytes32 handle) internal pure virtual returns (FheType typeCt) { + typeCt = FheType(uint8(handle[30])); + } + + function _appendMetadataToPrehandle( + bytes32 prehandle, + FheType handleType + ) internal view virtual returns (bytes32 result) { + /// @dev Clear bytes 21-31. + result = prehandle & 0xffffffffffffffffffffffffffffffffffffffffff0000000000000000000000; + /// @dev Set byte 21 to 0xff since the new handle comes from computation. + result = result | (bytes32(uint256(0xff)) << 80); + /// @dev chainId is cast to uint64 first to make sure it does not take more than 8 bytes before shifting. + /// If EIP2294 gets approved, it will force the chainID's size to be lower than MAX_UINT64. + result = result | (bytes32(uint256(uint64(block.chainid))) << 16); + /// @dev Insert handleType into byte 30. + result = result | (bytes32(uint256(uint8(handleType))) << 8); + /// @dev Insert HANDLE_VERSION into byte 31. result = result | bytes32(uint256(HANDLE_VERSION)); } /** - * @dev Checks the length for typeOf >= 9. + * @dev Checks the length for typeOf that are ebytes. */ - function _checkByteLengthForEbytesTypes(uint256 byteLength, uint8 typeOf) internal pure virtual { - if (typeOf == 9) { - if (byteLength != 64) revert InvalidByteLength(typeOf, byteLength); - } else if (typeOf == 10) { - if (byteLength != 128) revert InvalidByteLength(typeOf, byteLength); - } else { - /// @dev i.e typeOf == 11. - if (byteLength != 256) revert InvalidByteLength(typeOf, byteLength); + function _checkByteLengthForEbytesTypes(uint256 byteLength, FheType fheType) internal pure virtual { + if (fheType == FheType.Uint512) { + if (byteLength != 64) revert InvalidByteLength(fheType, byteLength); + } else if (fheType == FheType.Uint1024) { + if (byteLength != 128) revert InvalidByteLength(fheType, byteLength); + } else if (fheType == FheType.Uint2048) { + if (byteLength != 256) revert InvalidByteLength(fheType, byteLength); } } function _requireType(bytes32 handle, uint256 supportedTypes) internal pure virtual { - uint8 typeCt = _typeOf(handle); - if ((1 << typeCt) & supportedTypes == 0) revert UnsupportedType(); + FheType typeCt = _typeOf(handle); + if ((1 << uint8(typeCt)) & supportedTypes == 0) revert UnsupportedType(); } function _unaryOp(Operators op, bytes32 ct) internal virtual returns (bytes32 result) { if (!acl.isAllowed(ct, msg.sender)) revert ACLNotAllowed(ct, msg.sender); result = keccak256(abi.encodePacked(op, ct, acl, block.chainid)); - uint8 typeCt = _typeOf(ct); - result = _appendType(result, typeCt); + FheType typeCt = _typeOf(ct); + result = _appendMetadataToPrehandle(result, typeCt); acl.allowTransient(result, msg.sender); } @@ -794,18 +907,18 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { bytes32 lhs, bytes32 rhs, bytes1 scalar, - uint8 resultType + FheType resultType ) internal virtual returns (bytes32 result) { if (!acl.isAllowed(lhs, msg.sender)) revert ACLNotAllowed(lhs, msg.sender); if (scalar == 0x00) { if (!acl.isAllowed(rhs, msg.sender)) revert ACLNotAllowed(rhs, msg.sender); - uint8 typeRhs = _typeOf(rhs); - uint8 typeLhs = _typeOf(lhs); - if (typeLhs != typeRhs) revert IncompatibleTypes(); + FheType rhsType = _typeOf(rhs); + FheType lhsType = _typeOf(lhs); + if (lhsType != rhsType) revert IncompatibleTypes(); } result = keccak256(abi.encodePacked(op, lhs, rhs, scalar, acl, block.chainid)); - result = _appendType(result, resultType); + result = _appendMetadataToPrehandle(result, resultType); acl.allowTransient(result, msg.sender); } @@ -819,60 +932,64 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { if (!acl.isAllowed(middle, msg.sender)) revert ACLNotAllowed(middle, msg.sender); if (!acl.isAllowed(rhs, msg.sender)) revert ACLNotAllowed(rhs, msg.sender); - uint8 typeLhs = _typeOf(lhs); - uint8 typeMiddle = _typeOf(middle); - uint8 typeRhs = _typeOf(rhs); + FheType lhsType = _typeOf(lhs); + FheType middleType = _typeOf(middle); + FheType rhsType = _typeOf(rhs); - if (typeLhs != 0) revert UnsupportedType(); /// @dev lhs must be ebool - if (typeMiddle != typeRhs) revert IncompatibleTypes(); + /// @dev lhs must be ebool + if (lhsType != FheType.Bool) revert UnsupportedType(); + if (middleType != rhsType) revert IncompatibleTypes(); result = keccak256(abi.encodePacked(op, lhs, middle, rhs, acl, block.chainid)); - result = _appendType(result, typeMiddle); + result = _appendMetadataToPrehandle(result, middleType); acl.allowTransient(result, msg.sender); } function _generateSeed() internal virtual returns (bytes16 seed) { - TFHEExecutorStorage storage $ = _getTFHEExecutorStorage(); + HTTPZExecutorStorage storage $ = _getHTTPZExecutorStorage(); seed = bytes16( keccak256(abi.encodePacked($.counterRand, acl, block.chainid, blockhash(block.number - 1), block.timestamp)) ); $.counterRand++; } - function _generateRand(bytes1 randType, bytes16 seed) internal virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 0) + - (1 << 1) + - (1 << 2) + - (1 << 3) + - (1 << 4) + - (1 << 5) + - (1 << 6) + - (1 << 8) + - (1 << 9) + - (1 << 10) + - (1 << 11); - uint8 randT = uint8(randType); + function _generateRand(FheType randType, bytes16 seed) internal virtual returns (bytes32 result) { + uint256 supportedTypes = (1 << uint8(FheType.Bool)) + + (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)) + + (1 << uint8(FheType.Uint256)) + + (1 << uint8(FheType.Uint512)) + + (1 << uint8(FheType.Uint1024)) + + (1 << uint8(FheType.Uint2048)); + /// @dev Unsupported erandom type. - if ((1 << randT) & supportedTypes == 0) revert UnsupportedType(); - fheGasLimit.payForFheRand(randT); + if ((1 << uint8(randType)) & supportedTypes == 0) revert UnsupportedType(); + fheGasLimit.payForFheRand(randType); result = keccak256(abi.encodePacked(Operators.fheRand, randType, seed)); - result = _appendType(result, randT); + result = _appendMetadataToPrehandle(result, randType); acl.allowTransient(result, msg.sender); } function _generateRandBounded( uint256 upperBound, - bytes1 randType, + FheType randType, bytes16 seed ) internal virtual returns (bytes32 result) { - uint256 supportedTypes = (1 << 1) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5) + (1 << 6) + (1 << 8); - uint8 randT = uint8(randType); + uint256 supportedTypes = (1 << uint8(FheType.Uint8)) + + (1 << uint8(FheType.Uint16)) + + (1 << uint8(FheType.Uint32)) + + (1 << uint8(FheType.Uint64)) + + (1 << uint8(FheType.Uint128)) + + (1 << uint8(FheType.Uint256)); /// @dev Unsupported erandom type. - if ((1 << randT) & supportedTypes == 0) revert UnsupportedType(); + if ((1 << uint8(randType)) & supportedTypes == 0) revert UnsupportedType(); if (!_isPowerOfTwo(upperBound)) revert NotPowerOfTwo(); - fheGasLimit.payForFheRandBounded(randT); + fheGasLimit.payForFheRandBounded(randType); result = keccak256(abi.encodePacked(Operators.fheRandBounded, upperBound, randType, seed)); - result = _appendType(result, randT); + result = _appendMetadataToPrehandle(result, randType); acl.allowTransient(result, msg.sender); } @@ -885,11 +1002,11 @@ contract TFHEExecutorNoEvents is UUPSUpgradeable, Ownable2StepUpgradeable { } /** - * @dev Returns the TFHEExecutor storage location. + * @dev Returns the HTTPZExecutor storage location. */ - function _getTFHEExecutorStorage() internal pure returns (TFHEExecutorStorage storage $) { + function _getHTTPZExecutorStorage() internal pure returns (HTTPZExecutorStorage storage $) { assembly { - $.slot := TFHEExecutorStorageLocation + $.slot := HTTPZExecutorStorageLocation } } diff --git a/contracts/contracts/InputVerifier.sol b/contracts/contracts/InputVerifier.sol index 140aa99d..f059f919 100644 --- a/contracts/contracts/InputVerifier.sol +++ b/contracts/contracts/InputVerifier.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BSD-3-Clause-Clear pragma solidity ^0.8.24; -import {TFHEExecutor} from "./TFHEExecutor.sol"; +import {HTTPZExecutor} from "./HTTPZExecutor.sol"; // Importing OpenZeppelin contracts for cryptographic signature verification and access control. import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; @@ -13,7 +13,7 @@ import {EIP712UpgradeableCrossChain} from "./EIP712UpgradeableCrossChain.sol"; /** * @title InputVerifier. * @notice This contract allows signature verification of user encrypted inputs. - * This contract is called by the TFHEExecutor inside verifyCiphertext function + * This contract is called by the HTTPZExecutor inside verifyCiphertext function * @dev The contract uses EIP712UpgradeableCrossChain for cryptographic operations. */ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712UpgradeableCrossChain { @@ -31,6 +31,9 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad /// @notice Returned if the input proof is empty. error EmptyInputProof(); + /// @notice Returned if the chain id from the input handle is invalid. + error InvalidChainId(); + /// @notice Returned if the index is invalid. error InvalidIndex(); @@ -107,16 +110,16 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad /// @notice Patch version of the contract. uint256 private constant PATCH_VERSION = 0; - /// @custom:storage-location erc7201:fhevm.storage.InputVerifier + /// @custom:storage-location erc7201:httpz.storage.InputVerifier struct InputVerifierStorage { mapping(address => bool) isSigner; /// @notice Mapping to keep track of addresses that are signers address[] signers; /// @notice Array to keep track of all signers uint256 threshold; /// @notice The threshold for the number of signers required for a signature to be valid } - /// @dev keccak256(abi.encode(uint256(keccak256("fhevm.storage.InputVerifier")) - 1)) & ~bytes32(uint256(0xff)) + /// keccak256(abi.encode(uint256(keccak256("httpz.storage.InputVerifier")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant InputVerifierStorageLocation = - 0x3f7d7a96c8c7024e92d37afccfc9b87773a33b9bc22e23134b683e74a50ace00; + 0x0f3182ad724e9de82dc79a31e3b0e792f87a844d042e92fa257979351135e300; /// @custom:oz-upgrades-unsafe-allow constructor constructor() { @@ -170,21 +173,28 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad * @return result Result. */ function verifyCiphertext( - TFHEExecutor.ContextUserInputs memory context, + HTTPZExecutor.ContextUserInputs memory context, bytes32 inputHandle, bytes memory inputProof - ) public virtual returns (uint256) { + ) public virtual returns (bytes32) { (bool isProofCached, bytes32 cacheKey) = _checkProofCache( inputProof, context.userAddress, context.contractAddress ); + + uint64 recoveredChainId = uint64( + uint256((inputHandle & 0x00000000000000000000000000000000000000000000ffffffffffffffffffff) >> 16) + ); + + if (recoveredChainId != block.chainid) revert InvalidChainId(); + uint256 result = uint256(inputHandle); - uint256 indexHandle = (result & 0x0000000000000000000000000000000000000000000000000000000000ff0000) >> 16; + uint256 indexHandle = (result & 0x0000000000000000000000000000000000000000ff00000000000000000000) >> 80; if (!isProofCached) { /// @dev bundleCiphertext is compressedPackedCT+ZKPOK - /// inputHandle is keccak256(keccak256(bundleCiphertext)+index)[0:29]+index+type+version + /// inputHandle is keccak256(keccak256(bundleCiphertext)+index)[0:20] + index[21] + chainId[22:29] + type[30] + version[31] /// and inputProof is len(list_handles) + numSigners + list_handles + signatureCoprocessorSigners (1+1+NUM_HANDLES*32+65*numSigners) uint256 inputProofLen = inputProof.length; @@ -193,7 +203,7 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad uint256 numSigners = uint256(uint8(inputProof[1])); /// @dev This checks in particular that the list is non-empty. - if (numHandles <= indexHandle) revert InvalidIndex(); + if (numHandles <= indexHandle || indexHandle > 254) revert InvalidIndex(); if (inputProofLen != 2 + 32 * numHandles + 65 * numSigners) revert DeserializingInputProofFail(); /// @dev Deserialize handle and check that they are from the correct version. @@ -226,14 +236,15 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad } else { uint8 numHandles = uint8(inputProof[0]); /// @dev We know inputProof is non-empty since it has been previously cached. - if (numHandles <= indexHandle) revert InvalidIndex(); + if (numHandles <= indexHandle || indexHandle > 254) revert InvalidIndex(); uint256 element; for (uint256 j = 0; j < 32; j++) { element |= uint256(uint8(inputProof[2 + indexHandle * 32 + j])) << (8 * (31 - j)); } if (element != result) revert InvalidInputHandle(); } - return result; + + return bytes32(result); } /** @@ -288,7 +299,7 @@ contract InputVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgrad * @dev If there are too many signers, it could be out-of-gas. * @return signers List of signers. */ - function getSigners() public view virtual returns (address[] memory) { + function getCoprocessorSigners() public view virtual returns (address[] memory) { InputVerifierStorage storage $ = _getInputVerifierStorage(); return $.signers; } diff --git a/contracts/contracts/KMSVerifier.sol b/contracts/contracts/KMSVerifier.sol index 888e6b97..e761b19c 100644 --- a/contracts/contracts/KMSVerifier.sol +++ b/contracts/contracts/KMSVerifier.sol @@ -77,16 +77,16 @@ contract KMSVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgradea /// @notice Patch version of the contract. uint256 private constant PATCH_VERSION = 0; - /// @custom:storage-location erc7201:fhevm.storage.KMSVerifier + /// @custom:storage-location erc7201:httpz.storage.KMSVerifier struct KMSVerifierStorage { mapping(address => bool) isSigner; /// @notice Mapping to keep track of addresses that are signers address[] signers; /// @notice Array to keep track of all signers uint256 threshold; /// @notice The threshold for the number of signers required for a signature to be valid } - /// @dev keccak256(abi.encode(uint256(keccak256("fhevm.storage.KMSVerifier")) - 1)) & ~bytes32(uint256(0xff)) + /// keccak256(abi.encode(uint256(keccak256("httpz.storage.KMSVerifier")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant KMSVerifierStorageLocation = - 0x7e81a744be86773af8644dd7304fa1dc9350ccabf16cfcaa614ddb78b4ce8900; + 0x32de30c1e77d61b92590445ba1ed3bfeff4550f0ca57d996d78b6bad53c38800; /// @custom:oz-upgrades-unsafe-allow constructor constructor() { @@ -183,7 +183,7 @@ contract KMSVerifier is UUPSUpgradeable, Ownable2StepUpgradeable, EIP712Upgradea * @dev If there are too many signers, it could be out-of-gas. * @return signers List of signers. */ - function getSigners() public view virtual returns (address[] memory) { + function getKmsSigners() public view virtual returns (address[] memory) { KMSVerifierStorage storage $ = _getKMSVerifierStorage(); return $.signers; } diff --git a/contracts/decryptionOracle/DecryptionOracle.sol b/contracts/decryptionOracle/DecryptionOracle.sol index 4bde3aae..2d48d893 100644 --- a/contracts/decryptionOracle/DecryptionOracle.sol +++ b/contracts/decryptionOracle/DecryptionOracle.sol @@ -35,7 +35,7 @@ contract DecryptionOracle is UUPSUpgradeable, Ownable2StepUpgradeable { */ function _authorizeUpgrade(address _newImplementation) internal virtual override onlyOwner {} - /// @custom:storage-location erc7201:fhevm.storage.DecryptionOracle + /// @custom:storage-location erc7201:httpz.storage.DecryptionOracle struct DecryptionOracleStorage { uint256 counter; // tracks the number of decryption requests, and used to compute the requestID by hashing it with the dApp address } @@ -45,9 +45,9 @@ contract DecryptionOracle is UUPSUpgradeable, Ownable2StepUpgradeable { return $.counter; } - // keccak256(abi.encode(uint256(keccak256("fhevm.storage.DecryptionOracle")) - 1)) & ~bytes32(uint256(0xff)) + // keccak256(abi.encode(uint256(keccak256("httpz.storage.DecryptionOracle")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant DecryptionOracleStorageLocation = - 0xd86fa2a52e99634194c279afa011b5f5166614c3198dd09bbd002d5fb5c0bc00; + 0x936e06112e7fc4b8f5465a83d43e3a1585e7666ab7af39c4044235360fa2ea00; /** * @dev Returns the DecryptionOracle storage location. diff --git a/contracts/decryptionOracleLib/DecryptionOracleCaller.sol b/contracts/decryptionOracleLib/DecryptionOracleCaller.sol index 8481363a..4a811011 100644 --- a/contracts/decryptionOracleLib/DecryptionOracleCaller.sol +++ b/contracts/decryptionOracleLib/DecryptionOracleCaller.sol @@ -2,10 +2,10 @@ pragma solidity ^0.8.24; -import "../lib/TFHE.sol"; +import "../lib/HTTPZ.sol"; import "../lib/Impl.sol"; -import "../lib/FHEVMConfig.sol"; +import "../lib/HTTPZConfig.sol"; interface IKMSVerifier { function verifyDecryptionEIP712KMSSignatures( @@ -32,7 +32,6 @@ abstract contract DecryptionOracleCaller { uint256 internal counterRequest; mapping(uint256 => bytes32[]) private requestedHandles; mapping(uint256 => ebool[]) private paramsEBool; - mapping(uint256 => euint4[]) private paramsEUint4; mapping(uint256 => euint8[]) private paramsEUint8; mapping(uint256 => euint16[]) private paramsEUint16; mapping(uint256 => euint32[]) private paramsEUint32; @@ -47,10 +46,6 @@ abstract contract DecryptionOracleCaller { paramsEBool[requestID].push(_ebool); } - function addParamsEUint4(uint256 requestID, euint4 _euint4) internal { - paramsEUint4[requestID].push(_euint4); - } - function addParamsEUint8(uint256 requestID, euint8 _euint8) internal { paramsEUint8[requestID].push(_euint8); } @@ -97,10 +92,6 @@ abstract contract DecryptionOracleCaller { return paramsEBool[requestID]; } - function getParamsEUint4(uint256 requestID) internal view returns (euint4[] memory) { - return paramsEUint4[requestID]; - } - function getParamsEUint8(uint256 requestID) internal view returns (euint8[] memory) { return paramsEUint8[requestID]; } @@ -129,9 +120,9 @@ abstract contract DecryptionOracleCaller { return paramsUint256[requestID]; } - // keccak256(abi.encode(uint256(keccak256("fhevm.storage.DecryptionOracleConfig")) - 1)) & ~bytes32(uint256(0xff)) + // keccak256(abi.encode(uint256(keccak256("httpz.storage.DecryptionOracleConfig")) - 1)) & ~bytes32(uint256(0xff)) bytes32 private constant DecryptionOracleLocation = - 0xde725b831312c6c6cbab76ff954da6836e26d78fc467781757c36be9c3d67d00; + 0xd32a9093b7ac7851a2281334e46d88e2ade0a764d3acf8784e882e0899ed1d00; function getDecryptionOracleConfig() internal pure returns (DecryptionOracleConfigStruct storage $) { assembly { @@ -144,7 +135,7 @@ abstract contract DecryptionOracleCaller { $.DecryptionOracleAddress = decryptionOracleAddress; } - function gatewayContractAddress() internal view returns (address) { + function getDecryptionOracleAddress() internal view returns (address) { DecryptionOracleConfigStruct storage $ = getDecryptionOracleConfig(); return $.DecryptionOracleAddress; } @@ -153,10 +144,6 @@ abstract contract DecryptionOracleCaller { ct = ebool.unwrap(newCT); } - function toBytes32(euint4 newCT) internal pure returns (bytes32 ct) { - ct = euint4.unwrap(newCT); - } - function toBytes32(euint8 newCT) internal pure returns (bytes32 ct) { ct = euint8.unwrap(newCT); } @@ -202,7 +189,7 @@ abstract contract DecryptionOracleCaller { bytes4 callbackSelector ) internal returns (uint256 requestID) { requestID = counterRequest; - FHEVMConfigStruct storage $ = Impl.getFHEVMConfig(); + HTTPZConfigStruct storage $ = Impl.getHTTPZConfig(); IACL($.ACLAddress).allowForDecryption(ctsHandles); DecryptionOracleConfigStruct storage $$ = getDecryptionOracleConfig(); IDecryptionOracle($$.DecryptionOracleAddress).requestDecryption(requestID, ctsHandles, callbackSelector); @@ -218,7 +205,7 @@ abstract contract DecryptionOracleCaller { assembly { calldatacopy(add(decryptedResult, 0x20), start, length) // Copy the relevant part of calldata to decryptedResult memory } - FHEVMConfigStruct storage $ = Impl.getFHEVMConfig(); + HTTPZConfigStruct storage $ = Impl.getHTTPZConfig(); return IKMSVerifier($.KMSVerifierAddress).verifyDecryptionEIP712KMSSignatures( handlesList, @@ -231,16 +218,16 @@ abstract contract DecryptionOracleCaller { uint256 handlesListlen = handlesList.length; uint256 signedDataLength; for (uint256 i = 0; i < handlesListlen; i++) { - uint8 typeCt = uint8(handlesList[i][30]); - if (typeCt < 9) { + FheType typeCt = FheType(uint8(handlesList[i][30])); + if (uint8(typeCt) < 9) { signedDataLength += 32; - } else if (typeCt == 9) { + } else if (typeCt == FheType.Uint512) { //ebytes64 signedDataLength += 128; - } else if (typeCt == 10) { + } else if (typeCt == FheType.Uint1024) { //ebytes128 signedDataLength += 192; - } else if (typeCt == 11) { + } else if (typeCt == FheType.Uint2048) { //ebytes256 signedDataLength += 320; } else { diff --git a/contracts/examples/EncryptedERC20.sol b/contracts/examples/EncryptedERC20.sol index 372a90dd..f17265ba 100644 --- a/contracts/examples/EncryptedERC20.sol +++ b/contracts/examples/EncryptedERC20.sol @@ -2,10 +2,10 @@ pragma solidity ^0.8.24; -import "../lib/TFHE.sol"; +import "../lib/HTTPZ.sol"; import "@openzeppelin/contracts/access/Ownable2Step.sol"; -import "../lib/FHEVMConfig.sol"; +import "../lib/HTTPZConfig.sol"; /// @notice This contract implements an encrypted ERC20-like token with confidential balances using Zama's FHE (Fully Homomorphic Encryption) library. /// @dev It supports typical ERC20 functionality such as transferring tokens, minting, and setting allowances, but uses encrypted data types. @@ -36,7 +36,7 @@ contract EncryptedERC20 is Ownable2Step { /// @param name_ The name of the token /// @param symbol_ The symbol of the token constructor(string memory name_, string memory symbol_) Ownable(msg.sender) { - TFHE.setFHEVM(FHEVMConfig.defaultConfig()); // Set up the FHEVM configuration for this contract + HTTPZ.setCoprocessor(HTTPZConfig.defaultConfig()); // Set up the FHEVM configuration for this contract _name = name_; _symbol = symbol_; } @@ -60,9 +60,9 @@ contract EncryptedERC20 is Ownable2Step { /// @dev Only the contract owner can call this function. /// @param mintedAmount The amount of tokens to mint function mint(uint64 mintedAmount) public virtual onlyOwner { - balances[owner()] = TFHE.add(balances[owner()], mintedAmount); // overflow impossible because of next line - TFHE.allowThis(balances[owner()]); - TFHE.allow(balances[owner()], owner()); + balances[owner()] = HTTPZ.add(balances[owner()], mintedAmount); // overflow impossible because of next line + HTTPZ.allowThis(balances[owner()]); + HTTPZ.allow(balances[owner()], owner()); _totalSupply = _totalSupply + mintedAmount; emit Mint(owner(), mintedAmount); } @@ -73,7 +73,7 @@ contract EncryptedERC20 is Ownable2Step { /// @param inputProof The proof for the encrypted input /// @return bool indicating success of the transfer function transfer(address to, einput encryptedAmount, bytes calldata inputProof) public virtual returns (bool) { - transfer(to, TFHE.asEuint64(encryptedAmount, inputProof)); + transfer(to, HTTPZ.asEuint64(encryptedAmount, inputProof)); return true; } @@ -82,9 +82,9 @@ contract EncryptedERC20 is Ownable2Step { /// @param amount The encrypted amount to transfer /// @return bool indicating success of the transfer function transfer(address to, euint64 amount) public virtual returns (bool) { - require(TFHE.isSenderAllowed(amount)); + require(HTTPZ.isSenderAllowed(amount)); /// @dev Makes sure the owner has enough tokens - ebool canTransfer = TFHE.le(amount, balances[msg.sender]); + ebool canTransfer = HTTPZ.le(amount, balances[msg.sender]); _transfer(msg.sender, to, amount, canTransfer); return true; } @@ -102,7 +102,7 @@ contract EncryptedERC20 is Ownable2Step { /// @param inputProof The proof for the encrypted input /// @return bool indicating success of the approval function approve(address spender, einput encryptedAmount, bytes calldata inputProof) public virtual returns (bool) { - approve(spender, TFHE.asEuint64(encryptedAmount, inputProof)); + approve(spender, HTTPZ.asEuint64(encryptedAmount, inputProof)); return true; } @@ -111,7 +111,7 @@ contract EncryptedERC20 is Ownable2Step { /// @param amount The amount to approve /// @return bool indicating success of the approval function approve(address spender, euint64 amount) public virtual returns (bool) { - require(TFHE.isSenderAllowed(amount)); + require(HTTPZ.isSenderAllowed(amount)); address owner = msg.sender; _approve(owner, spender, amount); emit Approval(owner, spender); @@ -138,7 +138,7 @@ contract EncryptedERC20 is Ownable2Step { einput encryptedAmount, bytes calldata inputProof ) public virtual returns (bool) { - transferFrom(from, to, TFHE.asEuint64(encryptedAmount, inputProof)); + transferFrom(from, to, HTTPZ.asEuint64(encryptedAmount, inputProof)); return true; } @@ -148,7 +148,7 @@ contract EncryptedERC20 is Ownable2Step { /// @param amount The amount to transfer /// @return bool indicating success of the transfer function transferFrom(address from, address to, euint64 amount) public virtual returns (bool) { - require(TFHE.isSenderAllowed(amount)); + require(HTTPZ.isSenderAllowed(amount)); address spender = msg.sender; ebool isTransferable = _updateAllowance(from, spender, amount); _transfer(from, to, amount, isTransferable); @@ -162,9 +162,9 @@ contract EncryptedERC20 is Ownable2Step { /// @param amount The amount to approve function _approve(address owner, address spender, euint64 amount) internal virtual { allowances[owner][spender] = amount; - TFHE.allowThis(amount); - TFHE.allow(amount, owner); - TFHE.allow(amount, spender); + HTTPZ.allowThis(amount); + HTTPZ.allow(amount, owner); + HTTPZ.allow(amount, spender); } /// @notice Returns the internal allowance of a spender for a specific owner. @@ -184,11 +184,11 @@ contract EncryptedERC20 is Ownable2Step { function _updateAllowance(address owner, address spender, euint64 amount) internal virtual returns (ebool) { euint64 currentAllowance = _allowance(owner, spender); /// @dev Makes sure the allowance suffices - ebool allowedTransfer = TFHE.le(amount, currentAllowance); + ebool allowedTransfer = HTTPZ.le(amount, currentAllowance); /// @dev Makes sure the owner has enough tokens - ebool canTransfer = TFHE.le(amount, balances[owner]); - ebool isTransferable = TFHE.and(canTransfer, allowedTransfer); - _approve(owner, spender, TFHE.select(isTransferable, TFHE.sub(currentAllowance, amount), currentAllowance)); + ebool canTransfer = HTTPZ.le(amount, balances[owner]); + ebool isTransferable = HTTPZ.and(canTransfer, allowedTransfer); + _approve(owner, spender, HTTPZ.select(isTransferable, HTTPZ.sub(currentAllowance, amount), currentAllowance)); return isTransferable; } @@ -200,15 +200,15 @@ contract EncryptedERC20 is Ownable2Step { /// @param isTransferable Boolean indicating if the transfer is allowed function _transfer(address from, address to, euint64 amount, ebool isTransferable) internal virtual { /// @dev Add to the balance of `to` and subract from the balance of `from`. - euint64 transferValue = TFHE.select(isTransferable, amount, TFHE.asEuint64(0)); - euint64 newBalanceTo = TFHE.add(balances[to], transferValue); + euint64 transferValue = HTTPZ.select(isTransferable, amount, HTTPZ.asEuint64(0)); + euint64 newBalanceTo = HTTPZ.add(balances[to], transferValue); balances[to] = newBalanceTo; - TFHE.allowThis(newBalanceTo); - TFHE.allow(newBalanceTo, to); - euint64 newBalanceFrom = TFHE.sub(balances[from], transferValue); + HTTPZ.allowThis(newBalanceTo); + HTTPZ.allow(newBalanceTo, to); + euint64 newBalanceFrom = HTTPZ.sub(balances[from], transferValue); balances[from] = newBalanceFrom; - TFHE.allowThis(newBalanceFrom); - TFHE.allow(newBalanceFrom, from); + HTTPZ.allowThis(newBalanceFrom); + HTTPZ.allow(newBalanceFrom, from); emit Transfer(from, to); } } diff --git a/contracts/examples/TFHEExecutorUpgradedExample.sol b/contracts/examples/HTTPZExecutorUpgradedExample.sol similarity index 77% rename from contracts/examples/TFHEExecutorUpgradedExample.sol rename to contracts/examples/HTTPZExecutorUpgradedExample.sol index 0303d5ee..e0a0e3d4 100644 --- a/contracts/examples/TFHEExecutorUpgradedExample.sol +++ b/contracts/examples/HTTPZExecutorUpgradedExample.sol @@ -2,13 +2,13 @@ pragma solidity ^0.8.24; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; -import {TFHEExecutor} from "../contracts/TFHEExecutor.sol"; +import {HTTPZExecutor} from "../contracts/HTTPZExecutor.sol"; -/// @title TFHEExecutorUpgradedExample -/// @dev Contract that extends TFHEExecutor with version information -contract TFHEExecutorUpgradedExample is TFHEExecutor { +/// @title HTTPZExecutorUpgradedExample +/// @dev Contract that extends HTTPZExecutor with version information +contract HTTPZExecutorUpgradedExample is HTTPZExecutor { /// @dev Name of the contract - string private constant CONTRACT_NAME = "TFHEExecutor"; + string private constant CONTRACT_NAME = "HTTPZExecutor"; /// @dev Version numbers uint256 private constant MAJOR_VERSION = 0; diff --git a/contracts/examples/PaymentLimit.sol b/contracts/examples/PaymentLimit.sol index 05b55ef6..b35c06e5 100644 --- a/contracts/examples/PaymentLimit.sol +++ b/contracts/examples/PaymentLimit.sol @@ -2,8 +2,8 @@ pragma solidity ^0.8.24; -import "../lib/TFHE.sol"; -import "../lib/FHEVMConfig.sol"; +import "../lib/HTTPZ.sol"; +import "../lib/HTTPZConfig.sol"; /// @title PaymentLimit /// @notice A contract to demonstrate FHE gas limits in different scenarios @@ -11,36 +11,36 @@ contract PaymentLimit { /// @notice Constructor that sets up FHE configuration and deposits initial value /// @dev Payable to allow initial deposit constructor() { - TFHE.setFHEVM(FHEVMConfig.defaultConfig()); + HTTPZ.setCoprocessor(HTTPZConfig.defaultConfig()); } /// @notice Performs a small number of FHE operations /// @dev Should pass if it's the only transaction in a block function wayunderBlockFHEGasLimit() external { - euint64 x = TFHE.asEuint64(2); + euint64 x = HTTPZ.asEuint64(2); euint64 result; for (uint256 i; i < 3; i++) { - result = TFHE.mul(result, x); + result = HTTPZ.mul(result, x); } } /// @notice Performs a moderate number of FHE operations /// @dev Should pass if it's the only transaction in a block function underBlockFHEGasLimit() external { - euint64 x = TFHE.asEuint64(2); + euint64 x = HTTPZ.asEuint64(2); euint64 result; for (uint256 i; i < 15; i++) { - result = TFHE.mul(result, x); + result = HTTPZ.mul(result, x); } } /// @notice Performs a large number of FHE operations /// @dev Should revert due to exceeding the block FHE gas limit function aboveBlockFHEGasLimit() external { - euint64 x = TFHE.asEuint64(2); + euint64 x = HTTPZ.asEuint64(2); euint64 result; for (uint256 i; i < 16; i++) { - result = TFHE.mul(result, x); + result = HTTPZ.mul(result, x); } } } diff --git a/contracts/examples/Rand.sol b/contracts/examples/Rand.sol index 54c997f0..aca81410 100644 --- a/contracts/examples/Rand.sol +++ b/contracts/examples/Rand.sol @@ -2,15 +2,14 @@ pragma solidity ^0.8.24; -import "../lib/TFHE.sol"; +import "../lib/HTTPZ.sol"; -import "../lib/FHEVMConfig.sol"; +import "../lib/HTTPZConfig.sol"; /// @notice Contract for generating random encrypted numbers contract Rand { /// @notice Encrypted unsigned integers of various sizes ebool public valueb; - euint4 public value4; euint8 public value8; euint16 public value16; euint32 public value32; @@ -24,121 +23,111 @@ contract Rand { /// @notice Constructor to set FHE configuration constructor() { - TFHE.setFHEVM(FHEVMConfig.defaultConfig()); + HTTPZ.setCoprocessor(HTTPZConfig.defaultConfig()); } /// @notice Generate random 8-bit encrypted unsigned integer function generateBool() public { - valueb = TFHE.randEbool(); - TFHE.allowThis(valueb); - } - - function generate4() public { - value4 = TFHE.randEuint4(); - TFHE.allowThis(value4); - } - - function generate4UpperBound(uint8 upperBound) public { - value4 = TFHE.randEuint4(upperBound); - TFHE.allowThis(value4); + valueb = HTTPZ.randEbool(); + HTTPZ.allowThis(valueb); } function generate8() public { - value8 = TFHE.randEuint8(); - TFHE.allowThis(value8); + value8 = HTTPZ.randEuint8(); + HTTPZ.allowThis(value8); } /// @notice Generate random 8-bit encrypted unsigned integer with upper bound /// @param upperBound The maximum value (exclusive) for the generated number function generate8UpperBound(uint8 upperBound) public { - value8 = TFHE.randEuint8(upperBound); - TFHE.allowThis(value8); + value8 = HTTPZ.randEuint8(upperBound); + HTTPZ.allowThis(value8); } /// @notice Generate random 16-bit encrypted unsigned integer function generate16() public { - value16 = TFHE.randEuint16(); - TFHE.allowThis(value16); + value16 = HTTPZ.randEuint16(); + HTTPZ.allowThis(value16); } /// @notice Generate random 16-bit encrypted unsigned integer with upper bound /// @param upperBound The maximum value (exclusive) for the generated number function generate16UpperBound(uint16 upperBound) public { - value16 = TFHE.randEuint16(upperBound); - TFHE.allowThis(value16); + value16 = HTTPZ.randEuint16(upperBound); + HTTPZ.allowThis(value16); } /// @notice Generate random 32-bit encrypted unsigned integer function generate32() public { - value32 = TFHE.randEuint32(); - TFHE.allowThis(value32); + value32 = HTTPZ.randEuint32(); + HTTPZ.allowThis(value32); } /// @notice Generate random 32-bit encrypted unsigned integer with upper bound /// @param upperBound The maximum value (exclusive) for the generated number function generate32UpperBound(uint32 upperBound) public { - value32 = TFHE.randEuint32(upperBound); - TFHE.allowThis(value32); + value32 = HTTPZ.randEuint32(upperBound); + HTTPZ.allowThis(value32); } /// @notice Generate random 64-bit encrypted unsigned integer function generate64() public { - value64 = TFHE.randEuint64(); - TFHE.allowThis(value64); + value64 = HTTPZ.randEuint64(); + HTTPZ.allowThis(value64); } function generate64UpperBound(uint64 upperBound) public { - value64 = TFHE.randEuint64(upperBound); - TFHE.allowThis(value64); + value64 = HTTPZ.randEuint64(upperBound); + HTTPZ.allowThis(value64); } /// @notice Generate random 64-bit encrypted unsigned integer with error handling /// @dev This function attempts a failing call and then generates a bounded random number function generate64Reverting() public { try this.failingCall() {} catch {} - value64Bounded = TFHE.randEuint64(1024); - TFHE.allowThis(value64Bounded); + value64Bounded = HTTPZ.randEuint64(1024); + HTTPZ.allowThis(value64Bounded); } // Function that always reverts after generating a random number function failingCall() public { - value64 = TFHE.randEuint64(); - TFHE.allowThis(value64); + value64 = HTTPZ.randEuint64(); + HTTPZ.allowThis(value64); revert(); } function generate128() public { - value128 = TFHE.randEuint128(); - TFHE.allowThis(value128); + value128 = HTTPZ.randEuint128(); + HTTPZ.allowThis(value128); } function generate128UpperBound(uint128 upperBound) public { - value128 = TFHE.randEuint128(upperBound); - TFHE.allowThis(value128); + value128 = HTTPZ.randEuint128(upperBound); + HTTPZ.allowThis(value128); } function generate256() public { - value256 = TFHE.randEuint256(); - TFHE.allowThis(value256); + value256 = HTTPZ.randEuint256(); + HTTPZ.allowThis(value256); } function generate256UpperBound(uint256 upperBound) public { - value256 = TFHE.randEuint256(upperBound); - TFHE.allowThis(value256); + value256 = HTTPZ.randEuint256(upperBound); + HTTPZ.allowThis(value256); } function generate512() public { - value512 = TFHE.randEbytes64(); - TFHE.allowThis(value512); + value512 = HTTPZ.randEbytes64(); + HTTPZ.allowThis(value512); } function generate1024() public { - value1024 = TFHE.randEbytes128(); - TFHE.allowThis(value1024); + value1024 = HTTPZ.randEbytes128(); + HTTPZ.allowThis(value1024); } function generate2048() public { - value2048 = TFHE.randEbytes256(); - TFHE.allowThis(value2048); + value2048 = HTTPZ.randEbytes256(); + HTTPZ.allowThis(value2048); } } diff --git a/contracts/examples/Reencrypt.sol b/contracts/examples/Reencrypt.sol index 17b8dcaa..6dd50fb2 100644 --- a/contracts/examples/Reencrypt.sol +++ b/contracts/examples/Reencrypt.sol @@ -2,15 +2,13 @@ pragma solidity ^0.8.24; -import "../lib/TFHE.sol"; -import "../lib/FHEVMConfig.sol"; +import "../lib/HTTPZ.sol"; +import "../lib/HTTPZConfig.sol"; /// @notice Contract for demonstrating reencryption of various FHE data types contract Reencrypt { /// @dev Encrypted boolean ebool public xBool; - /// @dev Encrypted 4-bit unsigned integer - euint4 public xUint4; /// @dev Encrypted 8-bit unsigned integer euint8 public xUint8; /// @dev Encrypted 16-bit unsigned integer @@ -29,72 +27,67 @@ contract Reencrypt { /// @notice Constructor to initialize encrypted values and set permissions constructor() { // Set default FHE configuration - TFHE.setFHEVM(FHEVMConfig.defaultConfig()); + HTTPZ.setCoprocessor(HTTPZConfig.defaultConfig()); // Initialize and set permissions for xBool - xBool = TFHE.asEbool(true); - TFHE.allowThis(xBool); - TFHE.allow(xBool, msg.sender); - - // Initialize and set permissions for xUint4 - xUint4 = TFHE.asEuint4(4); - TFHE.allowThis(xUint4); - TFHE.allow(xUint4, msg.sender); + xBool = HTTPZ.asEbool(true); + HTTPZ.allowThis(xBool); + HTTPZ.allow(xBool, msg.sender); // Initialize and set permissions for xUint8 - xUint8 = TFHE.asEuint8(42); - TFHE.allowThis(xUint8); - TFHE.allow(xUint8, msg.sender); + xUint8 = HTTPZ.asEuint8(42); + HTTPZ.allowThis(xUint8); + HTTPZ.allow(xUint8, msg.sender); // Initialize and set permissions for xUint16 - xUint16 = TFHE.asEuint16(16); - TFHE.allowThis(xUint16); - TFHE.allow(xUint16, msg.sender); + xUint16 = HTTPZ.asEuint16(16); + HTTPZ.allowThis(xUint16); + HTTPZ.allow(xUint16, msg.sender); // Initialize and set permissions for xUint32 - xUint32 = TFHE.asEuint32(32); - TFHE.allowThis(xUint32); - TFHE.allow(xUint32, msg.sender); + xUint32 = HTTPZ.asEuint32(32); + HTTPZ.allowThis(xUint32); + HTTPZ.allow(xUint32, msg.sender); // Initialize and set permissions for xUint64 - xUint64 = TFHE.asEuint64(18446744073709551600); - TFHE.allowThis(xUint64); - TFHE.allow(xUint64, msg.sender); + xUint64 = HTTPZ.asEuint64(18446744073709551600); + HTTPZ.allowThis(xUint64); + HTTPZ.allow(xUint64, msg.sender); - xUint128 = TFHE.asEuint128(145275933516363203950142179850024740765); - TFHE.allowThis(xUint128); - TFHE.allow(xUint128, msg.sender); + xUint128 = HTTPZ.asEuint128(145275933516363203950142179850024740765); + HTTPZ.allowThis(xUint128); + HTTPZ.allow(xUint128, msg.sender); - xAddress = TFHE.asEaddress(0x8ba1f109551bD432803012645Ac136ddd64DBA72); - TFHE.allowThis(xAddress); - TFHE.allow(xAddress, msg.sender); + xAddress = HTTPZ.asEaddress(0x8ba1f109551bD432803012645Ac136ddd64DBA72); + HTTPZ.allowThis(xAddress); + HTTPZ.allow(xAddress, msg.sender); - xUint256 = TFHE.asEuint256(74285495974541385002137713624115238327312291047062397922780925695323480915729); - TFHE.allowThis(xUint256); - TFHE.allow(xUint256, msg.sender); + xUint256 = HTTPZ.asEuint256(74285495974541385002137713624115238327312291047062397922780925695323480915729); + HTTPZ.allowThis(xUint256); + HTTPZ.allow(xUint256, msg.sender); - yBytes64 = TFHE.asEbytes64( - TFHE.padToBytes64( + yBytes64 = HTTPZ.asEbytes64( + HTTPZ.padToBytes64( hex"19d179e0cc7e816dc944582ed4f5652f5951900098fc2e0a15a7ea4dc8cfa4e3b6c54beea5ee95e56b728762f659347ce1d4aa1b05fcc5" ) ); - TFHE.allowThis(yBytes64); - TFHE.allow(yBytes64, msg.sender); + HTTPZ.allowThis(yBytes64); + HTTPZ.allow(yBytes64, msg.sender); - yBytes128 = TFHE.asEbytes128( - TFHE.padToBytes128( + yBytes128 = HTTPZ.asEbytes128( + HTTPZ.padToBytes128( hex"13e7819123de6e2870c7e83bb764508e22d7c3ab8a5aee6bdfb26355ef0d3f1977d651b83bf5f78634fa360aa14debdc3daa6a587b5c2fb1710ab4d6677e62a8577f2d9fecc190ad8b11c9f0a5ec3138b27da1f055437af8c90a9495dad230" ) ); - TFHE.allowThis(yBytes128); - TFHE.allow(yBytes128, msg.sender); + HTTPZ.allowThis(yBytes128); + HTTPZ.allow(yBytes128, msg.sender); - yBytes256 = TFHE.asEbytes256( - TFHE.padToBytes256( + yBytes256 = HTTPZ.asEbytes256( + HTTPZ.padToBytes256( hex"d179e0cc7e816dc944582ed4f5652f5951900098fc2e0a15a7ea4dc8cfa4e3b6c54beea5ee95e56b728762f659347ce1d4aa1b05fcc513e7819123de6e2870c7e83bb764508e22d7c3ab8a5aee6bdfb26355ef0d3f1977d651b83bf5f78634fa360aa14debdc3daa6a587b5c2fb1710ab4d6677e62a8577f2d9fecc190ad8b11c9f0a5ec3138b27da1f055437af8c90a9495dad230" ) ); - TFHE.allowThis(yBytes256); - TFHE.allow(yBytes256, msg.sender); + HTTPZ.allowThis(yBytes256); + HTTPZ.allow(yBytes256, msg.sender); } } diff --git a/contracts/examples/TestAsyncDecrypt.sol b/contracts/examples/TestAsyncDecrypt.sol index 2a5817cc..164acb06 100644 --- a/contracts/examples/TestAsyncDecrypt.sol +++ b/contracts/examples/TestAsyncDecrypt.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.24; -import "../lib/TFHE.sol"; +import "../lib/HTTPZ.sol"; import "../decryptionOracleLib/DecryptionOracleCaller.sol"; import "../addresses/DecryptionOracleAddress.sol"; @@ -10,7 +10,6 @@ import "../addresses/DecryptionOracleAddress.sol"; contract TestAsyncDecrypt is DecryptionOracleCaller { /// @dev Encrypted state variables ebool xBool; - euint4 xUint4; euint8 xUint8; euint16 xUint16; euint32 xUint32; @@ -44,34 +43,33 @@ contract TestAsyncDecrypt is DecryptionOracleCaller { /// @notice Constructor to initialize the contract and set up encrypted values constructor() { - TFHE.setFHEVM(FHEVMConfig.defaultConfig()); + HTTPZ.setCoprocessor(HTTPZConfig.defaultConfig()); setDecryptionOracle(DECRYPTION_ORACLE_ADDRESS); /// @dev Initialize encrypted variables with sample values - xBool = TFHE.asEbool(true); - TFHE.allowThis(xBool); - xUint4 = TFHE.asEuint4(4); - TFHE.allowThis(xUint4); - xUint8 = TFHE.asEuint8(42); - TFHE.allowThis(xUint8); - xUint16 = TFHE.asEuint16(16); - TFHE.allowThis(xUint16); - xUint32 = TFHE.asEuint32(32); - TFHE.allowThis(xUint32); - xUint64 = TFHE.asEuint64(18446744073709551600); - TFHE.allowThis(xUint64); - xUint64_2 = TFHE.asEuint64(76575465786); - TFHE.allowThis(xUint64_2); - xUint64_3 = TFHE.asEuint64(6400); - TFHE.allowThis(xUint64_3); - xUint128 = TFHE.asEuint128(1267650600228229401496703205443); - TFHE.allowThis(xUint128); - xUint256 = TFHE.asEuint256(27606985387162255149739023449108101809804435888681546220650096895197251); - TFHE.allowThis(xUint256); - xAddress = TFHE.asEaddress(0x8ba1f109551bD432803012645Ac136ddd64DBA72); - TFHE.allowThis(xAddress); - xAddress2 = TFHE.asEaddress(0xf48b8840387ba3809DAE990c930F3b4766A86ca3); - TFHE.allowThis(xAddress2); + xBool = HTTPZ.asEbool(true); + HTTPZ.allowThis(xBool); + + xUint8 = HTTPZ.asEuint8(42); + HTTPZ.allowThis(xUint8); + xUint16 = HTTPZ.asEuint16(16); + HTTPZ.allowThis(xUint16); + xUint32 = HTTPZ.asEuint32(32); + HTTPZ.allowThis(xUint32); + xUint64 = HTTPZ.asEuint64(18446744073709551600); + HTTPZ.allowThis(xUint64); + xUint64_2 = HTTPZ.asEuint64(76575465786); + HTTPZ.allowThis(xUint64_2); + xUint64_3 = HTTPZ.asEuint64(6400); + HTTPZ.allowThis(xUint64_3); + xUint128 = HTTPZ.asEuint128(1267650600228229401496703205443); + HTTPZ.allowThis(xUint128); + xUint256 = HTTPZ.asEuint256(27606985387162255149739023449108101809804435888681546220650096895197251); + HTTPZ.allowThis(xUint256); + xAddress = HTTPZ.asEaddress(0x8ba1f109551bD432803012645Ac136ddd64DBA72); + HTTPZ.allowThis(xAddress); + xAddress2 = HTTPZ.asEaddress(0xf48b8840387ba3809DAE990c930F3b4766A86ca3); + HTTPZ.allowThis(xAddress2); } /// @notice Function to request decryption of a boolean value with an infinite loop in the callback @@ -120,21 +118,6 @@ contract TestAsyncDecrypt is DecryptionOracleCaller { return yBool; } - /// @notice Request decryption of a 4-bit unsigned integer - function requestUint4() public { - bytes32[] memory cts = new bytes32[](1); - cts[0] = toBytes32(xUint4); - requestDecryption(cts, this.callbackUint4.selector); - } - - /// @notice Attempt to request decryption of a fake 4-bit unsigned integer (should revert) - function requestFakeUint4() public { - bytes32[] memory cts = new bytes32[](1); - cts[0] = 0x4200000000000000000000000000000000000000000000000000000000000100; - /// @dev This should revert because the previous handle is not honestly obtained - requestDecryption(cts, this.callbackUint4.selector); - } - /// @notice Callback function for 4-bit unsigned integer decryption /// @param decryptedInput The decrypted 4-bit unsigned integer /// @return The decrypted value @@ -256,7 +239,7 @@ contract TestAsyncDecrypt is DecryptionOracleCaller { /// @param inputHandle The input handle for the encrypted value /// @param inputProof The input proof for the encrypted value function requestUint64NonTrivial(einput inputHandle, bytes calldata inputProof) public { - euint64 inputNonTrivial = TFHE.asEuint64(inputHandle, inputProof); + euint64 inputNonTrivial = HTTPZ.asEuint64(inputHandle, inputProof); bytes32[] memory cts = new bytes32[](1); cts[0] = toBytes32(inputNonTrivial); requestDecryption(cts, this.callbackUint64.selector); @@ -281,7 +264,7 @@ contract TestAsyncDecrypt is DecryptionOracleCaller { } function requestUint128NonTrivial(einput inputHandle, bytes calldata inputProof) public { - euint128 inputNonTrivial = TFHE.asEuint128(inputHandle, inputProof); + euint128 inputNonTrivial = HTTPZ.asEuint128(inputHandle, inputProof); bytes32[] memory cts = new bytes32[](1); cts[0] = toBytes32(inputNonTrivial); requestDecryption(cts, this.callbackUint128.selector); @@ -303,7 +286,7 @@ contract TestAsyncDecrypt is DecryptionOracleCaller { } function requestUint256NonTrivial(einput inputHandle, bytes calldata inputProof) public { - euint256 inputNonTrivial = TFHE.asEuint256(inputHandle, inputProof); + euint256 inputNonTrivial = HTTPZ.asEuint256(inputHandle, inputProof); bytes32[] memory cts = new bytes32[](1); cts[0] = toBytes32(inputNonTrivial); requestDecryption(cts, this.callbackUint256.selector); @@ -319,14 +302,14 @@ contract TestAsyncDecrypt is DecryptionOracleCaller { } function requestEbytes64NonTrivial(einput inputHandle, bytes calldata inputProof) public { - ebytes64 inputNonTrivial = TFHE.asEbytes64(inputHandle, inputProof); + ebytes64 inputNonTrivial = HTTPZ.asEbytes64(inputHandle, inputProof); bytes32[] memory cts = new bytes32[](1); cts[0] = toBytes32(inputNonTrivial); requestDecryption(cts, this.callbackBytes64.selector); } function requestEbytes64Trivial(bytes calldata value) public { - ebytes64 inputTrivial = TFHE.asEbytes64(TFHE.padToBytes64(value)); + ebytes64 inputTrivial = HTTPZ.asEbytes64(HTTPZ.padToBytes64(value)); bytes32[] memory cts = new bytes32[](1); cts[0] = toBytes32(inputTrivial); requestDecryption(cts, this.callbackBytes64.selector); @@ -342,14 +325,14 @@ contract TestAsyncDecrypt is DecryptionOracleCaller { } function requestEbytes128NonTrivial(einput inputHandle, bytes calldata inputProof) public { - ebytes128 inputNonTrivial = TFHE.asEbytes128(inputHandle, inputProof); + ebytes128 inputNonTrivial = HTTPZ.asEbytes128(inputHandle, inputProof); bytes32[] memory cts = new bytes32[](1); cts[0] = toBytes32(inputNonTrivial); requestDecryption(cts, this.callbackBytes128.selector); } function requestEbytes128Trivial(bytes calldata value) public { - ebytes128 inputTrivial = TFHE.asEbytes128(TFHE.padToBytes128(value)); + ebytes128 inputTrivial = HTTPZ.asEbytes128(HTTPZ.padToBytes128(value)); bytes32[] memory cts = new bytes32[](1); cts[0] = toBytes32(inputTrivial); requestDecryption(cts, this.callbackBytes128.selector); @@ -365,14 +348,14 @@ contract TestAsyncDecrypt is DecryptionOracleCaller { } function requestEbytes256Trivial(bytes calldata value) public { - ebytes256 inputTrivial = TFHE.asEbytes256(TFHE.padToBytes256(value)); + ebytes256 inputTrivial = HTTPZ.asEbytes256(HTTPZ.padToBytes256(value)); bytes32[] memory cts = new bytes32[](1); cts[0] = toBytes32(inputTrivial); requestDecryption(cts, this.callbackBytes256.selector); } function requestEbytes256NonTrivial(einput inputHandle, bytes calldata inputProof) public { - ebytes256 inputNonTrivial = TFHE.asEbytes256(inputHandle, inputProof); + ebytes256 inputNonTrivial = HTTPZ.asEbytes256(inputHandle, inputProof); bytes32[] memory cts = new bytes32[](1); cts[0] = toBytes32(inputNonTrivial); requestDecryption(cts, this.callbackBytes256.selector); @@ -445,12 +428,12 @@ contract TestAsyncDecrypt is DecryptionOracleCaller { /// @param inputHandle The encrypted input handle for the bytes256 /// @param inputProof The proof for the encrypted bytes256 function requestMixedBytes256(einput inputHandle, bytes calldata inputProof) public { - ebytes256 xBytes256 = TFHE.asEbytes256(inputHandle, inputProof); + ebytes256 xBytes256 = HTTPZ.asEbytes256(inputHandle, inputProof); bytes32[] memory cts = new bytes32[](4); cts[0] = toBytes32(xBool); cts[1] = toBytes32(xAddress); cts[2] = toBytes32(xBytes256); - ebytes64 input64Bytes = TFHE.asEbytes64(TFHE.padToBytes64(hex"aaff42")); + ebytes64 input64Bytes = HTTPZ.asEbytes64(HTTPZ.padToBytes64(hex"aaff42")); cts[3] = toBytes32(input64Bytes); requestDecryption(cts, this.callbackMixedBytes256.selector); } diff --git a/contracts/examples/TestInput.sol b/contracts/examples/TestInput.sol index de9df321..d02599bc 100644 --- a/contracts/examples/TestInput.sol +++ b/contracts/examples/TestInput.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.24; -import "../lib/TFHE.sol"; +import "../lib/HTTPZ.sol"; import "../decryptionOracleLib/DecryptionOracleCaller.sol"; import "../addresses/DecryptionOracleAddress.sol"; @@ -17,12 +17,12 @@ contract TestInput is DecryptionOracleCaller { address public yAddress; constructor() { - TFHE.setFHEVM(FHEVMConfig.defaultConfig()); + HTTPZ.setCoprocessor(HTTPZConfig.defaultConfig()); setDecryptionOracle(DECRYPTION_ORACLE_ADDRESS); } function requestUint64NonTrivial(einput inputHandle, bytes calldata inputProof) public { - euint64 inputNonTrivial = TFHE.asEuint64(inputHandle, inputProof); + euint64 inputNonTrivial = HTTPZ.asEuint64(inputHandle, inputProof); bytes32[] memory cts = new bytes32[](1); cts[0] = toBytes32(inputNonTrivial); requestDecryption(cts, this.callbackUint64.selector); @@ -42,9 +42,9 @@ contract TestInput is DecryptionOracleCaller { einput inputHandleAddress, bytes calldata inputProof ) public { - ebool encBool = TFHE.asEbool(inputHandleBool, inputProof); - euint8 encUint8 = TFHE.asEuint8(inputHandleUint8, inputProof); - eaddress encAddress = TFHE.asEaddress(inputHandleAddress, inputProof); + ebool encBool = HTTPZ.asEbool(inputHandleBool, inputProof); + euint8 encUint8 = HTTPZ.asEuint8(inputHandleUint8, inputProof); + eaddress encAddress = HTTPZ.asEaddress(inputHandleAddress, inputProof); bytes32[] memory cts = new bytes32[](3); cts[0] = toBytes32(encBool); cts[1] = toBytes32(encUint8); diff --git a/contracts/examples/TracingSubCalls.sol b/contracts/examples/TracingSubCalls.sol index f1c2e587..44258888 100644 --- a/contracts/examples/TracingSubCalls.sol +++ b/contracts/examples/TracingSubCalls.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BSD-3-Clause-Clear pragma solidity ^0.8.24; -import "../lib/TFHE.sol"; +import "../lib/HTTPZ.sol"; /// @notice Main contract for testing various subcalls and their behaviors contract TracingSubCalls { @@ -30,8 +30,8 @@ contract TracingSubCalls { contract SubContractCreate { /// @dev Constructor that encrypts the input /// @param input The value to be encrypted - constructor(uint256 input) { - TFHE.asEuint64(input); + constructor(uint64 input) { + HTTPZ.asEuint64(input); } } @@ -39,8 +39,8 @@ contract SubContractCreate { contract SubContractCreateFail { /// @dev Constructor that encrypts the input and then fails /// @param input The value to be encrypted before failing - constructor(uint256 input) { - TFHE.asEuint64(input); + constructor(uint64 input) { + HTTPZ.asEuint64(input); require(false, "This constructor always fails"); } } @@ -50,28 +50,28 @@ contract SubContract { /// @notice Function that always succeeds /// @dev Encrypts a specific value (601) function succeed() external { - TFHE.asEuint64(601); + HTTPZ.asEuint64(601); } /// @notice Function that always fails /// @dev Encrypts a value (602) before failing function fail() external { - TFHE.asEuint64(602); + HTTPZ.asEuint64(602); require(false, "This function always fails"); } /// @notice Internal function that fails with a custom input /// @dev Encrypts the input before failing /// @param input The value to be encrypted before failing - function fail2(uint input) external { - TFHE.asEuint64(input); + function fail2(uint64 input) external { + HTTPZ.asEuint64(input); require(false, "This function always fails with custom input"); } /// @notice Function that succeeds and then calls a failing function /// @dev Encrypts a value (603) and then attempts to call fail2 function succeedFail() external { - TFHE.asEuint64(603); + HTTPZ.asEuint64(603); try this.fail2(604) {} catch {} } @@ -79,26 +79,26 @@ contract SubContract { /// @dev Calls fail2 and then attempts to encrypt a value (606) function failSucceed() external { this.fail2(605); - TFHE.asEuint64(606); + HTTPZ.asEuint64(606); } /// @notice Function that runs out of gas /// @dev Encrypts a value (607) and then enters an infinite loop function oogFail() external { - TFHE.asEuint64(607); + HTTPZ.asEuint64(607); while (true) {} } /// @notice Another function that always succeeds /// @dev Encrypts a specific value (608) function succeed2() external { - TFHE.asEuint64(608); + HTTPZ.asEuint64(608); } /// @notice Function that fails with an invalid operation /// @dev Encrypts a value (609) and then executes an invalid operation function invalidFail() external { - TFHE.asEuint64(609); + HTTPZ.asEuint64(609); assembly { invalid() } @@ -107,7 +107,7 @@ contract SubContract { /// @notice Function that succeeds and then stops execution /// @dev Encrypts a value (610) and then stops the execution function succeedStop() external { - TFHE.asEuint64(610); + HTTPZ.asEuint64(610); assembly { stop() } @@ -116,7 +116,7 @@ contract SubContract { /// @notice Function that succeeds and then self-destructs the contract /// @dev Encrypts a value (611) and then self-destructs the contract function succeedSelfDestruct() external { - TFHE.asEuint64(611); + HTTPZ.asEuint64(611); selfdestruct(payable(address(1))); } } diff --git a/contracts/examples/tests/HTTPZTestSuite1.sol b/contracts/examples/tests/HTTPZTestSuite1.sol new file mode 100644 index 00000000..e241fd69 --- /dev/null +++ b/contracts/examples/tests/HTTPZTestSuite1.sol @@ -0,0 +1,653 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +pragma solidity ^0.8.24; + +import "../../lib/HTTPZ.sol"; +import "../../lib/HTTPZConfig.sol"; + +contract HTTPZTestSuite1 { + ebool public resEbool; + euint8 public resEuint8; + euint16 public resEuint16; + euint32 public resEuint32; + euint64 public resEuint64; + euint128 public resEuint128; + euint256 public resEuint256; + ebytes64 public resEbytes64; + ebytes128 public resEbytes128; + ebytes256 public resEbytes256; + + constructor() { + HTTPZ.setCoprocessor(HTTPZConfig.defaultConfig()); + } + + function add_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint8 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function sub_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint8 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function mul_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint8 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function and_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint8 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function or_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint8 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function xor_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint8 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function eq_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint8 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function max_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint8 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function add_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function sub_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function mul_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function and_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function or_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function xor_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function eq_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function max_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function add_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function sub_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function mul_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function and_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function or_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function xor_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function eq_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function max_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function add_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function sub_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function mul_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function and_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function or_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function xor_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function eq_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function max_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function add_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function sub_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function mul_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function and_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function or_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function xor_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function eq_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function max_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function and_euint8_euint256(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function or_euint8_euint256(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function xor_euint8_euint256(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function eq_euint8_euint256(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint8_euint256(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function add_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint16 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function sub_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint16 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function mul_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint16 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function and_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint16 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function or_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint16 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function xor_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint16 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function eq_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint16 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function max_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint16 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function add_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } +} diff --git a/contracts/examples/tests/HTTPZTestSuite2.sol b/contracts/examples/tests/HTTPZTestSuite2.sol new file mode 100644 index 00000000..836f2f08 --- /dev/null +++ b/contracts/examples/tests/HTTPZTestSuite2.sol @@ -0,0 +1,653 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +pragma solidity ^0.8.24; + +import "../../lib/HTTPZ.sol"; +import "../../lib/HTTPZConfig.sol"; + +contract HTTPZTestSuite2 { + ebool public resEbool; + euint8 public resEuint8; + euint16 public resEuint16; + euint32 public resEuint32; + euint64 public resEuint64; + euint128 public resEuint128; + euint256 public resEuint256; + ebytes64 public resEbytes64; + ebytes128 public resEbytes128; + ebytes256 public resEbytes256; + + constructor() { + HTTPZ.setCoprocessor(HTTPZConfig.defaultConfig()); + } + + function sub_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function mul_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function and_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function or_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function xor_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function eq_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function max_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function add_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function sub_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function mul_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function and_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function or_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function xor_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function eq_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function max_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function add_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function sub_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function mul_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function and_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function or_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function xor_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function eq_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function max_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function add_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function sub_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function mul_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function and_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function or_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function xor_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function eq_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function max_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function and_euint16_euint256(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function or_euint16_euint256(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function xor_euint16_euint256(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function eq_euint16_euint256(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint16_euint256(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function add_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint32 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function sub_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint32 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function mul_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint32 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function and_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint32 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function or_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint32 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function xor_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint32 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function eq_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint32 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function max_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint32 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function add_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint32 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function sub_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint32 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function mul_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint32 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function and_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint32 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function or_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint32 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function xor_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint32 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function eq_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint32 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function max_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint32 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function add_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function sub_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } +} diff --git a/contracts/examples/tests/HTTPZTestSuite3.sol b/contracts/examples/tests/HTTPZTestSuite3.sol new file mode 100644 index 00000000..cdcfb133 --- /dev/null +++ b/contracts/examples/tests/HTTPZTestSuite3.sol @@ -0,0 +1,653 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +pragma solidity ^0.8.24; + +import "../../lib/HTTPZ.sol"; +import "../../lib/HTTPZConfig.sol"; + +contract HTTPZTestSuite3 { + ebool public resEbool; + euint8 public resEuint8; + euint16 public resEuint16; + euint32 public resEuint32; + euint64 public resEuint64; + euint128 public resEuint128; + euint256 public resEuint256; + ebytes64 public resEbytes64; + ebytes128 public resEbytes128; + ebytes256 public resEbytes256; + + constructor() { + HTTPZ.setCoprocessor(HTTPZConfig.defaultConfig()); + } + + function mul_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function and_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function or_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function xor_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function eq_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function max_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function add_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function sub_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function mul_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function and_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function or_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function xor_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function eq_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function max_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function add_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function sub_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function mul_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function and_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function or_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function xor_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function eq_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function max_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function and_euint32_euint256(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function or_euint32_euint256(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function xor_euint32_euint256(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function eq_euint32_euint256(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint32_euint256(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function add_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint64 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function sub_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint64 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function mul_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint64 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function and_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint64 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function or_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint64 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function xor_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint64 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function eq_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint64 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function max_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint64 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function add_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint64 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function sub_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint64 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function mul_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint64 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function and_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint64 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function or_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint64 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function xor_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint64 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function eq_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint64 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function max_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint64 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function add_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint64 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function sub_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint64 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function mul_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint64 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function and_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint64 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function or_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint64 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function xor_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint64 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function eq_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint64 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function max_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint64 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function add_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function sub_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function mul_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } +} diff --git a/contracts/examples/tests/HTTPZTestSuite4.sol b/contracts/examples/tests/HTTPZTestSuite4.sol new file mode 100644 index 00000000..a0a9afb1 --- /dev/null +++ b/contracts/examples/tests/HTTPZTestSuite4.sol @@ -0,0 +1,653 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +pragma solidity ^0.8.24; + +import "../../lib/HTTPZ.sol"; +import "../../lib/HTTPZConfig.sol"; + +contract HTTPZTestSuite4 { + ebool public resEbool; + euint8 public resEuint8; + euint16 public resEuint16; + euint32 public resEuint32; + euint64 public resEuint64; + euint128 public resEuint128; + euint256 public resEuint256; + ebytes64 public resEbytes64; + ebytes128 public resEbytes128; + ebytes256 public resEbytes256; + + constructor() { + HTTPZ.setCoprocessor(HTTPZConfig.defaultConfig()); + } + + function and_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function or_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function xor_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function eq_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function max_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function add_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function sub_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function mul_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function and_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function or_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function xor_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function eq_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function max_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function and_euint64_euint256(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function or_euint64_euint256(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function xor_euint64_euint256(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function eq_euint64_euint256(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint64_euint256(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function add_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint128 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function sub_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint128 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function mul_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint128 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function and_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint128 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function or_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint128 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function xor_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint128 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function eq_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint128 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function max_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint128 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function add_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint128 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function sub_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint128 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function mul_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint128 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function and_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint128 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function or_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint128 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function xor_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint128 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function eq_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint128 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function max_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint128 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function add_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint128 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function sub_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint128 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function mul_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint128 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function and_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint128 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function or_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint128 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function xor_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint128 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function eq_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint128 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function max_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint128 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function add_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint128 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function sub_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint128 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function mul_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint128 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function and_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint128 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function or_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint128 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function xor_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint128 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function eq_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint128 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function max_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint128 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function add_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function sub_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function mul_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function and_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } +} diff --git a/contracts/examples/tests/HTTPZTestSuite5.sol b/contracts/examples/tests/HTTPZTestSuite5.sol new file mode 100644 index 00000000..67a2821c --- /dev/null +++ b/contracts/examples/tests/HTTPZTestSuite5.sol @@ -0,0 +1,653 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +pragma solidity ^0.8.24; + +import "../../lib/HTTPZ.sol"; +import "../../lib/HTTPZConfig.sol"; + +contract HTTPZTestSuite5 { + ebool public resEbool; + euint8 public resEuint8; + euint16 public resEuint16; + euint32 public resEuint32; + euint64 public resEuint64; + euint128 public resEuint128; + euint256 public resEuint256; + ebytes64 public resEbytes64; + ebytes128 public resEbytes128; + ebytes256 public resEbytes256; + + constructor() { + HTTPZ.setCoprocessor(HTTPZConfig.defaultConfig()); + } + + function or_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function xor_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function eq_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function max_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function and_euint128_euint256(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function or_euint128_euint256(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function xor_euint128_euint256(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function eq_euint128_euint256(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint128_euint256(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function and_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint256 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function or_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint256 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function xor_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint256 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function eq_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function and_euint256_euint16(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint256 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function or_euint256_euint16(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint256 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function xor_euint256_euint16(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint256 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function eq_euint256_euint16(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint256_euint16(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function and_euint256_euint32(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint256 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function or_euint256_euint32(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint256 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function xor_euint256_euint32(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint256 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function eq_euint256_euint32(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint256_euint32(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function and_euint256_euint64(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint256 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function or_euint256_euint64(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint256 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function xor_euint256_euint64(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint256 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function eq_euint256_euint64(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint256_euint64(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function and_euint256_euint128(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint256 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function or_euint256_euint128(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint256 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function xor_euint256_euint128(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint256 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function eq_euint256_euint128(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint256_euint128(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function and_euint256_euint256(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function or_euint256_euint256(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function xor_euint256_euint256(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function eq_euint256_euint256(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint256_euint256(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function add_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + uint8 bProc = b; + euint8 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function add_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { + uint8 aProc = a; + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint8 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function sub_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + uint8 bProc = b; + euint8 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function sub_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { + uint8 aProc = a; + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint8 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function mul_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + uint8 bProc = b; + euint8 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function mul_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { + uint8 aProc = a; + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint8 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function div_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + uint8 bProc = b; + euint8 result = HTTPZ.div(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function rem_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + uint8 bProc = b; + euint8 result = HTTPZ.rem(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function and_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + uint8 bProc = b; + euint8 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function and_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { + uint8 aProc = a; + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint8 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function or_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + uint8 bProc = b; + euint8 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function or_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { + uint8 aProc = a; + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint8 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function xor_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + uint8 bProc = b; + euint8 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function xor_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { + uint8 aProc = a; + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint8 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function eq_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + uint8 bProc = b; + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function eq_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { + uint8 aProc = a; + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + uint8 bProc = b; + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { + uint8 aProc = a; + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + uint8 bProc = b; + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { + uint8 aProc = a; + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + uint8 bProc = b; + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { + uint8 aProc = a; + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + uint8 bProc = b; + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { + uint8 aProc = a; + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + uint8 bProc = b; + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { + uint8 aProc = a; + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + uint8 bProc = b; + euint8 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function min_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { + uint8 aProc = a; + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint8 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function max_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + uint8 bProc = b; + euint8 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function max_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { + uint8 aProc = a; + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint8 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function add_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + uint16 bProc = b; + euint16 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function add_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { + uint16 aProc = a; + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function sub_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + uint16 bProc = b; + euint16 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function sub_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { + uint16 aProc = a; + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function mul_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + uint16 bProc = b; + euint16 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function mul_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { + uint16 aProc = a; + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function div_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + uint16 bProc = b; + euint16 result = HTTPZ.div(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function rem_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + uint16 bProc = b; + euint16 result = HTTPZ.rem(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function and_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + uint16 bProc = b; + euint16 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function and_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { + uint16 aProc = a; + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function or_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + uint16 bProc = b; + euint16 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function or_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { + uint16 aProc = a; + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function xor_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + uint16 bProc = b; + euint16 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function xor_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { + uint16 aProc = a; + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function eq_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + uint16 bProc = b; + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } +} diff --git a/contracts/examples/tests/HTTPZTestSuite6.sol b/contracts/examples/tests/HTTPZTestSuite6.sol new file mode 100644 index 00000000..8a6c59ad --- /dev/null +++ b/contracts/examples/tests/HTTPZTestSuite6.sol @@ -0,0 +1,653 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +pragma solidity ^0.8.24; + +import "../../lib/HTTPZ.sol"; +import "../../lib/HTTPZConfig.sol"; + +contract HTTPZTestSuite6 { + ebool public resEbool; + euint8 public resEuint8; + euint16 public resEuint16; + euint32 public resEuint32; + euint64 public resEuint64; + euint128 public resEuint128; + euint256 public resEuint256; + ebytes64 public resEbytes64; + ebytes128 public resEbytes128; + ebytes256 public resEbytes256; + + constructor() { + HTTPZ.setCoprocessor(HTTPZConfig.defaultConfig()); + } + + function eq_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { + uint16 aProc = a; + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + uint16 bProc = b; + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { + uint16 aProc = a; + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + uint16 bProc = b; + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { + uint16 aProc = a; + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + uint16 bProc = b; + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { + uint16 aProc = a; + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + uint16 bProc = b; + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { + uint16 aProc = a; + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + uint16 bProc = b; + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { + uint16 aProc = a; + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + uint16 bProc = b; + euint16 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function min_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { + uint16 aProc = a; + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function max_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + uint16 bProc = b; + euint16 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function max_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { + uint16 aProc = a; + euint16 bProc = HTTPZ.asEuint16(b, inputProof); + euint16 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function add_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + uint32 bProc = b; + euint32 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function add_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { + uint32 aProc = a; + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function sub_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + uint32 bProc = b; + euint32 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function sub_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { + uint32 aProc = a; + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function mul_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + uint32 bProc = b; + euint32 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function mul_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { + uint32 aProc = a; + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function div_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + uint32 bProc = b; + euint32 result = HTTPZ.div(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function rem_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + uint32 bProc = b; + euint32 result = HTTPZ.rem(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function and_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + uint32 bProc = b; + euint32 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function and_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { + uint32 aProc = a; + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function or_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + uint32 bProc = b; + euint32 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function or_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { + uint32 aProc = a; + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function xor_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + uint32 bProc = b; + euint32 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function xor_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { + uint32 aProc = a; + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function eq_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + uint32 bProc = b; + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function eq_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { + uint32 aProc = a; + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + uint32 bProc = b; + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { + uint32 aProc = a; + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + uint32 bProc = b; + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { + uint32 aProc = a; + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + uint32 bProc = b; + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { + uint32 aProc = a; + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + uint32 bProc = b; + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { + uint32 aProc = a; + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + uint32 bProc = b; + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { + uint32 aProc = a; + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + uint32 bProc = b; + euint32 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function min_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { + uint32 aProc = a; + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function max_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + uint32 bProc = b; + euint32 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function max_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { + uint32 aProc = a; + euint32 bProc = HTTPZ.asEuint32(b, inputProof); + euint32 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function add_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + uint64 bProc = b; + euint64 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function add_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { + uint64 aProc = a; + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function sub_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + uint64 bProc = b; + euint64 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function sub_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { + uint64 aProc = a; + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function mul_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + uint64 bProc = b; + euint64 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function mul_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { + uint64 aProc = a; + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function div_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + uint64 bProc = b; + euint64 result = HTTPZ.div(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function rem_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + uint64 bProc = b; + euint64 result = HTTPZ.rem(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function and_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + uint64 bProc = b; + euint64 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function and_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { + uint64 aProc = a; + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function or_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + uint64 bProc = b; + euint64 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function or_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { + uint64 aProc = a; + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function xor_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + uint64 bProc = b; + euint64 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function xor_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { + uint64 aProc = a; + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function eq_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + uint64 bProc = b; + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function eq_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { + uint64 aProc = a; + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + uint64 bProc = b; + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { + uint64 aProc = a; + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + uint64 bProc = b; + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { + uint64 aProc = a; + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + uint64 bProc = b; + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { + uint64 aProc = a; + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + uint64 bProc = b; + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { + uint64 aProc = a; + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + uint64 bProc = b; + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { + uint64 aProc = a; + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + uint64 bProc = b; + euint64 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function min_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { + uint64 aProc = a; + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function max_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + uint64 bProc = b; + euint64 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function max_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { + uint64 aProc = a; + euint64 bProc = HTTPZ.asEuint64(b, inputProof); + euint64 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function add_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + uint128 bProc = b; + euint128 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function add_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { + uint128 aProc = a; + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.add(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function sub_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + uint128 bProc = b; + euint128 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function sub_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { + uint128 aProc = a; + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.sub(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function mul_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + uint128 bProc = b; + euint128 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function mul_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { + uint128 aProc = a; + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.mul(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function div_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + uint128 bProc = b; + euint128 result = HTTPZ.div(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function rem_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + uint128 bProc = b; + euint128 result = HTTPZ.rem(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function and_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + uint128 bProc = b; + euint128 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function and_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { + uint128 aProc = a; + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function or_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + uint128 bProc = b; + euint128 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function or_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { + uint128 aProc = a; + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function xor_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + uint128 bProc = b; + euint128 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function xor_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { + uint128 aProc = a; + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function eq_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + uint128 bProc = b; + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } +} diff --git a/contracts/examples/tests/HTTPZTestSuite7.sol b/contracts/examples/tests/HTTPZTestSuite7.sol new file mode 100644 index 00000000..ea57f71f --- /dev/null +++ b/contracts/examples/tests/HTTPZTestSuite7.sol @@ -0,0 +1,606 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +pragma solidity ^0.8.24; + +import "../../lib/HTTPZ.sol"; +import "../../lib/HTTPZConfig.sol"; + +contract HTTPZTestSuite7 { + ebool public resEbool; + euint8 public resEuint8; + euint16 public resEuint16; + euint32 public resEuint32; + euint64 public resEuint64; + euint128 public resEuint128; + euint256 public resEuint256; + ebytes64 public resEbytes64; + ebytes128 public resEbytes128; + ebytes256 public resEbytes256; + + constructor() { + HTTPZ.setCoprocessor(HTTPZConfig.defaultConfig()); + } + + function eq_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { + uint128 aProc = a; + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + uint128 bProc = b; + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { + uint128 aProc = a; + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + uint128 bProc = b; + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ge_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { + uint128 aProc = a; + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.ge(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + uint128 bProc = b; + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function gt_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { + uint128 aProc = a; + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.gt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + uint128 bProc = b; + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function le_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { + uint128 aProc = a; + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.le(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + uint128 bProc = b; + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function lt_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { + uint128 aProc = a; + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + ebool result = HTTPZ.lt(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function min_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + uint128 bProc = b; + euint128 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function min_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { + uint128 aProc = a; + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.min(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function max_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + uint128 bProc = b; + euint128 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function max_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { + uint128 aProc = a; + euint128 bProc = HTTPZ.asEuint128(b, inputProof); + euint128 result = HTTPZ.max(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function and_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + uint256 bProc = b; + euint256 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function and_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public { + uint256 aProc = a; + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.and(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function or_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + uint256 bProc = b; + euint256 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function or_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public { + uint256 aProc = a; + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.or(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function xor_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + uint256 bProc = b; + euint256 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function xor_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public { + uint256 aProc = a; + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + euint256 result = HTTPZ.xor(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function eq_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + uint256 bProc = b; + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function eq_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public { + uint256 aProc = a; + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + uint256 bProc = b; + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function ne_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public { + uint256 aProc = a; + euint256 bProc = HTTPZ.asEuint256(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; + } + function shl_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint8 result = HTTPZ.shl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function shl_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + uint8 bProc = b; + euint8 result = HTTPZ.shl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function shr_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint8 result = HTTPZ.shr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function shr_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + uint8 bProc = b; + euint8 result = HTTPZ.shr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function rotl_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint8 result = HTTPZ.rotl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function rotl_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + uint8 bProc = b; + euint8 result = HTTPZ.rotl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function rotr_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint8 result = HTTPZ.rotr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function rotr_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + uint8 bProc = b; + euint8 result = HTTPZ.rotr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function shl_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint16 result = HTTPZ.shl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function shl_euint16_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + uint8 bProc = b; + euint16 result = HTTPZ.shl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function shr_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint16 result = HTTPZ.shr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function shr_euint16_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + uint8 bProc = b; + euint16 result = HTTPZ.shr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function rotl_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint16 result = HTTPZ.rotl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function rotl_euint16_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + uint8 bProc = b; + euint16 result = HTTPZ.rotl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function rotr_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint16 result = HTTPZ.rotr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function rotr_euint16_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + uint8 bProc = b; + euint16 result = HTTPZ.rotr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function shl_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint32 result = HTTPZ.shl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function shl_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + uint8 bProc = b; + euint32 result = HTTPZ.shl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function shr_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint32 result = HTTPZ.shr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function shr_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + uint8 bProc = b; + euint32 result = HTTPZ.shr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function rotl_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint32 result = HTTPZ.rotl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function rotl_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + uint8 bProc = b; + euint32 result = HTTPZ.rotl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function rotr_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint32 result = HTTPZ.rotr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function rotr_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + uint8 bProc = b; + euint32 result = HTTPZ.rotr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function shl_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint64 result = HTTPZ.shl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function shl_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + uint8 bProc = b; + euint64 result = HTTPZ.shl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function shr_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint64 result = HTTPZ.shr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function shr_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + uint8 bProc = b; + euint64 result = HTTPZ.shr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function rotl_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint64 result = HTTPZ.rotl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function rotl_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + uint8 bProc = b; + euint64 result = HTTPZ.rotl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function rotr_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint64 result = HTTPZ.rotr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function rotr_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + uint8 bProc = b; + euint64 result = HTTPZ.rotr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function shl_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint128 result = HTTPZ.shl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function shl_euint128_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + uint8 bProc = b; + euint128 result = HTTPZ.shl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function shr_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint128 result = HTTPZ.shr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function shr_euint128_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + uint8 bProc = b; + euint128 result = HTTPZ.shr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function rotl_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint128 result = HTTPZ.rotl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function rotl_euint128_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + uint8 bProc = b; + euint128 result = HTTPZ.rotl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function rotr_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint128 result = HTTPZ.rotr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function rotr_euint128_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + uint8 bProc = b; + euint128 result = HTTPZ.rotr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function shl_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint256 result = HTTPZ.shl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function shl_euint256_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + uint8 bProc = b; + euint256 result = HTTPZ.shl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function shr_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint256 result = HTTPZ.shr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function shr_euint256_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + uint8 bProc = b; + euint256 result = HTTPZ.shr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function rotl_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint256 result = HTTPZ.rotl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function rotl_euint256_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + uint8 bProc = b; + euint256 result = HTTPZ.rotl(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function rotr_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint8 bProc = HTTPZ.asEuint8(b, inputProof); + euint256 result = HTTPZ.rotr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function rotr_euint256_uint8(einput a, uint8 b, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + uint8 bProc = b; + euint256 result = HTTPZ.rotr(aProc, bProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function neg_euint8(einput a, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint8 result = HTTPZ.neg(aProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function not_euint8(einput a, bytes calldata inputProof) public { + euint8 aProc = HTTPZ.asEuint8(a, inputProof); + euint8 result = HTTPZ.not(aProc); + HTTPZ.allowThis(result); + resEuint8 = result; + } + function neg_euint16(einput a, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint16 result = HTTPZ.neg(aProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function not_euint16(einput a, bytes calldata inputProof) public { + euint16 aProc = HTTPZ.asEuint16(a, inputProof); + euint16 result = HTTPZ.not(aProc); + HTTPZ.allowThis(result); + resEuint16 = result; + } + function neg_euint32(einput a, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint32 result = HTTPZ.neg(aProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function not_euint32(einput a, bytes calldata inputProof) public { + euint32 aProc = HTTPZ.asEuint32(a, inputProof); + euint32 result = HTTPZ.not(aProc); + HTTPZ.allowThis(result); + resEuint32 = result; + } + function neg_euint64(einput a, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint64 result = HTTPZ.neg(aProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function not_euint64(einput a, bytes calldata inputProof) public { + euint64 aProc = HTTPZ.asEuint64(a, inputProof); + euint64 result = HTTPZ.not(aProc); + HTTPZ.allowThis(result); + resEuint64 = result; + } + function neg_euint128(einput a, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint128 result = HTTPZ.neg(aProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function not_euint128(einput a, bytes calldata inputProof) public { + euint128 aProc = HTTPZ.asEuint128(a, inputProof); + euint128 result = HTTPZ.not(aProc); + HTTPZ.allowThis(result); + resEuint128 = result; + } + function neg_euint256(einput a, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint256 result = HTTPZ.neg(aProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } + function not_euint256(einput a, bytes calldata inputProof) public { + euint256 aProc = HTTPZ.asEuint256(a, inputProof); + euint256 result = HTTPZ.not(aProc); + HTTPZ.allowThis(result); + resEuint256 = result; + } +} diff --git a/contracts/examples/tests/TFHEManualTestSuite.sol b/contracts/examples/tests/TFHEManualTestSuite.sol index ea00e1d6..e0262924 100644 --- a/contracts/examples/tests/TFHEManualTestSuite.sol +++ b/contracts/examples/tests/TFHEManualTestSuite.sol @@ -1,386 +1,377 @@ // SPDX-License-Identifier: BSD-3-Clause-Clear pragma solidity ^0.8.24; -import "../../lib/TFHE.sol"; -import "../../lib/FHEVMConfig.sol"; +import "../../lib/HTTPZ.sol"; +import "../../lib/HTTPZConfig.sol"; contract TFHEManualTestSuite { - ebool public resb; - euint4 public res4; - euint8 public res8; - euint16 public res16; - euint32 public res32; - euint64 public res64; - euint128 public res128; - euint256 public res256; + ebool public resEbool; + euint8 public resEuint8; + euint16 public resEuint16; + euint32 public resEuint32; + euint64 public resEuint64; + euint128 public resEuint128; + euint256 public resEuint256; eaddress public resAdd; - ebytes64 public resB64; - ebytes128 public resB128; - ebytes256 public resB256; + ebytes64 public resEbytes64; + ebytes128 public resEbytes128; + ebytes256 public resEbytes256; constructor() { - TFHE.setFHEVM(FHEVMConfig.defaultConfig()); // Set up the FHEVM configuration for this contract + HTTPZ.setCoprocessor(HTTPZConfig.defaultConfig()); // Set up the FHEVM configuration for this contract } function eqEbool(bool a, bool b) external { - ebool input1 = TFHE.asEbool(a); - ebool input2 = TFHE.asEbool(b); - ebool result = TFHE.eq(input1, input2); - TFHE.allowThis(result); - resb = result; + ebool input1 = HTTPZ.asEbool(a); + ebool input2 = HTTPZ.asEbool(b); + ebool result = HTTPZ.eq(input1, input2); + HTTPZ.allowThis(result); + resEbool = result; } function eqEboolScalarL(bool a, bool b) external { - ebool input2 = TFHE.asEbool(b); - ebool result = TFHE.eq(a, input2); - TFHE.allowThis(result); - resb = result; + ebool input2 = HTTPZ.asEbool(b); + ebool result = HTTPZ.eq(a, input2); + HTTPZ.allowThis(result); + resEbool = result; } function eqEboolScalarR(bool a, bool b) external { - ebool input1 = TFHE.asEbool(a); - ebool result = TFHE.eq(input1, b); - TFHE.allowThis(result); - resb = result; + ebool input1 = HTTPZ.asEbool(a); + ebool result = HTTPZ.eq(input1, b); + HTTPZ.allowThis(result); + resEbool = result; } function neEbool(bool a, bool b) external { - ebool input1 = TFHE.asEbool(a); - ebool input2 = TFHE.asEbool(b); - ebool result = TFHE.ne(input1, input2); - TFHE.allowThis(result); - resb = result; + ebool input1 = HTTPZ.asEbool(a); + ebool input2 = HTTPZ.asEbool(b); + ebool result = HTTPZ.ne(input1, input2); + HTTPZ.allowThis(result); + resEbool = result; } function neEboolScalarL(bool a, bool b) external { - ebool input2 = TFHE.asEbool(b); - ebool result = TFHE.ne(a, input2); - TFHE.allowThis(result); - resb = result; + ebool input2 = HTTPZ.asEbool(b); + ebool result = HTTPZ.ne(a, input2); + HTTPZ.allowThis(result); + resEbool = result; } function neEboolScalarR(bool a, bool b) external { - ebool input1 = TFHE.asEbool(a); - ebool result = TFHE.ne(input1, b); - TFHE.allowThis(result); - resb = result; + ebool input1 = HTTPZ.asEbool(a); + ebool result = HTTPZ.ne(input1, b); + HTTPZ.allowThis(result); + resEbool = result; } function eqEbytes256(einput inp1, bytes calldata inputProof1, einput inp2, bytes calldata inputProof2) external { - ebytes256 input1 = TFHE.asEbytes256(inp1, inputProof1); - ebytes256 input2 = TFHE.asEbytes256(inp2, inputProof2); - ebool result = TFHE.eq(input1, input2); - TFHE.allowThis(result); - resb = result; + ebytes256 input1 = HTTPZ.asEbytes256(inp1, inputProof1); + ebytes256 input2 = HTTPZ.asEbytes256(inp2, inputProof2); + ebool result = HTTPZ.eq(input1, input2); + HTTPZ.allowThis(result); + resEbool = result; } function neEbytes256(einput inp1, bytes calldata inputProof1, einput inp2, bytes calldata inputProof2) external { - ebytes256 input1 = TFHE.asEbytes256(inp1, inputProof1); - ebytes256 input2 = TFHE.asEbytes256(inp2, inputProof2); - ebool result = TFHE.ne(input1, input2); - TFHE.allowThis(result); - resb = result; + ebytes256 input1 = HTTPZ.asEbytes256(inp1, inputProof1); + ebytes256 input2 = HTTPZ.asEbytes256(inp2, inputProof2); + ebool result = HTTPZ.ne(input1, input2); + HTTPZ.allowThis(result); + resEbool = result; } function eqEbytes64(bytes memory a, bytes memory b) external { - ebytes64 input1 = TFHE.asEbytes64(TFHE.padToBytes64(a)); - ebytes64 input2 = TFHE.asEbytes64(TFHE.padToBytes64(b)); - ebool result = TFHE.eq(input1, input2); - TFHE.allowThis(result); - resb = result; + ebytes64 input1 = HTTPZ.asEbytes64(HTTPZ.padToBytes64(a)); + ebytes64 input2 = HTTPZ.asEbytes64(HTTPZ.padToBytes64(b)); + ebool result = HTTPZ.eq(input1, input2); + HTTPZ.allowThis(result); + resEbool = result; } function eqEbytes64ScalarL(bytes memory a, bytes memory b) external { - bytes memory input1 = TFHE.padToBytes64(a); - ebytes64 input2 = TFHE.asEbytes64(TFHE.padToBytes64(b)); - ebool result = TFHE.eq(input1, input2); - TFHE.allowThis(result); - resb = result; + bytes memory input1 = HTTPZ.padToBytes64(a); + ebytes64 input2 = HTTPZ.asEbytes64(HTTPZ.padToBytes64(b)); + ebool result = HTTPZ.eq(input1, input2); + HTTPZ.allowThis(result); + resEbool = result; } function eqEbytes64ScalarR(bytes memory a, bytes memory b) external { - ebytes64 input1 = TFHE.asEbytes64(TFHE.padToBytes64(a)); - bytes memory input2 = TFHE.padToBytes64(b); - ebool result = TFHE.eq(input1, input2); - TFHE.allowThis(result); - resb = result; + ebytes64 input1 = HTTPZ.asEbytes64(HTTPZ.padToBytes64(a)); + bytes memory input2 = HTTPZ.padToBytes64(b); + ebool result = HTTPZ.eq(input1, input2); + HTTPZ.allowThis(result); + resEbool = result; } function neEbytes64(bytes memory a, bytes memory b) external { - ebytes64 input1 = TFHE.asEbytes64(TFHE.padToBytes64(a)); - ebytes64 input2 = TFHE.asEbytes64(TFHE.padToBytes64(b)); - ebool result = TFHE.ne(input1, input2); - TFHE.allowThis(result); - resb = result; + ebytes64 input1 = HTTPZ.asEbytes64(HTTPZ.padToBytes64(a)); + ebytes64 input2 = HTTPZ.asEbytes64(HTTPZ.padToBytes64(b)); + ebool result = HTTPZ.ne(input1, input2); + HTTPZ.allowThis(result); + resEbool = result; } function neEbytes64ScalarL(bytes memory a, bytes memory b) external { - bytes memory input1 = TFHE.padToBytes64(a); - ebytes64 input2 = TFHE.asEbytes64(TFHE.padToBytes64(b)); - ebool result = TFHE.ne(input1, input2); - TFHE.allowThis(result); - resb = result; + bytes memory input1 = HTTPZ.padToBytes64(a); + ebytes64 input2 = HTTPZ.asEbytes64(HTTPZ.padToBytes64(b)); + ebool result = HTTPZ.ne(input1, input2); + HTTPZ.allowThis(result); + resEbool = result; } function neEbytes64ScalarR(bytes memory a, bytes memory b) external { - ebytes64 input1 = TFHE.asEbytes64(TFHE.padToBytes64(a)); - bytes memory input2 = TFHE.padToBytes64(b); - ebool result = TFHE.ne(input1, input2); - TFHE.allowThis(result); - resb = result; + ebytes64 input1 = HTTPZ.asEbytes64(HTTPZ.padToBytes64(a)); + bytes memory input2 = HTTPZ.padToBytes64(b); + ebool result = HTTPZ.ne(input1, input2); + HTTPZ.allowThis(result); + resEbool = result; } function eqEbytes128(bytes memory a, bytes memory b) external { - ebytes128 input1 = TFHE.asEbytes128(TFHE.padToBytes128(a)); - ebytes128 input2 = TFHE.asEbytes128(TFHE.padToBytes128(b)); - ebool result = TFHE.eq(input1, input2); - TFHE.allowThis(result); - resb = result; + ebytes128 input1 = HTTPZ.asEbytes128(HTTPZ.padToBytes128(a)); + ebytes128 input2 = HTTPZ.asEbytes128(HTTPZ.padToBytes128(b)); + ebool result = HTTPZ.eq(input1, input2); + HTTPZ.allowThis(result); + resEbool = result; } function eqEbytes128ScalarL(bytes memory a, bytes memory b) external { - bytes memory input1 = TFHE.padToBytes128(a); - ebytes128 input2 = TFHE.asEbytes128(TFHE.padToBytes128(b)); - ebool result = TFHE.eq(input1, input2); - TFHE.allowThis(result); - resb = result; + bytes memory input1 = HTTPZ.padToBytes128(a); + ebytes128 input2 = HTTPZ.asEbytes128(HTTPZ.padToBytes128(b)); + ebool result = HTTPZ.eq(input1, input2); + HTTPZ.allowThis(result); + resEbool = result; } function eqEbytes128ScalarR(bytes memory a, bytes memory b) external { - ebytes128 input1 = TFHE.asEbytes128(TFHE.padToBytes128(a)); - bytes memory input2 = TFHE.padToBytes128(b); - ebool result = TFHE.eq(input1, input2); - TFHE.allowThis(result); - resb = result; + ebytes128 input1 = HTTPZ.asEbytes128(HTTPZ.padToBytes128(a)); + bytes memory input2 = HTTPZ.padToBytes128(b); + ebool result = HTTPZ.eq(input1, input2); + HTTPZ.allowThis(result); + resEbool = result; } function neEbytes128(bytes memory a, bytes memory b) external { - ebytes128 input1 = TFHE.asEbytes128(TFHE.padToBytes128(a)); - ebytes128 input2 = TFHE.asEbytes128(TFHE.padToBytes128(b)); - ebool result = TFHE.ne(input1, input2); - TFHE.allowThis(result); - resb = result; + ebytes128 input1 = HTTPZ.asEbytes128(HTTPZ.padToBytes128(a)); + ebytes128 input2 = HTTPZ.asEbytes128(HTTPZ.padToBytes128(b)); + ebool result = HTTPZ.ne(input1, input2); + HTTPZ.allowThis(result); + resEbool = result; } function neEbytes128ScalarL(bytes memory a, bytes memory b) external { - bytes memory input1 = TFHE.padToBytes128(a); - ebytes128 input2 = TFHE.asEbytes128(TFHE.padToBytes128(b)); - ebool result = TFHE.ne(input1, input2); - TFHE.allowThis(result); - resb = result; + bytes memory input1 = HTTPZ.padToBytes128(a); + ebytes128 input2 = HTTPZ.asEbytes128(HTTPZ.padToBytes128(b)); + ebool result = HTTPZ.ne(input1, input2); + HTTPZ.allowThis(result); + resEbool = result; } function neEbytes128ScalarR(bytes memory a, bytes memory b) external { - ebytes128 input1 = TFHE.asEbytes128(TFHE.padToBytes128(a)); - bytes memory input2 = TFHE.padToBytes128(b); - ebool result = TFHE.ne(input1, input2); - TFHE.allowThis(result); - resb = result; + ebytes128 input1 = HTTPZ.asEbytes128(HTTPZ.padToBytes128(a)); + bytes memory input2 = HTTPZ.padToBytes128(b); + ebool result = HTTPZ.ne(input1, input2); + HTTPZ.allowThis(result); + resEbool = result; } function eqEbytes256ScalarL(bytes memory a, bytes memory b) external { - bytes memory input1 = TFHE.padToBytes256(a); - ebytes256 input2 = TFHE.asEbytes256(TFHE.padToBytes256(b)); - ebool result = TFHE.eq(input1, input2); - TFHE.allowThis(result); - resb = result; + bytes memory input1 = HTTPZ.padToBytes256(a); + ebytes256 input2 = HTTPZ.asEbytes256(HTTPZ.padToBytes256(b)); + ebool result = HTTPZ.eq(input1, input2); + HTTPZ.allowThis(result); + resEbool = result; } function eqEbytes256ScalarR(bytes memory a, bytes memory b) external { - ebytes256 input1 = TFHE.asEbytes256(TFHE.padToBytes256(a)); - bytes memory input2 = TFHE.padToBytes256(b); - ebool result = TFHE.eq(input1, input2); - TFHE.allowThis(result); - resb = result; + ebytes256 input1 = HTTPZ.asEbytes256(HTTPZ.padToBytes256(a)); + bytes memory input2 = HTTPZ.padToBytes256(b); + ebool result = HTTPZ.eq(input1, input2); + HTTPZ.allowThis(result); + resEbool = result; } function neEbytes256ScalarL(bytes memory a, bytes memory b) external { - bytes memory input1 = TFHE.padToBytes256(a); - ebytes256 input2 = TFHE.asEbytes256(TFHE.padToBytes256(b)); - ebool result = TFHE.ne(input1, input2); - TFHE.allowThis(result); - resb = result; + bytes memory input1 = HTTPZ.padToBytes256(a); + ebytes256 input2 = HTTPZ.asEbytes256(HTTPZ.padToBytes256(b)); + ebool result = HTTPZ.ne(input1, input2); + HTTPZ.allowThis(result); + resEbool = result; } function neEbytes256ScalarR(bytes memory a, bytes memory b) external { - ebytes256 input1 = TFHE.asEbytes256(TFHE.padToBytes256(a)); - bytes memory input2 = TFHE.padToBytes256(b); - ebool result = TFHE.ne(input1, input2); - TFHE.allowThis(result); - resb = result; + ebytes256 input1 = HTTPZ.asEbytes256(HTTPZ.padToBytes256(a)); + bytes memory input2 = HTTPZ.padToBytes256(b); + ebool result = HTTPZ.ne(input1, input2); + HTTPZ.allowThis(result); + resEbool = result; } function test_select_ebool(bool control, bool ifTrue, bool ifFalse) public { - ebool controlProc = TFHE.asEbool(control); - ebool ifTrueProc = TFHE.asEbool(ifTrue); - ebool ifFalseProc = TFHE.asEbool(ifFalse); - ebool result = TFHE.select(controlProc, ifTrueProc, ifFalseProc); - TFHE.allowThis(result); - resb = result; + ebool controlProc = HTTPZ.asEbool(control); + ebool ifTrueProc = HTTPZ.asEbool(ifTrue); + ebool ifFalseProc = HTTPZ.asEbool(ifFalse); + ebool result = HTTPZ.select(controlProc, ifTrueProc, ifFalseProc); + HTTPZ.allowThis(result); + resEbool = result; } function test_select_ebytes64(bool control, bytes memory ifTrue, bytes memory ifFalse) public { - ebool controlProc = TFHE.asEbool(control); - ebytes64 ifTrueProc = TFHE.asEbytes64(TFHE.padToBytes64(ifTrue)); - ebytes64 ifFalseProc = TFHE.asEbytes64(TFHE.padToBytes64(ifFalse)); - ebytes64 result = TFHE.select(controlProc, ifTrueProc, ifFalseProc); - TFHE.allowThis(result); - resB64 = result; + ebool controlProc = HTTPZ.asEbool(control); + ebytes64 ifTrueProc = HTTPZ.asEbytes64(HTTPZ.padToBytes64(ifTrue)); + ebytes64 ifFalseProc = HTTPZ.asEbytes64(HTTPZ.padToBytes64(ifFalse)); + ebytes64 result = HTTPZ.select(controlProc, ifTrueProc, ifFalseProc); + HTTPZ.allowThis(result); + resEbytes64 = result; } function test_select_ebytes128(bool control, bytes memory ifTrue, bytes memory ifFalse) public { - ebool controlProc = TFHE.asEbool(control); - ebytes128 ifTrueProc = TFHE.asEbytes128(TFHE.padToBytes128(ifTrue)); - ebytes128 ifFalseProc = TFHE.asEbytes128(TFHE.padToBytes128(ifFalse)); - ebytes128 result = TFHE.select(controlProc, ifTrueProc, ifFalseProc); - TFHE.allowThis(result); - resB128 = result; + ebool controlProc = HTTPZ.asEbool(control); + ebytes128 ifTrueProc = HTTPZ.asEbytes128(HTTPZ.padToBytes128(ifTrue)); + ebytes128 ifFalseProc = HTTPZ.asEbytes128(HTTPZ.padToBytes128(ifFalse)); + ebytes128 result = HTTPZ.select(controlProc, ifTrueProc, ifFalseProc); + HTTPZ.allowThis(result); + resEbytes128 = result; } function test_select_ebytes256(bool control, bytes memory ifTrue, bytes memory ifFalse) public { - ebool controlProc = TFHE.asEbool(control); - ebytes256 ifTrueProc = TFHE.asEbytes256(TFHE.padToBytes256(ifTrue)); - ebytes256 ifFalseProc = TFHE.asEbytes256(TFHE.padToBytes256(ifFalse)); - ebytes256 result = TFHE.select(controlProc, ifTrueProc, ifFalseProc); - TFHE.allowThis(result); - resB256 = result; + ebool controlProc = HTTPZ.asEbool(control); + ebytes256 ifTrueProc = HTTPZ.asEbytes256(HTTPZ.padToBytes256(ifTrue)); + ebytes256 ifFalseProc = HTTPZ.asEbytes256(HTTPZ.padToBytes256(ifFalse)); + ebytes256 result = HTTPZ.select(controlProc, ifTrueProc, ifFalseProc); + HTTPZ.allowThis(result); + resEbytes256 = result; } function test_select(einput control, einput ifTrue, einput ifFalse, bytes calldata inputProof) public { - ebool controlProc = TFHE.asEbool(control, inputProof); - euint32 ifTrueProc = TFHE.asEuint32(ifTrue, inputProof); - euint32 ifFalseProc = TFHE.asEuint32(ifFalse, inputProof); - euint32 result = TFHE.select(controlProc, ifTrueProc, ifFalseProc); - TFHE.allowThis(result); - res32 = result; + ebool controlProc = HTTPZ.asEbool(control, inputProof); + euint32 ifTrueProc = HTTPZ.asEuint32(ifTrue, inputProof); + euint32 ifFalseProc = HTTPZ.asEuint32(ifFalse, inputProof); + euint32 result = HTTPZ.select(controlProc, ifTrueProc, ifFalseProc); + HTTPZ.allowThis(result); + resEuint32 = result; } function test_select_eaddress(einput control, einput ifTrue, einput ifFalse, bytes calldata inputProof) public { - ebool controlProc = TFHE.asEbool(control, inputProof); - eaddress ifTrueProc = TFHE.asEaddress(ifTrue, inputProof); - eaddress ifFalseProc = TFHE.asEaddress(ifFalse, inputProof); - eaddress result = TFHE.select(controlProc, ifTrueProc, ifFalseProc); - TFHE.allowThis(result); + ebool controlProc = HTTPZ.asEbool(control, inputProof); + eaddress ifTrueProc = HTTPZ.asEaddress(ifTrue, inputProof); + eaddress ifFalseProc = HTTPZ.asEaddress(ifFalse, inputProof); + eaddress result = HTTPZ.select(controlProc, ifTrueProc, ifFalseProc); + HTTPZ.allowThis(result); resAdd = result; } function test_eq_eaddress_eaddress(einput a, einput b, bytes calldata inputProof) public { - eaddress aProc = TFHE.asEaddress(a, inputProof); - eaddress bProc = TFHE.asEaddress(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; + eaddress aProc = HTTPZ.asEaddress(a, inputProof); + eaddress bProc = HTTPZ.asEaddress(b, inputProof); + ebool result = HTTPZ.eq(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; } function test_ne_eaddress_eaddress(einput a, einput b, bytes calldata inputProof) public { - eaddress aProc = TFHE.asEaddress(a, inputProof); - eaddress bProc = TFHE.asEaddress(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; + eaddress aProc = HTTPZ.asEaddress(a, inputProof); + eaddress bProc = HTTPZ.asEaddress(b, inputProof); + ebool result = HTTPZ.ne(aProc, bProc); + HTTPZ.allowThis(result); + resEbool = result; } function test_eq_eaddress_address(einput a, address b, bytes calldata inputProof) public { - eaddress aProc = TFHE.asEaddress(a, inputProof); - ebool result = TFHE.eq(aProc, b); - TFHE.allowThis(result); - resb = result; + eaddress aProc = HTTPZ.asEaddress(a, inputProof); + ebool result = HTTPZ.eq(aProc, b); + HTTPZ.allowThis(result); + resEbool = result; } function test_eq_address_eaddress(einput a, address b, bytes calldata inputProof) public { - eaddress aProc = TFHE.asEaddress(a, inputProof); - ebool result = TFHE.eq(b, aProc); - TFHE.allowThis(result); - resb = result; + eaddress aProc = HTTPZ.asEaddress(a, inputProof); + ebool result = HTTPZ.eq(b, aProc); + HTTPZ.allowThis(result); + resEbool = result; } function test_ne_eaddress_address(einput a, address b, bytes calldata inputProof) public { - eaddress aProc = TFHE.asEaddress(a, inputProof); - ebool result = TFHE.ne(aProc, b); - TFHE.allowThis(result); - resb = result; + eaddress aProc = HTTPZ.asEaddress(a, inputProof); + ebool result = HTTPZ.ne(aProc, b); + HTTPZ.allowThis(result); + resEbool = result; } function test_ne_address_eaddress(einput a, address b, bytes calldata inputProof) public { - eaddress aProc = TFHE.asEaddress(a, inputProof); - ebool result = TFHE.ne(b, aProc); - TFHE.allowThis(result); - resb = result; - } - - function test_ebool_to_euint4_cast(bool input) public { - res4 = TFHE.asEuint4(TFHE.asEbool(input)); + eaddress aProc = HTTPZ.asEaddress(a, inputProof); + ebool result = HTTPZ.ne(b, aProc); + HTTPZ.allowThis(result); + resEbool = result; } function test_ebool_to_euint8_cast(bool input) public { - res8 = TFHE.asEuint8(TFHE.asEbool(input)); + resEuint8 = HTTPZ.asEuint8(HTTPZ.asEbool(input)); } function test_ebool_to_euint16_cast(bool input) public { - res16 = TFHE.asEuint16(TFHE.asEbool(input)); + resEuint16 = HTTPZ.asEuint16(HTTPZ.asEbool(input)); } function test_ebool_to_euint32_cast(bool input) public { - res32 = TFHE.asEuint32(TFHE.asEbool(input)); + resEuint32 = HTTPZ.asEuint32(HTTPZ.asEbool(input)); } function test_ebool_to_euint64_cast(bool input) public { - res64 = TFHE.asEuint64(TFHE.asEbool(input)); + resEuint64 = HTTPZ.asEuint64(HTTPZ.asEbool(input)); } function test_ebool_to_euint128_cast(bool input) public { - res128 = TFHE.asEuint128(TFHE.asEbool(input)); + resEuint128 = HTTPZ.asEuint128(HTTPZ.asEbool(input)); } function test_ebool_to_euint256_cast(bool input) public { - res256 = TFHE.asEuint256(TFHE.asEbool(input)); - } - - function test_euint4_to_euint256_cast(uint8 input) public { - res256 = TFHE.asEuint256(TFHE.asEuint4(input)); + resEuint256 = HTTPZ.asEuint256(HTTPZ.asEbool(input)); } function test_euint128_to_euint8_cast(uint128 input) public { - res8 = TFHE.asEuint8(TFHE.asEuint128(input)); + resEuint8 = HTTPZ.asEuint8(HTTPZ.asEuint128(input)); } function test_ebool_not(bool input) public { - resb = TFHE.not(TFHE.asEbool(input)); + resEbool = HTTPZ.not(HTTPZ.asEbool(input)); } function test_ebool_and(bool a, bool b) public { - resb = TFHE.and(TFHE.asEbool(a), TFHE.asEbool(b)); + resEbool = HTTPZ.and(HTTPZ.asEbool(a), HTTPZ.asEbool(b)); } function test_ebool_and_scalarL(bool a, bool b) public { - resb = TFHE.and(a, TFHE.asEbool(b)); + resEbool = HTTPZ.and(a, HTTPZ.asEbool(b)); } function test_ebool_and_scalarR(bool a, bool b) public { - resb = TFHE.and(TFHE.asEbool(a), b); + resEbool = HTTPZ.and(HTTPZ.asEbool(a), b); } function test_ebool_or(bool a, bool b) public { - resb = TFHE.or(TFHE.asEbool(a), TFHE.asEbool(b)); + resEbool = HTTPZ.or(HTTPZ.asEbool(a), HTTPZ.asEbool(b)); } function test_ebool_or_scalarL(bool a, bool b) public { - resb = TFHE.or(a, TFHE.asEbool(b)); + resEbool = HTTPZ.or(a, HTTPZ.asEbool(b)); } function test_ebool_or_scalarR(bool a, bool b) public { - resb = TFHE.or(TFHE.asEbool(a), b); + resEbool = HTTPZ.or(HTTPZ.asEbool(a), b); } function test_ebool_xor(bool a, bool b) public { - resb = TFHE.xor(TFHE.asEbool(a), TFHE.asEbool(b)); + resEbool = HTTPZ.xor(HTTPZ.asEbool(a), HTTPZ.asEbool(b)); } function test_ebool_xor_scalarL(bool a, bool b) public { - resb = TFHE.xor(a, TFHE.asEbool(b)); + resEbool = HTTPZ.xor(a, HTTPZ.asEbool(b)); } function test_ebool_xor_scalarR(bool a, bool b) public { - resb = TFHE.xor(TFHE.asEbool(a), b); + resEbool = HTTPZ.xor(HTTPZ.asEbool(a), b); } } diff --git a/contracts/examples/tests/TFHETestSuite1.sol b/contracts/examples/tests/TFHETestSuite1.sol deleted file mode 100644 index 5ca2e9e2..00000000 --- a/contracts/examples/tests/TFHETestSuite1.sol +++ /dev/null @@ -1,651 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause-Clear -pragma solidity ^0.8.24; - -import "../../lib/TFHE.sol"; -import "../../lib/FHEVMConfig.sol"; - -contract TFHETestSuite1 { - ebool public resb; - euint4 public res4; - euint8 public res8; - euint16 public res16; - euint32 public res32; - euint64 public res64; - euint128 public res128; - euint256 public res256; - - constructor() { - TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - } - - function add_euint4_euint4(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint4 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function sub_euint4_euint4(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint4 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function mul_euint4_euint4(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint4 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function and_euint4_euint4(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint4 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function or_euint4_euint4(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint4 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function xor_euint4_euint4(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint4 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function eq_euint4_euint4(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint4_euint4(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint4_euint4(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint4_euint4(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint4_euint4(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint4_euint4(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint4_euint4(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint4 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function max_euint4_euint4(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint4 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function add_euint4_euint8(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function sub_euint4_euint8(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function mul_euint4_euint8(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function and_euint4_euint8(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function or_euint4_euint8(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function xor_euint4_euint8(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function eq_euint4_euint8(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint4_euint8(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint4_euint8(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint4_euint8(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint4_euint8(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint4_euint8(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint4_euint8(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function max_euint4_euint8(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function add_euint4_euint16(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function sub_euint4_euint16(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function mul_euint4_euint16(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function and_euint4_euint16(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function or_euint4_euint16(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function xor_euint4_euint16(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function eq_euint4_euint16(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint4_euint16(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint4_euint16(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint4_euint16(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint4_euint16(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint4_euint16(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint4_euint16(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function max_euint4_euint16(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function add_euint4_euint32(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function sub_euint4_euint32(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function mul_euint4_euint32(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function and_euint4_euint32(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function or_euint4_euint32(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function xor_euint4_euint32(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function eq_euint4_euint32(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint4_euint32(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint4_euint32(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint4_euint32(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint4_euint32(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint4_euint32(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint4_euint32(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function max_euint4_euint32(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function add_euint4_euint64(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function sub_euint4_euint64(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function mul_euint4_euint64(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function and_euint4_euint64(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function or_euint4_euint64(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function xor_euint4_euint64(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function eq_euint4_euint64(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint4_euint64(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint4_euint64(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint4_euint64(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint4_euint64(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint4_euint64(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint4_euint64(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function max_euint4_euint64(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function add_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function sub_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function mul_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function and_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function or_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function xor_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function eq_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function max_euint4_euint128(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function add_euint4_euint256(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function sub_euint4_euint256(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function mul_euint4_euint256(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function and_euint4_euint256(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function or_euint4_euint256(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function xor_euint4_euint256(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } -} diff --git a/contracts/examples/tests/TFHETestSuite10.sol b/contracts/examples/tests/TFHETestSuite10.sol deleted file mode 100644 index 0cae14a6..00000000 --- a/contracts/examples/tests/TFHETestSuite10.sol +++ /dev/null @@ -1,651 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause-Clear -pragma solidity ^0.8.24; - -import "../../lib/TFHE.sol"; -import "../../lib/FHEVMConfig.sol"; - -contract TFHETestSuite10 { - ebool public resb; - euint4 public res4; - euint8 public res8; - euint16 public res16; - euint32 public res32; - euint64 public res64; - euint128 public res128; - euint256 public res256; - - constructor() { - TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - } - - function add_euint256_euint32(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint256 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function sub_euint256_euint32(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint256 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function mul_euint256_euint32(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint256 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function and_euint256_euint32(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint256 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function or_euint256_euint32(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint256 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function xor_euint256_euint32(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint256 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function eq_euint256_euint32(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint256_euint32(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint256_euint32(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint256_euint32(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint256_euint32(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint256_euint32(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint256_euint32(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint256 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function max_euint256_euint32(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint256 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function add_euint256_euint64(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint256 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function sub_euint256_euint64(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint256 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function mul_euint256_euint64(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint256 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function and_euint256_euint64(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint256 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function or_euint256_euint64(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint256 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function xor_euint256_euint64(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint256 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function eq_euint256_euint64(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint256_euint64(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint256_euint64(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint256_euint64(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint256_euint64(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint256_euint64(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint256_euint64(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint256 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function max_euint256_euint64(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint256 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function add_euint256_euint128(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint256 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function sub_euint256_euint128(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint256 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function mul_euint256_euint128(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint256 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function and_euint256_euint128(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint256 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function or_euint256_euint128(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint256 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function xor_euint256_euint128(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint256 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function eq_euint256_euint128(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint256_euint128(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint256_euint128(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint256_euint128(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint256_euint128(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint256_euint128(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint256_euint128(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint256 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function max_euint256_euint128(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint256 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function add_euint256_euint256(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function sub_euint256_euint256(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function mul_euint256_euint256(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function and_euint256_euint256(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function or_euint256_euint256(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function xor_euint256_euint256(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function eq_euint256_euint256(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint256_euint256(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint256_euint256(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint256_euint256(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint256_euint256(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint256_euint256(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint256_euint256(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function max_euint256_euint256(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function add_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - uint256 bProc = b; - euint256 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function add_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public { - uint256 aProc = a; - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function sub_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - uint256 bProc = b; - euint256 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function sub_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public { - uint256 aProc = a; - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function mul_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - uint256 bProc = b; - euint256 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function mul_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public { - uint256 aProc = a; - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function div_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - uint256 bProc = b; - euint256 result = TFHE.div(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function rem_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - uint256 bProc = b; - euint256 result = TFHE.rem(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function and_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - uint256 bProc = b; - euint256 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function and_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public { - uint256 aProc = a; - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function or_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - uint256 bProc = b; - euint256 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function or_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public { - uint256 aProc = a; - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function xor_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - uint256 bProc = b; - euint256 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function xor_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public { - uint256 aProc = a; - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function eq_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - uint256 bProc = b; - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function eq_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public { - uint256 aProc = a; - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - uint256 bProc = b; - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public { - uint256 aProc = a; - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - uint256 bProc = b; - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public { - uint256 aProc = a; - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - uint256 bProc = b; - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public { - uint256 aProc = a; - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - uint256 bProc = b; - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public { - uint256 aProc = a; - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - uint256 bProc = b; - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public { - uint256 aProc = a; - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - uint256 bProc = b; - euint256 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function min_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public { - uint256 aProc = a; - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function max_euint256_uint256(einput a, uint256 b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - uint256 bProc = b; - euint256 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function max_uint256_euint256(uint256 a, einput b, bytes calldata inputProof) public { - uint256 aProc = a; - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function shl_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - euint4 result = TFHE.shl(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function shr_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - euint4 result = TFHE.shr(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function rotl_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - euint4 result = TFHE.rotl(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function rotr_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - euint4 result = TFHE.rotr(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } -} diff --git a/contracts/examples/tests/TFHETestSuite11.sol b/contracts/examples/tests/TFHETestSuite11.sol deleted file mode 100644 index bd132580..00000000 --- a/contracts/examples/tests/TFHETestSuite11.sol +++ /dev/null @@ -1,441 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause-Clear -pragma solidity ^0.8.24; - -import "../../lib/TFHE.sol"; -import "../../lib/FHEVMConfig.sol"; - -contract TFHETestSuite11 { - ebool public resb; - euint4 public res4; - euint8 public res8; - euint16 public res16; - euint32 public res32; - euint64 public res64; - euint128 public res128; - euint256 public res256; - - constructor() { - TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - } - - function shl_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.shl(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function shl_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - uint8 bProc = b; - euint8 result = TFHE.shl(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function shr_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.shr(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function shr_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - uint8 bProc = b; - euint8 result = TFHE.shr(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function rotl_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.rotl(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function rotl_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - uint8 bProc = b; - euint8 result = TFHE.rotl(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function rotr_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.rotr(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function rotr_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - uint8 bProc = b; - euint8 result = TFHE.rotr(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function shl_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint16 result = TFHE.shl(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function shl_euint16_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint8 bProc = b; - euint16 result = TFHE.shl(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function shr_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint16 result = TFHE.shr(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function shr_euint16_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint8 bProc = b; - euint16 result = TFHE.shr(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function rotl_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint16 result = TFHE.rotl(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function rotl_euint16_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint8 bProc = b; - euint16 result = TFHE.rotl(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function rotr_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint16 result = TFHE.rotr(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function rotr_euint16_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint8 bProc = b; - euint16 result = TFHE.rotr(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function shl_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint32 result = TFHE.shl(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function shl_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint8 bProc = b; - euint32 result = TFHE.shl(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function shr_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint32 result = TFHE.shr(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function shr_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint8 bProc = b; - euint32 result = TFHE.shr(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function rotl_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint32 result = TFHE.rotl(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function rotl_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint8 bProc = b; - euint32 result = TFHE.rotl(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function rotr_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint32 result = TFHE.rotr(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function rotr_euint32_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint8 bProc = b; - euint32 result = TFHE.rotr(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function shl_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint64 result = TFHE.shl(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function shl_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - uint8 bProc = b; - euint64 result = TFHE.shl(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function shr_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint64 result = TFHE.shr(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function shr_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - uint8 bProc = b; - euint64 result = TFHE.shr(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function rotl_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint64 result = TFHE.rotl(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function rotl_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - uint8 bProc = b; - euint64 result = TFHE.rotl(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function rotr_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint64 result = TFHE.rotr(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function rotr_euint64_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - uint8 bProc = b; - euint64 result = TFHE.rotr(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function shl_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint128 result = TFHE.shl(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function shl_euint128_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - uint8 bProc = b; - euint128 result = TFHE.shl(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function shr_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint128 result = TFHE.shr(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function shr_euint128_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - uint8 bProc = b; - euint128 result = TFHE.shr(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function rotl_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint128 result = TFHE.rotl(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function rotl_euint128_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - uint8 bProc = b; - euint128 result = TFHE.rotl(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function rotr_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint128 result = TFHE.rotr(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function rotr_euint128_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - uint8 bProc = b; - euint128 result = TFHE.rotr(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function shl_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint256 result = TFHE.shl(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function shl_euint256_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - uint8 bProc = b; - euint256 result = TFHE.shl(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function shr_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint256 result = TFHE.shr(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function shr_euint256_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - uint8 bProc = b; - euint256 result = TFHE.shr(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function rotl_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint256 result = TFHE.rotl(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function rotl_euint256_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - uint8 bProc = b; - euint256 result = TFHE.rotl(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function rotr_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint256 result = TFHE.rotr(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function rotr_euint256_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - uint8 bProc = b; - euint256 result = TFHE.rotr(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function neg_euint4(einput a, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint4 result = TFHE.neg(aProc); - TFHE.allowThis(result); - res4 = result; - } - function not_euint4(einput a, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint4 result = TFHE.not(aProc); - TFHE.allowThis(result); - res4 = result; - } - function neg_euint8(einput a, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 result = TFHE.neg(aProc); - TFHE.allowThis(result); - res8 = result; - } - function not_euint8(einput a, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 result = TFHE.not(aProc); - TFHE.allowThis(result); - res8 = result; - } - function neg_euint16(einput a, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 result = TFHE.neg(aProc); - TFHE.allowThis(result); - res16 = result; - } - function not_euint16(einput a, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 result = TFHE.not(aProc); - TFHE.allowThis(result); - res16 = result; - } - function neg_euint32(einput a, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint32 result = TFHE.neg(aProc); - TFHE.allowThis(result); - res32 = result; - } - function not_euint32(einput a, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint32 result = TFHE.not(aProc); - TFHE.allowThis(result); - res32 = result; - } - function neg_euint64(einput a, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 result = TFHE.neg(aProc); - TFHE.allowThis(result); - res64 = result; - } - function not_euint64(einput a, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 result = TFHE.not(aProc); - TFHE.allowThis(result); - res64 = result; - } - function neg_euint128(einput a, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint128 result = TFHE.neg(aProc); - TFHE.allowThis(result); - res128 = result; - } - function not_euint128(einput a, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint128 result = TFHE.not(aProc); - TFHE.allowThis(result); - res128 = result; - } - function neg_euint256(einput a, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint256 result = TFHE.neg(aProc); - TFHE.allowThis(result); - res256 = result; - } - function not_euint256(einput a, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint256 result = TFHE.not(aProc); - TFHE.allowThis(result); - res256 = result; - } -} diff --git a/contracts/examples/tests/TFHETestSuite2.sol b/contracts/examples/tests/TFHETestSuite2.sol deleted file mode 100644 index 059eee5a..00000000 --- a/contracts/examples/tests/TFHETestSuite2.sol +++ /dev/null @@ -1,651 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause-Clear -pragma solidity ^0.8.24; - -import "../../lib/TFHE.sol"; -import "../../lib/FHEVMConfig.sol"; - -contract TFHETestSuite2 { - ebool public resb; - euint4 public res4; - euint8 public res8; - euint16 public res16; - euint32 public res32; - euint64 public res64; - euint128 public res128; - euint256 public res256; - - constructor() { - TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - } - - function eq_euint4_euint256(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint4_euint256(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint4_euint256(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint4_euint256(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint4_euint256(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint4_euint256(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint4_euint256(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function max_euint4_euint256(einput a, einput b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function add_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - euint4 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function add_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint4 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function sub_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - euint4 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function sub_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint4 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function mul_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - euint4 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function mul_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint4 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function div_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - euint4 result = TFHE.div(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function rem_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - euint4 result = TFHE.rem(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function and_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - euint4 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function and_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint4 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function or_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - euint4 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function or_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint4 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function xor_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - euint4 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function xor_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint4 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function eq_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function eq_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - euint4 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function min_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint4 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function max_euint4_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint4 aProc = TFHE.asEuint4(a, inputProof); - uint8 bProc = b; - euint4 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function max_uint8_euint4(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint4 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res4 = result; - } - function add_euint8_euint4(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint8 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function sub_euint8_euint4(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint8 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function mul_euint8_euint4(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint8 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function and_euint8_euint4(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint8 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function or_euint8_euint4(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint8 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function xor_euint8_euint4(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint8 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function eq_euint8_euint4(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint8_euint4(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint8_euint4(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint8_euint4(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint8_euint4(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint8_euint4(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint8_euint4(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint8 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function max_euint8_euint4(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint8 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function add_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function sub_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function mul_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function and_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function or_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function xor_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function eq_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function max_euint8_euint8(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function add_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function sub_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function mul_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function and_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function or_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function xor_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function eq_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function max_euint8_euint16(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function add_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function sub_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function mul_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function and_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function or_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function xor_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function eq_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } -} diff --git a/contracts/examples/tests/TFHETestSuite3.sol b/contracts/examples/tests/TFHETestSuite3.sol deleted file mode 100644 index ca7de2e6..00000000 --- a/contracts/examples/tests/TFHETestSuite3.sol +++ /dev/null @@ -1,651 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause-Clear -pragma solidity ^0.8.24; - -import "../../lib/TFHE.sol"; -import "../../lib/FHEVMConfig.sol"; - -contract TFHETestSuite3 { - ebool public resb; - euint4 public res4; - euint8 public res8; - euint16 public res16; - euint32 public res32; - euint64 public res64; - euint128 public res128; - euint256 public res256; - - constructor() { - TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - } - - function le_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function max_euint8_euint32(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function add_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function sub_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function mul_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function and_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function or_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function xor_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function eq_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function max_euint8_euint64(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function add_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function sub_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function mul_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function and_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function or_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function xor_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function eq_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function max_euint8_euint128(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function add_euint8_euint256(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function sub_euint8_euint256(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function mul_euint8_euint256(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function and_euint8_euint256(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function or_euint8_euint256(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function xor_euint8_euint256(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function eq_euint8_euint256(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint8_euint256(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint8_euint256(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint8_euint256(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint8_euint256(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint8_euint256(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint8_euint256(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function max_euint8_euint256(einput a, einput b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function add_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - uint8 bProc = b; - euint8 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function add_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function sub_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - uint8 bProc = b; - euint8 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function sub_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function mul_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - uint8 bProc = b; - euint8 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function mul_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function div_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - uint8 bProc = b; - euint8 result = TFHE.div(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function rem_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - uint8 bProc = b; - euint8 result = TFHE.rem(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function and_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - uint8 bProc = b; - euint8 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function and_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function or_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - uint8 bProc = b; - euint8 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function or_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function xor_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - uint8 bProc = b; - euint8 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function xor_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function eq_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - uint8 bProc = b; - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function eq_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - uint8 bProc = b; - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - uint8 bProc = b; - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - uint8 bProc = b; - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - uint8 bProc = b; - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - uint8 bProc = b; - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - uint8 bProc = b; - euint8 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function min_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function max_euint8_uint8(einput a, uint8 b, bytes calldata inputProof) public { - euint8 aProc = TFHE.asEuint8(a, inputProof); - uint8 bProc = b; - euint8 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function max_uint8_euint8(uint8 a, einput b, bytes calldata inputProof) public { - uint8 aProc = a; - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint8 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res8 = result; - } - function add_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint16 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function sub_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint16 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function mul_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint16 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function and_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint16 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function or_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint16 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function xor_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint16 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function eq_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint16 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function max_euint16_euint4(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint16 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } -} diff --git a/contracts/examples/tests/TFHETestSuite4.sol b/contracts/examples/tests/TFHETestSuite4.sol deleted file mode 100644 index d7edffc4..00000000 --- a/contracts/examples/tests/TFHETestSuite4.sol +++ /dev/null @@ -1,651 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause-Clear -pragma solidity ^0.8.24; - -import "../../lib/TFHE.sol"; -import "../../lib/FHEVMConfig.sol"; - -contract TFHETestSuite4 { - ebool public resb; - euint4 public res4; - euint8 public res8; - euint16 public res16; - euint32 public res32; - euint64 public res64; - euint128 public res128; - euint256 public res256; - - constructor() { - TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - } - - function add_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint16 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function sub_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint16 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function mul_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint16 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function and_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint16 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function or_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint16 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function xor_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint16 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function eq_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint16 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function max_euint16_euint8(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint16 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function add_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function sub_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function mul_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function and_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function or_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function xor_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function eq_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function max_euint16_euint16(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function add_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function sub_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function mul_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function and_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function or_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function xor_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function eq_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function max_euint16_euint32(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function add_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function sub_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function mul_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function and_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function or_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function xor_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function eq_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function max_euint16_euint64(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function add_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function sub_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function mul_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function and_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function or_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function xor_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function eq_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function max_euint16_euint128(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function add_euint16_euint256(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function sub_euint16_euint256(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function mul_euint16_euint256(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function and_euint16_euint256(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function or_euint16_euint256(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function xor_euint16_euint256(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function eq_euint16_euint256(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint16_euint256(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint16_euint256(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint16_euint256(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint16_euint256(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint16_euint256(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint16_euint256(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function max_euint16_euint256(einput a, einput b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function add_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; - euint16 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function add_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { - uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function sub_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; - euint16 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function sub_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { - uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function mul_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; - euint16 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function mul_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { - uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } -} diff --git a/contracts/examples/tests/TFHETestSuite5.sol b/contracts/examples/tests/TFHETestSuite5.sol deleted file mode 100644 index 4a2e388c..00000000 --- a/contracts/examples/tests/TFHETestSuite5.sol +++ /dev/null @@ -1,651 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause-Clear -pragma solidity ^0.8.24; - -import "../../lib/TFHE.sol"; -import "../../lib/FHEVMConfig.sol"; - -contract TFHETestSuite5 { - ebool public resb; - euint4 public res4; - euint8 public res8; - euint16 public res16; - euint32 public res32; - euint64 public res64; - euint128 public res128; - euint256 public res256; - - constructor() { - TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - } - - function div_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; - euint16 result = TFHE.div(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function rem_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; - euint16 result = TFHE.rem(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function and_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; - euint16 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function and_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { - uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function or_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; - euint16 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function or_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { - uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function xor_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; - euint16 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function xor_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { - uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function eq_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function eq_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { - uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { - uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { - uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { - uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { - uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { - uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; - euint16 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function min_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { - uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function max_euint16_uint16(einput a, uint16 b, bytes calldata inputProof) public { - euint16 aProc = TFHE.asEuint16(a, inputProof); - uint16 bProc = b; - euint16 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function max_uint16_euint16(uint16 a, einput b, bytes calldata inputProof) public { - uint16 aProc = a; - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint16 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res16 = result; - } - function add_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint32 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function sub_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint32 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function mul_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint32 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function and_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint32 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function or_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint32 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function xor_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint32 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function eq_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint32 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function max_euint32_euint4(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint32 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function add_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint32 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function sub_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint32 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function mul_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint32 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function and_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint32 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function or_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint32 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function xor_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint32 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function eq_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint32 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function max_euint32_euint8(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint32 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function add_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint32 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function sub_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint32 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function mul_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint32 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function and_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint32 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function or_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint32 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function xor_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint32 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function eq_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint32 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function max_euint32_euint16(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint32 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function add_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function sub_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function mul_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function and_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function or_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function xor_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function eq_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function max_euint32_euint32(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function add_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function sub_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function mul_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function and_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function or_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function xor_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function eq_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } -} diff --git a/contracts/examples/tests/TFHETestSuite6.sol b/contracts/examples/tests/TFHETestSuite6.sol deleted file mode 100644 index e64f3a44..00000000 --- a/contracts/examples/tests/TFHETestSuite6.sol +++ /dev/null @@ -1,651 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause-Clear -pragma solidity ^0.8.24; - -import "../../lib/TFHE.sol"; -import "../../lib/FHEVMConfig.sol"; - -contract TFHETestSuite6 { - ebool public resb; - euint4 public res4; - euint8 public res8; - euint16 public res16; - euint32 public res32; - euint64 public res64; - euint128 public res128; - euint256 public res256; - - constructor() { - TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - } - - function le_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function max_euint32_euint64(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function add_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function sub_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function mul_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function and_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function or_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function xor_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function eq_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function max_euint32_euint128(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function add_euint32_euint256(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function sub_euint32_euint256(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function mul_euint32_euint256(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function and_euint32_euint256(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function or_euint32_euint256(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function xor_euint32_euint256(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function eq_euint32_euint256(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint32_euint256(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint32_euint256(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint32_euint256(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint32_euint256(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint32_euint256(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint32_euint256(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function max_euint32_euint256(einput a, einput b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function add_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint32 bProc = b; - euint32 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function add_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { - uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function sub_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint32 bProc = b; - euint32 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function sub_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { - uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function mul_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint32 bProc = b; - euint32 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function mul_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { - uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function div_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint32 bProc = b; - euint32 result = TFHE.div(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function rem_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint32 bProc = b; - euint32 result = TFHE.rem(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function and_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint32 bProc = b; - euint32 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function and_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { - uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function or_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint32 bProc = b; - euint32 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function or_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { - uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function xor_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint32 bProc = b; - euint32 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function xor_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { - uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function eq_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint32 bProc = b; - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function eq_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { - uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint32 bProc = b; - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { - uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint32 bProc = b; - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { - uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint32 bProc = b; - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { - uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint32 bProc = b; - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { - uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint32 bProc = b; - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { - uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint32 bProc = b; - euint32 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function min_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { - uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function max_euint32_uint32(einput a, uint32 b, bytes calldata inputProof) public { - euint32 aProc = TFHE.asEuint32(a, inputProof); - uint32 bProc = b; - euint32 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function max_uint32_euint32(uint32 a, einput b, bytes calldata inputProof) public { - uint32 aProc = a; - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint32 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res32 = result; - } - function add_euint64_euint4(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint64 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function sub_euint64_euint4(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint64 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function mul_euint64_euint4(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint64 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function and_euint64_euint4(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint64 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function or_euint64_euint4(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint64 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function xor_euint64_euint4(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint64 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function eq_euint64_euint4(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint64_euint4(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint64_euint4(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint64_euint4(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint64_euint4(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint64_euint4(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint64_euint4(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint64 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function max_euint64_euint4(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint64 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function add_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint64 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function sub_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint64 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function mul_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint64 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function and_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint64 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function or_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint64 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function xor_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint64 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function eq_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint64 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function max_euint64_euint8(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint64 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } -} diff --git a/contracts/examples/tests/TFHETestSuite7.sol b/contracts/examples/tests/TFHETestSuite7.sol deleted file mode 100644 index 0ced1024..00000000 --- a/contracts/examples/tests/TFHETestSuite7.sol +++ /dev/null @@ -1,651 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause-Clear -pragma solidity ^0.8.24; - -import "../../lib/TFHE.sol"; -import "../../lib/FHEVMConfig.sol"; - -contract TFHETestSuite7 { - ebool public resb; - euint4 public res4; - euint8 public res8; - euint16 public res16; - euint32 public res32; - euint64 public res64; - euint128 public res128; - euint256 public res256; - - constructor() { - TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - } - - function add_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint64 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function sub_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint64 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function mul_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint64 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function and_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint64 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function or_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint64 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function xor_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint64 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function eq_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint64 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function max_euint64_euint16(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint64 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function add_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint64 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function sub_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint64 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function mul_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint64 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function and_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint64 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function or_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint64 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function xor_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint64 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function eq_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint64 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function max_euint64_euint32(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint64 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function add_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function sub_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function mul_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function and_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function or_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function xor_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function eq_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function max_euint64_euint64(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function add_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function sub_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function mul_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function and_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function or_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function xor_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function eq_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function max_euint64_euint128(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function add_euint64_euint256(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function sub_euint64_euint256(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function mul_euint64_euint256(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function and_euint64_euint256(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function or_euint64_euint256(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function xor_euint64_euint256(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function eq_euint64_euint256(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint64_euint256(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint64_euint256(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint64_euint256(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint64_euint256(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint64_euint256(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint64_euint256(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function max_euint64_euint256(einput a, einput b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function add_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - uint64 bProc = b; - euint64 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function add_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { - uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function sub_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - uint64 bProc = b; - euint64 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function sub_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { - uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function mul_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - uint64 bProc = b; - euint64 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function mul_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { - uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function div_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - uint64 bProc = b; - euint64 result = TFHE.div(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function rem_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - uint64 bProc = b; - euint64 result = TFHE.rem(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function and_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - uint64 bProc = b; - euint64 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function and_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { - uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function or_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - uint64 bProc = b; - euint64 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function or_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { - uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function xor_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - uint64 bProc = b; - euint64 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function xor_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { - uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function eq_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - uint64 bProc = b; - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function eq_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { - uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - uint64 bProc = b; - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { - uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - uint64 bProc = b; - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { - uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } -} diff --git a/contracts/examples/tests/TFHETestSuite8.sol b/contracts/examples/tests/TFHETestSuite8.sol deleted file mode 100644 index e8a698fa..00000000 --- a/contracts/examples/tests/TFHETestSuite8.sol +++ /dev/null @@ -1,651 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause-Clear -pragma solidity ^0.8.24; - -import "../../lib/TFHE.sol"; -import "../../lib/FHEVMConfig.sol"; - -contract TFHETestSuite8 { - ebool public resb; - euint4 public res4; - euint8 public res8; - euint16 public res16; - euint32 public res32; - euint64 public res64; - euint128 public res128; - euint256 public res256; - - constructor() { - TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - } - - function gt_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - uint64 bProc = b; - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { - uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - uint64 bProc = b; - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { - uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - uint64 bProc = b; - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { - uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - uint64 bProc = b; - euint64 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function min_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { - uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function max_euint64_uint64(einput a, uint64 b, bytes calldata inputProof) public { - euint64 aProc = TFHE.asEuint64(a, inputProof); - uint64 bProc = b; - euint64 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function max_uint64_euint64(uint64 a, einput b, bytes calldata inputProof) public { - uint64 aProc = a; - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint64 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res64 = result; - } - function add_euint128_euint4(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint128 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function sub_euint128_euint4(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint128 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function mul_euint128_euint4(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint128 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function and_euint128_euint4(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint128 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function or_euint128_euint4(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint128 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function xor_euint128_euint4(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint128 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function eq_euint128_euint4(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint128_euint4(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint128_euint4(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint128_euint4(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint128_euint4(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint128_euint4(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint128_euint4(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint128 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function max_euint128_euint4(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint128 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function add_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint128 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function sub_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint128 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function mul_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint128 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function and_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint128 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function or_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint128 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function xor_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint128 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function eq_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint128 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function max_euint128_euint8(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint128 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function add_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint128 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function sub_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint128 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function mul_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint128 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function and_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint128 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function or_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint128 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function xor_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint128 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function eq_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint128 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function max_euint128_euint16(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint128 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function add_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint128 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function sub_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint128 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function mul_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint128 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function and_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint128 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function or_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint128 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function xor_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint128 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function eq_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint128 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function max_euint128_euint32(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint32 bProc = TFHE.asEuint32(b, inputProof); - euint128 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function add_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint128 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function sub_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint128 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function mul_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint128 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function and_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint128 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function or_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint128 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function xor_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint128 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function eq_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint128 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function max_euint128_euint64(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint64 bProc = TFHE.asEuint64(b, inputProof); - euint128 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function add_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function sub_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function mul_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function and_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function or_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function xor_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function eq_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } -} diff --git a/contracts/examples/tests/TFHETestSuite9.sol b/contracts/examples/tests/TFHETestSuite9.sol deleted file mode 100644 index e2e171ff..00000000 --- a/contracts/examples/tests/TFHETestSuite9.sol +++ /dev/null @@ -1,651 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause-Clear -pragma solidity ^0.8.24; - -import "../../lib/TFHE.sol"; -import "../../lib/FHEVMConfig.sol"; - -contract TFHETestSuite9 { - ebool public resb; - euint4 public res4; - euint8 public res8; - euint16 public res16; - euint32 public res32; - euint64 public res64; - euint128 public res128; - euint256 public res256; - - constructor() { - TFHE.setFHEVM(FHEVMConfig.defaultConfig()); - } - - function le_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function max_euint128_euint128(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function add_euint128_euint256(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function sub_euint128_euint256(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function mul_euint128_euint256(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function and_euint128_euint256(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function or_euint128_euint256(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function xor_euint128_euint256(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function eq_euint128_euint256(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint128_euint256(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint128_euint256(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint128_euint256(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint128_euint256(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint128_euint256(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint128_euint256(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function max_euint128_euint256(einput a, einput b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - euint256 bProc = TFHE.asEuint256(b, inputProof); - euint256 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function add_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - uint128 bProc = b; - euint128 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function add_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { - uint128 aProc = a; - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function sub_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - uint128 bProc = b; - euint128 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function sub_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { - uint128 aProc = a; - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function mul_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - uint128 bProc = b; - euint128 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function mul_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { - uint128 aProc = a; - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function div_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - uint128 bProc = b; - euint128 result = TFHE.div(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function rem_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - uint128 bProc = b; - euint128 result = TFHE.rem(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function and_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - uint128 bProc = b; - euint128 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function and_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { - uint128 aProc = a; - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function or_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - uint128 bProc = b; - euint128 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function or_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { - uint128 aProc = a; - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function xor_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - uint128 bProc = b; - euint128 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function xor_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { - uint128 aProc = a; - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function eq_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - uint128 bProc = b; - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function eq_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { - uint128 aProc = a; - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - uint128 bProc = b; - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { - uint128 aProc = a; - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - uint128 bProc = b; - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { - uint128 aProc = a; - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - uint128 bProc = b; - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { - uint128 aProc = a; - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - uint128 bProc = b; - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { - uint128 aProc = a; - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - uint128 bProc = b; - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { - uint128 aProc = a; - euint128 bProc = TFHE.asEuint128(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - uint128 bProc = b; - euint128 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function min_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { - uint128 aProc = a; - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function max_euint128_uint128(einput a, uint128 b, bytes calldata inputProof) public { - euint128 aProc = TFHE.asEuint128(a, inputProof); - uint128 bProc = b; - euint128 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function max_uint128_euint128(uint128 a, einput b, bytes calldata inputProof) public { - uint128 aProc = a; - euint128 bProc = TFHE.asEuint128(b, inputProof); - euint128 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res128 = result; - } - function add_euint256_euint4(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint256 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function sub_euint256_euint4(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint256 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function mul_euint256_euint4(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint256 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function and_euint256_euint4(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint256 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function or_euint256_euint4(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint256 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function xor_euint256_euint4(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint256 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function eq_euint256_euint4(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint256_euint4(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint256_euint4(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint256_euint4(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint256_euint4(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint256_euint4(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint256_euint4(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint256 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function max_euint256_euint4(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint4 bProc = TFHE.asEuint4(b, inputProof); - euint256 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function add_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint256 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function sub_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint256 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function mul_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint256 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function and_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint256 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function or_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint256 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function xor_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint256 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function eq_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint256 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function max_euint256_euint8(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint8 bProc = TFHE.asEuint8(b, inputProof); - euint256 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function add_euint256_euint16(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint256 result = TFHE.add(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function sub_euint256_euint16(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint256 result = TFHE.sub(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function mul_euint256_euint16(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint256 result = TFHE.mul(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function and_euint256_euint16(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint256 result = TFHE.and(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function or_euint256_euint16(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint256 result = TFHE.or(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function xor_euint256_euint16(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint256 result = TFHE.xor(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function eq_euint256_euint16(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.eq(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ne_euint256_euint16(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.ne(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function ge_euint256_euint16(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.ge(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function gt_euint256_euint16(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.gt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function le_euint256_euint16(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.le(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function lt_euint256_euint16(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - ebool result = TFHE.lt(aProc, bProc); - TFHE.allowThis(result); - resb = result; - } - function min_euint256_euint16(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint256 result = TFHE.min(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } - function max_euint256_euint16(einput a, einput b, bytes calldata inputProof) public { - euint256 aProc = TFHE.asEuint256(a, inputProof); - euint16 bProc = TFHE.asEuint16(b, inputProof); - euint256 result = TFHE.max(aProc, bProc); - TFHE.allowThis(result); - res256 = result; - } -} diff --git a/contracts/lib/TFHE.sol b/contracts/lib/HTTPZ.sol similarity index 55% rename from contracts/lib/TFHE.sol rename to contracts/lib/HTTPZ.sol index 538917cb..dc19c763 100644 --- a/contracts/lib/TFHE.sol +++ b/contracts/lib/HTTPZ.sol @@ -2,9 +2,9 @@ pragma solidity ^0.8.24; import "./Impl.sol"; +import {FheType} from "../contracts/FheType.sol"; type ebool is bytes32; -type euint4 is bytes32; type euint8 is bytes32; type euint16 is bytes32; type euint32 is bytes32; @@ -18,50 +18,11 @@ type ebytes256 is bytes32; type einput is bytes32; /** - * @title Common - * @notice This library contains all the values used to communicate types to the run time. - */ -library Common { - /// @notice Runtime type for encrypted boolean. - uint8 internal constant ebool_t = 0; - - /// @notice Runtime type for encrypted uint4. - uint8 internal constant euint4_t = 1; - - /// @notice Runtime type for encrypted uint8. - uint8 internal constant euint8_t = 2; - - /// @notice Runtime type for encrypted uint16. - uint8 internal constant euint16_t = 3; - - /// @notice Runtime type for encrypted uint32. - uint8 internal constant euint32_t = 4; - /// @notice Runtime type for encrypted uint64. - uint8 internal constant euint64_t = 5; - /// @notice Runtime type for encrypted uint128. - uint8 internal constant euint128_t = 6; - /// @notice Runtime type for encrypted addresses. - uint8 internal constant euint160_t = 7; - - /// @notice Runtime type for encrypted uint256. - uint8 internal constant euint256_t = 8; - - /// @notice Runtime type for encrypted bytes64. - uint8 internal constant ebytes64_t = 9; - - /// @notice Runtime type for encrypted bytes128. - uint8 internal constant ebytes128_t = 10; - - /// @notice Runtime type for encrypted bytes256. - uint8 internal constant ebytes256_t = 11; -} - -/** - * @title TFHE + * @title HTTPZ * @notice This library is the interaction point for all smart contract developers - * that interact with TFHE. + * that interact with the HTTPZ protocol. */ -library TFHE { +library HTTPZ { /// @notice Returned if the input's length is greater than 64 bytes. error InputLengthAbove64Bytes(uint256 inputLength); @@ -72,11 +33,11 @@ library TFHE { error InputLengthAbove256Bytes(uint256 inputLength); /** - * @notice Sets the FHEVM addresses. - * @param fhevmConfig FHEVM config struct that contains contract addresses. + * @notice Sets the coprocessor addresses. + * @param httpzConfig HTTPZ config struct that contains contract addresses. */ - function setFHEVM(FHEVMConfigStruct memory fhevmConfig) internal { - Impl.setFHEVM(fhevmConfig); + function setCoprocessor(HTTPZConfigStruct memory httpzConfig) internal { + Impl.setCoprocessor(httpzConfig); } /** @@ -86,13 +47,6 @@ library TFHE { return ebool.unwrap(v) != 0; } - /** - * @dev Returns true if the encrypted integer is initialized and false otherwise. - */ - function isInitialized(euint4 v) internal pure returns (bool) { - return euint4.unwrap(v) != 0; - } - /** * @dev Returns true if the encrypted integer is initialized and false otherwise. */ @@ -131,380 +85,291 @@ library TFHE { /** * @dev Returns true if the encrypted integer is initialized and false otherwise. */ - function isInitialized(euint256 v) internal pure returns (bool) { - return euint256.unwrap(v) != 0; - } - - /** - * @dev Evaluates add(a, b) and returns the result. - */ - function add(euint4 a, euint4 b) internal returns (euint4) { - if (!isInitialized(a)) { - a = asEuint4(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return euint4.wrap(Impl.add(euint4.unwrap(a), euint4.unwrap(b), false)); - } - - /** - * @dev Evaluates sub(a, b) and returns the result. - */ - function sub(euint4 a, euint4 b) internal returns (euint4) { - if (!isInitialized(a)) { - a = asEuint4(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return euint4.wrap(Impl.sub(euint4.unwrap(a), euint4.unwrap(b), false)); - } - - /** - * @dev Evaluates mul(a, b) and returns the result. - */ - function mul(euint4 a, euint4 b) internal returns (euint4) { - if (!isInitialized(a)) { - a = asEuint4(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return euint4.wrap(Impl.mul(euint4.unwrap(a), euint4.unwrap(b), false)); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(euint4 a, euint4 b) internal returns (euint4) { - if (!isInitialized(a)) { - a = asEuint4(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return euint4.wrap(Impl.and(euint4.unwrap(a), euint4.unwrap(b), false)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(euint4 a, euint4 b) internal returns (euint4) { - if (!isInitialized(a)) { - a = asEuint4(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return euint4.wrap(Impl.or(euint4.unwrap(a), euint4.unwrap(b), false)); + function isInitialized(eaddress v) internal pure returns (bool) { + return eaddress.unwrap(v) != 0; } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Returns true if the encrypted integer is initialized and false otherwise. */ - function xor(euint4 a, euint4 b) internal returns (euint4) { - if (!isInitialized(a)) { - a = asEuint4(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return euint4.wrap(Impl.xor(euint4.unwrap(a), euint4.unwrap(b), false)); + function isInitialized(euint256 v) internal pure returns (bool) { + return euint256.unwrap(v) != 0; } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Returns true if the encrypted integer is initialized and false otherwise. */ - function eq(euint4 a, euint4 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint4(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return ebool.wrap(Impl.eq(euint4.unwrap(a), euint4.unwrap(b), false)); + function isInitialized(ebytes64 v) internal pure returns (bool) { + return ebytes64.unwrap(v) != 0; } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Returns true if the encrypted integer is initialized and false otherwise. */ - function ne(euint4 a, euint4 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint4(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return ebool.wrap(Impl.ne(euint4.unwrap(a), euint4.unwrap(b), false)); + function isInitialized(ebytes128 v) internal pure returns (bool) { + return ebytes128.unwrap(v) != 0; } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Returns true if the encrypted integer is initialized and false otherwise. */ - function ge(euint4 a, euint4 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint4(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return ebool.wrap(Impl.ge(euint4.unwrap(a), euint4.unwrap(b), false)); + function isInitialized(ebytes256 v) internal pure returns (bool) { + return ebytes256.unwrap(v) != 0; } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates and(ebool a, ebool b) and returns the result. */ - function gt(euint4 a, euint4 b) internal returns (ebool) { + function and(ebool a, ebool b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEbool(false); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEbool(false); } - return ebool.wrap(Impl.gt(euint4.unwrap(a), euint4.unwrap(b), false)); + return ebool.wrap(Impl.and(ebool.unwrap(a), ebool.unwrap(b), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates or(ebool a, ebool b) and returns the result. */ - function le(euint4 a, euint4 b) internal returns (ebool) { + function or(ebool a, ebool b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEbool(false); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEbool(false); } - return ebool.wrap(Impl.le(euint4.unwrap(a), euint4.unwrap(b), false)); + return ebool.wrap(Impl.or(ebool.unwrap(a), ebool.unwrap(b), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates xor(ebool a, ebool b) and returns the result. */ - function lt(euint4 a, euint4 b) internal returns (ebool) { + function xor(ebool a, ebool b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEbool(false); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEbool(false); } - return ebool.wrap(Impl.lt(euint4.unwrap(a), euint4.unwrap(b), false)); + return ebool.wrap(Impl.xor(ebool.unwrap(a), ebool.unwrap(b), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates eq(ebool a, ebool b) and returns the result. */ - function min(euint4 a, euint4 b) internal returns (euint4) { + function eq(ebool a, ebool b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEbool(false); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEbool(false); } - return euint4.wrap(Impl.min(euint4.unwrap(a), euint4.unwrap(b), false)); + return ebool.wrap(Impl.eq(ebool.unwrap(a), ebool.unwrap(b), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates ne(ebool a, ebool b) and returns the result. */ - function max(euint4 a, euint4 b) internal returns (euint4) { + function ne(ebool a, ebool b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEbool(false); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEbool(false); } - return euint4.wrap(Impl.max(euint4.unwrap(a), euint4.unwrap(b), false)); + return ebool.wrap(Impl.ne(ebool.unwrap(a), ebool.unwrap(b), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates add(euint8 a, euint8 b) and returns the result. */ - function add(euint4 a, euint8 b) internal returns (euint8) { + function add(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return euint8.wrap(Impl.add(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); + return euint8.wrap(Impl.add(euint8.unwrap(a), euint8.unwrap(b), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates sub(euint8 a, euint8 b) and returns the result. */ - function sub(euint4 a, euint8 b) internal returns (euint8) { + function sub(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return euint8.wrap(Impl.sub(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); + return euint8.wrap(Impl.sub(euint8.unwrap(a), euint8.unwrap(b), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates mul(euint8 a, euint8 b) and returns the result. */ - function mul(euint4 a, euint8 b) internal returns (euint8) { + function mul(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return euint8.wrap(Impl.mul(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); + return euint8.wrap(Impl.mul(euint8.unwrap(a), euint8.unwrap(b), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates and(euint8 a, euint8 b) and returns the result. */ - function and(euint4 a, euint8 b) internal returns (euint8) { + function and(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return euint8.wrap(Impl.and(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); + return euint8.wrap(Impl.and(euint8.unwrap(a), euint8.unwrap(b), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates or(euint8 a, euint8 b) and returns the result. */ - function or(euint4 a, euint8 b) internal returns (euint8) { + function or(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return euint8.wrap(Impl.or(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); + return euint8.wrap(Impl.or(euint8.unwrap(a), euint8.unwrap(b), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates xor(euint8 a, euint8 b) and returns the result. */ - function xor(euint4 a, euint8 b) internal returns (euint8) { + function xor(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return euint8.wrap(Impl.xor(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); + return euint8.wrap(Impl.xor(euint8.unwrap(a), euint8.unwrap(b), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates eq(euint8 a, euint8 b) and returns the result. */ - function eq(euint4 a, euint8 b) internal returns (ebool) { + function eq(euint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return ebool.wrap(Impl.eq(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint8.unwrap(a), euint8.unwrap(b), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates ne(euint8 a, euint8 b) and returns the result. */ - function ne(euint4 a, euint8 b) internal returns (ebool) { + function ne(euint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return ebool.wrap(Impl.ne(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint8.unwrap(a), euint8.unwrap(b), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates ge(euint8 a, euint8 b) and returns the result. */ - function ge(euint4 a, euint8 b) internal returns (ebool) { + function ge(euint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return ebool.wrap(Impl.ge(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint8.unwrap(a), euint8.unwrap(b), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates gt(euint8 a, euint8 b) and returns the result. */ - function gt(euint4 a, euint8 b) internal returns (ebool) { + function gt(euint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return ebool.wrap(Impl.gt(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint8.unwrap(a), euint8.unwrap(b), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates le(euint8 a, euint8 b) and returns the result. */ - function le(euint4 a, euint8 b) internal returns (ebool) { + function le(euint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return ebool.wrap(Impl.le(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); + return ebool.wrap(Impl.le(euint8.unwrap(a), euint8.unwrap(b), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates lt(euint8 a, euint8 b) and returns the result. */ - function lt(euint4 a, euint8 b) internal returns (ebool) { + function lt(euint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return ebool.wrap(Impl.lt(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint8.unwrap(a), euint8.unwrap(b), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates min(euint8 a, euint8 b) and returns the result. */ - function min(euint4 a, euint8 b) internal returns (euint8) { + function min(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return euint8.wrap(Impl.min(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); + return euint8.wrap(Impl.min(euint8.unwrap(a), euint8.unwrap(b), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates max(euint8 a, euint8 b) and returns the result. */ - function max(euint4 a, euint8 b) internal returns (euint8) { + function max(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return euint8.wrap(Impl.max(euint8.unwrap(asEuint8(a)), euint8.unwrap(b), false)); + return euint8.wrap(Impl.max(euint8.unwrap(a), euint8.unwrap(b), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates add(euint8 a, euint16 b) and returns the result. */ - function add(euint4 a, euint16 b) internal returns (euint16) { + function add(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint16(0); @@ -513,11 +378,11 @@ library TFHE { } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates sub(euint8 a, euint16 b) and returns the result. */ - function sub(euint4 a, euint16 b) internal returns (euint16) { + function sub(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint16(0); @@ -526,11 +391,11 @@ library TFHE { } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates mul(euint8 a, euint16 b) and returns the result. */ - function mul(euint4 a, euint16 b) internal returns (euint16) { + function mul(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint16(0); @@ -539,11 +404,11 @@ library TFHE { } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates and(euint8 a, euint16 b) and returns the result. */ - function and(euint4 a, euint16 b) internal returns (euint16) { + function and(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint16(0); @@ -552,11 +417,11 @@ library TFHE { } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates or(euint8 a, euint16 b) and returns the result. */ - function or(euint4 a, euint16 b) internal returns (euint16) { + function or(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint16(0); @@ -565,11 +430,11 @@ library TFHE { } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates xor(euint8 a, euint16 b) and returns the result. */ - function xor(euint4 a, euint16 b) internal returns (euint16) { + function xor(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint16(0); @@ -578,11 +443,11 @@ library TFHE { } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates eq(euint8 a, euint16 b) and returns the result. */ - function eq(euint4 a, euint16 b) internal returns (ebool) { + function eq(euint8 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint16(0); @@ -591,11 +456,11 @@ library TFHE { } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates ne(euint8 a, euint16 b) and returns the result. */ - function ne(euint4 a, euint16 b) internal returns (ebool) { + function ne(euint8 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint16(0); @@ -604,11 +469,11 @@ library TFHE { } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates ge(euint8 a, euint16 b) and returns the result. */ - function ge(euint4 a, euint16 b) internal returns (ebool) { + function ge(euint8 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint16(0); @@ -617,11 +482,11 @@ library TFHE { } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates gt(euint8 a, euint16 b) and returns the result. */ - function gt(euint4 a, euint16 b) internal returns (ebool) { + function gt(euint8 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint16(0); @@ -630,11 +495,11 @@ library TFHE { } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates le(euint8 a, euint16 b) and returns the result. */ - function le(euint4 a, euint16 b) internal returns (ebool) { + function le(euint8 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint16(0); @@ -643,11 +508,11 @@ library TFHE { } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates lt(euint8 a, euint16 b) and returns the result. */ - function lt(euint4 a, euint16 b) internal returns (ebool) { + function lt(euint8 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint16(0); @@ -656,11 +521,11 @@ library TFHE { } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates min(euint8 a, euint16 b) and returns the result. */ - function min(euint4 a, euint16 b) internal returns (euint16) { + function min(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint16(0); @@ -669,11 +534,11 @@ library TFHE { } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates max(euint8 a, euint16 b) and returns the result. */ - function max(euint4 a, euint16 b) internal returns (euint16) { + function max(euint8 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint16(0); @@ -682,11 +547,11 @@ library TFHE { } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates add(euint8 a, euint32 b) and returns the result. */ - function add(euint4 a, euint32 b) internal returns (euint32) { + function add(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint32(0); @@ -695,11 +560,11 @@ library TFHE { } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates sub(euint8 a, euint32 b) and returns the result. */ - function sub(euint4 a, euint32 b) internal returns (euint32) { + function sub(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint32(0); @@ -708,11 +573,11 @@ library TFHE { } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates mul(euint8 a, euint32 b) and returns the result. */ - function mul(euint4 a, euint32 b) internal returns (euint32) { + function mul(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint32(0); @@ -721,11 +586,11 @@ library TFHE { } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates and(euint8 a, euint32 b) and returns the result. */ - function and(euint4 a, euint32 b) internal returns (euint32) { + function and(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint32(0); @@ -734,11 +599,11 @@ library TFHE { } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates or(euint8 a, euint32 b) and returns the result. */ - function or(euint4 a, euint32 b) internal returns (euint32) { + function or(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint32(0); @@ -747,11 +612,11 @@ library TFHE { } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates xor(euint8 a, euint32 b) and returns the result. */ - function xor(euint4 a, euint32 b) internal returns (euint32) { + function xor(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint32(0); @@ -760,11 +625,11 @@ library TFHE { } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates eq(euint8 a, euint32 b) and returns the result. */ - function eq(euint4 a, euint32 b) internal returns (ebool) { + function eq(euint8 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint32(0); @@ -773,11 +638,11 @@ library TFHE { } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates ne(euint8 a, euint32 b) and returns the result. */ - function ne(euint4 a, euint32 b) internal returns (ebool) { + function ne(euint8 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint32(0); @@ -786,11 +651,11 @@ library TFHE { } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates ge(euint8 a, euint32 b) and returns the result. */ - function ge(euint4 a, euint32 b) internal returns (ebool) { + function ge(euint8 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint32(0); @@ -799,11 +664,11 @@ library TFHE { } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates gt(euint8 a, euint32 b) and returns the result. */ - function gt(euint4 a, euint32 b) internal returns (ebool) { + function gt(euint8 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint32(0); @@ -812,11 +677,11 @@ library TFHE { } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates le(euint8 a, euint32 b) and returns the result. */ - function le(euint4 a, euint32 b) internal returns (ebool) { + function le(euint8 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint32(0); @@ -825,11 +690,11 @@ library TFHE { } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates lt(euint8 a, euint32 b) and returns the result. */ - function lt(euint4 a, euint32 b) internal returns (ebool) { + function lt(euint8 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint32(0); @@ -838,11 +703,11 @@ library TFHE { } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates min(euint8 a, euint32 b) and returns the result. */ - function min(euint4 a, euint32 b) internal returns (euint32) { + function min(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint32(0); @@ -851,11 +716,11 @@ library TFHE { } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates max(euint8 a, euint32 b) and returns the result. */ - function max(euint4 a, euint32 b) internal returns (euint32) { + function max(euint8 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint32(0); @@ -864,11 +729,11 @@ library TFHE { } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates add(euint8 a, euint64 b) and returns the result. */ - function add(euint4 a, euint64 b) internal returns (euint64) { + function add(euint8 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint64(0); @@ -877,11 +742,11 @@ library TFHE { } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates sub(euint8 a, euint64 b) and returns the result. */ - function sub(euint4 a, euint64 b) internal returns (euint64) { + function sub(euint8 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint64(0); @@ -890,11 +755,11 @@ library TFHE { } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates mul(euint8 a, euint64 b) and returns the result. */ - function mul(euint4 a, euint64 b) internal returns (euint64) { + function mul(euint8 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint64(0); @@ -903,11 +768,11 @@ library TFHE { } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates and(euint8 a, euint64 b) and returns the result. */ - function and(euint4 a, euint64 b) internal returns (euint64) { + function and(euint8 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint64(0); @@ -916,11 +781,11 @@ library TFHE { } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates or(euint8 a, euint64 b) and returns the result. */ - function or(euint4 a, euint64 b) internal returns (euint64) { + function or(euint8 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint64(0); @@ -929,11 +794,11 @@ library TFHE { } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates xor(euint8 a, euint64 b) and returns the result. */ - function xor(euint4 a, euint64 b) internal returns (euint64) { + function xor(euint8 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint64(0); @@ -942,11 +807,11 @@ library TFHE { } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates eq(euint8 a, euint64 b) and returns the result. */ - function eq(euint4 a, euint64 b) internal returns (ebool) { + function eq(euint8 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint64(0); @@ -955,11 +820,11 @@ library TFHE { } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates ne(euint8 a, euint64 b) and returns the result. */ - function ne(euint4 a, euint64 b) internal returns (ebool) { + function ne(euint8 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint64(0); @@ -968,11 +833,11 @@ library TFHE { } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates ge(euint8 a, euint64 b) and returns the result. */ - function ge(euint4 a, euint64 b) internal returns (ebool) { + function ge(euint8 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint64(0); @@ -981,11 +846,11 @@ library TFHE { } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates gt(euint8 a, euint64 b) and returns the result. */ - function gt(euint4 a, euint64 b) internal returns (ebool) { + function gt(euint8 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint64(0); @@ -994,11 +859,11 @@ library TFHE { } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates le(euint8 a, euint64 b) and returns the result. */ - function le(euint4 a, euint64 b) internal returns (ebool) { + function le(euint8 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint64(0); @@ -1007,11 +872,11 @@ library TFHE { } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates lt(euint8 a, euint64 b) and returns the result. */ - function lt(euint4 a, euint64 b) internal returns (ebool) { + function lt(euint8 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint64(0); @@ -1020,11 +885,11 @@ library TFHE { } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates min(euint8 a, euint64 b) and returns the result. */ - function min(euint4 a, euint64 b) internal returns (euint64) { + function min(euint8 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint64(0); @@ -1033,11 +898,11 @@ library TFHE { } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates max(euint8 a, euint64 b) and returns the result. */ - function max(euint4 a, euint64 b) internal returns (euint64) { + function max(euint8 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint64(0); @@ -1046,11 +911,11 @@ library TFHE { } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates add(euint8 a, euint128 b) and returns the result. */ - function add(euint4 a, euint128 b) internal returns (euint128) { + function add(euint8 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -1059,11 +924,11 @@ library TFHE { } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates sub(euint8 a, euint128 b) and returns the result. */ - function sub(euint4 a, euint128 b) internal returns (euint128) { + function sub(euint8 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -1072,11 +937,11 @@ library TFHE { } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates mul(euint8 a, euint128 b) and returns the result. */ - function mul(euint4 a, euint128 b) internal returns (euint128) { + function mul(euint8 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -1085,11 +950,11 @@ library TFHE { } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates and(euint8 a, euint128 b) and returns the result. */ - function and(euint4 a, euint128 b) internal returns (euint128) { + function and(euint8 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -1098,11 +963,11 @@ library TFHE { } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates or(euint8 a, euint128 b) and returns the result. */ - function or(euint4 a, euint128 b) internal returns (euint128) { + function or(euint8 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -1111,11 +976,11 @@ library TFHE { } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates xor(euint8 a, euint128 b) and returns the result. */ - function xor(euint4 a, euint128 b) internal returns (euint128) { + function xor(euint8 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -1124,11 +989,11 @@ library TFHE { } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates eq(euint8 a, euint128 b) and returns the result. */ - function eq(euint4 a, euint128 b) internal returns (ebool) { + function eq(euint8 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -1137,11 +1002,11 @@ library TFHE { } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates ne(euint8 a, euint128 b) and returns the result. */ - function ne(euint4 a, euint128 b) internal returns (ebool) { + function ne(euint8 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -1150,11 +1015,11 @@ library TFHE { } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates ge(euint8 a, euint128 b) and returns the result. */ - function ge(euint4 a, euint128 b) internal returns (ebool) { + function ge(euint8 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -1163,11 +1028,11 @@ library TFHE { } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates gt(euint8 a, euint128 b) and returns the result. */ - function gt(euint4 a, euint128 b) internal returns (ebool) { + function gt(euint8 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -1176,11 +1041,11 @@ library TFHE { } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates le(euint8 a, euint128 b) and returns the result. */ - function le(euint4 a, euint128 b) internal returns (ebool) { + function le(euint8 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -1189,11 +1054,11 @@ library TFHE { } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates lt(euint8 a, euint128 b) and returns the result. */ - function lt(euint4 a, euint128 b) internal returns (ebool) { + function lt(euint8 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -1202,11 +1067,11 @@ library TFHE { } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates min(euint8 a, euint128 b) and returns the result. */ - function min(euint4 a, euint128 b) internal returns (euint128) { + function min(euint8 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -1215,11 +1080,11 @@ library TFHE { } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates max(euint8 a, euint128 b) and returns the result. */ - function max(euint4 a, euint128 b) internal returns (euint128) { + function max(euint8 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -1228,2979 +1093,2754 @@ library TFHE { } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates and(euint8 a, euint256 b) and returns the result. */ - function add(euint4 a, euint256 b) internal returns (euint256) { + function and(euint8 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint256(0); } - return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates or(euint8 a, euint256 b) and returns the result. */ - function sub(euint4 a, euint256 b) internal returns (euint256) { + function or(euint8 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint256(0); } - return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates xor(euint8 a, euint256 b) and returns the result. */ - function mul(euint4 a, euint256 b) internal returns (euint256) { + function xor(euint8 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint256(0); } - return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates eq(euint8 a, euint256 b) and returns the result. */ - function and(euint4 a, euint256 b) internal returns (euint256) { + function eq(euint8 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint256(0); } - return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates ne(euint8 a, euint256 b) and returns the result. */ - function or(euint4 a, euint256 b) internal returns (euint256) { + function ne(euint8 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint8(0); } if (!isInitialized(b)) { b = asEuint256(0); } - return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates add(euint16 a, euint8 b) and returns the result. */ - function xor(euint4 a, euint256 b) internal returns (euint256) { + function add(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint8(0); } - return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates sub(euint16 a, euint8 b) and returns the result. */ - function eq(euint4 a, euint256 b) internal returns (ebool) { + function sub(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint8(0); } - return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates mul(euint16 a, euint8 b) and returns the result. */ - function ne(euint4 a, euint256 b) internal returns (ebool) { + function mul(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint8(0); } - return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates and(euint16 a, euint8 b) and returns the result. */ - function ge(euint4 a, euint256 b) internal returns (ebool) { + function and(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint8(0); } - return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates or(euint16 a, euint8 b) and returns the result. */ - function gt(euint4 a, euint256 b) internal returns (ebool) { + function or(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint8(0); } - return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates xor(euint16 a, euint8 b) and returns the result. */ - function le(euint4 a, euint256 b) internal returns (ebool) { + function xor(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint8(0); } - return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates eq(euint16 a, euint8 b) and returns the result. */ - function lt(euint4 a, euint256 b) internal returns (ebool) { + function eq(euint16 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint8(0); } - return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates ne(euint16 a, euint8 b) and returns the result. */ - function min(euint4 a, euint256 b) internal returns (euint256) { + function ne(euint16 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint8(0); } - return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates ge(euint16 a, euint8 b) and returns the result. */ - function max(euint4 a, euint256 b) internal returns (euint256) { + function ge(euint16 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint8(0); } - return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates gt(euint16 a, euint8 b) and returns the result. */ - function add(euint4 a, uint8 b) internal returns (euint4) { + function gt(euint16 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } - return euint4.wrap(Impl.add(euint4.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates add(a, b) and returns the result. - */ - function add(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint8(0); } - return euint4.wrap(Impl.add(euint4.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates le(euint16 a, euint8 b) and returns the result. */ - function sub(euint4 a, uint8 b) internal returns (euint4) { + function le(euint16 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } - return euint4.wrap(Impl.sub(euint4.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates sub(a, b) and returns the result. - */ - function sub(uint8 a, euint4 b) internal returns (euint4) { - euint4 aEnc = asEuint4(a); if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint8(0); } - return euint4.wrap(Impl.sub(euint4.unwrap(aEnc), euint4.unwrap(b), false)); + return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates lt(euint16 a, euint8 b) and returns the result. */ - function mul(euint4 a, uint8 b) internal returns (euint4) { + function lt(euint16 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } - return euint4.wrap(Impl.mul(euint4.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates mul(a, b) and returns the result. - */ - function mul(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint8(0); } - return euint4.wrap(Impl.mul(euint4.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } /** - * @dev Evaluates div(a, b) and returns the result. + * @dev Evaluates min(euint16 a, euint8 b) and returns the result. */ - function div(euint4 a, uint8 b) internal returns (euint4) { + function min(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); + } + if (!isInitialized(b)) { + b = asEuint8(0); } - return euint4.wrap(Impl.div(euint4.unwrap(a), bytes32(uint256(b)))); + return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } /** - * @dev Evaluates rem(a, b) and returns the result. + * @dev Evaluates max(euint16 a, euint8 b) and returns the result. */ - function rem(euint4 a, uint8 b) internal returns (euint4) { + function max(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } - return euint4.wrap(Impl.rem(euint4.unwrap(a), bytes32(uint256(b)))); + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates add(euint16 a, euint16 b) and returns the result. */ - function and(euint4 a, uint8 b) internal returns (euint4) { + function add(euint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } - return euint4.wrap(Impl.and(euint4.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint4.wrap(Impl.and(euint4.unwrap(b), bytes32(uint256(a)), true)); + return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(b), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates sub(euint16 a, euint16 b) and returns the result. */ - function or(euint4 a, uint8 b) internal returns (euint4) { + function sub(euint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } - return euint4.wrap(Impl.or(euint4.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint4.wrap(Impl.or(euint4.unwrap(b), bytes32(uint256(a)), true)); + return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(b), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates mul(euint16 a, euint16 b) and returns the result. */ - function xor(euint4 a, uint8 b) internal returns (euint4) { + function mul(euint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } - return euint4.wrap(Impl.xor(euint4.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint4.wrap(Impl.xor(euint4.unwrap(b), bytes32(uint256(a)), true)); + return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(b), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates and(euint16 a, euint16 b) and returns the result. */ - function eq(euint4 a, uint8 b) internal returns (ebool) { + function and(euint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } - return ebool.wrap(Impl.eq(euint4.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return ebool.wrap(Impl.eq(euint4.unwrap(b), bytes32(uint256(a)), true)); + return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(b), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates or(euint16 a, euint16 b) and returns the result. */ - function ne(euint4 a, uint8 b) internal returns (ebool) { + function or(euint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } - return ebool.wrap(Impl.ne(euint4.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return ebool.wrap(Impl.ne(euint4.unwrap(b), bytes32(uint256(a)), true)); + return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(b), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates xor(euint16 a, euint16 b) and returns the result. */ - function ge(euint4 a, uint8 b) internal returns (ebool) { + function xor(euint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } - return ebool.wrap(Impl.ge(euint4.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates ge(a, b) and returns the result. - */ - function ge(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return ebool.wrap(Impl.le(euint4.unwrap(b), bytes32(uint256(a)), true)); + return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(b), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates eq(euint16 a, euint16 b) and returns the result. */ - function gt(euint4 a, uint8 b) internal returns (ebool) { + function eq(euint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } - return ebool.wrap(Impl.gt(euint4.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates gt(a, b) and returns the result. - */ - function gt(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return ebool.wrap(Impl.lt(euint4.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(b), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates ne(euint16 a, euint16 b) and returns the result. */ - function le(euint4 a, uint8 b) internal returns (ebool) { + function ne(euint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } - return ebool.wrap(Impl.le(euint4.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates le(a, b) and returns the result. - */ - function le(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return ebool.wrap(Impl.ge(euint4.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(b), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates ge(euint16 a, euint16 b) and returns the result. */ - function lt(euint4 a, uint8 b) internal returns (ebool) { + function ge(euint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } - return ebool.wrap(Impl.lt(euint4.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates lt(a, b) and returns the result. - */ - function lt(uint8 a, euint4 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return ebool.wrap(Impl.gt(euint4.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(b), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates gt(euint16 a, euint16 b) and returns the result. */ - function min(euint4 a, uint8 b) internal returns (euint4) { + function gt(euint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } - return euint4.wrap(Impl.min(euint4.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates min(a, b) and returns the result. - */ - function min(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint4.wrap(Impl.min(euint4.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(b), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates le(euint16 a, euint16 b) and returns the result. */ - function max(euint4 a, uint8 b) internal returns (euint4) { + function le(euint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint4(0); + a = asEuint16(0); } - return euint4.wrap(Impl.max(euint4.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates max(a, b) and returns the result. - */ - function max(uint8 a, euint4 b) internal returns (euint4) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint4.wrap(Impl.max(euint4.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(b), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates lt(euint16 a, euint16 b) and returns the result. */ - function add(euint8 a, euint4 b) internal returns (euint8) { + function lt(euint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint8.wrap(Impl.add(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(b), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates min(euint16 a, euint16 b) and returns the result. */ - function sub(euint8 a, euint4 b) internal returns (euint8) { + function min(euint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint8.wrap(Impl.sub(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(b), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates max(euint16 a, euint16 b) and returns the result. */ - function mul(euint8 a, euint4 b) internal returns (euint8) { + function max(euint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint8.wrap(Impl.mul(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(b), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates add(euint16 a, euint32 b) and returns the result. */ - function and(euint8 a, euint4 b) internal returns (euint8) { + function add(euint16 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return euint8.wrap(Impl.and(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return euint32.wrap(Impl.add(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates sub(euint16 a, euint32 b) and returns the result. */ - function or(euint8 a, euint4 b) internal returns (euint8) { + function sub(euint16 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return euint8.wrap(Impl.or(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return euint32.wrap(Impl.sub(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates mul(euint16 a, euint32 b) and returns the result. */ - function xor(euint8 a, euint4 b) internal returns (euint8) { + function mul(euint16 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return euint8.wrap(Impl.xor(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return euint32.wrap(Impl.mul(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates and(euint16 a, euint32 b) and returns the result. */ - function eq(euint8 a, euint4 b) internal returns (ebool) { + function and(euint16 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return ebool.wrap(Impl.eq(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return euint32.wrap(Impl.and(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates or(euint16 a, euint32 b) and returns the result. */ - function ne(euint8 a, euint4 b) internal returns (ebool) { + function or(euint16 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return ebool.wrap(Impl.ne(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return euint32.wrap(Impl.or(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates xor(euint16 a, euint32 b) and returns the result. */ - function ge(euint8 a, euint4 b) internal returns (ebool) { + function xor(euint16 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return ebool.wrap(Impl.ge(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return euint32.wrap(Impl.xor(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates eq(euint16 a, euint32 b) and returns the result. */ - function gt(euint8 a, euint4 b) internal returns (ebool) { + function eq(euint16 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return ebool.wrap(Impl.gt(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return ebool.wrap(Impl.eq(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates ne(euint16 a, euint32 b) and returns the result. */ - function le(euint8 a, euint4 b) internal returns (ebool) { + function ne(euint16 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return ebool.wrap(Impl.le(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return ebool.wrap(Impl.ne(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates ge(euint16 a, euint32 b) and returns the result. */ - function lt(euint8 a, euint4 b) internal returns (ebool) { + function ge(euint16 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return ebool.wrap(Impl.lt(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return ebool.wrap(Impl.ge(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates gt(euint16 a, euint32 b) and returns the result. */ - function min(euint8 a, euint4 b) internal returns (euint8) { + function gt(euint16 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return euint8.wrap(Impl.min(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return ebool.wrap(Impl.gt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates le(euint16 a, euint32 b) and returns the result. */ - function max(euint8 a, euint4 b) internal returns (euint8) { + function le(euint16 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return euint8.wrap(Impl.max(euint8.unwrap(a), euint8.unwrap(asEuint8(b)), false)); + return ebool.wrap(Impl.le(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates lt(euint16 a, euint32 b) and returns the result. */ - function add(euint8 a, euint8 b) internal returns (euint8) { + function lt(euint16 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return euint8.wrap(Impl.add(euint8.unwrap(a), euint8.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates min(euint16 a, euint32 b) and returns the result. */ - function sub(euint8 a, euint8 b) internal returns (euint8) { + function min(euint16 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return euint8.wrap(Impl.sub(euint8.unwrap(a), euint8.unwrap(b), false)); + return euint32.wrap(Impl.min(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates max(euint16 a, euint32 b) and returns the result. */ - function mul(euint8 a, euint8 b) internal returns (euint8) { + function max(euint16 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return euint8.wrap(Impl.mul(euint8.unwrap(a), euint8.unwrap(b), false)); + return euint32.wrap(Impl.max(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates add(euint16 a, euint64 b) and returns the result. */ - function and(euint8 a, euint8 b) internal returns (euint8) { + function add(euint16 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return euint8.wrap(Impl.and(euint8.unwrap(a), euint8.unwrap(b), false)); + return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates sub(euint16 a, euint64 b) and returns the result. */ - function or(euint8 a, euint8 b) internal returns (euint8) { + function sub(euint16 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return euint8.wrap(Impl.or(euint8.unwrap(a), euint8.unwrap(b), false)); + return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates mul(euint16 a, euint64 b) and returns the result. */ - function xor(euint8 a, euint8 b) internal returns (euint8) { + function mul(euint16 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return euint8.wrap(Impl.xor(euint8.unwrap(a), euint8.unwrap(b), false)); + return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates and(euint16 a, euint64 b) and returns the result. */ - function eq(euint8 a, euint8 b) internal returns (ebool) { + function and(euint16 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return ebool.wrap(Impl.eq(euint8.unwrap(a), euint8.unwrap(b), false)); + return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates or(euint16 a, euint64 b) and returns the result. */ - function ne(euint8 a, euint8 b) internal returns (ebool) { + function or(euint16 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return ebool.wrap(Impl.ne(euint8.unwrap(a), euint8.unwrap(b), false)); + return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates xor(euint16 a, euint64 b) and returns the result. */ - function ge(euint8 a, euint8 b) internal returns (ebool) { + function xor(euint16 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return ebool.wrap(Impl.ge(euint8.unwrap(a), euint8.unwrap(b), false)); + return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates eq(euint16 a, euint64 b) and returns the result. */ - function gt(euint8 a, euint8 b) internal returns (ebool) { + function eq(euint16 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return ebool.wrap(Impl.gt(euint8.unwrap(a), euint8.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates ne(euint16 a, euint64 b) and returns the result. */ - function le(euint8 a, euint8 b) internal returns (ebool) { + function ne(euint16 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return ebool.wrap(Impl.le(euint8.unwrap(a), euint8.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates ge(euint16 a, euint64 b) and returns the result. */ - function lt(euint8 a, euint8 b) internal returns (ebool) { + function ge(euint16 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return ebool.wrap(Impl.lt(euint8.unwrap(a), euint8.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates gt(euint16 a, euint64 b) and returns the result. */ - function min(euint8 a, euint8 b) internal returns (euint8) { + function gt(euint16 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return euint8.wrap(Impl.min(euint8.unwrap(a), euint8.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates le(euint16 a, euint64 b) and returns the result. */ - function max(euint8 a, euint8 b) internal returns (euint8) { + function le(euint16 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return euint8.wrap(Impl.max(euint8.unwrap(a), euint8.unwrap(b), false)); + return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates lt(euint16 a, euint64 b) and returns the result. */ - function add(euint8 a, euint16 b) internal returns (euint16) { + function lt(euint16 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint64(0); } - return euint16.wrap(Impl.add(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates min(euint16 a, euint64 b) and returns the result. */ - function sub(euint8 a, euint16 b) internal returns (euint16) { + function min(euint16 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint64(0); } - return euint16.wrap(Impl.sub(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates max(euint16 a, euint64 b) and returns the result. */ - function mul(euint8 a, euint16 b) internal returns (euint16) { + function max(euint16 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint64(0); } - return euint16.wrap(Impl.mul(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates add(euint16 a, euint128 b) and returns the result. */ - function and(euint8 a, euint16 b) internal returns (euint16) { + function add(euint16 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return euint16.wrap(Impl.and(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates sub(euint16 a, euint128 b) and returns the result. */ - function or(euint8 a, euint16 b) internal returns (euint16) { + function sub(euint16 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return euint16.wrap(Impl.or(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates mul(euint16 a, euint128 b) and returns the result. */ - function xor(euint8 a, euint16 b) internal returns (euint16) { + function mul(euint16 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return euint16.wrap(Impl.xor(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates and(euint16 a, euint128 b) and returns the result. */ - function eq(euint8 a, euint16 b) internal returns (ebool) { + function and(euint16 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return ebool.wrap(Impl.eq(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates or(euint16 a, euint128 b) and returns the result. */ - function ne(euint8 a, euint16 b) internal returns (ebool) { + function or(euint16 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return ebool.wrap(Impl.ne(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates xor(euint16 a, euint128 b) and returns the result. */ - function ge(euint8 a, euint16 b) internal returns (ebool) { + function xor(euint16 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return ebool.wrap(Impl.ge(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates eq(euint16 a, euint128 b) and returns the result. */ - function gt(euint8 a, euint16 b) internal returns (ebool) { + function eq(euint16 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return ebool.wrap(Impl.gt(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates ne(euint16 a, euint128 b) and returns the result. */ - function le(euint8 a, euint16 b) internal returns (ebool) { + function ne(euint16 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return ebool.wrap(Impl.le(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates ge(euint16 a, euint128 b) and returns the result. */ - function lt(euint8 a, euint16 b) internal returns (ebool) { + function ge(euint16 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return ebool.wrap(Impl.lt(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates gt(euint16 a, euint128 b) and returns the result. */ - function min(euint8 a, euint16 b) internal returns (euint16) { + function gt(euint16 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return euint16.wrap(Impl.min(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates le(euint16 a, euint128 b) and returns the result. */ - function max(euint8 a, euint16 b) internal returns (euint16) { + function le(euint16 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return euint16.wrap(Impl.max(euint16.unwrap(asEuint16(a)), euint16.unwrap(b), false)); + return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates lt(euint16 a, euint128 b) and returns the result. */ - function add(euint8 a, euint32 b) internal returns (euint32) { + function lt(euint16 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return euint32.wrap(Impl.add(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates min(euint16 a, euint128 b) and returns the result. */ - function sub(euint8 a, euint32 b) internal returns (euint32) { + function min(euint16 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return euint32.wrap(Impl.sub(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates max(euint16 a, euint128 b) and returns the result. */ - function mul(euint8 a, euint32 b) internal returns (euint32) { + function max(euint16 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return euint32.wrap(Impl.mul(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates and(euint16 a, euint256 b) and returns the result. */ - function and(euint8 a, euint32 b) internal returns (euint32) { + function and(euint16 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint256(0); } - return euint32.wrap(Impl.and(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates or(euint16 a, euint256 b) and returns the result. */ - function or(euint8 a, euint32 b) internal returns (euint32) { + function or(euint16 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint256(0); } - return euint32.wrap(Impl.or(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates xor(euint16 a, euint256 b) and returns the result. */ - function xor(euint8 a, euint32 b) internal returns (euint32) { + function xor(euint16 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint256(0); } - return euint32.wrap(Impl.xor(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates eq(euint16 a, euint256 b) and returns the result. */ - function eq(euint8 a, euint32 b) internal returns (ebool) { + function eq(euint16 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint256(0); } - return ebool.wrap(Impl.eq(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates ne(euint16 a, euint256 b) and returns the result. */ - function ne(euint8 a, euint32 b) internal returns (ebool) { + function ne(euint16 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint256(0); } - return ebool.wrap(Impl.ne(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates add(euint32 a, euint8 b) and returns the result. */ - function ge(euint8 a, euint32 b) internal returns (ebool) { + function add(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.ge(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates sub(euint32 a, euint8 b) and returns the result. */ - function gt(euint8 a, euint32 b) internal returns (ebool) { + function sub(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.gt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates mul(euint32 a, euint8 b) and returns the result. */ - function le(euint8 a, euint32 b) internal returns (ebool) { + function mul(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.le(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates and(euint32 a, euint8 b) and returns the result. */ - function lt(euint8 a, euint32 b) internal returns (ebool) { + function and(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.lt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates or(euint32 a, euint8 b) and returns the result. */ - function min(euint8 a, euint32 b) internal returns (euint32) { + function or(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.min(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates xor(euint32 a, euint8 b) and returns the result. */ - function max(euint8 a, euint32 b) internal returns (euint32) { + function xor(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.max(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates eq(euint32 a, euint8 b) and returns the result. */ - function add(euint8 a, euint64 b) internal returns (euint64) { + function eq(euint32 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint8(0); } - return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates ne(euint32 a, euint8 b) and returns the result. */ - function sub(euint8 a, euint64 b) internal returns (euint64) { + function ne(euint32 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint8(0); } - return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates ge(euint32 a, euint8 b) and returns the result. */ - function mul(euint8 a, euint64 b) internal returns (euint64) { + function ge(euint32 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint8(0); } - return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates gt(euint32 a, euint8 b) and returns the result. */ - function and(euint8 a, euint64 b) internal returns (euint64) { + function gt(euint32 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint8(0); } - return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates le(euint32 a, euint8 b) and returns the result. */ - function or(euint8 a, euint64 b) internal returns (euint64) { + function le(euint32 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint8(0); } - return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates lt(euint32 a, euint8 b) and returns the result. */ - function xor(euint8 a, euint64 b) internal returns (euint64) { + function lt(euint32 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint8(0); } - return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates min(euint32 a, euint8 b) and returns the result. */ - function eq(euint8 a, euint64 b) internal returns (ebool) { + function min(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint8(0); } - return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates max(euint32 a, euint8 b) and returns the result. */ - function ne(euint8 a, euint64 b) internal returns (ebool) { + function max(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint8(0); } - return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates add(euint32 a, euint16 b) and returns the result. */ - function ge(euint8 a, euint64 b) internal returns (ebool) { + function add(euint32 a, euint16 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates sub(euint32 a, euint16 b) and returns the result. */ - function gt(euint8 a, euint64 b) internal returns (ebool) { + function sub(euint32 a, euint16 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates mul(euint32 a, euint16 b) and returns the result. */ - function le(euint8 a, euint64 b) internal returns (ebool) { + function mul(euint32 a, euint16 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates and(euint32 a, euint16 b) and returns the result. */ - function lt(euint8 a, euint64 b) internal returns (ebool) { + function and(euint32 a, euint16 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates or(euint32 a, euint16 b) and returns the result. */ - function min(euint8 a, euint64 b) internal returns (euint64) { + function or(euint32 a, euint16 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates xor(euint32 a, euint16 b) and returns the result. */ - function max(euint8 a, euint64 b) internal returns (euint64) { + function xor(euint32 a, euint16 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates eq(euint32 a, euint16 b) and returns the result. */ - function add(euint8 a, euint128 b) internal returns (euint128) { + function eq(euint32 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint16(0); } - return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates ne(euint32 a, euint16 b) and returns the result. */ - function sub(euint8 a, euint128 b) internal returns (euint128) { + function ne(euint32 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint16(0); } - return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates ge(euint32 a, euint16 b) and returns the result. */ - function mul(euint8 a, euint128 b) internal returns (euint128) { + function ge(euint32 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint16(0); } - return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates gt(euint32 a, euint16 b) and returns the result. */ - function and(euint8 a, euint128 b) internal returns (euint128) { + function gt(euint32 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint16(0); } - return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates le(euint32 a, euint16 b) and returns the result. */ - function or(euint8 a, euint128 b) internal returns (euint128) { + function le(euint32 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint16(0); } - return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates lt(euint32 a, euint16 b) and returns the result. */ - function xor(euint8 a, euint128 b) internal returns (euint128) { + function lt(euint32 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint16(0); } - return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates min(euint32 a, euint16 b) and returns the result. */ - function eq(euint8 a, euint128 b) internal returns (ebool) { + function min(euint32 a, euint16 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint16(0); } - return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates max(euint32 a, euint16 b) and returns the result. */ - function ne(euint8 a, euint128 b) internal returns (ebool) { + function max(euint32 a, euint16 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint16(0); } - return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates add(euint32 a, euint32 b) and returns the result. */ - function ge(euint8 a, euint128 b) internal returns (ebool) { + function add(euint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint32(0); } - return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(b), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates sub(euint32 a, euint32 b) and returns the result. */ - function gt(euint8 a, euint128 b) internal returns (ebool) { + function sub(euint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint32(0); } - return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(b), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates mul(euint32 a, euint32 b) and returns the result. */ - function le(euint8 a, euint128 b) internal returns (ebool) { + function mul(euint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint32(0); } - return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(b), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates and(euint32 a, euint32 b) and returns the result. */ - function lt(euint8 a, euint128 b) internal returns (ebool) { + function and(euint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint32(0); } - return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(b), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates or(euint32 a, euint32 b) and returns the result. */ - function min(euint8 a, euint128 b) internal returns (euint128) { + function or(euint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint32(0); } - return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(b), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates xor(euint32 a, euint32 b) and returns the result. */ - function max(euint8 a, euint128 b) internal returns (euint128) { + function xor(euint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint32(0); } - return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(b), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates eq(euint32 a, euint32 b) and returns the result. */ - function add(euint8 a, euint256 b) internal returns (euint256) { + function eq(euint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint32(0); } - return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(b), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates ne(euint32 a, euint32 b) and returns the result. */ - function sub(euint8 a, euint256 b) internal returns (euint256) { + function ne(euint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint32(0); } - return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(b), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates ge(euint32 a, euint32 b) and returns the result. */ - function mul(euint8 a, euint256 b) internal returns (euint256) { + function ge(euint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint32(0); } - return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(b), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates gt(euint32 a, euint32 b) and returns the result. */ - function and(euint8 a, euint256 b) internal returns (euint256) { + function gt(euint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint32(0); } - return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(b), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates le(euint32 a, euint32 b) and returns the result. */ - function or(euint8 a, euint256 b) internal returns (euint256) { + function le(euint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint32(0); } - return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(b), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates lt(euint32 a, euint32 b) and returns the result. */ - function xor(euint8 a, euint256 b) internal returns (euint256) { + function lt(euint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint32(0); } - return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(b), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates min(euint32 a, euint32 b) and returns the result. */ - function eq(euint8 a, euint256 b) internal returns (ebool) { + function min(euint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint32(0); } - return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(b), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates max(euint32 a, euint32 b) and returns the result. */ - function ne(euint8 a, euint256 b) internal returns (ebool) { + function max(euint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint32(0); } - return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(b), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates add(euint32 a, euint64 b) and returns the result. */ - function ge(euint8 a, euint256 b) internal returns (ebool) { + function add(euint32 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint64(0); } - return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates sub(euint32 a, euint64 b) and returns the result. */ - function gt(euint8 a, euint256 b) internal returns (ebool) { + function sub(euint32 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint64(0); } - return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates mul(euint32 a, euint64 b) and returns the result. */ - function le(euint8 a, euint256 b) internal returns (ebool) { + function mul(euint32 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint64(0); } - return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates and(euint32 a, euint64 b) and returns the result. */ - function lt(euint8 a, euint256 b) internal returns (ebool) { + function and(euint32 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint64(0); } - return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates or(euint32 a, euint64 b) and returns the result. */ - function min(euint8 a, euint256 b) internal returns (euint256) { + function or(euint32 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint64(0); } - return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates xor(euint32 a, euint64 b) and returns the result. */ - function max(euint8 a, euint256 b) internal returns (euint256) { + function xor(euint32 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint64(0); } - return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates eq(euint32 a, euint64 b) and returns the result. */ - function add(euint8 a, uint8 b) internal returns (euint8) { + function eq(euint32 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } - return euint8.wrap(Impl.add(euint8.unwrap(a), bytes32(uint256(b)), true)); + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates ne(euint32 a, euint64 b) and returns the result. */ - function add(uint8 a, euint8 b) internal returns (euint8) { + function ne(euint32 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return euint8.wrap(Impl.add(euint8.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates ge(euint32 a, euint64 b) and returns the result. */ - function sub(euint8 a, uint8 b) internal returns (euint8) { + function ge(euint32 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } - return euint8.wrap(Impl.sub(euint8.unwrap(a), bytes32(uint256(b)), true)); + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates gt(euint32 a, euint64 b) and returns the result. */ - function sub(uint8 a, euint8 b) internal returns (euint8) { - euint8 aEnc = asEuint8(a); + function gt(euint32 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return euint8.wrap(Impl.sub(euint8.unwrap(aEnc), euint8.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates le(euint32 a, euint64 b) and returns the result. */ - function mul(euint8 a, uint8 b) internal returns (euint8) { + function le(euint32 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } - return euint8.wrap(Impl.mul(euint8.unwrap(a), bytes32(uint256(b)), true)); + if (!isInitialized(b)) { + b = asEuint64(0); + } + return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates lt(euint32 a, euint64 b) and returns the result. */ - function mul(uint8 a, euint8 b) internal returns (euint8) { + function lt(euint32 a, euint64 b) internal returns (ebool) { + if (!isInitialized(a)) { + a = asEuint32(0); + } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return euint8.wrap(Impl.mul(euint8.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates div(a, b) and returns the result. + * @dev Evaluates min(euint32 a, euint64 b) and returns the result. */ - function div(euint8 a, uint8 b) internal returns (euint8) { + function min(euint32 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } - return euint8.wrap(Impl.div(euint8.unwrap(a), bytes32(uint256(b)))); + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates rem(a, b) and returns the result. + * @dev Evaluates max(euint32 a, euint64 b) and returns the result. */ - function rem(euint8 a, uint8 b) internal returns (euint8) { + function max(euint32 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } - return euint8.wrap(Impl.rem(euint8.unwrap(a), bytes32(uint256(b)))); + if (!isInitialized(b)) { + b = asEuint64(0); + } + return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates add(euint32 a, euint128 b) and returns the result. */ - function and(euint8 a, uint8 b) internal returns (euint8) { + function add(euint32 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } - return euint8.wrap(Impl.and(euint8.unwrap(a), bytes32(uint256(b)), true)); + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates sub(euint32 a, euint128 b) and returns the result. */ - function and(uint8 a, euint8 b) internal returns (euint8) { + function sub(euint32 a, euint128 b) internal returns (euint128) { + if (!isInitialized(a)) { + a = asEuint32(0); + } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint128(0); } - return euint8.wrap(Impl.and(euint8.unwrap(b), bytes32(uint256(a)), true)); + return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates mul(euint32 a, euint128 b) and returns the result. */ - function or(euint8 a, uint8 b) internal returns (euint8) { + function mul(euint32 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } - return euint8.wrap(Impl.or(euint8.unwrap(a), bytes32(uint256(b)), true)); + if (!isInitialized(b)) { + b = asEuint128(0); + } + return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates and(euint32 a, euint128 b) and returns the result. */ - function or(uint8 a, euint8 b) internal returns (euint8) { - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint8.wrap(Impl.or(euint8.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(euint8 a, uint8 b) internal returns (euint8) { + function and(euint32 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } - return euint8.wrap(Impl.xor(euint8.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint128(0); } - return euint8.wrap(Impl.xor(euint8.unwrap(b), bytes32(uint256(a)), true)); + return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates or(euint32 a, euint128 b) and returns the result. */ - function eq(euint8 a, uint8 b) internal returns (ebool) { + function or(euint32 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } - return ebool.wrap(Impl.eq(euint8.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint128(0); } - return ebool.wrap(Impl.eq(euint8.unwrap(b), bytes32(uint256(a)), true)); + return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates xor(euint32 a, euint128 b) and returns the result. */ - function ne(euint8 a, uint8 b) internal returns (ebool) { + function xor(euint32 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } - return ebool.wrap(Impl.ne(euint8.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint128(0); } - return ebool.wrap(Impl.ne(euint8.unwrap(b), bytes32(uint256(a)), true)); + return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates eq(euint32 a, euint128 b) and returns the result. */ - function ge(euint8 a, uint8 b) internal returns (ebool) { + function eq(euint32 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } - return ebool.wrap(Impl.ge(euint8.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates ge(a, b) and returns the result. - */ - function ge(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint128(0); } - return ebool.wrap(Impl.le(euint8.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates ne(euint32 a, euint128 b) and returns the result. */ - function gt(euint8 a, uint8 b) internal returns (ebool) { + function ne(euint32 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } - return ebool.wrap(Impl.gt(euint8.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates gt(a, b) and returns the result. - */ - function gt(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint128(0); } - return ebool.wrap(Impl.lt(euint8.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates ge(euint32 a, euint128 b) and returns the result. */ - function le(euint8 a, uint8 b) internal returns (ebool) { + function ge(euint32 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } - return ebool.wrap(Impl.le(euint8.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates le(a, b) and returns the result. - */ - function le(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint128(0); } - return ebool.wrap(Impl.ge(euint8.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates gt(euint32 a, euint128 b) and returns the result. */ - function lt(euint8 a, uint8 b) internal returns (ebool) { + function gt(euint32 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } - return ebool.wrap(Impl.lt(euint8.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates lt(a, b) and returns the result. - */ - function lt(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint128(0); } - return ebool.wrap(Impl.gt(euint8.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates le(euint32 a, euint128 b) and returns the result. */ - function min(euint8 a, uint8 b) internal returns (euint8) { + function le(euint32 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } - return euint8.wrap(Impl.min(euint8.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates min(a, b) and returns the result. - */ - function min(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint128(0); } - return euint8.wrap(Impl.min(euint8.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates lt(euint32 a, euint128 b) and returns the result. */ - function max(euint8 a, uint8 b) internal returns (euint8) { + function lt(euint32 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint8(0); + a = asEuint32(0); } - return euint8.wrap(Impl.max(euint8.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates max(a, b) and returns the result. - */ - function max(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint128(0); } - return euint8.wrap(Impl.max(euint8.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates min(euint32 a, euint128 b) and returns the result. */ - function add(euint16 a, euint4 b) internal returns (euint16) { + function min(euint32 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint128(0); } - return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates max(euint32 a, euint128 b) and returns the result. */ - function sub(euint16 a, euint4 b) internal returns (euint16) { + function max(euint32 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint128(0); } - return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates and(euint32 a, euint256 b) and returns the result. */ - function mul(euint16 a, euint4 b) internal returns (euint16) { + function and(euint32 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint256(0); } - return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates or(euint32 a, euint256 b) and returns the result. */ - function and(euint16 a, euint4 b) internal returns (euint16) { + function or(euint32 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint256(0); } - return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates xor(euint32 a, euint256 b) and returns the result. */ - function or(euint16 a, euint4 b) internal returns (euint16) { + function xor(euint32 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint256(0); } - return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates eq(euint32 a, euint256 b) and returns the result. */ - function xor(euint16 a, euint4 b) internal returns (euint16) { + function eq(euint32 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint256(0); } - return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates ne(euint32 a, euint256 b) and returns the result. */ - function eq(euint16 a, euint4 b) internal returns (ebool) { + function ne(euint32 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint32(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint256(0); } - return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates add(euint64 a, euint8 b) and returns the result. */ - function ne(euint16 a, euint4 b) internal returns (ebool) { + function add(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint8(0); } - return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates sub(euint64 a, euint8 b) and returns the result. */ - function ge(euint16 a, euint4 b) internal returns (ebool) { + function sub(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint8(0); } - return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates mul(euint64 a, euint8 b) and returns the result. */ - function gt(euint16 a, euint4 b) internal returns (ebool) { + function mul(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint8(0); } - return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates and(euint64 a, euint8 b) and returns the result. */ - function le(euint16 a, euint4 b) internal returns (ebool) { + function and(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint8(0); } - return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates or(euint64 a, euint8 b) and returns the result. */ - function lt(euint16 a, euint4 b) internal returns (ebool) { + function or(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint8(0); } - return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates xor(euint64 a, euint8 b) and returns the result. */ - function min(euint16 a, euint4 b) internal returns (euint16) { + function xor(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint8(0); } - return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates eq(euint64 a, euint8 b) and returns the result. */ - function max(euint16 a, euint4 b) internal returns (euint16) { + function eq(euint64 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint8(0); } - return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates ne(euint64 a, euint8 b) and returns the result. */ - function add(euint16 a, euint8 b) internal returns (euint16) { + function ne(euint64 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates ge(euint64 a, euint8 b) and returns the result. */ - function sub(euint16 a, euint8 b) internal returns (euint16) { + function ge(euint64 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates gt(euint64 a, euint8 b) and returns the result. */ - function mul(euint16 a, euint8 b) internal returns (euint16) { + function gt(euint64 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates le(euint64 a, euint8 b) and returns the result. */ - function and(euint16 a, euint8 b) internal returns (euint16) { + function le(euint64 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates lt(euint64 a, euint8 b) and returns the result. */ - function or(euint16 a, euint8 b) internal returns (euint16) { + function lt(euint64 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates min(euint64 a, euint8 b) and returns the result. */ - function xor(euint16 a, euint8 b) internal returns (euint16) { + function min(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates max(euint64 a, euint8 b) and returns the result. */ - function eq(euint16 a, euint8 b) internal returns (ebool) { + function max(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates add(euint64 a, euint16 b) and returns the result. */ - function ne(euint16 a, euint8 b) internal returns (ebool) { + function add(euint64 a, euint16 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint16(0); } - return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates sub(euint64 a, euint16 b) and returns the result. */ - function ge(euint16 a, euint8 b) internal returns (ebool) { + function sub(euint64 a, euint16 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint16(0); } - return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates mul(euint64 a, euint16 b) and returns the result. */ - function gt(euint16 a, euint8 b) internal returns (ebool) { + function mul(euint64 a, euint16 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint16(0); } - return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates and(euint64 a, euint16 b) and returns the result. */ - function le(euint16 a, euint8 b) internal returns (ebool) { + function and(euint64 a, euint16 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint16(0); } - return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates or(euint64 a, euint16 b) and returns the result. */ - function lt(euint16 a, euint8 b) internal returns (ebool) { + function or(euint64 a, euint16 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint16(0); } - return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates xor(euint64 a, euint16 b) and returns the result. */ - function min(euint16 a, euint8 b) internal returns (euint16) { + function xor(euint64 a, euint16 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint16(0); } - return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates eq(euint64 a, euint16 b) and returns the result. */ - function max(euint16 a, euint8 b) internal returns (euint16) { + function eq(euint64 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint16(0); } - return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); + return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates ne(euint64 a, euint16 b) and returns the result. */ - function add(euint16 a, euint16 b) internal returns (euint16) { + function ne(euint64 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint16(0); } - return euint16.wrap(Impl.add(euint16.unwrap(a), euint16.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates ge(euint64 a, euint16 b) and returns the result. */ - function sub(euint16 a, euint16 b) internal returns (euint16) { + function ge(euint64 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint16(0); } - return euint16.wrap(Impl.sub(euint16.unwrap(a), euint16.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates gt(euint64 a, euint16 b) and returns the result. */ - function mul(euint16 a, euint16 b) internal returns (euint16) { + function gt(euint64 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint16(0); } - return euint16.wrap(Impl.mul(euint16.unwrap(a), euint16.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates le(euint64 a, euint16 b) and returns the result. */ - function and(euint16 a, euint16 b) internal returns (euint16) { + function le(euint64 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint16(0); } - return euint16.wrap(Impl.and(euint16.unwrap(a), euint16.unwrap(b), false)); + return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates lt(euint64 a, euint16 b) and returns the result. */ - function or(euint16 a, euint16 b) internal returns (euint16) { + function lt(euint64 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint16(0); } - return euint16.wrap(Impl.or(euint16.unwrap(a), euint16.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates min(euint64 a, euint16 b) and returns the result. */ - function xor(euint16 a, euint16 b) internal returns (euint16) { + function min(euint64 a, euint16 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint16(0); } - return euint16.wrap(Impl.xor(euint16.unwrap(a), euint16.unwrap(b), false)); + return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates max(euint64 a, euint16 b) and returns the result. */ - function eq(euint16 a, euint16 b) internal returns (ebool) { + function max(euint64 a, euint16 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint16(0); } - return ebool.wrap(Impl.eq(euint16.unwrap(a), euint16.unwrap(b), false)); + return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates add(euint64 a, euint32 b) and returns the result. */ - function ne(euint16 a, euint16 b) internal returns (ebool) { + function add(euint64 a, euint32 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return ebool.wrap(Impl.ne(euint16.unwrap(a), euint16.unwrap(b), false)); + return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates sub(euint64 a, euint32 b) and returns the result. */ - function ge(euint16 a, euint16 b) internal returns (ebool) { + function sub(euint64 a, euint32 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return ebool.wrap(Impl.ge(euint16.unwrap(a), euint16.unwrap(b), false)); + return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates mul(euint64 a, euint32 b) and returns the result. */ - function gt(euint16 a, euint16 b) internal returns (ebool) { + function mul(euint64 a, euint32 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return ebool.wrap(Impl.gt(euint16.unwrap(a), euint16.unwrap(b), false)); + return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates and(euint64 a, euint32 b) and returns the result. */ - function le(euint16 a, euint16 b) internal returns (ebool) { + function and(euint64 a, euint32 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return ebool.wrap(Impl.le(euint16.unwrap(a), euint16.unwrap(b), false)); + return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates or(euint64 a, euint32 b) and returns the result. */ - function lt(euint16 a, euint16 b) internal returns (ebool) { + function or(euint64 a, euint32 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return ebool.wrap(Impl.lt(euint16.unwrap(a), euint16.unwrap(b), false)); + return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates xor(euint64 a, euint32 b) and returns the result. */ - function min(euint16 a, euint16 b) internal returns (euint16) { + function xor(euint64 a, euint32 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return euint16.wrap(Impl.min(euint16.unwrap(a), euint16.unwrap(b), false)); + return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates eq(euint64 a, euint32 b) and returns the result. */ - function max(euint16 a, euint16 b) internal returns (euint16) { + function eq(euint64 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return euint16.wrap(Impl.max(euint16.unwrap(a), euint16.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates ne(euint64 a, euint32 b) and returns the result. */ - function add(euint16 a, euint32 b) internal returns (euint32) { + function ne(euint64 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint32(0); } - return euint32.wrap(Impl.add(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates ge(euint64 a, euint32 b) and returns the result. */ - function sub(euint16 a, euint32 b) internal returns (euint32) { + function ge(euint64 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint32(0); } - return euint32.wrap(Impl.sub(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates gt(euint64 a, euint32 b) and returns the result. */ - function mul(euint16 a, euint32 b) internal returns (euint32) { + function gt(euint64 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint32(0); } - return euint32.wrap(Impl.mul(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates le(euint64 a, euint32 b) and returns the result. */ - function and(euint16 a, euint32 b) internal returns (euint32) { + function le(euint64 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint32(0); } - return euint32.wrap(Impl.and(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates lt(euint64 a, euint32 b) and returns the result. */ - function or(euint16 a, euint32 b) internal returns (euint32) { + function lt(euint64 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint32(0); } - return euint32.wrap(Impl.or(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates min(euint64 a, euint32 b) and returns the result. */ - function xor(euint16 a, euint32 b) internal returns (euint32) { + function min(euint64 a, euint32 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint32(0); } - return euint32.wrap(Impl.xor(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates max(euint64 a, euint32 b) and returns the result. */ - function eq(euint16 a, euint32 b) internal returns (ebool) { + function max(euint64 a, euint32 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint32(0); } - return ebool.wrap(Impl.eq(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates add(euint64 a, euint64 b) and returns the result. */ - function ne(euint16 a, euint32 b) internal returns (ebool) { + function add(euint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint64(0); } - return ebool.wrap(Impl.ne(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(b), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates sub(euint64 a, euint64 b) and returns the result. */ - function ge(euint16 a, euint32 b) internal returns (ebool) { + function sub(euint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint64(0); } - return ebool.wrap(Impl.ge(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(b), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates mul(euint64 a, euint64 b) and returns the result. */ - function gt(euint16 a, euint32 b) internal returns (ebool) { + function mul(euint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint64(0); } - return ebool.wrap(Impl.gt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(b), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates and(euint64 a, euint64 b) and returns the result. */ - function le(euint16 a, euint32 b) internal returns (ebool) { + function and(euint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint64(0); } - return ebool.wrap(Impl.le(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(b), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates or(euint64 a, euint64 b) and returns the result. */ - function lt(euint16 a, euint32 b) internal returns (ebool) { + function or(euint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint64(0); } - return ebool.wrap(Impl.lt(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(b), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates xor(euint64 a, euint64 b) and returns the result. */ - function min(euint16 a, euint32 b) internal returns (euint32) { + function xor(euint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint64(0); } - return euint32.wrap(Impl.min(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(b), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates eq(euint64 a, euint64 b) and returns the result. */ - function max(euint16 a, euint32 b) internal returns (euint32) { + function eq(euint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint64(0); } - return euint32.wrap(Impl.max(euint32.unwrap(asEuint32(a)), euint32.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(b), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates ne(euint64 a, euint64 b) and returns the result. */ - function add(euint16 a, euint64 b) internal returns (euint64) { + function ne(euint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); - } - - /** - * @dev Evaluates sub(a, b) and returns the result. - */ - function sub(euint16 a, euint64 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint16(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); - } - - /** - * @dev Evaluates mul(a, b) and returns the result. - */ - function mul(euint16 a, euint64 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint16(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(euint16 a, euint64 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint16(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(euint16 a, euint64 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint16(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(euint16 a, euint64 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint16(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(euint16 a, euint64 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint16(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(euint16 a, euint64 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint64(0); } - return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(b), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates ge(euint64 a, euint64 b) and returns the result. */ - function ge(euint16 a, euint64 b) internal returns (ebool) { + function ge(euint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint64(0); } - return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(b), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates gt(euint64 a, euint64 b) and returns the result. */ - function gt(euint16 a, euint64 b) internal returns (ebool) { + function gt(euint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint64(0); } - return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(b), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates le(euint64 a, euint64 b) and returns the result. */ - function le(euint16 a, euint64 b) internal returns (ebool) { + function le(euint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint64(0); } - return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(b), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates lt(euint64 a, euint64 b) and returns the result. */ - function lt(euint16 a, euint64 b) internal returns (ebool) { + function lt(euint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint64(0); } - return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(b), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates min(euint64 a, euint64 b) and returns the result. */ - function min(euint16 a, euint64 b) internal returns (euint64) { + function min(euint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint64(0); } - return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(b), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates max(euint64 a, euint64 b) and returns the result. */ - function max(euint16 a, euint64 b) internal returns (euint64) { + function max(euint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint64(0); } - return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(b), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates add(euint64 a, euint128 b) and returns the result. */ - function add(euint16 a, euint128 b) internal returns (euint128) { + function add(euint64 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -4209,11 +3849,11 @@ library TFHE { } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates sub(euint64 a, euint128 b) and returns the result. */ - function sub(euint16 a, euint128 b) internal returns (euint128) { + function sub(euint64 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -4222,11 +3862,11 @@ library TFHE { } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates mul(euint64 a, euint128 b) and returns the result. */ - function mul(euint16 a, euint128 b) internal returns (euint128) { + function mul(euint64 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -4235,11 +3875,11 @@ library TFHE { } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates and(euint64 a, euint128 b) and returns the result. */ - function and(euint16 a, euint128 b) internal returns (euint128) { + function and(euint64 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -4248,11 +3888,11 @@ library TFHE { } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates or(euint64 a, euint128 b) and returns the result. */ - function or(euint16 a, euint128 b) internal returns (euint128) { + function or(euint64 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -4261,11 +3901,11 @@ library TFHE { } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates xor(euint64 a, euint128 b) and returns the result. */ - function xor(euint16 a, euint128 b) internal returns (euint128) { + function xor(euint64 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -4274,11 +3914,11 @@ library TFHE { } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates eq(euint64 a, euint128 b) and returns the result. */ - function eq(euint16 a, euint128 b) internal returns (ebool) { + function eq(euint64 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -4287,11 +3927,11 @@ library TFHE { } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates ne(euint64 a, euint128 b) and returns the result. */ - function ne(euint16 a, euint128 b) internal returns (ebool) { + function ne(euint64 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -4300,11 +3940,11 @@ library TFHE { } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates ge(euint64 a, euint128 b) and returns the result. */ - function ge(euint16 a, euint128 b) internal returns (ebool) { + function ge(euint64 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -4313,11 +3953,11 @@ library TFHE { } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates gt(euint64 a, euint128 b) and returns the result. */ - function gt(euint16 a, euint128 b) internal returns (ebool) { + function gt(euint64 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -4326,11 +3966,11 @@ library TFHE { } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates le(euint64 a, euint128 b) and returns the result. */ - function le(euint16 a, euint128 b) internal returns (ebool) { + function le(euint64 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -4339,11 +3979,11 @@ library TFHE { } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates lt(euint64 a, euint128 b) and returns the result. */ - function lt(euint16 a, euint128 b) internal returns (ebool) { + function lt(euint64 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -4352,11 +3992,11 @@ library TFHE { } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates min(euint64 a, euint128 b) and returns the result. */ - function min(euint16 a, euint128 b) internal returns (euint128) { + function min(euint64 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -4365,11 +4005,11 @@ library TFHE { } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates max(euint64 a, euint128 b) and returns the result. */ - function max(euint16 a, euint128 b) internal returns (euint128) { + function max(euint64 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint128(0); @@ -4378,8731 +4018,4770 @@ library TFHE { } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates and(euint64 a, euint256 b) and returns the result. */ - function add(euint16 a, euint256 b) internal returns (euint256) { + function and(euint64 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint256(0); } - return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates or(euint64 a, euint256 b) and returns the result. */ - function sub(euint16 a, euint256 b) internal returns (euint256) { + function or(euint64 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint256(0); } - return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates xor(euint64 a, euint256 b) and returns the result. */ - function mul(euint16 a, euint256 b) internal returns (euint256) { + function xor(euint64 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint256(0); } - return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates eq(euint64 a, euint256 b) and returns the result. */ - function and(euint16 a, euint256 b) internal returns (euint256) { + function eq(euint64 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint256(0); } - return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates ne(euint64 a, euint256 b) and returns the result. */ - function or(euint16 a, euint256 b) internal returns (euint256) { + function ne(euint64 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint256(0); } - return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates add(euint128 a, euint8 b) and returns the result. */ - function xor(euint16 a, euint256 b) internal returns (euint256) { + function add(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint8(0); } - return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates sub(euint128 a, euint8 b) and returns the result. */ - function eq(euint16 a, euint256 b) internal returns (ebool) { + function sub(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint8(0); } - return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates mul(euint128 a, euint8 b) and returns the result. */ - function ne(euint16 a, euint256 b) internal returns (ebool) { + function mul(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint8(0); } - return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates and(euint128 a, euint8 b) and returns the result. */ - function ge(euint16 a, euint256 b) internal returns (ebool) { + function and(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint8(0); } - return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates or(euint128 a, euint8 b) and returns the result. */ - function gt(euint16 a, euint256 b) internal returns (ebool) { + function or(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint8(0); } - return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates xor(euint128 a, euint8 b) and returns the result. */ - function le(euint16 a, euint256 b) internal returns (ebool) { + function xor(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint8(0); } - return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates eq(euint128 a, euint8 b) and returns the result. */ - function lt(euint16 a, euint256 b) internal returns (ebool) { + function eq(euint128 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint8(0); } - return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates ne(euint128 a, euint8 b) and returns the result. */ - function min(euint16 a, euint256 b) internal returns (euint256) { + function ne(euint128 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint8(0); } - return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates ge(euint128 a, euint8 b) and returns the result. */ - function max(euint16 a, euint256 b) internal returns (euint256) { + function ge(euint128 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint8(0); } - return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates gt(euint128 a, euint8 b) and returns the result. */ - function add(euint16 a, uint16 b) internal returns (euint16) { + function gt(euint128 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return euint16.wrap(Impl.add(euint16.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates add(a, b) and returns the result. - */ - function add(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint8(0); } - return euint16.wrap(Impl.add(euint16.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates le(euint128 a, euint8 b) and returns the result. */ - function sub(euint16 a, uint16 b) internal returns (euint16) { + function le(euint128 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return euint16.wrap(Impl.sub(euint16.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates sub(a, b) and returns the result. - */ - function sub(uint16 a, euint16 b) internal returns (euint16) { - euint16 aEnc = asEuint16(a); if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint8(0); } - return euint16.wrap(Impl.sub(euint16.unwrap(aEnc), euint16.unwrap(b), false)); + return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates lt(euint128 a, euint8 b) and returns the result. */ - function mul(euint16 a, uint16 b) internal returns (euint16) { + function lt(euint128 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return euint16.wrap(Impl.mul(euint16.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates mul(a, b) and returns the result. - */ - function mul(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint8(0); } - return euint16.wrap(Impl.mul(euint16.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates div(a, b) and returns the result. + * @dev Evaluates min(euint128 a, euint8 b) and returns the result. */ - function div(euint16 a, uint16 b) internal returns (euint16) { + function min(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return euint16.wrap(Impl.div(euint16.unwrap(a), bytes32(uint256(b)))); + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates rem(a, b) and returns the result. + * @dev Evaluates max(euint128 a, euint8 b) and returns the result. */ - function rem(euint16 a, uint16 b) internal returns (euint16) { + function max(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return euint16.wrap(Impl.rem(euint16.unwrap(a), bytes32(uint256(b)))); + if (!isInitialized(b)) { + b = asEuint8(0); + } + return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates add(euint128 a, euint16 b) and returns the result. */ - function and(euint16 a, uint16 b) internal returns (euint16) { + function add(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return euint16.wrap(Impl.and(euint16.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { b = asEuint16(0); } - return euint16.wrap(Impl.and(euint16.unwrap(b), bytes32(uint256(a)), true)); + return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates sub(euint128 a, euint16 b) and returns the result. */ - function or(euint16 a, uint16 b) internal returns (euint16) { + function sub(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return euint16.wrap(Impl.or(euint16.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { b = asEuint16(0); } - return euint16.wrap(Impl.or(euint16.unwrap(b), bytes32(uint256(a)), true)); + return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates mul(euint128 a, euint16 b) and returns the result. */ - function xor(euint16 a, uint16 b) internal returns (euint16) { + function mul(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return euint16.wrap(Impl.xor(euint16.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { b = asEuint16(0); } - return euint16.wrap(Impl.xor(euint16.unwrap(b), bytes32(uint256(a)), true)); + return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates and(euint128 a, euint16 b) and returns the result. */ - function eq(euint16 a, uint16 b) internal returns (ebool) { + function and(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return ebool.wrap(Impl.eq(euint16.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint16(0); } - return ebool.wrap(Impl.eq(euint16.unwrap(b), bytes32(uint256(a)), true)); + return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates or(euint128 a, euint16 b) and returns the result. */ - function ne(euint16 a, uint16 b) internal returns (ebool) { + function or(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return ebool.wrap(Impl.ne(euint16.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint16(0); } - return ebool.wrap(Impl.ne(euint16.unwrap(b), bytes32(uint256(a)), true)); + return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates xor(euint128 a, euint16 b) and returns the result. */ - function ge(euint16 a, uint16 b) internal returns (ebool) { + function xor(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return ebool.wrap(Impl.ge(euint16.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates ge(a, b) and returns the result. - */ - function ge(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint16(0); } - return ebool.wrap(Impl.le(euint16.unwrap(b), bytes32(uint256(a)), true)); + return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates eq(euint128 a, euint16 b) and returns the result. */ - function gt(euint16 a, uint16 b) internal returns (ebool) { + function eq(euint128 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return ebool.wrap(Impl.gt(euint16.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates gt(a, b) and returns the result. - */ - function gt(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint16(0); } - return ebool.wrap(Impl.lt(euint16.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates ne(euint128 a, euint16 b) and returns the result. */ - function le(euint16 a, uint16 b) internal returns (ebool) { + function ne(euint128 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return ebool.wrap(Impl.le(euint16.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates le(a, b) and returns the result. - */ - function le(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint16(0); } - return ebool.wrap(Impl.ge(euint16.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates ge(euint128 a, euint16 b) and returns the result. */ - function lt(euint16 a, uint16 b) internal returns (ebool) { + function ge(euint128 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return ebool.wrap(Impl.lt(euint16.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates lt(a, b) and returns the result. - */ - function lt(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint16(0); } - return ebool.wrap(Impl.gt(euint16.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates gt(euint128 a, euint16 b) and returns the result. */ - function min(euint16 a, uint16 b) internal returns (euint16) { + function gt(euint128 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return euint16.wrap(Impl.min(euint16.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates min(a, b) and returns the result. - */ - function min(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { b = asEuint16(0); } - return euint16.wrap(Impl.min(euint16.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates le(euint128 a, euint16 b) and returns the result. */ - function max(euint16 a, uint16 b) internal returns (euint16) { + function le(euint128 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint16(0); + a = asEuint128(0); } - return euint16.wrap(Impl.max(euint16.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates max(a, b) and returns the result. - */ - function max(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { b = asEuint16(0); } - return euint16.wrap(Impl.max(euint16.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates lt(euint128 a, euint16 b) and returns the result. */ - function add(euint32 a, euint4 b) internal returns (euint32) { + function lt(euint128 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates min(euint128 a, euint16 b) and returns the result. */ - function sub(euint32 a, euint4 b) internal returns (euint32) { + function min(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates max(euint128 a, euint16 b) and returns the result. */ - function mul(euint32 a, euint4 b) internal returns (euint32) { + function max(euint128 a, euint16 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates add(euint128 a, euint32 b) and returns the result. */ - function and(euint32 a, euint4 b) internal returns (euint32) { + function add(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates sub(euint128 a, euint32 b) and returns the result. */ - function or(euint32 a, euint4 b) internal returns (euint32) { + function sub(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates mul(euint128 a, euint32 b) and returns the result. */ - function xor(euint32 a, euint4 b) internal returns (euint32) { + function mul(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates and(euint128 a, euint32 b) and returns the result. */ - function eq(euint32 a, euint4 b) internal returns (ebool) { + function and(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates or(euint128 a, euint32 b) and returns the result. */ - function ne(euint32 a, euint4 b) internal returns (ebool) { + function or(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates xor(euint128 a, euint32 b) and returns the result. */ - function ge(euint32 a, euint4 b) internal returns (ebool) { + function xor(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates eq(euint128 a, euint32 b) and returns the result. */ - function gt(euint32 a, euint4 b) internal returns (ebool) { + function eq(euint128 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates ne(euint128 a, euint32 b) and returns the result. */ - function le(euint32 a, euint4 b) internal returns (ebool) { + function ne(euint128 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates ge(euint128 a, euint32 b) and returns the result. */ - function lt(euint32 a, euint4 b) internal returns (ebool) { + function ge(euint128 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates gt(euint128 a, euint32 b) and returns the result. */ - function min(euint32 a, euint4 b) internal returns (euint32) { + function gt(euint128 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates le(euint128 a, euint32 b) and returns the result. */ - function max(euint32 a, euint4 b) internal returns (euint32) { + function le(euint128 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint32(0); } - return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates lt(euint128 a, euint32 b) and returns the result. */ - function add(euint32 a, euint8 b) internal returns (euint32) { + function lt(euint128 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates min(euint128 a, euint32 b) and returns the result. */ - function sub(euint32 a, euint8 b) internal returns (euint32) { + function min(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates max(euint128 a, euint32 b) and returns the result. */ - function mul(euint32 a, euint8 b) internal returns (euint32) { + function max(euint128 a, euint32 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint32(0); } - return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates add(euint128 a, euint64 b) and returns the result. */ - function and(euint32 a, euint8 b) internal returns (euint32) { + function add(euint128 a, euint64 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates sub(euint128 a, euint64 b) and returns the result. */ - function or(euint32 a, euint8 b) internal returns (euint32) { + function sub(euint128 a, euint64 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates mul(euint128 a, euint64 b) and returns the result. */ - function xor(euint32 a, euint8 b) internal returns (euint32) { + function mul(euint128 a, euint64 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates and(euint128 a, euint64 b) and returns the result. */ - function eq(euint32 a, euint8 b) internal returns (ebool) { + function and(euint128 a, euint64 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates or(euint128 a, euint64 b) and returns the result. */ - function ne(euint32 a, euint8 b) internal returns (ebool) { + function or(euint128 a, euint64 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates xor(euint128 a, euint64 b) and returns the result. */ - function ge(euint32 a, euint8 b) internal returns (ebool) { + function xor(euint128 a, euint64 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates eq(euint128 a, euint64 b) and returns the result. */ - function gt(euint32 a, euint8 b) internal returns (ebool) { + function eq(euint128 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates ne(euint128 a, euint64 b) and returns the result. */ - function le(euint32 a, euint8 b) internal returns (ebool) { + function ne(euint128 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates ge(euint128 a, euint64 b) and returns the result. */ - function lt(euint32 a, euint8 b) internal returns (ebool) { + function ge(euint128 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates gt(euint128 a, euint64 b) and returns the result. */ - function min(euint32 a, euint8 b) internal returns (euint32) { + function gt(euint128 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates le(euint128 a, euint64 b) and returns the result. */ - function max(euint32 a, euint8 b) internal returns (euint32) { + function le(euint128 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint64(0); } - return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates lt(euint128 a, euint64 b) and returns the result. */ - function add(euint32 a, euint16 b) internal returns (euint32) { + function lt(euint128 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint64(0); } - return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates min(euint128 a, euint64 b) and returns the result. */ - function sub(euint32 a, euint16 b) internal returns (euint32) { + function min(euint128 a, euint64 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint64(0); } - return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates max(euint128 a, euint64 b) and returns the result. */ - function mul(euint32 a, euint16 b) internal returns (euint32) { + function max(euint128 a, euint64 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint64(0); } - return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates add(euint128 a, euint128 b) and returns the result. */ - function and(euint32 a, euint16 b) internal returns (euint32) { + function add(euint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(b), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates sub(euint128 a, euint128 b) and returns the result. */ - function or(euint32 a, euint16 b) internal returns (euint32) { + function sub(euint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(b), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates mul(euint128 a, euint128 b) and returns the result. */ - function xor(euint32 a, euint16 b) internal returns (euint32) { + function mul(euint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(b), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates and(euint128 a, euint128 b) and returns the result. */ - function eq(euint32 a, euint16 b) internal returns (ebool) { + function and(euint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(b), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates or(euint128 a, euint128 b) and returns the result. */ - function ne(euint32 a, euint16 b) internal returns (ebool) { + function or(euint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(b), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates xor(euint128 a, euint128 b) and returns the result. */ - function ge(euint32 a, euint16 b) internal returns (ebool) { + function xor(euint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(b), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates eq(euint128 a, euint128 b) and returns the result. */ - function gt(euint32 a, euint16 b) internal returns (ebool) { + function eq(euint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(b), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates ne(euint128 a, euint128 b) and returns the result. */ - function le(euint32 a, euint16 b) internal returns (ebool) { + function ne(euint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(b), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates ge(euint128 a, euint128 b) and returns the result. */ - function lt(euint32 a, euint16 b) internal returns (ebool) { + function ge(euint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(b), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates gt(euint128 a, euint128 b) and returns the result. */ - function min(euint32 a, euint16 b) internal returns (euint32) { + function gt(euint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(b), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates le(euint128 a, euint128 b) and returns the result. */ - function max(euint32 a, euint16 b) internal returns (euint32) { + function le(euint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint128(0); } - return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); + return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(b), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates lt(euint128 a, euint128 b) and returns the result. */ - function add(euint32 a, euint32 b) internal returns (euint32) { + function lt(euint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return euint32.wrap(Impl.add(euint32.unwrap(a), euint32.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(b), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates min(euint128 a, euint128 b) and returns the result. */ - function sub(euint32 a, euint32 b) internal returns (euint32) { + function min(euint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return euint32.wrap(Impl.sub(euint32.unwrap(a), euint32.unwrap(b), false)); + return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(b), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates max(euint128 a, euint128 b) and returns the result. */ - function mul(euint32 a, euint32 b) internal returns (euint32) { + function max(euint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint128(0); } - return euint32.wrap(Impl.mul(euint32.unwrap(a), euint32.unwrap(b), false)); + return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(b), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates and(euint128 a, euint256 b) and returns the result. */ - function and(euint32 a, euint32 b) internal returns (euint32) { + function and(euint128 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint256(0); } - return euint32.wrap(Impl.and(euint32.unwrap(a), euint32.unwrap(b), false)); + return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates or(euint128 a, euint256 b) and returns the result. */ - function or(euint32 a, euint32 b) internal returns (euint32) { + function or(euint128 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint256(0); } - return euint32.wrap(Impl.or(euint32.unwrap(a), euint32.unwrap(b), false)); + return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates xor(euint128 a, euint256 b) and returns the result. */ - function xor(euint32 a, euint32 b) internal returns (euint32) { + function xor(euint128 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint256(0); } - return euint32.wrap(Impl.xor(euint32.unwrap(a), euint32.unwrap(b), false)); + return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates eq(euint128 a, euint256 b) and returns the result. */ - function eq(euint32 a, euint32 b) internal returns (ebool) { + function eq(euint128 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint256(0); } - return ebool.wrap(Impl.eq(euint32.unwrap(a), euint32.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates ne(euint128 a, euint256 b) and returns the result. */ - function ne(euint32 a, euint32 b) internal returns (ebool) { + function ne(euint128 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint256(0); } - return ebool.wrap(Impl.ne(euint32.unwrap(a), euint32.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates eq(eaddress a, eaddress b) and returns the result. */ - function ge(euint32 a, euint32 b) internal returns (ebool) { + function eq(eaddress a, eaddress b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEaddress(address(0)); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEaddress(address(0)); } - return ebool.wrap(Impl.ge(euint32.unwrap(a), euint32.unwrap(b), false)); + return ebool.wrap(Impl.eq(eaddress.unwrap(a), eaddress.unwrap(b), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates ne(eaddress a, eaddress b) and returns the result. */ - function gt(euint32 a, euint32 b) internal returns (ebool) { + function ne(eaddress a, eaddress b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEaddress(address(0)); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEaddress(address(0)); } - return ebool.wrap(Impl.gt(euint32.unwrap(a), euint32.unwrap(b), false)); + return ebool.wrap(Impl.ne(eaddress.unwrap(a), eaddress.unwrap(b), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates and(euint256 a, euint8 b) and returns the result. */ - function le(euint32 a, euint32 b) internal returns (ebool) { + function and(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.le(euint32.unwrap(a), euint32.unwrap(b), false)); + return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates or(euint256 a, euint8 b) and returns the result. */ - function lt(euint32 a, euint32 b) internal returns (ebool) { + function or(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.lt(euint32.unwrap(a), euint32.unwrap(b), false)); + return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates xor(euint256 a, euint8 b) and returns the result. */ - function min(euint32 a, euint32 b) internal returns (euint32) { + function xor(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.min(euint32.unwrap(a), euint32.unwrap(b), false)); + return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates eq(euint256 a, euint8 b) and returns the result. */ - function max(euint32 a, euint32 b) internal returns (euint32) { + function eq(euint256 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.max(euint32.unwrap(a), euint32.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates ne(euint256 a, euint8 b) and returns the result. */ - function add(euint32 a, euint64 b) internal returns (euint64) { + function ne(euint256 a, euint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint8(0); } - return euint64.wrap(Impl.add(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates and(euint256 a, euint16 b) and returns the result. */ - function sub(euint32 a, euint64 b) internal returns (euint64) { + function and(euint256 a, euint16 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.sub(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates or(euint256 a, euint16 b) and returns the result. */ - function mul(euint32 a, euint64 b) internal returns (euint64) { + function or(euint256 a, euint16 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.mul(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates xor(euint256 a, euint16 b) and returns the result. */ - function and(euint32 a, euint64 b) internal returns (euint64) { + function xor(euint256 a, euint16 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.and(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates eq(euint256 a, euint16 b) and returns the result. */ - function or(euint32 a, euint64 b) internal returns (euint64) { + function eq(euint256 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.or(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates ne(euint256 a, euint16 b) and returns the result. */ - function xor(euint32 a, euint64 b) internal returns (euint64) { + function ne(euint256 a, euint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint16(0); } - return euint64.wrap(Impl.xor(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates and(euint256 a, euint32 b) and returns the result. */ - function eq(euint32 a, euint64 b) internal returns (ebool) { + function and(euint256 a, euint32 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint32(0); } - return ebool.wrap(Impl.eq(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates or(euint256 a, euint32 b) and returns the result. */ - function ne(euint32 a, euint64 b) internal returns (ebool) { + function or(euint256 a, euint32 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint32(0); } - return ebool.wrap(Impl.ne(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates xor(euint256 a, euint32 b) and returns the result. */ - function ge(euint32 a, euint64 b) internal returns (ebool) { + function xor(euint256 a, euint32 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint32(0); } - return ebool.wrap(Impl.ge(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates eq(euint256 a, euint32 b) and returns the result. */ - function gt(euint32 a, euint64 b) internal returns (ebool) { + function eq(euint256 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint32(0); } - return ebool.wrap(Impl.gt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates ne(euint256 a, euint32 b) and returns the result. */ - function le(euint32 a, euint64 b) internal returns (ebool) { + function ne(euint256 a, euint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint32(0); } - return ebool.wrap(Impl.le(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates and(euint256 a, euint64 b) and returns the result. */ - function lt(euint32 a, euint64 b) internal returns (ebool) { + function and(euint256 a, euint64 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { b = asEuint64(0); } - return ebool.wrap(Impl.lt(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates or(euint256 a, euint64 b) and returns the result. */ - function min(euint32 a, euint64 b) internal returns (euint64) { + function or(euint256 a, euint64 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { b = asEuint64(0); } - return euint64.wrap(Impl.min(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates xor(euint256 a, euint64 b) and returns the result. */ - function max(euint32 a, euint64 b) internal returns (euint64) { + function xor(euint256 a, euint64 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { b = asEuint64(0); } - return euint64.wrap(Impl.max(euint64.unwrap(asEuint64(a)), euint64.unwrap(b), false)); + return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates eq(euint256 a, euint64 b) and returns the result. */ - function add(euint32 a, euint128 b) internal returns (euint128) { + function eq(euint256 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint64(0); } - return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates ne(euint256 a, euint64 b) and returns the result. */ - function sub(euint32 a, euint128 b) internal returns (euint128) { + function ne(euint256 a, euint64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint64(0); } - return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates and(euint256 a, euint128 b) and returns the result. */ - function mul(euint32 a, euint128 b) internal returns (euint128) { + function and(euint256 a, euint128 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { b = asEuint128(0); } - return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates or(euint256 a, euint128 b) and returns the result. */ - function and(euint32 a, euint128 b) internal returns (euint128) { + function or(euint256 a, euint128 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { b = asEuint128(0); } - return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates xor(euint256 a, euint128 b) and returns the result. */ - function or(euint32 a, euint128 b) internal returns (euint128) { + function xor(euint256 a, euint128 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { b = asEuint128(0); } - return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates eq(euint256 a, euint128 b) and returns the result. */ - function xor(euint32 a, euint128 b) internal returns (euint128) { + function eq(euint256 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { b = asEuint128(0); } - return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates ne(euint256 a, euint128 b) and returns the result. */ - function eq(euint32 a, euint128 b) internal returns (ebool) { + function ne(euint256 a, euint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { b = asEuint128(0); } - return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates and(euint256 a, euint256 b) and returns the result. */ - function ne(euint32 a, euint128 b) internal returns (ebool) { + function and(euint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint256(0); } - return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(b), false)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates or(euint256 a, euint256 b) and returns the result. */ - function ge(euint32 a, euint128 b) internal returns (ebool) { + function or(euint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint256(0); } - return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(b), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates xor(euint256 a, euint256 b) and returns the result. */ - function gt(euint32 a, euint128 b) internal returns (ebool) { + function xor(euint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint256(0); } - return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(b), false)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates eq(euint256 a, euint256 b) and returns the result. */ - function le(euint32 a, euint128 b) internal returns (ebool) { + function eq(euint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint256(0); } - return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(b), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates ne(euint256 a, euint256 b) and returns the result. */ - function lt(euint32 a, euint128 b) internal returns (ebool) { + function ne(euint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint256(0); } - return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(b), false)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates eq(ebytes64 a, ebytes64 b) and returns the result. */ - function min(euint32 a, euint128 b) internal returns (euint128) { + function eq(ebytes64 a, ebytes64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEbytes64(padToBytes64(hex"")); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEbytes64(padToBytes64(hex"")); } - return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return ebool.wrap(Impl.eq(ebytes64.unwrap(a), ebytes64.unwrap(b), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates ne(ebytes64 a, ebytes64 b) and returns the result. */ - function max(euint32 a, euint128 b) internal returns (euint128) { + function ne(ebytes64 a, ebytes64 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEbytes64(padToBytes64(hex"")); } if (!isInitialized(b)) { - b = asEuint128(0); + b = asEbytes64(padToBytes64(hex"")); } - return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return ebool.wrap(Impl.ne(ebytes64.unwrap(a), ebytes64.unwrap(b), false)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates eq(ebytes128 a, ebytes128 b) and returns the result. */ - function add(euint32 a, euint256 b) internal returns (euint256) { + function eq(ebytes128 a, ebytes128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEbytes128(padToBytes128(hex"")); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEbytes128(padToBytes128(hex"")); } - return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.eq(ebytes128.unwrap(a), ebytes128.unwrap(b), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates ne(ebytes128 a, ebytes128 b) and returns the result. */ - function sub(euint32 a, euint256 b) internal returns (euint256) { + function ne(ebytes128 a, ebytes128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEbytes128(padToBytes128(hex"")); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEbytes128(padToBytes128(hex"")); } - return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.ne(ebytes128.unwrap(a), ebytes128.unwrap(b), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates eq(ebytes256 a, ebytes256 b) and returns the result. */ - function mul(euint32 a, euint256 b) internal returns (euint256) { + function eq(ebytes256 a, ebytes256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEbytes256(padToBytes256(hex"")); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEbytes256(padToBytes256(hex"")); } - return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.eq(ebytes256.unwrap(a), ebytes256.unwrap(b), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates ne(ebytes256 a, ebytes256 b) and returns the result. */ - function and(euint32 a, euint256 b) internal returns (euint256) { + function ne(ebytes256 a, ebytes256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEbytes256(padToBytes256(hex"")); } if (!isInitialized(b)) { - b = asEuint256(0); + b = asEbytes256(padToBytes256(hex"")); } - return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.ne(ebytes256.unwrap(a), ebytes256.unwrap(b), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates and(ebool a, bool b) and returns the result. */ - function or(euint32 a, euint256 b) internal returns (euint256) { + function and(ebool a, bool b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); + a = asEbool(false); } - return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.and(ebool.unwrap(a), bytes32(uint256(b ? 1 : 0)), true)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates and(bool a, ebool b) and returns the result. */ - function xor(euint32 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint32(0); - } + function and(bool a, ebool b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint256(0); + b = asEbool(false); } - return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.and(ebool.unwrap(b), bytes32(uint256(a ? 1 : 0)), true)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates or(ebool a, bool b) and returns the result. */ - function eq(euint32 a, euint256 b) internal returns (ebool) { + function or(ebool a, bool b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); + a = asEbool(false); } - return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.or(ebool.unwrap(a), bytes32(uint256(b ? 1 : 0)), true)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates or(bool a, ebool b) and returns the result. */ - function ne(euint32 a, euint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint32(0); - } + function or(bool a, ebool b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint256(0); + b = asEbool(false); } - return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.or(ebool.unwrap(b), bytes32(uint256(a ? 1 : 0)), true)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates xor(ebool a, bool b) and returns the result. */ - function ge(euint32 a, euint256 b) internal returns (ebool) { + function xor(ebool a, bool b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); + a = asEbool(false); } - return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.xor(ebool.unwrap(a), bytes32(uint256(b ? 1 : 0)), true)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates xor(bool a, ebool b) and returns the result. */ - function gt(euint32 a, euint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint32(0); - } + function xor(bool a, ebool b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint256(0); + b = asEbool(false); } - return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.xor(ebool.unwrap(b), bytes32(uint256(a ? 1 : 0)), true)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates eq(ebool a, bool b) and returns the result. */ - function le(euint32 a, euint256 b) internal returns (ebool) { + function eq(ebool a, bool b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); + a = asEbool(false); } - return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.eq(ebool.unwrap(a), bytes32(uint256(b ? 1 : 0)), true)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates eq(bool a, ebool b) and returns the result. */ - function lt(euint32 a, euint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint32(0); - } + function eq(bool a, ebool b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint256(0); + b = asEbool(false); } - return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.eq(ebool.unwrap(b), bytes32(uint256(a ? 1 : 0)), true)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates ne(ebool a, bool b) and returns the result. */ - function min(euint32 a, euint256 b) internal returns (euint256) { + function ne(ebool a, bool b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); + a = asEbool(false); } - return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.ne(ebool.unwrap(a), bytes32(uint256(b ? 1 : 0)), true)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates ne(bool a, ebool b) and returns the result. */ - function max(euint32 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint32(0); - } + function ne(bool a, ebool b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint256(0); + b = asEbool(false); } - return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.ne(ebool.unwrap(b), bytes32(uint256(a ? 1 : 0)), true)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates add(euint8 a, uint8 b) and returns the result. */ - function add(euint32 a, uint32 b) internal returns (euint32) { + function add(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint8(0); } - return euint32.wrap(Impl.add(euint32.unwrap(a), bytes32(uint256(b)), true)); + return euint8.wrap(Impl.add(euint8.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates add(uint8 a, euint8 b) and returns the result. */ - function add(uint32 a, euint32 b) internal returns (euint32) { + function add(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.add(euint32.unwrap(b), bytes32(uint256(a)), true)); + return euint8.wrap(Impl.add(euint8.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates sub(euint8 a, uint8 b) and returns the result. */ - function sub(euint32 a, uint32 b) internal returns (euint32) { + function sub(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint8(0); } - return euint32.wrap(Impl.sub(euint32.unwrap(a), bytes32(uint256(b)), true)); + return euint8.wrap(Impl.sub(euint8.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates sub(uint8 a, euint8 b) and returns the result. */ - function sub(uint32 a, euint32 b) internal returns (euint32) { - euint32 aEnc = asEuint32(a); + function sub(uint8 a, euint8 b) internal returns (euint8) { + euint8 aEnc = asEuint8(a); if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.sub(euint32.unwrap(aEnc), euint32.unwrap(b), false)); + return euint8.wrap(Impl.sub(euint8.unwrap(aEnc), euint8.unwrap(b), false)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates mul(euint8 a, uint8 b) and returns the result. */ - function mul(euint32 a, uint32 b) internal returns (euint32) { + function mul(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint8(0); } - return euint32.wrap(Impl.mul(euint32.unwrap(a), bytes32(uint256(b)), true)); + return euint8.wrap(Impl.mul(euint8.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates mul(uint8 a, euint8 b) and returns the result. */ - function mul(uint32 a, euint32 b) internal returns (euint32) { + function mul(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.mul(euint32.unwrap(b), bytes32(uint256(a)), true)); + return euint8.wrap(Impl.mul(euint8.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates div(a, b) and returns the result. + * @dev Evaluates div(euint8 a, uint8 b) and returns the result. */ - function div(euint32 a, uint32 b) internal returns (euint32) { + function div(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint8(0); } - return euint32.wrap(Impl.div(euint32.unwrap(a), bytes32(uint256(b)))); + return euint8.wrap(Impl.div(euint8.unwrap(a), bytes32(uint256(b)))); } /** - * @dev Evaluates rem(a, b) and returns the result. + * @dev Evaluates rem(euint8 a, uint8 b) and returns the result. */ - function rem(euint32 a, uint32 b) internal returns (euint32) { + function rem(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint8(0); } - return euint32.wrap(Impl.rem(euint32.unwrap(a), bytes32(uint256(b)))); + return euint8.wrap(Impl.rem(euint8.unwrap(a), bytes32(uint256(b)))); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates and(euint8 a, uint8 b) and returns the result. */ - function and(euint32 a, uint32 b) internal returns (euint32) { + function and(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint8(0); } - return euint32.wrap(Impl.and(euint32.unwrap(a), bytes32(uint256(b)), true)); + return euint8.wrap(Impl.and(euint8.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates and(uint8 a, euint8 b) and returns the result. */ - function and(uint32 a, euint32 b) internal returns (euint32) { + function and(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.and(euint32.unwrap(b), bytes32(uint256(a)), true)); + return euint8.wrap(Impl.and(euint8.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates or(euint8 a, uint8 b) and returns the result. */ - function or(euint32 a, uint32 b) internal returns (euint32) { + function or(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint8(0); } - return euint32.wrap(Impl.or(euint32.unwrap(a), bytes32(uint256(b)), true)); + return euint8.wrap(Impl.or(euint8.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates or(uint8 a, euint8 b) and returns the result. */ - function or(uint32 a, euint32 b) internal returns (euint32) { + function or(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.or(euint32.unwrap(b), bytes32(uint256(a)), true)); + return euint8.wrap(Impl.or(euint8.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates xor(euint8 a, uint8 b) and returns the result. */ - function xor(euint32 a, uint32 b) internal returns (euint32) { + function xor(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint8(0); } - return euint32.wrap(Impl.xor(euint32.unwrap(a), bytes32(uint256(b)), true)); + return euint8.wrap(Impl.xor(euint8.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates xor(uint8 a, euint8 b) and returns the result. */ - function xor(uint32 a, euint32 b) internal returns (euint32) { + function xor(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.xor(euint32.unwrap(b), bytes32(uint256(a)), true)); + return euint8.wrap(Impl.xor(euint8.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates eq(euint8 a, uint8 b) and returns the result. */ - function eq(euint32 a, uint32 b) internal returns (ebool) { + function eq(euint8 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint8(0); } - return ebool.wrap(Impl.eq(euint32.unwrap(a), bytes32(uint256(b)), true)); + return ebool.wrap(Impl.eq(euint8.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates eq(uint8 a, euint8 b) and returns the result. */ - function eq(uint32 a, euint32 b) internal returns (ebool) { + function eq(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.eq(euint32.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.eq(euint8.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates ne(euint8 a, uint8 b) and returns the result. */ - function ne(euint32 a, uint32 b) internal returns (ebool) { + function ne(euint8 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint8(0); } - return ebool.wrap(Impl.ne(euint32.unwrap(a), bytes32(uint256(b)), true)); + return ebool.wrap(Impl.ne(euint8.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates ne(uint8 a, euint8 b) and returns the result. */ - function ne(uint32 a, euint32 b) internal returns (ebool) { + function ne(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.ne(euint32.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.ne(euint8.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates ge(euint8 a, uint8 b) and returns the result. */ - function ge(euint32 a, uint32 b) internal returns (ebool) { + function ge(euint8 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint8(0); } - return ebool.wrap(Impl.ge(euint32.unwrap(a), bytes32(uint256(b)), true)); + return ebool.wrap(Impl.ge(euint8.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates ge(uint8 a, euint8 b) and returns the result. */ - function ge(uint32 a, euint32 b) internal returns (ebool) { + function ge(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.le(euint32.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.le(euint8.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates gt(euint8 a, uint8 b) and returns the result. */ - function gt(euint32 a, uint32 b) internal returns (ebool) { + function gt(euint8 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint8(0); } - return ebool.wrap(Impl.gt(euint32.unwrap(a), bytes32(uint256(b)), true)); + return ebool.wrap(Impl.gt(euint8.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates gt(uint8 a, euint8 b) and returns the result. */ - function gt(uint32 a, euint32 b) internal returns (ebool) { + function gt(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.lt(euint32.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.lt(euint8.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates le(euint8 a, uint8 b) and returns the result. */ - function le(euint32 a, uint32 b) internal returns (ebool) { + function le(euint8 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint8(0); } - return ebool.wrap(Impl.le(euint32.unwrap(a), bytes32(uint256(b)), true)); + return ebool.wrap(Impl.le(euint8.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates le(uint8 a, euint8 b) and returns the result. */ - function le(uint32 a, euint32 b) internal returns (ebool) { + function le(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.ge(euint32.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.ge(euint8.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates lt(euint8 a, uint8 b) and returns the result. */ - function lt(euint32 a, uint32 b) internal returns (ebool) { + function lt(euint8 a, uint8 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint8(0); } - return ebool.wrap(Impl.lt(euint32.unwrap(a), bytes32(uint256(b)), true)); + return ebool.wrap(Impl.lt(euint8.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates lt(uint8 a, euint8 b) and returns the result. */ - function lt(uint32 a, euint32 b) internal returns (ebool) { + function lt(uint8 a, euint8 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.gt(euint32.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.gt(euint8.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates min(euint8 a, uint8 b) and returns the result. */ - function min(euint32 a, uint32 b) internal returns (euint32) { + function min(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint8(0); } - return euint32.wrap(Impl.min(euint32.unwrap(a), bytes32(uint256(b)), true)); + return euint8.wrap(Impl.min(euint8.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates min(uint8 a, euint8 b) and returns the result. */ - function min(uint32 a, euint32 b) internal returns (euint32) { + function min(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.min(euint32.unwrap(b), bytes32(uint256(a)), true)); + return euint8.wrap(Impl.min(euint8.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates max(euint8 a, uint8 b) and returns the result. */ - function max(euint32 a, uint32 b) internal returns (euint32) { + function max(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint32(0); + a = asEuint8(0); } - return euint32.wrap(Impl.max(euint32.unwrap(a), bytes32(uint256(b)), true)); + return euint8.wrap(Impl.max(euint8.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates max(uint8 a, euint8 b) and returns the result. */ - function max(uint32 a, euint32 b) internal returns (euint32) { + function max(uint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint32.wrap(Impl.max(euint32.unwrap(b), bytes32(uint256(a)), true)); + return euint8.wrap(Impl.max(euint8.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates add(euint16 a, uint16 b) and returns the result. */ - function add(euint64 a, euint4 b) internal returns (euint64) { + function add(euint16 a, uint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); + a = asEuint16(0); } - return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint16.wrap(Impl.add(euint16.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates add(uint16 a, euint16 b) and returns the result. */ - function sub(euint64 a, euint4 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function add(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint16.wrap(Impl.add(euint16.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates sub(euint16 a, uint16 b) and returns the result. */ - function mul(euint64 a, euint4 b) internal returns (euint64) { + function sub(euint16 a, uint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); + a = asEuint16(0); } - return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint16.wrap(Impl.sub(euint16.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates sub(uint16 a, euint16 b) and returns the result. */ - function and(euint64 a, euint4 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function sub(uint16 a, euint16 b) internal returns (euint16) { + euint16 aEnc = asEuint16(a); if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint16.wrap(Impl.sub(euint16.unwrap(aEnc), euint16.unwrap(b), false)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates mul(euint16 a, uint16 b) and returns the result. */ - function or(euint64 a, euint4 b) internal returns (euint64) { + function mul(euint16 a, uint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); + a = asEuint16(0); } - return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint16.wrap(Impl.mul(euint16.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates mul(uint16 a, euint16 b) and returns the result. */ - function xor(euint64 a, euint4 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function mul(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint16.wrap(Impl.mul(euint16.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates div(euint16 a, uint16 b) and returns the result. */ - function eq(euint64 a, euint4 b) internal returns (ebool) { + function div(euint16 a, uint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); + a = asEuint16(0); } - return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint16.wrap(Impl.div(euint16.unwrap(a), bytes32(uint256(b)))); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates rem(euint16 a, uint16 b) and returns the result. */ - function ne(euint64 a, euint4 b) internal returns (ebool) { + function rem(euint16 a, uint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); + a = asEuint16(0); } - return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint16.wrap(Impl.rem(euint16.unwrap(a), bytes32(uint256(b)))); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates and(euint16 a, uint16 b) and returns the result. */ - function ge(euint64 a, euint4 b) internal returns (ebool) { + function and(euint16 a, uint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); + a = asEuint16(0); } - return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint16.wrap(Impl.and(euint16.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates and(uint16 a, euint16 b) and returns the result. */ - function gt(euint64 a, euint4 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function and(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint16.wrap(Impl.and(euint16.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates or(euint16 a, uint16 b) and returns the result. */ - function le(euint64 a, euint4 b) internal returns (ebool) { + function or(euint16 a, uint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); + a = asEuint16(0); } - return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint16.wrap(Impl.or(euint16.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates or(uint16 a, euint16 b) and returns the result. */ - function lt(euint64 a, euint4 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function or(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint16.wrap(Impl.or(euint16.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates xor(euint16 a, uint16 b) and returns the result. */ - function min(euint64 a, euint4 b) internal returns (euint64) { + function xor(euint16 a, uint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); + a = asEuint16(0); } - return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint16.wrap(Impl.xor(euint16.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates xor(uint16 a, euint16 b) and returns the result. */ - function max(euint64 a, euint4 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function xor(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint16(0); } - return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint16.wrap(Impl.xor(euint16.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates eq(euint16 a, uint16 b) and returns the result. */ - function add(euint64 a, euint8 b) internal returns (euint64) { + function eq(euint16 a, uint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); + a = asEuint16(0); } - return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.eq(euint16.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates eq(uint16 a, euint16 b) and returns the result. */ - function sub(euint64 a, euint8 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function eq(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint16(0); } - return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.eq(euint16.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates ne(euint16 a, uint16 b) and returns the result. */ - function mul(euint64 a, euint8 b) internal returns (euint64) { + function ne(euint16 a, uint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); + a = asEuint16(0); } - return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.ne(euint16.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates ne(uint16 a, euint16 b) and returns the result. */ - function and(euint64 a, euint8 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function ne(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint16(0); } - return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.ne(euint16.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates ge(euint16 a, uint16 b) and returns the result. */ - function or(euint64 a, euint8 b) internal returns (euint64) { + function ge(euint16 a, uint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); + a = asEuint16(0); } - return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.ge(euint16.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates ge(uint16 a, euint16 b) and returns the result. */ - function xor(euint64 a, euint8 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function ge(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint16(0); } - return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.le(euint16.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates gt(euint16 a, uint16 b) and returns the result. */ - function eq(euint64 a, euint8 b) internal returns (ebool) { + function gt(euint16 a, uint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); + a = asEuint16(0); } - return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.gt(euint16.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates gt(uint16 a, euint16 b) and returns the result. */ - function ne(euint64 a, euint8 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function gt(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint16(0); } - return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.lt(euint16.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates le(euint16 a, uint16 b) and returns the result. */ - function ge(euint64 a, euint8 b) internal returns (ebool) { + function le(euint16 a, uint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); + a = asEuint16(0); } - return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.le(euint16.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates le(uint16 a, euint16 b) and returns the result. */ - function gt(euint64 a, euint8 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function le(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint16(0); } - return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.ge(euint16.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates lt(euint16 a, uint16 b) and returns the result. */ - function le(euint64 a, euint8 b) internal returns (ebool) { + function lt(euint16 a, uint16 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); + a = asEuint16(0); } - return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.lt(euint16.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates lt(uint16 a, euint16 b) and returns the result. */ - function lt(euint64 a, euint8 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function lt(uint16 a, euint16 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint16(0); } - return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.gt(euint16.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates min(euint16 a, uint16 b) and returns the result. */ - function min(euint64 a, euint8 b) internal returns (euint64) { + function min(euint16 a, uint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); + a = asEuint16(0); } - return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint16.wrap(Impl.min(euint16.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates min(uint16 a, euint16 b) and returns the result. */ - function max(euint64 a, euint8 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function min(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { - b = asEuint8(0); + b = asEuint16(0); } - return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint16.wrap(Impl.min(euint16.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates max(euint16 a, uint16 b) and returns the result. */ - function add(euint64 a, euint16 b) internal returns (euint64) { + function max(euint16 a, uint16 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); + a = asEuint16(0); } - return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint16.wrap(Impl.max(euint16.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates max(uint16 a, euint16 b) and returns the result. */ - function sub(euint64 a, euint16 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function max(uint16 a, euint16 b) internal returns (euint16) { if (!isInitialized(b)) { b = asEuint16(0); } - return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint16.wrap(Impl.max(euint16.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates add(euint32 a, uint32 b) and returns the result. */ - function mul(euint64 a, euint16 b) internal returns (euint64) { + function add(euint32 a, uint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); + a = asEuint32(0); } - return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint32.wrap(Impl.add(euint32.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates add(uint32 a, euint32 b) and returns the result. */ - function and(euint64 a, euint16 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function add(uint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint32.wrap(Impl.add(euint32.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates sub(euint32 a, uint32 b) and returns the result. */ - function or(euint64 a, euint16 b) internal returns (euint64) { + function sub(euint32 a, uint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); + a = asEuint32(0); } - return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint32.wrap(Impl.sub(euint32.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates sub(uint32 a, euint32 b) and returns the result. */ - function xor(euint64 a, euint16 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function sub(uint32 a, euint32 b) internal returns (euint32) { + euint32 aEnc = asEuint32(a); if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint32.wrap(Impl.sub(euint32.unwrap(aEnc), euint32.unwrap(b), false)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates mul(euint32 a, uint32 b) and returns the result. */ - function eq(euint64 a, euint16 b) internal returns (ebool) { + function mul(euint32 a, uint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); + a = asEuint32(0); } - return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint32.wrap(Impl.mul(euint32.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates mul(uint32 a, euint32 b) and returns the result. */ - function ne(euint64 a, euint16 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function mul(uint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint32.wrap(Impl.mul(euint32.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates div(euint32 a, uint32 b) and returns the result. */ - function ge(euint64 a, euint16 b) internal returns (ebool) { + function div(euint32 a, uint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); + a = asEuint32(0); } - return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint32.wrap(Impl.div(euint32.unwrap(a), bytes32(uint256(b)))); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates rem(euint32 a, uint32 b) and returns the result. */ - function gt(euint64 a, euint16 b) internal returns (ebool) { + function rem(euint32 a, uint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); + a = asEuint32(0); } - return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint32.wrap(Impl.rem(euint32.unwrap(a), bytes32(uint256(b)))); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates and(euint32 a, uint32 b) and returns the result. */ - function le(euint64 a, euint16 b) internal returns (ebool) { + function and(euint32 a, uint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); + a = asEuint32(0); } - return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint32.wrap(Impl.and(euint32.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates and(uint32 a, euint32 b) and returns the result. */ - function lt(euint64 a, euint16 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function and(uint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint32.wrap(Impl.and(euint32.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates or(euint32 a, uint32 b) and returns the result. */ - function min(euint64 a, euint16 b) internal returns (euint64) { + function or(euint32 a, uint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); + a = asEuint32(0); } - return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint32.wrap(Impl.or(euint32.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates or(uint32 a, euint32 b) and returns the result. */ - function max(euint64 a, euint16 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function or(uint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint32(0); } - return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint32.wrap(Impl.or(euint32.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates xor(euint32 a, uint32 b) and returns the result. */ - function add(euint64 a, euint32 b) internal returns (euint64) { + function xor(euint32 a, uint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); + a = asEuint32(0); } - return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint32.wrap(Impl.xor(euint32.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates xor(uint32 a, euint32 b) and returns the result. */ - function sub(euint64 a, euint32 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function xor(uint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(b)) { b = asEuint32(0); } - return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint32.wrap(Impl.xor(euint32.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates eq(euint32 a, uint32 b) and returns the result. */ - function mul(euint64 a, euint32 b) internal returns (euint64) { + function eq(euint32 a, uint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); + a = asEuint32(0); } - return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.eq(euint32.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates eq(uint32 a, euint32 b) and returns the result. */ - function and(euint64 a, euint32 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function eq(uint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint32(0); } - return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.eq(euint32.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates ne(euint32 a, uint32 b) and returns the result. */ - function or(euint64 a, euint32 b) internal returns (euint64) { + function ne(euint32 a, uint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); + a = asEuint32(0); } - return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.ne(euint32.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates ne(uint32 a, euint32 b) and returns the result. */ - function xor(euint64 a, euint32 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function ne(uint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint32(0); } - return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.ne(euint32.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates ge(euint32 a, uint32 b) and returns the result. */ - function eq(euint64 a, euint32 b) internal returns (ebool) { + function ge(euint32 a, uint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); + a = asEuint32(0); } - return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.ge(euint32.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates ge(uint32 a, euint32 b) and returns the result. */ - function ne(euint64 a, euint32 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function ge(uint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint32(0); } - return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.le(euint32.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates gt(euint32 a, uint32 b) and returns the result. */ - function ge(euint64 a, euint32 b) internal returns (ebool) { + function gt(euint32 a, uint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint32(0); } + return ebool.wrap(Impl.gt(euint32.unwrap(a), bytes32(uint256(b)), true)); + } + + /** + * @dev Evaluates gt(uint32 a, euint32 b) and returns the result. + */ + function gt(uint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint32(0); } - return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.lt(euint32.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates le(euint32 a, uint32 b) and returns the result. */ - function gt(euint64 a, euint32 b) internal returns (ebool) { + function le(euint32 a, uint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); + a = asEuint32(0); } - return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.le(euint32.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates le(uint32 a, euint32 b) and returns the result. */ - function le(euint64 a, euint32 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function le(uint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint32(0); } - return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.ge(euint32.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates lt(euint32 a, uint32 b) and returns the result. */ - function lt(euint64 a, euint32 b) internal returns (ebool) { + function lt(euint32 a, uint32 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint32(0); } + return ebool.wrap(Impl.lt(euint32.unwrap(a), bytes32(uint256(b)), true)); + } + + /** + * @dev Evaluates lt(uint32 a, euint32 b) and returns the result. + */ + function lt(uint32 a, euint32 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint32(0); } - return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return ebool.wrap(Impl.gt(euint32.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates min(euint32 a, uint32 b) and returns the result. */ - function min(euint64 a, euint32 b) internal returns (euint64) { + function min(euint32 a, uint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint32(0); } + return euint32.wrap(Impl.min(euint32.unwrap(a), bytes32(uint256(b)), true)); + } + + /** + * @dev Evaluates min(uint32 a, euint32 b) and returns the result. + */ + function min(uint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(b)) { b = asEuint32(0); } - return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint32.wrap(Impl.min(euint32.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates max(euint32 a, uint32 b) and returns the result. */ - function max(euint64 a, euint32 b) internal returns (euint64) { + function max(euint32 a, uint32 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint32(0); } + return euint32.wrap(Impl.max(euint32.unwrap(a), bytes32(uint256(b)), true)); + } + + /** + * @dev Evaluates max(uint32 a, euint32 b) and returns the result. + */ + function max(uint32 a, euint32 b) internal returns (euint32) { if (!isInitialized(b)) { b = asEuint32(0); } - return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); + return euint32.wrap(Impl.max(euint32.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates add(euint64 a, uint64 b) and returns the result. */ - function add(euint64 a, euint64 b) internal returns (euint64) { + function add(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint64.wrap(Impl.add(euint64.unwrap(a), euint64.unwrap(b), false)); + return euint64.wrap(Impl.add(euint64.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates add(uint64 a, euint64 b) and returns the result. */ - function sub(euint64 a, euint64 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function add(uint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(b)) { b = asEuint64(0); } - return euint64.wrap(Impl.sub(euint64.unwrap(a), euint64.unwrap(b), false)); + return euint64.wrap(Impl.add(euint64.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates sub(euint64 a, uint64 b) and returns the result. */ - function mul(euint64 a, euint64 b) internal returns (euint64) { + function sub(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); } + return euint64.wrap(Impl.sub(euint64.unwrap(a), bytes32(uint256(b)), true)); + } + + /** + * @dev Evaluates sub(uint64 a, euint64 b) and returns the result. + */ + function sub(uint64 a, euint64 b) internal returns (euint64) { + euint64 aEnc = asEuint64(a); if (!isInitialized(b)) { b = asEuint64(0); } - return euint64.wrap(Impl.mul(euint64.unwrap(a), euint64.unwrap(b), false)); + return euint64.wrap(Impl.sub(euint64.unwrap(aEnc), euint64.unwrap(b), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates mul(euint64 a, uint64 b) and returns the result. */ - function and(euint64 a, euint64 b) internal returns (euint64) { + function mul(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); } + return euint64.wrap(Impl.mul(euint64.unwrap(a), bytes32(uint256(b)), true)); + } + + /** + * @dev Evaluates mul(uint64 a, euint64 b) and returns the result. + */ + function mul(uint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(b)) { b = asEuint64(0); } - return euint64.wrap(Impl.and(euint64.unwrap(a), euint64.unwrap(b), false)); + return euint64.wrap(Impl.mul(euint64.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates div(euint64 a, uint64 b) and returns the result. */ - function or(euint64 a, euint64 b) internal returns (euint64) { + function div(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint64.wrap(Impl.or(euint64.unwrap(a), euint64.unwrap(b), false)); + return euint64.wrap(Impl.div(euint64.unwrap(a), bytes32(uint256(b)))); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates rem(euint64 a, uint64 b) and returns the result. */ - function xor(euint64 a, euint64 b) internal returns (euint64) { + function rem(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint64.wrap(Impl.xor(euint64.unwrap(a), euint64.unwrap(b), false)); + return euint64.wrap(Impl.rem(euint64.unwrap(a), bytes32(uint256(b)))); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates and(euint64 a, uint64 b) and returns the result. */ - function eq(euint64 a, euint64 b) internal returns (ebool) { + function and(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); } + return euint64.wrap(Impl.and(euint64.unwrap(a), bytes32(uint256(b)), true)); + } + + /** + * @dev Evaluates and(uint64 a, euint64 b) and returns the result. + */ + function and(uint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(b)) { b = asEuint64(0); } - return ebool.wrap(Impl.eq(euint64.unwrap(a), euint64.unwrap(b), false)); + return euint64.wrap(Impl.and(euint64.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates or(euint64 a, uint64 b) and returns the result. */ - function ne(euint64 a, euint64 b) internal returns (ebool) { + function or(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); } + return euint64.wrap(Impl.or(euint64.unwrap(a), bytes32(uint256(b)), true)); + } + + /** + * @dev Evaluates or(uint64 a, euint64 b) and returns the result. + */ + function or(uint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(b)) { b = asEuint64(0); } - return ebool.wrap(Impl.ne(euint64.unwrap(a), euint64.unwrap(b), false)); + return euint64.wrap(Impl.or(euint64.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates xor(euint64 a, uint64 b) and returns the result. */ - function ge(euint64 a, euint64 b) internal returns (ebool) { + function xor(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); } + return euint64.wrap(Impl.xor(euint64.unwrap(a), bytes32(uint256(b)), true)); + } + + /** + * @dev Evaluates xor(uint64 a, euint64 b) and returns the result. + */ + function xor(uint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(b)) { b = asEuint64(0); } - return ebool.wrap(Impl.ge(euint64.unwrap(a), euint64.unwrap(b), false)); + return euint64.wrap(Impl.xor(euint64.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates eq(euint64 a, uint64 b) and returns the result. */ - function gt(euint64 a, euint64 b) internal returns (ebool) { + function eq(euint64 a, uint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); } + return ebool.wrap(Impl.eq(euint64.unwrap(a), bytes32(uint256(b)), true)); + } + + /** + * @dev Evaluates eq(uint64 a, euint64 b) and returns the result. + */ + function eq(uint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint64(0); } - return ebool.wrap(Impl.gt(euint64.unwrap(a), euint64.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint64.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates ne(euint64 a, uint64 b) and returns the result. */ - function le(euint64 a, euint64 b) internal returns (ebool) { + function ne(euint64 a, uint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); } + return ebool.wrap(Impl.ne(euint64.unwrap(a), bytes32(uint256(b)), true)); + } + + /** + * @dev Evaluates ne(uint64 a, euint64 b) and returns the result. + */ + function ne(uint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint64(0); } - return ebool.wrap(Impl.le(euint64.unwrap(a), euint64.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint64.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates ge(euint64 a, uint64 b) and returns the result. */ - function lt(euint64 a, euint64 b) internal returns (ebool) { + function ge(euint64 a, uint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); } + return ebool.wrap(Impl.ge(euint64.unwrap(a), bytes32(uint256(b)), true)); + } + + /** + * @dev Evaluates ge(uint64 a, euint64 b) and returns the result. + */ + function ge(uint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint64(0); } - return ebool.wrap(Impl.lt(euint64.unwrap(a), euint64.unwrap(b), false)); + return ebool.wrap(Impl.le(euint64.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates gt(euint64 a, uint64 b) and returns the result. */ - function min(euint64 a, euint64 b) internal returns (euint64) { + function gt(euint64 a, uint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); } + return ebool.wrap(Impl.gt(euint64.unwrap(a), bytes32(uint256(b)), true)); + } + + /** + * @dev Evaluates gt(uint64 a, euint64 b) and returns the result. + */ + function gt(uint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint64(0); } - return euint64.wrap(Impl.min(euint64.unwrap(a), euint64.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint64.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates le(euint64 a, uint64 b) and returns the result. */ - function max(euint64 a, euint64 b) internal returns (euint64) { + function le(euint64 a, uint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); } + return ebool.wrap(Impl.le(euint64.unwrap(a), bytes32(uint256(b)), true)); + } + + /** + * @dev Evaluates le(uint64 a, euint64 b) and returns the result. + */ + function le(uint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(b)) { b = asEuint64(0); } - return euint64.wrap(Impl.max(euint64.unwrap(a), euint64.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint64.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates lt(euint64 a, uint64 b) and returns the result. */ - function add(euint64 a, euint128 b) internal returns (euint128) { + function lt(euint64 a, uint64 b) internal returns (ebool) { if (!isInitialized(a)) { a = asEuint64(0); } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint128.wrap(Impl.add(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint64.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates lt(uint64 a, euint64 b) and returns the result. */ - function sub(euint64 a, euint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function lt(uint64 a, euint64 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint64(0); } - return euint128.wrap(Impl.sub(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint64.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates min(euint64 a, uint64 b) and returns the result. */ - function mul(euint64 a, euint128 b) internal returns (euint128) { + function min(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint128.wrap(Impl.mul(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint64.wrap(Impl.min(euint64.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates min(uint64 a, euint64 b) and returns the result. */ - function and(euint64 a, euint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function min(uint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint64(0); } - return euint128.wrap(Impl.and(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint64.wrap(Impl.min(euint64.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates max(euint64 a, uint64 b) and returns the result. */ - function or(euint64 a, euint128 b) internal returns (euint128) { + function max(euint64 a, uint64 b) internal returns (euint64) { if (!isInitialized(a)) { a = asEuint64(0); } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint128.wrap(Impl.or(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint64.wrap(Impl.max(euint64.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates max(uint64 a, euint64 b) and returns the result. */ - function xor(euint64 a, euint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function max(uint64 a, euint64 b) internal returns (euint64) { if (!isInitialized(b)) { - b = asEuint128(0); + b = asEuint64(0); } - return euint128.wrap(Impl.xor(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint64.wrap(Impl.max(euint64.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates add(euint128 a, uint128 b) and returns the result. */ - function eq(euint64 a, euint128 b) internal returns (ebool) { + function add(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); + a = asEuint128(0); } - return ebool.wrap(Impl.eq(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint128.wrap(Impl.add(euint128.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates add(uint128 a, euint128 b) and returns the result. */ - function ne(euint64 a, euint128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function add(uint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(b)) { b = asEuint128(0); } - return ebool.wrap(Impl.ne(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint128.wrap(Impl.add(euint128.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates sub(euint128 a, uint128 b) and returns the result. */ - function ge(euint64 a, euint128 b) internal returns (ebool) { + function sub(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint128(0); } + return euint128.wrap(Impl.sub(euint128.unwrap(a), bytes32(uint256(b)), true)); + } + + /** + * @dev Evaluates sub(uint128 a, euint128 b) and returns the result. + */ + function sub(uint128 a, euint128 b) internal returns (euint128) { + euint128 aEnc = asEuint128(a); if (!isInitialized(b)) { b = asEuint128(0); } - return ebool.wrap(Impl.ge(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint128.wrap(Impl.sub(euint128.unwrap(aEnc), euint128.unwrap(b), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates mul(euint128 a, uint128 b) and returns the result. */ - function gt(euint64 a, euint128 b) internal returns (ebool) { + function mul(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); + a = asEuint128(0); } - return ebool.wrap(Impl.gt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint128.wrap(Impl.mul(euint128.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates mul(uint128 a, euint128 b) and returns the result. */ - function le(euint64 a, euint128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function mul(uint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(b)) { b = asEuint128(0); } - return ebool.wrap(Impl.le(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint128.wrap(Impl.mul(euint128.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates div(euint128 a, uint128 b) and returns the result. */ - function lt(euint64 a, euint128 b) internal returns (ebool) { + function div(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); + a = asEuint128(0); } - return ebool.wrap(Impl.lt(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint128.wrap(Impl.div(euint128.unwrap(a), bytes32(uint256(b)))); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates rem(euint128 a, uint128 b) and returns the result. */ - function min(euint64 a, euint128 b) internal returns (euint128) { + function rem(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); + a = asEuint128(0); } - return euint128.wrap(Impl.min(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint128.wrap(Impl.rem(euint128.unwrap(a), bytes32(uint256(b)))); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates and(euint128 a, uint128 b) and returns the result. */ - function max(euint64 a, euint128 b) internal returns (euint128) { + function and(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint128(0); } + return euint128.wrap(Impl.and(euint128.unwrap(a), bytes32(uint256(b)), true)); + } + + /** + * @dev Evaluates and(uint128 a, euint128 b) and returns the result. + */ + function and(uint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(b)) { b = asEuint128(0); } - return euint128.wrap(Impl.max(euint128.unwrap(asEuint128(a)), euint128.unwrap(b), false)); + return euint128.wrap(Impl.and(euint128.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates or(euint128 a, uint128 b) and returns the result. */ - function add(euint64 a, euint256 b) internal returns (euint256) { + function or(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); + a = asEuint128(0); } - return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint128.wrap(Impl.or(euint128.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates or(uint128 a, euint128 b) and returns the result. */ - function sub(euint64 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function or(uint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint128(0); } - return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint128.wrap(Impl.or(euint128.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates xor(euint128 a, uint128 b) and returns the result. */ - function mul(euint64 a, euint256 b) internal returns (euint256) { + function xor(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); + a = asEuint128(0); } - return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint128.wrap(Impl.xor(euint128.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates xor(uint128 a, euint128 b) and returns the result. */ - function and(euint64 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function xor(uint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint128(0); } - return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return euint128.wrap(Impl.xor(euint128.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates eq(euint128 a, uint128 b) and returns the result. */ - function or(euint64 a, euint256 b) internal returns (euint256) { + function eq(euint128 a, uint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); + a = asEuint128(0); } - return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint128.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates eq(uint128 a, euint128 b) and returns the result. */ - function xor(euint64 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function eq(uint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint128(0); } - return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.eq(euint128.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates ne(euint128 a, uint128 b) and returns the result. */ - function eq(euint64 a, euint256 b) internal returns (ebool) { + function ne(euint128 a, uint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); + a = asEuint128(0); } - return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint128.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates ne(uint128 a, euint128 b) and returns the result. */ - function ne(euint64 a, euint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function ne(uint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint128(0); } - return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.ne(euint128.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates ge(euint128 a, uint128 b) and returns the result. */ - function ge(euint64 a, euint256 b) internal returns (ebool) { + function ge(euint128 a, uint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); + a = asEuint128(0); } - return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint128.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates ge(uint128 a, euint128 b) and returns the result. */ - function gt(euint64 a, euint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function ge(uint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint128(0); } - return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.le(euint128.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates gt(euint128 a, uint128 b) and returns the result. */ - function le(euint64 a, euint256 b) internal returns (ebool) { + function gt(euint128 a, uint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); + a = asEuint128(0); } - return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.gt(euint128.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates gt(uint128 a, euint128 b) and returns the result. */ - function lt(euint64 a, euint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function gt(uint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint128(0); } - return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.lt(euint128.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates le(euint128 a, uint128 b) and returns the result. */ - function min(euint64 a, euint256 b) internal returns (euint256) { + function le(euint128 a, uint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); + a = asEuint128(0); } - return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.le(euint128.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates le(uint128 a, euint128 b) and returns the result. */ - function max(euint64 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint64(0); - } + function le(uint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint256(0); + b = asEuint128(0); } - return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); + return ebool.wrap(Impl.ge(euint128.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates lt(euint128 a, uint128 b) and returns the result. */ - function add(euint64 a, uint64 b) internal returns (euint64) { + function lt(euint128 a, uint128 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint128(0); } - return euint64.wrap(Impl.add(euint64.unwrap(a), bytes32(uint256(b)), true)); + return ebool.wrap(Impl.lt(euint128.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates lt(uint128 a, euint128 b) and returns the result. */ - function add(uint64 a, euint64 b) internal returns (euint64) { + function lt(uint128 a, euint128 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint128(0); } - return euint64.wrap(Impl.add(euint64.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.gt(euint128.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates min(euint128 a, uint128 b) and returns the result. */ - function sub(euint64 a, uint64 b) internal returns (euint64) { + function min(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint128(0); } - return euint64.wrap(Impl.sub(euint64.unwrap(a), bytes32(uint256(b)), true)); + return euint128.wrap(Impl.min(euint128.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates min(uint128 a, euint128 b) and returns the result. */ - function sub(uint64 a, euint64 b) internal returns (euint64) { - euint64 aEnc = asEuint64(a); + function min(uint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint128(0); } - return euint64.wrap(Impl.sub(euint64.unwrap(aEnc), euint64.unwrap(b), false)); + return euint128.wrap(Impl.min(euint128.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates max(euint128 a, uint128 b) and returns the result. */ - function mul(euint64 a, uint64 b) internal returns (euint64) { + function max(euint128 a, uint128 b) internal returns (euint128) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint128(0); } - return euint64.wrap(Impl.mul(euint64.unwrap(a), bytes32(uint256(b)), true)); + return euint128.wrap(Impl.max(euint128.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates max(uint128 a, euint128 b) and returns the result. */ - function mul(uint64 a, euint64 b) internal returns (euint64) { + function max(uint128 a, euint128 b) internal returns (euint128) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint128(0); } - return euint64.wrap(Impl.mul(euint64.unwrap(b), bytes32(uint256(a)), true)); + return euint128.wrap(Impl.max(euint128.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates div(a, b) and returns the result. + * @dev Evaluates eq(eaddress a, address b) and returns the result. */ - function div(euint64 a, uint64 b) internal returns (euint64) { + function eq(eaddress a, address b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEaddress(address(0)); } - return euint64.wrap(Impl.div(euint64.unwrap(a), bytes32(uint256(b)))); + return ebool.wrap(Impl.eq(eaddress.unwrap(a), bytes32(uint256(uint160(b))), true)); } /** - * @dev Evaluates rem(a, b) and returns the result. + * @dev Evaluates eq(address a, eaddress b) and returns the result. */ - function rem(euint64 a, uint64 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); + function eq(address a, eaddress b) internal returns (ebool) { + if (!isInitialized(b)) { + b = asEaddress(address(0)); } - return euint64.wrap(Impl.rem(euint64.unwrap(a), bytes32(uint256(b)))); + return ebool.wrap(Impl.eq(eaddress.unwrap(b), bytes32(uint256(uint160(a))), true)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates ne(eaddress a, address b) and returns the result. */ - function and(euint64 a, uint64 b) internal returns (euint64) { + function ne(eaddress a, address b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEaddress(address(0)); } - return euint64.wrap(Impl.and(euint64.unwrap(a), bytes32(uint256(b)), true)); + return ebool.wrap(Impl.ne(eaddress.unwrap(a), bytes32(uint256(uint160(b))), true)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates ne(address a, eaddress b) and returns the result. */ - function and(uint64 a, euint64 b) internal returns (euint64) { + function ne(address a, eaddress b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEaddress(address(0)); } - return euint64.wrap(Impl.and(euint64.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.ne(eaddress.unwrap(b), bytes32(uint256(uint160(a))), true)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates and(euint256 a, uint256 b) and returns the result. */ - function or(euint64 a, uint64 b) internal returns (euint64) { + function and(euint256 a, uint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } - return euint64.wrap(Impl.or(euint64.unwrap(a), bytes32(uint256(b)), true)); + return euint256.wrap(Impl.and(euint256.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates and(uint256 a, euint256 b) and returns the result. */ - function or(uint64 a, euint64 b) internal returns (euint64) { + function and(uint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return euint64.wrap(Impl.or(euint64.unwrap(b), bytes32(uint256(a)), true)); + return euint256.wrap(Impl.and(euint256.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates or(euint256 a, uint256 b) and returns the result. */ - function xor(euint64 a, uint64 b) internal returns (euint64) { + function or(euint256 a, uint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } - return euint64.wrap(Impl.xor(euint64.unwrap(a), bytes32(uint256(b)), true)); + return euint256.wrap(Impl.or(euint256.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates or(uint256 a, euint256 b) and returns the result. */ - function xor(uint64 a, euint64 b) internal returns (euint64) { + function or(uint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return euint64.wrap(Impl.xor(euint64.unwrap(b), bytes32(uint256(a)), true)); + return euint256.wrap(Impl.or(euint256.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates xor(euint256 a, uint256 b) and returns the result. */ - function eq(euint64 a, uint64 b) internal returns (ebool) { + function xor(euint256 a, uint256 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } - return ebool.wrap(Impl.eq(euint64.unwrap(a), bytes32(uint256(b)), true)); + return euint256.wrap(Impl.xor(euint256.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates xor(uint256 a, euint256 b) and returns the result. */ - function eq(uint64 a, euint64 b) internal returns (ebool) { + function xor(uint256 a, euint256 b) internal returns (euint256) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return ebool.wrap(Impl.eq(euint64.unwrap(b), bytes32(uint256(a)), true)); + return euint256.wrap(Impl.xor(euint256.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates eq(euint256 a, uint256 b) and returns the result. */ - function ne(euint64 a, uint64 b) internal returns (ebool) { + function eq(euint256 a, uint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } - return ebool.wrap(Impl.ne(euint64.unwrap(a), bytes32(uint256(b)), true)); + return ebool.wrap(Impl.eq(euint256.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates eq(uint256 a, euint256 b) and returns the result. */ - function ne(uint64 a, euint64 b) internal returns (ebool) { + function eq(uint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return ebool.wrap(Impl.ne(euint64.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.eq(euint256.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates ne(euint256 a, uint256 b) and returns the result. */ - function ge(euint64 a, uint64 b) internal returns (ebool) { + function ne(euint256 a, uint256 b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEuint256(0); } - return ebool.wrap(Impl.ge(euint64.unwrap(a), bytes32(uint256(b)), true)); + return ebool.wrap(Impl.ne(euint256.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates ne(uint256 a, euint256 b) and returns the result. */ - function ge(uint64 a, euint64 b) internal returns (ebool) { + function ne(uint256 a, euint256 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEuint256(0); } - return ebool.wrap(Impl.le(euint64.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.ne(euint256.unwrap(b), bytes32(uint256(a)), true)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates eq(ebytes64 a, bytes memory b) and returns the result. */ - function gt(euint64 a, uint64 b) internal returns (ebool) { + function eq(ebytes64 a, bytes memory b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEbytes64(padToBytes64(hex"")); } - return ebool.wrap(Impl.gt(euint64.unwrap(a), bytes32(uint256(b)), true)); + return ebool.wrap(Impl.eq(ebytes64.unwrap(a), b, true)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates eq(bytes memory a, ebytes64 b) and returns the result. */ - function gt(uint64 a, euint64 b) internal returns (ebool) { + function eq(bytes memory a, ebytes64 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEbytes64(padToBytes64(hex"")); } - return ebool.wrap(Impl.lt(euint64.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.eq(ebytes64.unwrap(b), a, true)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates ne(ebytes64 a, bytes memory b) and returns the result. */ - function le(euint64 a, uint64 b) internal returns (ebool) { + function ne(ebytes64 a, bytes memory b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEbytes64(padToBytes64(hex"")); } - return ebool.wrap(Impl.le(euint64.unwrap(a), bytes32(uint256(b)), true)); + return ebool.wrap(Impl.ne(ebytes64.unwrap(a), b, true)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates ne(bytes memory a, ebytes64 b) and returns the result. */ - function le(uint64 a, euint64 b) internal returns (ebool) { + function ne(bytes memory a, ebytes64 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEbytes64(padToBytes64(hex"")); } - return ebool.wrap(Impl.ge(euint64.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.ne(ebytes64.unwrap(b), a, true)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates eq(ebytes128 a, bytes memory b) and returns the result. */ - function lt(euint64 a, uint64 b) internal returns (ebool) { + function eq(ebytes128 a, bytes memory b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEbytes128(padToBytes128(hex"")); } - return ebool.wrap(Impl.lt(euint64.unwrap(a), bytes32(uint256(b)), true)); + return ebool.wrap(Impl.eq(ebytes128.unwrap(a), b, true)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates eq(bytes memory a, ebytes128 b) and returns the result. */ - function lt(uint64 a, euint64 b) internal returns (ebool) { + function eq(bytes memory a, ebytes128 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEbytes128(padToBytes128(hex"")); } - return ebool.wrap(Impl.gt(euint64.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.eq(ebytes128.unwrap(b), a, true)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates ne(ebytes128 a, bytes memory b) and returns the result. */ - function min(euint64 a, uint64 b) internal returns (euint64) { + function ne(ebytes128 a, bytes memory b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEbytes128(padToBytes128(hex"")); } - return euint64.wrap(Impl.min(euint64.unwrap(a), bytes32(uint256(b)), true)); + return ebool.wrap(Impl.ne(ebytes128.unwrap(a), b, true)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates ne(bytes memory a, ebytes128 b) and returns the result. */ - function min(uint64 a, euint64 b) internal returns (euint64) { + function ne(bytes memory a, ebytes128 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEbytes128(padToBytes128(hex"")); } - return euint64.wrap(Impl.min(euint64.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.ne(ebytes128.unwrap(b), a, true)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates eq(ebytes256 a, bytes memory b) and returns the result. */ - function max(euint64 a, uint64 b) internal returns (euint64) { + function eq(ebytes256 a, bytes memory b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint64(0); + a = asEbytes256(padToBytes256(hex"")); } - return euint64.wrap(Impl.max(euint64.unwrap(a), bytes32(uint256(b)), true)); + return ebool.wrap(Impl.eq(ebytes256.unwrap(a), b, true)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates eq(bytes memory a, ebytes256 b) and returns the result. */ - function max(uint64 a, euint64 b) internal returns (euint64) { + function eq(bytes memory a, ebytes256 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint64(0); + b = asEbytes256(padToBytes256(hex"")); } - return euint64.wrap(Impl.max(euint64.unwrap(b), bytes32(uint256(a)), true)); + return ebool.wrap(Impl.eq(ebytes256.unwrap(b), a, true)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates ne(ebytes256 a, bytes memory b) and returns the result. */ - function add(euint128 a, euint4 b) internal returns (euint128) { + function ne(ebytes256 a, bytes memory b) internal returns (ebool) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); + a = asEbytes256(padToBytes256(hex"")); } - return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return ebool.wrap(Impl.ne(ebytes256.unwrap(a), b, true)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates ne(bytes memory a, ebytes256 b) and returns the result. */ - function sub(euint128 a, euint4 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } + function ne(bytes memory a, ebytes256 b) internal returns (ebool) { if (!isInitialized(b)) { - b = asEuint4(0); + b = asEbytes256(padToBytes256(hex"")); } - return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return ebool.wrap(Impl.ne(ebytes256.unwrap(b), a, true)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates shl(euint8 a, euint8 b) and returns the result. */ - function mul(euint128 a, euint4 b) internal returns (euint128) { + function shl(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint128(0); + a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint8(0); } - return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint8.wrap(Impl.shl(euint8.unwrap(a), euint8.unwrap(b), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates shl(euint8 a, uint8) and returns the result. */ - function and(euint128 a, euint4 b) internal returns (euint128) { + function shl(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); + a = asEuint8(0); } - return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint8.wrap(Impl.shl(euint8.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates shr(euint8 a, euint8 b) and returns the result. */ - function or(euint128 a, euint4 b) internal returns (euint128) { + function shr(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint128(0); + a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint8(0); } - return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint8.wrap(Impl.shr(euint8.unwrap(a), euint8.unwrap(b), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates shr(euint8 a, uint8) and returns the result. */ - function xor(euint128 a, euint4 b) internal returns (euint128) { + function shr(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); + a = asEuint8(0); } - return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint8.wrap(Impl.shr(euint8.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates rotl(euint8 a, euint8 b) and returns the result. */ - function eq(euint128 a, euint4 b) internal returns (ebool) { + function rotl(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint128(0); + a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint8(0); } - return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint8.wrap(Impl.rotl(euint8.unwrap(a), euint8.unwrap(b), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates rotl(euint8 a, uint8) and returns the result. */ - function ne(euint128 a, euint4 b) internal returns (ebool) { + function rotl(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); + a = asEuint8(0); } - return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint8.wrap(Impl.rotl(euint8.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates rotr(euint8 a, euint8 b) and returns the result. */ - function ge(euint128 a, euint4 b) internal returns (ebool) { + function rotr(euint8 a, euint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint128(0); + a = asEuint8(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint8(0); } - return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint8.wrap(Impl.rotr(euint8.unwrap(a), euint8.unwrap(b), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates rotr(euint8 a, uint8) and returns the result. */ - function gt(euint128 a, euint4 b) internal returns (ebool) { + function rotr(euint8 a, uint8 b) internal returns (euint8) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); + a = asEuint8(0); } - return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint8.wrap(Impl.rotr(euint8.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates shl(euint16 a, euint8 b) and returns the result. */ - function le(euint128 a, euint4 b) internal returns (ebool) { + function shl(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint128(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint8(0); } - return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint16.wrap(Impl.shl(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates shl(euint16 a, uint8) and returns the result. */ - function lt(euint128 a, euint4 b) internal returns (ebool) { + function shl(euint16 a, uint8 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); + a = asEuint16(0); } - return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint16.wrap(Impl.shl(euint16.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates shr(euint16 a, euint8 b) and returns the result. */ - function min(euint128 a, euint4 b) internal returns (euint128) { + function shr(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint128(0); + a = asEuint16(0); } if (!isInitialized(b)) { - b = asEuint4(0); + b = asEuint8(0); } - return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint16.wrap(Impl.shr(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates shr(euint16 a, uint8) and returns the result. */ - function max(euint128 a, euint4 b) internal returns (euint128) { + function shr(euint16 a, uint8 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); + a = asEuint16(0); } - return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint16.wrap(Impl.shr(euint16.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates rotl(euint16 a, euint8 b) and returns the result. */ - function add(euint128 a, euint8 b) internal returns (euint128) { + function rotl(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint128(0); + a = asEuint16(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint16.wrap(Impl.rotl(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates rotl(euint16 a, uint8) and returns the result. */ - function sub(euint128 a, euint8 b) internal returns (euint128) { + function rotl(euint16 a, uint8 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); + a = asEuint16(0); } - return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint16.wrap(Impl.rotl(euint16.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates rotr(euint16 a, euint8 b) and returns the result. */ - function mul(euint128 a, euint8 b) internal returns (euint128) { + function rotr(euint16 a, euint8 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint128(0); + a = asEuint16(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint16.wrap(Impl.rotr(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates rotr(euint16 a, uint8) and returns the result. */ - function and(euint128 a, euint8 b) internal returns (euint128) { + function rotr(euint16 a, uint8 b) internal returns (euint16) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); + a = asEuint16(0); } - return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint16.wrap(Impl.rotr(euint16.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates shl(euint32 a, euint8 b) and returns the result. */ - function or(euint128 a, euint8 b) internal returns (euint128) { + function shl(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint128(0); + a = asEuint32(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint32.wrap(Impl.shl(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates shl(euint32 a, uint8) and returns the result. */ - function xor(euint128 a, euint8 b) internal returns (euint128) { + function shl(euint32 a, uint8 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); + a = asEuint32(0); } - return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint32.wrap(Impl.shl(euint32.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates shr(euint32 a, euint8 b) and returns the result. */ - function eq(euint128 a, euint8 b) internal returns (ebool) { + function shr(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint128(0); + a = asEuint32(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint32.wrap(Impl.shr(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates shr(euint32 a, uint8) and returns the result. */ - function ne(euint128 a, euint8 b) internal returns (ebool) { + function shr(euint32 a, uint8 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); + a = asEuint32(0); } - return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint32.wrap(Impl.shr(euint32.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates rotl(euint32 a, euint8 b) and returns the result. */ - function ge(euint128 a, euint8 b) internal returns (ebool) { + function rotl(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint128(0); + a = asEuint32(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint32.wrap(Impl.rotl(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates rotl(euint32 a, uint8) and returns the result. */ - function gt(euint128 a, euint8 b) internal returns (ebool) { + function rotl(euint32 a, uint8 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); + a = asEuint32(0); } - return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint32.wrap(Impl.rotl(euint32.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates rotr(euint32 a, euint8 b) and returns the result. */ - function le(euint128 a, euint8 b) internal returns (ebool) { + function rotr(euint32 a, euint8 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint128(0); + a = asEuint32(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint32.wrap(Impl.rotr(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates rotr(euint32 a, uint8) and returns the result. */ - function lt(euint128 a, euint8 b) internal returns (ebool) { + function rotr(euint32 a, uint8 b) internal returns (euint32) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); + a = asEuint32(0); } - return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint32.wrap(Impl.rotr(euint32.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates shl(euint64 a, euint8 b) and returns the result. */ - function min(euint128 a, euint8 b) internal returns (euint128) { + function shl(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint128(0); + a = asEuint64(0); } if (!isInitialized(b)) { b = asEuint8(0); } - return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint64.wrap(Impl.shl(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates shl(euint64 a, uint8) and returns the result. */ - function max(euint128 a, euint8 b) internal returns (euint128) { + function shl(euint64 a, uint8 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); + a = asEuint64(0); } - return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint64.wrap(Impl.shl(euint64.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates shr(euint64 a, euint8 b) and returns the result. */ - function add(euint128 a, euint16 b) internal returns (euint128) { + function shr(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint128(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint8(0); } - return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint64.wrap(Impl.shr(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates shr(euint64 a, uint8) and returns the result. */ - function sub(euint128 a, euint16 b) internal returns (euint128) { + function shr(euint64 a, uint8 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); + a = asEuint64(0); } - return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint64.wrap(Impl.shr(euint64.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates rotl(euint64 a, euint8 b) and returns the result. */ - function mul(euint128 a, euint16 b) internal returns (euint128) { + function rotl(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint128(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint8(0); } - return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint64.wrap(Impl.rotl(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates rotl(euint64 a, uint8) and returns the result. */ - function and(euint128 a, euint16 b) internal returns (euint128) { + function rotl(euint64 a, uint8 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); + a = asEuint64(0); } - return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint64.wrap(Impl.rotl(euint64.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates rotr(euint64 a, euint8 b) and returns the result. */ - function or(euint128 a, euint16 b) internal returns (euint128) { + function rotr(euint64 a, euint8 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint128(0); + a = asEuint64(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint8(0); } - return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint64.wrap(Impl.rotr(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates rotr(euint64 a, uint8) and returns the result. */ - function xor(euint128 a, euint16 b) internal returns (euint128) { + function rotr(euint64 a, uint8 b) internal returns (euint64) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); + a = asEuint64(0); } - return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint64.wrap(Impl.rotr(euint64.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates shl(euint128 a, euint8 b) and returns the result. */ - function eq(euint128 a, euint16 b) internal returns (ebool) { + function shl(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint8(0); } - return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint128.wrap(Impl.shl(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates shl(euint128 a, uint8) and returns the result. */ - function ne(euint128 a, euint16 b) internal returns (ebool) { + function shl(euint128 a, uint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); } - if (!isInitialized(b)) { - b = asEuint16(0); - } - return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint128.wrap(Impl.shl(euint128.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev Evaluates shr(euint128 a, euint8 b) and returns the result. */ - function ge(euint128 a, euint16 b) internal returns (ebool) { + function shr(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint8(0); } - return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint128.wrap(Impl.shr(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev Evaluates shr(euint128 a, uint8) and returns the result. */ - function gt(euint128 a, euint16 b) internal returns (ebool) { + function shr(euint128 a, uint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); } - if (!isInitialized(b)) { - b = asEuint16(0); - } - return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint128.wrap(Impl.shr(euint128.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates le(a, b) and returns the result. + * @dev Evaluates rotl(euint128 a, euint8 b) and returns the result. */ - function le(euint128 a, euint16 b) internal returns (ebool) { + function rotl(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint8(0); } - return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint128.wrap(Impl.rotl(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev Evaluates rotl(euint128 a, uint8) and returns the result. */ - function lt(euint128 a, euint16 b) internal returns (ebool) { + function rotl(euint128 a, uint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); } - if (!isInitialized(b)) { - b = asEuint16(0); - } - return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint128.wrap(Impl.rotl(euint128.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates min(a, b) and returns the result. + * @dev Evaluates rotr(euint128 a, euint8 b) and returns the result. */ - function min(euint128 a, euint16 b) internal returns (euint128) { + function rotr(euint128 a, euint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); } if (!isInitialized(b)) { - b = asEuint16(0); + b = asEuint8(0); } - return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint128.wrap(Impl.rotr(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); } /** - * @dev Evaluates max(a, b) and returns the result. + * @dev Evaluates rotr(euint128 a, uint8) and returns the result. */ - function max(euint128 a, euint16 b) internal returns (euint128) { + function rotr(euint128 a, uint8 b) internal returns (euint128) { if (!isInitialized(a)) { a = asEuint128(0); } - if (!isInitialized(b)) { - b = asEuint16(0); - } - return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint128.wrap(Impl.rotr(euint128.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates add(a, b) and returns the result. + * @dev Evaluates shl(euint256 a, euint8 b) and returns the result. */ - function add(euint128 a, euint32 b) internal returns (euint128) { + function shl(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint128(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint256.wrap(Impl.shl(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates sub(a, b) and returns the result. + * @dev Evaluates shl(euint256 a, uint8) and returns the result. */ - function sub(euint128 a, euint32 b) internal returns (euint128) { + function shl(euint256 a, uint8 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); + a = asEuint256(0); } - return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint256.wrap(Impl.shl(euint256.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates mul(a, b) and returns the result. + * @dev Evaluates shr(euint256 a, euint8 b) and returns the result. */ - function mul(euint128 a, euint32 b) internal returns (euint128) { + function shr(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint128(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint256.wrap(Impl.shr(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates and(a, b) and returns the result. + * @dev Evaluates shr(euint256 a, uint8) and returns the result. */ - function and(euint128 a, euint32 b) internal returns (euint128) { + function shr(euint256 a, uint8 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); + a = asEuint256(0); } - return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint256.wrap(Impl.shr(euint256.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates or(a, b) and returns the result. + * @dev Evaluates rotl(euint256 a, euint8 b) and returns the result. */ - function or(euint128 a, euint32 b) internal returns (euint128) { + function rotl(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint128(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint256.wrap(Impl.rotl(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates xor(a, b) and returns the result. + * @dev Evaluates rotl(euint256 a, uint8) and returns the result. */ - function xor(euint128 a, euint32 b) internal returns (euint128) { + function rotl(euint256 a, uint8 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); + a = asEuint256(0); } - return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint256.wrap(Impl.rotl(euint256.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Evaluates rotr(euint256 a, euint8 b) and returns the result. */ - function eq(euint128 a, euint32 b) internal returns (ebool) { + function rotr(euint256 a, euint8 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint128(0); + a = asEuint256(0); } if (!isInitialized(b)) { - b = asEuint32(0); + b = asEuint8(0); } - return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint256.wrap(Impl.rotr(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Evaluates rotr(euint256 a, uint8) and returns the result. */ - function ne(euint128 a, euint32 b) internal returns (ebool) { + function rotr(euint256 a, uint8 b) internal returns (euint256) { if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); + a = asEuint256(0); } - return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + return euint256.wrap(Impl.rotr(euint256.unwrap(a), bytes32(uint256(b)), true)); } /** - * @dev Evaluates ge(a, b) and returns the result. + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. */ - function ge(euint128 a, euint32 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); - } - return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + function select(ebool control, ebool a, ebool b) internal returns (ebool) { + return ebool.wrap(Impl.select(ebool.unwrap(control), ebool.unwrap(a), ebool.unwrap(b))); } - /** - * @dev Evaluates gt(a, b) and returns the result. + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. */ - function gt(euint128 a, euint32 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); - } - return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + function select(ebool control, euint8 a, euint8 b) internal returns (euint8) { + return euint8.wrap(Impl.select(ebool.unwrap(control), euint8.unwrap(a), euint8.unwrap(b))); } - /** - * @dev Evaluates le(a, b) and returns the result. + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. */ - function le(euint128 a, euint32 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); - } - return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + function select(ebool control, euint16 a, euint16 b) internal returns (euint16) { + return euint16.wrap(Impl.select(ebool.unwrap(control), euint16.unwrap(a), euint16.unwrap(b))); } - /** - * @dev Evaluates lt(a, b) and returns the result. + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. */ - function lt(euint128 a, euint32 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); - } - return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + function select(ebool control, euint32 a, euint32 b) internal returns (euint32) { + return euint32.wrap(Impl.select(ebool.unwrap(control), euint32.unwrap(a), euint32.unwrap(b))); } - /** - * @dev Evaluates min(a, b) and returns the result. + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. */ - function min(euint128 a, euint32 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); - } - return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); + function select(ebool control, euint64 a, euint64 b) internal returns (euint64) { + return euint64.wrap(Impl.select(ebool.unwrap(control), euint64.unwrap(a), euint64.unwrap(b))); } - /** - * @dev Evaluates max(a, b) and returns the result. + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. */ - function max(euint128 a, euint32 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); - } - return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); - } - - /** - * @dev Evaluates add(a, b) and returns the result. - */ - function add(euint128 a, euint64 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); - } - - /** - * @dev Evaluates sub(a, b) and returns the result. - */ - function sub(euint128 a, euint64 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); - } - - /** - * @dev Evaluates mul(a, b) and returns the result. - */ - function mul(euint128 a, euint64 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(euint128 a, euint64 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(euint128 a, euint64 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(euint128 a, euint64 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(euint128 a, euint64 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(euint128 a, euint64 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); - } - - /** - * @dev Evaluates ge(a, b) and returns the result. - */ - function ge(euint128 a, euint64 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); - } - - /** - * @dev Evaluates gt(a, b) and returns the result. - */ - function gt(euint128 a, euint64 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); - } - - /** - * @dev Evaluates le(a, b) and returns the result. - */ - function le(euint128 a, euint64 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); - } - - /** - * @dev Evaluates lt(a, b) and returns the result. - */ - function lt(euint128 a, euint64 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); - } - - /** - * @dev Evaluates min(a, b) and returns the result. - */ - function min(euint128 a, euint64 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); - } - - /** - * @dev Evaluates max(a, b) and returns the result. - */ - function max(euint128 a, euint64 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); - } - - /** - * @dev Evaluates add(a, b) and returns the result. - */ - function add(euint128 a, euint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint128.wrap(Impl.add(euint128.unwrap(a), euint128.unwrap(b), false)); - } - - /** - * @dev Evaluates sub(a, b) and returns the result. - */ - function sub(euint128 a, euint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint128.wrap(Impl.sub(euint128.unwrap(a), euint128.unwrap(b), false)); - } - - /** - * @dev Evaluates mul(a, b) and returns the result. - */ - function mul(euint128 a, euint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint128.wrap(Impl.mul(euint128.unwrap(a), euint128.unwrap(b), false)); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(euint128 a, euint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint128.wrap(Impl.and(euint128.unwrap(a), euint128.unwrap(b), false)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(euint128 a, euint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint128.wrap(Impl.or(euint128.unwrap(a), euint128.unwrap(b), false)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(euint128 a, euint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint128.wrap(Impl.xor(euint128.unwrap(a), euint128.unwrap(b), false)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(euint128 a, euint128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return ebool.wrap(Impl.eq(euint128.unwrap(a), euint128.unwrap(b), false)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(euint128 a, euint128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return ebool.wrap(Impl.ne(euint128.unwrap(a), euint128.unwrap(b), false)); - } - - /** - * @dev Evaluates ge(a, b) and returns the result. - */ - function ge(euint128 a, euint128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return ebool.wrap(Impl.ge(euint128.unwrap(a), euint128.unwrap(b), false)); - } - - /** - * @dev Evaluates gt(a, b) and returns the result. - */ - function gt(euint128 a, euint128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return ebool.wrap(Impl.gt(euint128.unwrap(a), euint128.unwrap(b), false)); - } - - /** - * @dev Evaluates le(a, b) and returns the result. - */ - function le(euint128 a, euint128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return ebool.wrap(Impl.le(euint128.unwrap(a), euint128.unwrap(b), false)); - } - - /** - * @dev Evaluates lt(a, b) and returns the result. - */ - function lt(euint128 a, euint128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return ebool.wrap(Impl.lt(euint128.unwrap(a), euint128.unwrap(b), false)); - } - - /** - * @dev Evaluates min(a, b) and returns the result. - */ - function min(euint128 a, euint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint128.wrap(Impl.min(euint128.unwrap(a), euint128.unwrap(b), false)); - } - - /** - * @dev Evaluates max(a, b) and returns the result. - */ - function max(euint128 a, euint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint128.wrap(Impl.max(euint128.unwrap(a), euint128.unwrap(b), false)); - } - - /** - * @dev Evaluates add(a, b) and returns the result. - */ - function add(euint128 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.add(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates sub(a, b) and returns the result. - */ - function sub(euint128 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.sub(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates mul(a, b) and returns the result. - */ - function mul(euint128 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.mul(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(euint128 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.and(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(euint128 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.or(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(euint128 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.xor(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(euint128 a, euint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return ebool.wrap(Impl.eq(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(euint128 a, euint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return ebool.wrap(Impl.ne(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates ge(a, b) and returns the result. - */ - function ge(euint128 a, euint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return ebool.wrap(Impl.ge(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates gt(a, b) and returns the result. - */ - function gt(euint128 a, euint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return ebool.wrap(Impl.gt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates le(a, b) and returns the result. - */ - function le(euint128 a, euint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return ebool.wrap(Impl.le(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates lt(a, b) and returns the result. - */ - function lt(euint128 a, euint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return ebool.wrap(Impl.lt(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates min(a, b) and returns the result. - */ - function min(euint128 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.min(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates max(a, b) and returns the result. - */ - function max(euint128 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.max(euint256.unwrap(asEuint256(a)), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates add(a, b) and returns the result. - */ - function add(euint128 a, uint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - return euint128.wrap(Impl.add(euint128.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates add(a, b) and returns the result. - */ - function add(uint128 a, euint128 b) internal returns (euint128) { - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint128.wrap(Impl.add(euint128.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates sub(a, b) and returns the result. - */ - function sub(euint128 a, uint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - return euint128.wrap(Impl.sub(euint128.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates sub(a, b) and returns the result. - */ - function sub(uint128 a, euint128 b) internal returns (euint128) { - euint128 aEnc = asEuint128(a); - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint128.wrap(Impl.sub(euint128.unwrap(aEnc), euint128.unwrap(b), false)); - } - - /** - * @dev Evaluates mul(a, b) and returns the result. - */ - function mul(euint128 a, uint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - return euint128.wrap(Impl.mul(euint128.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates mul(a, b) and returns the result. - */ - function mul(uint128 a, euint128 b) internal returns (euint128) { - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint128.wrap(Impl.mul(euint128.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates div(a, b) and returns the result. - */ - function div(euint128 a, uint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - return euint128.wrap(Impl.div(euint128.unwrap(a), bytes32(uint256(b)))); - } - - /** - * @dev Evaluates rem(a, b) and returns the result. - */ - function rem(euint128 a, uint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - return euint128.wrap(Impl.rem(euint128.unwrap(a), bytes32(uint256(b)))); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(euint128 a, uint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - return euint128.wrap(Impl.and(euint128.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(uint128 a, euint128 b) internal returns (euint128) { - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint128.wrap(Impl.and(euint128.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(euint128 a, uint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - return euint128.wrap(Impl.or(euint128.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(uint128 a, euint128 b) internal returns (euint128) { - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint128.wrap(Impl.or(euint128.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(euint128 a, uint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - return euint128.wrap(Impl.xor(euint128.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(uint128 a, euint128 b) internal returns (euint128) { - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint128.wrap(Impl.xor(euint128.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(euint128 a, uint128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - return ebool.wrap(Impl.eq(euint128.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(uint128 a, euint128 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEuint128(0); - } - return ebool.wrap(Impl.eq(euint128.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(euint128 a, uint128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - return ebool.wrap(Impl.ne(euint128.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(uint128 a, euint128 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEuint128(0); - } - return ebool.wrap(Impl.ne(euint128.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates ge(a, b) and returns the result. - */ - function ge(euint128 a, uint128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - return ebool.wrap(Impl.ge(euint128.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates ge(a, b) and returns the result. - */ - function ge(uint128 a, euint128 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEuint128(0); - } - return ebool.wrap(Impl.le(euint128.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates gt(a, b) and returns the result. - */ - function gt(euint128 a, uint128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - return ebool.wrap(Impl.gt(euint128.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates gt(a, b) and returns the result. - */ - function gt(uint128 a, euint128 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEuint128(0); - } - return ebool.wrap(Impl.lt(euint128.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates le(a, b) and returns the result. - */ - function le(euint128 a, uint128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - return ebool.wrap(Impl.le(euint128.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates le(a, b) and returns the result. - */ - function le(uint128 a, euint128 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEuint128(0); - } - return ebool.wrap(Impl.ge(euint128.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates lt(a, b) and returns the result. - */ - function lt(euint128 a, uint128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - return ebool.wrap(Impl.lt(euint128.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates lt(a, b) and returns the result. - */ - function lt(uint128 a, euint128 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEuint128(0); - } - return ebool.wrap(Impl.gt(euint128.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates min(a, b) and returns the result. - */ - function min(euint128 a, uint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - return euint128.wrap(Impl.min(euint128.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates min(a, b) and returns the result. - */ - function min(uint128 a, euint128 b) internal returns (euint128) { - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint128.wrap(Impl.min(euint128.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates max(a, b) and returns the result. - */ - function max(euint128 a, uint128 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - return euint128.wrap(Impl.max(euint128.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates max(a, b) and returns the result. - */ - function max(uint128 a, euint128 b) internal returns (euint128) { - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint128.wrap(Impl.max(euint128.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates add(a, b) and returns the result. - */ - function add(euint256 a, euint4 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates sub(a, b) and returns the result. - */ - function sub(euint256 a, euint4 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates mul(a, b) and returns the result. - */ - function mul(euint256 a, euint4 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(euint256 a, euint4 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(euint256 a, euint4 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(euint256 a, euint4 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(euint256 a, euint4 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(euint256 a, euint4 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates ge(a, b) and returns the result. - */ - function ge(euint256 a, euint4 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates gt(a, b) and returns the result. - */ - function gt(euint256 a, euint4 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates le(a, b) and returns the result. - */ - function le(euint256 a, euint4 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates lt(a, b) and returns the result. - */ - function lt(euint256 a, euint4 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates min(a, b) and returns the result. - */ - function min(euint256 a, euint4 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates max(a, b) and returns the result. - */ - function max(euint256 a, euint4 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint4(0); - } - return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates add(a, b) and returns the result. - */ - function add(euint256 a, euint8 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates sub(a, b) and returns the result. - */ - function sub(euint256 a, euint8 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates mul(a, b) and returns the result. - */ - function mul(euint256 a, euint8 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(euint256 a, euint8 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(euint256 a, euint8 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(euint256 a, euint8 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(euint256 a, euint8 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(euint256 a, euint8 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates ge(a, b) and returns the result. - */ - function ge(euint256 a, euint8 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates gt(a, b) and returns the result. - */ - function gt(euint256 a, euint8 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates le(a, b) and returns the result. - */ - function le(euint256 a, euint8 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates lt(a, b) and returns the result. - */ - function lt(euint256 a, euint8 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates min(a, b) and returns the result. - */ - function min(euint256 a, euint8 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates max(a, b) and returns the result. - */ - function max(euint256 a, euint8 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates add(a, b) and returns the result. - */ - function add(euint256 a, euint16 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); - } - return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates sub(a, b) and returns the result. - */ - function sub(euint256 a, euint16 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); - } - return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates mul(a, b) and returns the result. - */ - function mul(euint256 a, euint16 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); - } - return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(euint256 a, euint16 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); - } - return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(euint256 a, euint16 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); - } - return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(euint256 a, euint16 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); - } - return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(euint256 a, euint16 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); - } - return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(euint256 a, euint16 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); - } - return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates ge(a, b) and returns the result. - */ - function ge(euint256 a, euint16 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); - } - return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates gt(a, b) and returns the result. - */ - function gt(euint256 a, euint16 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); - } - return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates le(a, b) and returns the result. - */ - function le(euint256 a, euint16 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); - } - return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates lt(a, b) and returns the result. - */ - function lt(euint256 a, euint16 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); - } - return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates min(a, b) and returns the result. - */ - function min(euint256 a, euint16 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); - } - return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates max(a, b) and returns the result. - */ - function max(euint256 a, euint16 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint16(0); - } - return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates add(a, b) and returns the result. - */ - function add(euint256 a, euint32 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); - } - return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates sub(a, b) and returns the result. - */ - function sub(euint256 a, euint32 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); - } - return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates mul(a, b) and returns the result. - */ - function mul(euint256 a, euint32 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); - } - return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(euint256 a, euint32 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); - } - return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(euint256 a, euint32 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); - } - return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(euint256 a, euint32 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); - } - return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(euint256 a, euint32 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); - } - return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(euint256 a, euint32 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); - } - return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates ge(a, b) and returns the result. - */ - function ge(euint256 a, euint32 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); - } - return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates gt(a, b) and returns the result. - */ - function gt(euint256 a, euint32 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); - } - return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates le(a, b) and returns the result. - */ - function le(euint256 a, euint32 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); - } - return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates lt(a, b) and returns the result. - */ - function lt(euint256 a, euint32 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); - } - return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates min(a, b) and returns the result. - */ - function min(euint256 a, euint32 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); - } - return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates max(a, b) and returns the result. - */ - function max(euint256 a, euint32 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint32(0); - } - return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates add(a, b) and returns the result. - */ - function add(euint256 a, euint64 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates sub(a, b) and returns the result. - */ - function sub(euint256 a, euint64 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates mul(a, b) and returns the result. - */ - function mul(euint256 a, euint64 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(euint256 a, euint64 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(euint256 a, euint64 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(euint256 a, euint64 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(euint256 a, euint64 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(euint256 a, euint64 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates ge(a, b) and returns the result. - */ - function ge(euint256 a, euint64 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates gt(a, b) and returns the result. - */ - function gt(euint256 a, euint64 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates le(a, b) and returns the result. - */ - function le(euint256 a, euint64 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates lt(a, b) and returns the result. - */ - function lt(euint256 a, euint64 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates min(a, b) and returns the result. - */ - function min(euint256 a, euint64 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates max(a, b) and returns the result. - */ - function max(euint256 a, euint64 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint64(0); - } - return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates add(a, b) and returns the result. - */ - function add(euint256 a, euint128 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates sub(a, b) and returns the result. - */ - function sub(euint256 a, euint128 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates mul(a, b) and returns the result. - */ - function mul(euint256 a, euint128 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(euint256 a, euint128 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(euint256 a, euint128 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(euint256 a, euint128 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(euint256 a, euint128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(euint256 a, euint128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates ge(a, b) and returns the result. - */ - function ge(euint256 a, euint128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates gt(a, b) and returns the result. - */ - function gt(euint256 a, euint128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates le(a, b) and returns the result. - */ - function le(euint256 a, euint128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates lt(a, b) and returns the result. - */ - function lt(euint256 a, euint128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates min(a, b) and returns the result. - */ - function min(euint256 a, euint128 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates max(a, b) and returns the result. - */ - function max(euint256 a, euint128 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint128(0); - } - return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates add(a, b) and returns the result. - */ - function add(euint256 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.add(euint256.unwrap(a), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates sub(a, b) and returns the result. - */ - function sub(euint256 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.sub(euint256.unwrap(a), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates mul(a, b) and returns the result. - */ - function mul(euint256 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.mul(euint256.unwrap(a), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(euint256 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.and(euint256.unwrap(a), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(euint256 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.or(euint256.unwrap(a), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(euint256 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.xor(euint256.unwrap(a), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(euint256 a, euint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return ebool.wrap(Impl.eq(euint256.unwrap(a), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(euint256 a, euint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return ebool.wrap(Impl.ne(euint256.unwrap(a), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates ge(a, b) and returns the result. - */ - function ge(euint256 a, euint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return ebool.wrap(Impl.ge(euint256.unwrap(a), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates gt(a, b) and returns the result. - */ - function gt(euint256 a, euint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return ebool.wrap(Impl.gt(euint256.unwrap(a), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates le(a, b) and returns the result. - */ - function le(euint256 a, euint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return ebool.wrap(Impl.le(euint256.unwrap(a), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates lt(a, b) and returns the result. - */ - function lt(euint256 a, euint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return ebool.wrap(Impl.lt(euint256.unwrap(a), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates min(a, b) and returns the result. - */ - function min(euint256 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.min(euint256.unwrap(a), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates max(a, b) and returns the result. - */ - function max(euint256 a, euint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.max(euint256.unwrap(a), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates add(a, b) and returns the result. - */ - function add(euint256 a, uint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - return euint256.wrap(Impl.add(euint256.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates add(a, b) and returns the result. - */ - function add(uint256 a, euint256 b) internal returns (euint256) { - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.add(euint256.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates sub(a, b) and returns the result. - */ - function sub(euint256 a, uint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - return euint256.wrap(Impl.sub(euint256.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates sub(a, b) and returns the result. - */ - function sub(uint256 a, euint256 b) internal returns (euint256) { - euint256 aEnc = asEuint256(a); - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.sub(euint256.unwrap(aEnc), euint256.unwrap(b), false)); - } - - /** - * @dev Evaluates mul(a, b) and returns the result. - */ - function mul(euint256 a, uint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - return euint256.wrap(Impl.mul(euint256.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates mul(a, b) and returns the result. - */ - function mul(uint256 a, euint256 b) internal returns (euint256) { - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.mul(euint256.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates div(a, b) and returns the result. - */ - function div(euint256 a, uint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - return euint256.wrap(Impl.div(euint256.unwrap(a), bytes32(uint256(b)))); - } - - /** - * @dev Evaluates rem(a, b) and returns the result. - */ - function rem(euint256 a, uint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - return euint256.wrap(Impl.rem(euint256.unwrap(a), bytes32(uint256(b)))); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(euint256 a, uint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - return euint256.wrap(Impl.and(euint256.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(uint256 a, euint256 b) internal returns (euint256) { - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.and(euint256.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(euint256 a, uint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - return euint256.wrap(Impl.or(euint256.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(uint256 a, euint256 b) internal returns (euint256) { - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.or(euint256.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(euint256 a, uint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - return euint256.wrap(Impl.xor(euint256.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(uint256 a, euint256 b) internal returns (euint256) { - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.xor(euint256.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(euint256 a, uint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - return ebool.wrap(Impl.eq(euint256.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates eq(a, b) and returns the result. - */ - function eq(uint256 a, euint256 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEuint256(0); - } - return ebool.wrap(Impl.eq(euint256.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(euint256 a, uint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - return ebool.wrap(Impl.ne(euint256.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(uint256 a, euint256 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEuint256(0); - } - return ebool.wrap(Impl.ne(euint256.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates ge(a, b) and returns the result. - */ - function ge(euint256 a, uint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - return ebool.wrap(Impl.ge(euint256.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates ge(a, b) and returns the result. - */ - function ge(uint256 a, euint256 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEuint256(0); - } - return ebool.wrap(Impl.le(euint256.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates gt(a, b) and returns the result. - */ - function gt(euint256 a, uint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - return ebool.wrap(Impl.gt(euint256.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates gt(a, b) and returns the result. - */ - function gt(uint256 a, euint256 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEuint256(0); - } - return ebool.wrap(Impl.lt(euint256.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates le(a, b) and returns the result. - */ - function le(euint256 a, uint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - return ebool.wrap(Impl.le(euint256.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates le(a, b) and returns the result. - */ - function le(uint256 a, euint256 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEuint256(0); - } - return ebool.wrap(Impl.ge(euint256.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates lt(a, b) and returns the result. - */ - function lt(euint256 a, uint256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - return ebool.wrap(Impl.lt(euint256.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates lt(a, b) and returns the result. - */ - function lt(uint256 a, euint256 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEuint256(0); - } - return ebool.wrap(Impl.gt(euint256.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates min(a, b) and returns the result. - */ - function min(euint256 a, uint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - return euint256.wrap(Impl.min(euint256.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates min(a, b) and returns the result. - */ - function min(uint256 a, euint256 b) internal returns (euint256) { - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.min(euint256.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates max(a, b) and returns the result. - */ - function max(euint256 a, uint256 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - return euint256.wrap(Impl.max(euint256.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates max(a, b) and returns the result. - */ - function max(uint256 a, euint256 b) internal returns (euint256) { - if (!isInitialized(b)) { - b = asEuint256(0); - } - return euint256.wrap(Impl.max(euint256.unwrap(b), bytes32(uint256(a)), true)); - } - - /** - * @dev Evaluates shl(a, b) and returns the result. - */ - function shl(euint4 a, uint8 b) internal returns (euint4) { - if (!isInitialized(a)) { - a = asEuint4(0); - } - return euint4.wrap(Impl.shl(euint4.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates shr(a, b) and returns the result. - */ - function shr(euint4 a, uint8 b) internal returns (euint4) { - if (!isInitialized(a)) { - a = asEuint4(0); - } - return euint4.wrap(Impl.shr(euint4.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates rotl(a, b) and returns the result. - */ - function rotl(euint4 a, uint8 b) internal returns (euint4) { - if (!isInitialized(a)) { - a = asEuint4(0); - } - return euint4.wrap(Impl.rotl(euint4.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates rotr(a, b) and returns the result. - */ - function rotr(euint4 a, uint8 b) internal returns (euint4) { - if (!isInitialized(a)) { - a = asEuint4(0); - } - return euint4.wrap(Impl.rotr(euint4.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates shl(a, b) and returns the result. - */ - function shl(euint8 a, euint8 b) internal returns (euint8) { - if (!isInitialized(a)) { - a = asEuint8(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint8.wrap(Impl.shl(euint8.unwrap(a), euint8.unwrap(b), false)); - } - - /** - * @dev Evaluates shl(a, b) and returns the result. - */ - function shl(euint8 a, uint8 b) internal returns (euint8) { - if (!isInitialized(a)) { - a = asEuint8(0); - } - return euint8.wrap(Impl.shl(euint8.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates shr(a, b) and returns the result. - */ - function shr(euint8 a, euint8 b) internal returns (euint8) { - if (!isInitialized(a)) { - a = asEuint8(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint8.wrap(Impl.shr(euint8.unwrap(a), euint8.unwrap(b), false)); - } - - /** - * @dev Evaluates shr(a, b) and returns the result. - */ - function shr(euint8 a, uint8 b) internal returns (euint8) { - if (!isInitialized(a)) { - a = asEuint8(0); - } - return euint8.wrap(Impl.shr(euint8.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates rotl(a, b) and returns the result. - */ - function rotl(euint8 a, euint8 b) internal returns (euint8) { - if (!isInitialized(a)) { - a = asEuint8(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint8.wrap(Impl.rotl(euint8.unwrap(a), euint8.unwrap(b), false)); - } - - /** - * @dev Evaluates rotl(a, b) and returns the result. - */ - function rotl(euint8 a, uint8 b) internal returns (euint8) { - if (!isInitialized(a)) { - a = asEuint8(0); - } - return euint8.wrap(Impl.rotl(euint8.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates rotr(a, b) and returns the result. - */ - function rotr(euint8 a, euint8 b) internal returns (euint8) { - if (!isInitialized(a)) { - a = asEuint8(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint8.wrap(Impl.rotr(euint8.unwrap(a), euint8.unwrap(b), false)); - } - - /** - * @dev Evaluates rotr(a, b) and returns the result. - */ - function rotr(euint8 a, uint8 b) internal returns (euint8) { - if (!isInitialized(a)) { - a = asEuint8(0); - } - return euint8.wrap(Impl.rotr(euint8.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates shl(a, b) and returns the result. - */ - function shl(euint16 a, euint8 b) internal returns (euint16) { - if (!isInitialized(a)) { - a = asEuint16(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint16.wrap(Impl.shl(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); - } - - /** - * @dev Evaluates shl(a, b) and returns the result. - */ - function shl(euint16 a, uint8 b) internal returns (euint16) { - if (!isInitialized(a)) { - a = asEuint16(0); - } - return euint16.wrap(Impl.shl(euint16.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates shr(a, b) and returns the result. - */ - function shr(euint16 a, euint8 b) internal returns (euint16) { - if (!isInitialized(a)) { - a = asEuint16(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint16.wrap(Impl.shr(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); - } - - /** - * @dev Evaluates shr(a, b) and returns the result. - */ - function shr(euint16 a, uint8 b) internal returns (euint16) { - if (!isInitialized(a)) { - a = asEuint16(0); - } - return euint16.wrap(Impl.shr(euint16.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates rotl(a, b) and returns the result. - */ - function rotl(euint16 a, euint8 b) internal returns (euint16) { - if (!isInitialized(a)) { - a = asEuint16(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint16.wrap(Impl.rotl(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); - } - - /** - * @dev Evaluates rotl(a, b) and returns the result. - */ - function rotl(euint16 a, uint8 b) internal returns (euint16) { - if (!isInitialized(a)) { - a = asEuint16(0); - } - return euint16.wrap(Impl.rotl(euint16.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates rotr(a, b) and returns the result. - */ - function rotr(euint16 a, euint8 b) internal returns (euint16) { - if (!isInitialized(a)) { - a = asEuint16(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint16.wrap(Impl.rotr(euint16.unwrap(a), euint16.unwrap(asEuint16(b)), false)); - } - - /** - * @dev Evaluates rotr(a, b) and returns the result. - */ - function rotr(euint16 a, uint8 b) internal returns (euint16) { - if (!isInitialized(a)) { - a = asEuint16(0); - } - return euint16.wrap(Impl.rotr(euint16.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates shl(a, b) and returns the result. - */ - function shl(euint32 a, euint8 b) internal returns (euint32) { - if (!isInitialized(a)) { - a = asEuint32(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint32.wrap(Impl.shl(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); - } - - /** - * @dev Evaluates shl(a, b) and returns the result. - */ - function shl(euint32 a, uint8 b) internal returns (euint32) { - if (!isInitialized(a)) { - a = asEuint32(0); - } - return euint32.wrap(Impl.shl(euint32.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates shr(a, b) and returns the result. - */ - function shr(euint32 a, euint8 b) internal returns (euint32) { - if (!isInitialized(a)) { - a = asEuint32(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint32.wrap(Impl.shr(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); - } - - /** - * @dev Evaluates shr(a, b) and returns the result. - */ - function shr(euint32 a, uint8 b) internal returns (euint32) { - if (!isInitialized(a)) { - a = asEuint32(0); - } - return euint32.wrap(Impl.shr(euint32.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates rotl(a, b) and returns the result. - */ - function rotl(euint32 a, euint8 b) internal returns (euint32) { - if (!isInitialized(a)) { - a = asEuint32(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint32.wrap(Impl.rotl(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); - } - - /** - * @dev Evaluates rotl(a, b) and returns the result. - */ - function rotl(euint32 a, uint8 b) internal returns (euint32) { - if (!isInitialized(a)) { - a = asEuint32(0); - } - return euint32.wrap(Impl.rotl(euint32.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates rotr(a, b) and returns the result. - */ - function rotr(euint32 a, euint8 b) internal returns (euint32) { - if (!isInitialized(a)) { - a = asEuint32(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint32.wrap(Impl.rotr(euint32.unwrap(a), euint32.unwrap(asEuint32(b)), false)); - } - - /** - * @dev Evaluates rotr(a, b) and returns the result. - */ - function rotr(euint32 a, uint8 b) internal returns (euint32) { - if (!isInitialized(a)) { - a = asEuint32(0); - } - return euint32.wrap(Impl.rotr(euint32.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates shl(a, b) and returns the result. - */ - function shl(euint64 a, euint8 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint64.wrap(Impl.shl(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); - } - - /** - * @dev Evaluates shl(a, b) and returns the result. - */ - function shl(euint64 a, uint8 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } - return euint64.wrap(Impl.shl(euint64.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates shr(a, b) and returns the result. - */ - function shr(euint64 a, euint8 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint64.wrap(Impl.shr(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); - } - - /** - * @dev Evaluates shr(a, b) and returns the result. - */ - function shr(euint64 a, uint8 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } - return euint64.wrap(Impl.shr(euint64.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates rotl(a, b) and returns the result. - */ - function rotl(euint64 a, euint8 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint64.wrap(Impl.rotl(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); - } - - /** - * @dev Evaluates rotl(a, b) and returns the result. - */ - function rotl(euint64 a, uint8 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } - return euint64.wrap(Impl.rotl(euint64.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates rotr(a, b) and returns the result. - */ - function rotr(euint64 a, euint8 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint64.wrap(Impl.rotr(euint64.unwrap(a), euint64.unwrap(asEuint64(b)), false)); - } - - /** - * @dev Evaluates rotr(a, b) and returns the result. - */ - function rotr(euint64 a, uint8 b) internal returns (euint64) { - if (!isInitialized(a)) { - a = asEuint64(0); - } - return euint64.wrap(Impl.rotr(euint64.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates shl(a, b) and returns the result. - */ - function shl(euint128 a, euint8 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint128.wrap(Impl.shl(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); - } - - /** - * @dev Evaluates shl(a, b) and returns the result. - */ - function shl(euint128 a, uint8 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - return euint128.wrap(Impl.shl(euint128.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates shr(a, b) and returns the result. - */ - function shr(euint128 a, euint8 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint128.wrap(Impl.shr(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); - } - - /** - * @dev Evaluates shr(a, b) and returns the result. - */ - function shr(euint128 a, uint8 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - return euint128.wrap(Impl.shr(euint128.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates rotl(a, b) and returns the result. - */ - function rotl(euint128 a, euint8 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint128.wrap(Impl.rotl(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); - } - - /** - * @dev Evaluates rotl(a, b) and returns the result. - */ - function rotl(euint128 a, uint8 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - return euint128.wrap(Impl.rotl(euint128.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates rotr(a, b) and returns the result. - */ - function rotr(euint128 a, euint8 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint128.wrap(Impl.rotr(euint128.unwrap(a), euint128.unwrap(asEuint128(b)), false)); - } - - /** - * @dev Evaluates rotr(a, b) and returns the result. - */ - function rotr(euint128 a, uint8 b) internal returns (euint128) { - if (!isInitialized(a)) { - a = asEuint128(0); - } - return euint128.wrap(Impl.rotr(euint128.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates shl(a, b) and returns the result. - */ - function shl(euint256 a, euint8 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint256.wrap(Impl.shl(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates shl(a, b) and returns the result. - */ - function shl(euint256 a, uint8 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - return euint256.wrap(Impl.shl(euint256.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates shr(a, b) and returns the result. - */ - function shr(euint256 a, euint8 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint256.wrap(Impl.shr(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates shr(a, b) and returns the result. - */ - function shr(euint256 a, uint8 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - return euint256.wrap(Impl.shr(euint256.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates rotl(a, b) and returns the result. - */ - function rotl(euint256 a, euint8 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint256.wrap(Impl.rotl(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates rotl(a, b) and returns the result. - */ - function rotl(euint256 a, uint8 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - return euint256.wrap(Impl.rotl(euint256.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev Evaluates rotr(a, b) and returns the result. - */ - function rotr(euint256 a, euint8 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - if (!isInitialized(b)) { - b = asEuint8(0); - } - return euint256.wrap(Impl.rotr(euint256.unwrap(a), euint256.unwrap(asEuint256(b)), false)); - } - - /** - * @dev Evaluates rotr(a, b) and returns the result. - */ - function rotr(euint256 a, uint8 b) internal returns (euint256) { - if (!isInitialized(a)) { - a = asEuint256(0); - } - return euint256.wrap(Impl.rotr(euint256.unwrap(a), bytes32(uint256(b)), true)); - } - - /** - * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. - * If 'control's value is 'false', the result has the same value as 'ifFalse'. - */ - function select(ebool control, euint4 a, euint4 b) internal returns (euint4) { - return euint4.wrap(Impl.select(ebool.unwrap(control), euint4.unwrap(a), euint4.unwrap(b))); - } - /** - * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. - * If 'control's value is 'false', the result has the same value as 'ifFalse'. - */ - function select(ebool control, euint8 a, euint8 b) internal returns (euint8) { - return euint8.wrap(Impl.select(ebool.unwrap(control), euint8.unwrap(a), euint8.unwrap(b))); - } - /** - * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. - * If 'control's value is 'false', the result has the same value as 'ifFalse'. - */ - function select(ebool control, euint16 a, euint16 b) internal returns (euint16) { - return euint16.wrap(Impl.select(ebool.unwrap(control), euint16.unwrap(a), euint16.unwrap(b))); - } - /** - * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. - * If 'control's value is 'false', the result has the same value as 'ifFalse'. - */ - function select(ebool control, euint32 a, euint32 b) internal returns (euint32) { - return euint32.wrap(Impl.select(ebool.unwrap(control), euint32.unwrap(a), euint32.unwrap(b))); - } - /** - * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. - * If 'control's value is 'false', the result has the same value as 'ifFalse'. - */ - function select(ebool control, euint64 a, euint64 b) internal returns (euint64) { - return euint64.wrap(Impl.select(ebool.unwrap(control), euint64.unwrap(a), euint64.unwrap(b))); - } - /** - * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. - * If 'control's value is 'false', the result has the same value as 'ifFalse'. - */ - function select(ebool control, euint128 a, euint128 b) internal returns (euint128) { - return euint128.wrap(Impl.select(ebool.unwrap(control), euint128.unwrap(a), euint128.unwrap(b))); - } - /** - * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. - * If 'control's value is 'false', the result has the same value as 'ifFalse'. - */ - function select(ebool control, euint256 a, euint256 b) internal returns (euint256) { - return euint256.wrap(Impl.select(ebool.unwrap(control), euint256.unwrap(a), euint256.unwrap(b))); - } - /** - * @dev Casts an encrypted integer from euint8 to euint4. - */ - function asEuint4(euint8 value) internal returns (euint4) { - return euint4.wrap(Impl.cast(euint8.unwrap(value), Common.euint4_t)); - } - - /** - * @dev Casts an encrypted integer from euint16 to euint4. - */ - function asEuint4(euint16 value) internal returns (euint4) { - return euint4.wrap(Impl.cast(euint16.unwrap(value), Common.euint4_t)); - } - - /** - * @dev Casts an encrypted integer from euint32 to euint4. - */ - function asEuint4(euint32 value) internal returns (euint4) { - return euint4.wrap(Impl.cast(euint32.unwrap(value), Common.euint4_t)); - } - - /** - * @dev Casts an encrypted integer from euint64 to euint4. - */ - function asEuint4(euint64 value) internal returns (euint4) { - return euint4.wrap(Impl.cast(euint64.unwrap(value), Common.euint4_t)); - } - - /** - * @dev Casts an encrypted integer from euint128 to euint4. - */ - function asEuint4(euint128 value) internal returns (euint4) { - return euint4.wrap(Impl.cast(euint128.unwrap(value), Common.euint4_t)); - } - - /** - * @dev Casts an encrypted integer from euint256 to euint4. - */ - function asEuint4(euint256 value) internal returns (euint4) { - return euint4.wrap(Impl.cast(euint256.unwrap(value), Common.euint4_t)); - } - - /** - * @dev Casts an encrypted integer from euint4 to ebool. - */ - function asEbool(euint4 value) internal returns (ebool) { - return ne(value, 0); - } - - /** - * @dev Converts an 'ebool' to an 'euint4'. - */ - function asEuint4(ebool b) internal returns (euint4) { - return euint4.wrap(Impl.cast(ebool.unwrap(b), Common.euint4_t)); - } - - /** - * @dev Casts an encrypted integer from euint4 to euint8. - */ - function asEuint8(euint4 value) internal returns (euint8) { - return euint8.wrap(Impl.cast(euint4.unwrap(value), Common.euint8_t)); - } - - /** - * @dev Casts an encrypted integer from euint16 to euint8. - */ - function asEuint8(euint16 value) internal returns (euint8) { - return euint8.wrap(Impl.cast(euint16.unwrap(value), Common.euint8_t)); - } - - /** - * @dev Casts an encrypted integer from euint32 to euint8. - */ - function asEuint8(euint32 value) internal returns (euint8) { - return euint8.wrap(Impl.cast(euint32.unwrap(value), Common.euint8_t)); - } - - /** - * @dev Casts an encrypted integer from euint64 to euint8. - */ - function asEuint8(euint64 value) internal returns (euint8) { - return euint8.wrap(Impl.cast(euint64.unwrap(value), Common.euint8_t)); - } - - /** - * @dev Casts an encrypted integer from euint128 to euint8. - */ - function asEuint8(euint128 value) internal returns (euint8) { - return euint8.wrap(Impl.cast(euint128.unwrap(value), Common.euint8_t)); - } - - /** - * @dev Casts an encrypted integer from euint256 to euint8. - */ - function asEuint8(euint256 value) internal returns (euint8) { - return euint8.wrap(Impl.cast(euint256.unwrap(value), Common.euint8_t)); - } - - /** - * @dev Casts an encrypted integer from euint8 to ebool. - */ - function asEbool(euint8 value) internal returns (ebool) { - return ne(value, 0); - } - - /** - * @dev Converts an inputHandle with corresponding inputProof to an encrypted boolean. - */ - function asEbool(einput inputHandle, bytes memory inputProof) internal returns (ebool) { - return ebool.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebool_t)); - } - - /** - * @dev Converts a plaintext value to an encrypted boolean. - */ - function asEbool(uint256 value) internal returns (ebool) { - return ebool.wrap(Impl.trivialEncrypt(value, Common.ebool_t)); - } - - /** - * @dev Converts a plaintext boolean to an encrypted boolean. - */ - function asEbool(bool value) internal returns (ebool) { - if (value) { - return asEbool(uint256(1)); - } else { - return asEbool(uint256(0)); - } - } - - /** - * @dev Converts an 'ebool' to an 'euint8'. - */ - function asEuint8(ebool value) internal returns (euint8) { - return euint8.wrap(Impl.cast(ebool.unwrap(value), Common.euint8_t)); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(ebool a, ebool b) internal returns (ebool) { - return ebool.wrap(Impl.and(ebool.unwrap(a), ebool.unwrap(b), false)); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(ebool a, bool b) internal returns (ebool) { - return ebool.wrap(Impl.and(ebool.unwrap(a), bytes32(uint256(b ? 1 : 0)), true)); - } - - /** - * @dev Evaluates and(a, b) and returns the result. - */ - function and(bool a, ebool b) internal returns (ebool) { - return ebool.wrap(Impl.and(ebool.unwrap(b), bytes32(uint256(a ? 1 : 0)), true)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(ebool a, ebool b) internal returns (ebool) { - return ebool.wrap(Impl.or(ebool.unwrap(a), ebool.unwrap(b), false)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(ebool a, bool b) internal returns (ebool) { - return ebool.wrap(Impl.or(ebool.unwrap(a), bytes32(uint256(b ? 1 : 0)), true)); - } - - /** - * @dev Evaluates or(a, b) and returns the result. - */ - function or(bool a, ebool b) internal returns (ebool) { - return ebool.wrap(Impl.or(ebool.unwrap(b), bytes32(uint256(a ? 1 : 0)), true)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(ebool a, ebool b) internal returns (ebool) { - return ebool.wrap(Impl.xor(ebool.unwrap(a), ebool.unwrap(b), false)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(ebool a, bool b) internal returns (ebool) { - return ebool.wrap(Impl.xor(ebool.unwrap(a), bytes32(uint256(b ? 1 : 0)), true)); - } - - /** - * @dev Evaluates xor(a, b) and returns the result. - */ - function xor(bool a, ebool b) internal returns (ebool) { - return ebool.wrap(Impl.xor(ebool.unwrap(b), bytes32(uint256(a ? 1 : 0)), true)); - } - - function not(ebool a) internal returns (ebool) { - return ebool.wrap(Impl.not(ebool.unwrap(a))); - } - - /** - * @dev Casts an encrypted integer from euint4 to euint16. - */ - function asEuint16(euint4 value) internal returns (euint16) { - return euint16.wrap(Impl.cast(euint4.unwrap(value), Common.euint16_t)); - } - - /** - * @dev Casts an encrypted integer from euint8 to euint16. - */ - function asEuint16(euint8 value) internal returns (euint16) { - return euint16.wrap(Impl.cast(euint8.unwrap(value), Common.euint16_t)); - } - - /** - * @dev Casts an encrypted integer from euint32 to euint16. - */ - function asEuint16(euint32 value) internal returns (euint16) { - return euint16.wrap(Impl.cast(euint32.unwrap(value), Common.euint16_t)); - } - - /** - * @dev Casts an encrypted integer from euint64 to euint16. - */ - function asEuint16(euint64 value) internal returns (euint16) { - return euint16.wrap(Impl.cast(euint64.unwrap(value), Common.euint16_t)); - } - - /** - * @dev Casts an encrypted integer from euint128 to euint16. - */ - function asEuint16(euint128 value) internal returns (euint16) { - return euint16.wrap(Impl.cast(euint128.unwrap(value), Common.euint16_t)); - } - - /** - * @dev Casts an encrypted integer from euint256 to euint16. - */ - function asEuint16(euint256 value) internal returns (euint16) { - return euint16.wrap(Impl.cast(euint256.unwrap(value), Common.euint16_t)); - } - - /** - * @dev Casts an encrypted integer from euint16 to ebool. - */ - function asEbool(euint16 value) internal returns (ebool) { - return ne(value, 0); - } - - /** - * @dev Converts an 'ebool' to an 'euint16'. - */ - function asEuint16(ebool b) internal returns (euint16) { - return euint16.wrap(Impl.cast(ebool.unwrap(b), Common.euint16_t)); - } - - /** - * @dev Casts an encrypted integer from euint4 to euint32. - */ - function asEuint32(euint4 value) internal returns (euint32) { - return euint32.wrap(Impl.cast(euint4.unwrap(value), Common.euint32_t)); - } - - /** - * @dev Casts an encrypted integer from euint8 to euint32. - */ - function asEuint32(euint8 value) internal returns (euint32) { - return euint32.wrap(Impl.cast(euint8.unwrap(value), Common.euint32_t)); - } - - /** - * @dev Casts an encrypted integer from euint16 to euint32. - */ - function asEuint32(euint16 value) internal returns (euint32) { - return euint32.wrap(Impl.cast(euint16.unwrap(value), Common.euint32_t)); - } - - /** - * @dev Casts an encrypted integer from euint64 to euint32. - */ - function asEuint32(euint64 value) internal returns (euint32) { - return euint32.wrap(Impl.cast(euint64.unwrap(value), Common.euint32_t)); - } - - /** - * @dev Casts an encrypted integer from euint128 to euint32. - */ - function asEuint32(euint128 value) internal returns (euint32) { - return euint32.wrap(Impl.cast(euint128.unwrap(value), Common.euint32_t)); - } - - /** - * @dev Casts an encrypted integer from euint256 to euint32. - */ - function asEuint32(euint256 value) internal returns (euint32) { - return euint32.wrap(Impl.cast(euint256.unwrap(value), Common.euint32_t)); - } - - /** - * @dev Casts an encrypted integer from euint32 to ebool. - */ - function asEbool(euint32 value) internal returns (ebool) { - return ne(value, 0); - } - - /** - * @dev Converts an 'ebool' to an 'euint32'. - */ - function asEuint32(ebool b) internal returns (euint32) { - return euint32.wrap(Impl.cast(ebool.unwrap(b), Common.euint32_t)); - } - - /** - * @dev Casts an encrypted integer from euint4 to euint64. - */ - function asEuint64(euint4 value) internal returns (euint64) { - return euint64.wrap(Impl.cast(euint4.unwrap(value), Common.euint64_t)); - } - - /** - * @dev Casts an encrypted integer from euint8 to euint64. - */ - function asEuint64(euint8 value) internal returns (euint64) { - return euint64.wrap(Impl.cast(euint8.unwrap(value), Common.euint64_t)); - } - - /** - * @dev Casts an encrypted integer from euint16 to euint64. - */ - function asEuint64(euint16 value) internal returns (euint64) { - return euint64.wrap(Impl.cast(euint16.unwrap(value), Common.euint64_t)); - } - - /** - * @dev Casts an encrypted integer from euint32 to euint64. - */ - function asEuint64(euint32 value) internal returns (euint64) { - return euint64.wrap(Impl.cast(euint32.unwrap(value), Common.euint64_t)); - } - - /** - * @dev Casts an encrypted integer from euint128 to euint64. - */ - function asEuint64(euint128 value) internal returns (euint64) { - return euint64.wrap(Impl.cast(euint128.unwrap(value), Common.euint64_t)); - } - - /** - * @dev Casts an encrypted integer from euint256 to euint64. - */ - function asEuint64(euint256 value) internal returns (euint64) { - return euint64.wrap(Impl.cast(euint256.unwrap(value), Common.euint64_t)); - } - - /** - * @dev Casts an encrypted integer from euint64 to ebool. - */ - function asEbool(euint64 value) internal returns (ebool) { - return ne(value, 0); - } - - /** - * @dev Converts an 'ebool' to an 'euint64'. - */ - function asEuint64(ebool b) internal returns (euint64) { - return euint64.wrap(Impl.cast(ebool.unwrap(b), Common.euint64_t)); - } - - /** - * @dev Casts an encrypted integer from euint4 to euint128. - */ - function asEuint128(euint4 value) internal returns (euint128) { - return euint128.wrap(Impl.cast(euint4.unwrap(value), Common.euint128_t)); - } - - /** - * @dev Casts an encrypted integer from euint8 to euint128. - */ - function asEuint128(euint8 value) internal returns (euint128) { - return euint128.wrap(Impl.cast(euint8.unwrap(value), Common.euint128_t)); - } - - /** - * @dev Casts an encrypted integer from euint16 to euint128. - */ - function asEuint128(euint16 value) internal returns (euint128) { - return euint128.wrap(Impl.cast(euint16.unwrap(value), Common.euint128_t)); + function select(ebool control, euint128 a, euint128 b) internal returns (euint128) { + return euint128.wrap(Impl.select(ebool.unwrap(control), euint128.unwrap(a), euint128.unwrap(b))); } - /** - * @dev Casts an encrypted integer from euint32 to euint128. + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. */ - function asEuint128(euint32 value) internal returns (euint128) { - return euint128.wrap(Impl.cast(euint32.unwrap(value), Common.euint128_t)); + function select(ebool control, eaddress a, eaddress b) internal returns (eaddress) { + return eaddress.wrap(Impl.select(ebool.unwrap(control), eaddress.unwrap(a), eaddress.unwrap(b))); } - /** - * @dev Casts an encrypted integer from euint64 to euint128. + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. */ - function asEuint128(euint64 value) internal returns (euint128) { - return euint128.wrap(Impl.cast(euint64.unwrap(value), Common.euint128_t)); + function select(ebool control, euint256 a, euint256 b) internal returns (euint256) { + return euint256.wrap(Impl.select(ebool.unwrap(control), euint256.unwrap(a), euint256.unwrap(b))); } - /** - * @dev Casts an encrypted integer from euint256 to euint128. + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. */ - function asEuint128(euint256 value) internal returns (euint128) { - return euint128.wrap(Impl.cast(euint256.unwrap(value), Common.euint128_t)); + function select(ebool control, ebytes64 a, ebytes64 b) internal returns (ebytes64) { + return ebytes64.wrap(Impl.select(ebool.unwrap(control), ebytes64.unwrap(a), ebytes64.unwrap(b))); } - /** - * @dev Casts an encrypted integer from euint128 to ebool. + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. */ - function asEbool(euint128 value) internal returns (ebool) { - return ne(value, 0); + function select(ebool control, ebytes128 a, ebytes128 b) internal returns (ebytes128) { + return ebytes128.wrap(Impl.select(ebool.unwrap(control), ebytes128.unwrap(a), ebytes128.unwrap(b))); } - /** - * @dev Converts an 'ebool' to an 'euint128'. + * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. */ - function asEuint128(ebool b) internal returns (euint128) { - return euint128.wrap(Impl.cast(ebool.unwrap(b), Common.euint128_t)); + function select(ebool control, ebytes256 a, ebytes256 b) internal returns (ebytes256) { + return ebytes256.wrap(Impl.select(ebool.unwrap(control), ebytes256.unwrap(a), ebytes256.unwrap(b))); } - /** - * @dev Casts an encrypted integer from euint4 to euint256. + * @dev Casts an encrypted integer from 'euint16' to 'euint8'. */ - function asEuint256(euint4 value) internal returns (euint256) { - return euint256.wrap(Impl.cast(euint4.unwrap(value), Common.euint256_t)); + function asEuint8(euint16 value) internal returns (euint8) { + return euint8.wrap(Impl.cast(euint16.unwrap(value), FheType.Uint8)); } /** - * @dev Casts an encrypted integer from euint8 to euint256. + * @dev Casts an encrypted integer from 'euint32' to 'euint8'. */ - function asEuint256(euint8 value) internal returns (euint256) { - return euint256.wrap(Impl.cast(euint8.unwrap(value), Common.euint256_t)); + function asEuint8(euint32 value) internal returns (euint8) { + return euint8.wrap(Impl.cast(euint32.unwrap(value), FheType.Uint8)); } /** - * @dev Casts an encrypted integer from euint16 to euint256. + * @dev Casts an encrypted integer from 'euint64' to 'euint8'. */ - function asEuint256(euint16 value) internal returns (euint256) { - return euint256.wrap(Impl.cast(euint16.unwrap(value), Common.euint256_t)); + function asEuint8(euint64 value) internal returns (euint8) { + return euint8.wrap(Impl.cast(euint64.unwrap(value), FheType.Uint8)); } /** - * @dev Casts an encrypted integer from euint32 to euint256. + * @dev Casts an encrypted integer from 'euint128' to 'euint8'. */ - function asEuint256(euint32 value) internal returns (euint256) { - return euint256.wrap(Impl.cast(euint32.unwrap(value), Common.euint256_t)); + function asEuint8(euint128 value) internal returns (euint8) { + return euint8.wrap(Impl.cast(euint128.unwrap(value), FheType.Uint8)); } /** - * @dev Casts an encrypted integer from euint64 to euint256. + * @dev Casts an encrypted integer from 'euint256' to 'euint8'. */ - function asEuint256(euint64 value) internal returns (euint256) { - return euint256.wrap(Impl.cast(euint64.unwrap(value), Common.euint256_t)); + function asEuint8(euint256 value) internal returns (euint8) { + return euint8.wrap(Impl.cast(euint256.unwrap(value), FheType.Uint8)); } /** - * @dev Casts an encrypted integer from euint128 to euint256. + /** + * @dev Converts an 'ebool' to an 'euint8'. */ - function asEuint256(euint128 value) internal returns (euint256) { - return euint256.wrap(Impl.cast(euint128.unwrap(value), Common.euint256_t)); + function asEuint8(ebool b) internal returns (euint8) { + return euint8.wrap(Impl.cast(ebool.unwrap(b), FheType.Uint8)); } /** - * @dev Casts an encrypted integer from euint256 to ebool. + * @dev Casts an encrypted integer from 'euint8' to 'ebool'. */ - function asEbool(euint256 value) internal returns (ebool) { + function asEbool(euint8 value) internal returns (ebool) { return ne(value, 0); } /** - * @dev Converts an 'ebool' to an 'euint256'. + * @dev Casts an encrypted integer from 'euint8' to 'euint16'. */ - function asEuint256(ebool b) internal returns (euint256) { - return euint256.wrap(Impl.cast(ebool.unwrap(b), Common.euint256_t)); - } - - function neg(euint4 value) internal returns (euint4) { - return euint4.wrap(Impl.neg(euint4.unwrap(value))); - } - - function not(euint4 value) internal returns (euint4) { - return euint4.wrap(Impl.not(euint4.unwrap(value))); - } - - function neg(euint8 value) internal returns (euint8) { - return euint8.wrap(Impl.neg(euint8.unwrap(value))); - } - - function not(euint8 value) internal returns (euint8) { - return euint8.wrap(Impl.not(euint8.unwrap(value))); - } - - function neg(euint16 value) internal returns (euint16) { - return euint16.wrap(Impl.neg(euint16.unwrap(value))); - } - - function not(euint16 value) internal returns (euint16) { - return euint16.wrap(Impl.not(euint16.unwrap(value))); - } - - function neg(euint32 value) internal returns (euint32) { - return euint32.wrap(Impl.neg(euint32.unwrap(value))); + function asEuint16(euint8 value) internal returns (euint16) { + return euint16.wrap(Impl.cast(euint8.unwrap(value), FheType.Uint16)); } - function not(euint32 value) internal returns (euint32) { - return euint32.wrap(Impl.not(euint32.unwrap(value))); + /** + * @dev Casts an encrypted integer from 'euint32' to 'euint16'. + */ + function asEuint16(euint32 value) internal returns (euint16) { + return euint16.wrap(Impl.cast(euint32.unwrap(value), FheType.Uint16)); } - function neg(euint64 value) internal returns (euint64) { - return euint64.wrap(Impl.neg(euint64.unwrap(value))); + /** + * @dev Casts an encrypted integer from 'euint64' to 'euint16'. + */ + function asEuint16(euint64 value) internal returns (euint16) { + return euint16.wrap(Impl.cast(euint64.unwrap(value), FheType.Uint16)); } - function not(euint64 value) internal returns (euint64) { - return euint64.wrap(Impl.not(euint64.unwrap(value))); + /** + * @dev Casts an encrypted integer from 'euint128' to 'euint16'. + */ + function asEuint16(euint128 value) internal returns (euint16) { + return euint16.wrap(Impl.cast(euint128.unwrap(value), FheType.Uint16)); } - function neg(euint128 value) internal returns (euint128) { - return euint128.wrap(Impl.neg(euint128.unwrap(value))); + /** + * @dev Casts an encrypted integer from 'euint256' to 'euint16'. + */ + function asEuint16(euint256 value) internal returns (euint16) { + return euint16.wrap(Impl.cast(euint256.unwrap(value), FheType.Uint16)); } - function not(euint128 value) internal returns (euint128) { - return euint128.wrap(Impl.not(euint128.unwrap(value))); + /** + /** + * @dev Converts an 'ebool' to an 'euint16'. + */ + function asEuint16(ebool b) internal returns (euint16) { + return euint16.wrap(Impl.cast(ebool.unwrap(b), FheType.Uint16)); } - function neg(euint256 value) internal returns (euint256) { - return euint256.wrap(Impl.neg(euint256.unwrap(value))); + /** + * @dev Casts an encrypted integer from 'euint16' to 'ebool'. + */ + function asEbool(euint16 value) internal returns (ebool) { + return ne(value, 0); } - function not(euint256 value) internal returns (euint256) { - return euint256.wrap(Impl.not(euint256.unwrap(value))); + /** + * @dev Casts an encrypted integer from 'euint8' to 'euint32'. + */ + function asEuint32(euint8 value) internal returns (euint32) { + return euint32.wrap(Impl.cast(euint8.unwrap(value), FheType.Uint32)); } /** - * @dev Convert an inputHandle with corresponding inputProof to an encrypted euint4 integer. + * @dev Casts an encrypted integer from 'euint16' to 'euint32'. */ - function asEuint4(einput inputHandle, bytes memory inputProof) internal returns (euint4) { - return euint4.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint4_t)); + function asEuint32(euint16 value) internal returns (euint32) { + return euint32.wrap(Impl.cast(euint16.unwrap(value), FheType.Uint32)); } /** - * @dev Convert a plaintext value to an encrypted euint4 integer. + * @dev Casts an encrypted integer from 'euint64' to 'euint32'. */ - function asEuint4(uint256 value) internal returns (euint4) { - return euint4.wrap(Impl.trivialEncrypt(value, Common.euint4_t)); + function asEuint32(euint64 value) internal returns (euint32) { + return euint32.wrap(Impl.cast(euint64.unwrap(value), FheType.Uint32)); } /** - * @dev Convert an inputHandle with corresponding inputProof to an encrypted euint8 integer. + * @dev Casts an encrypted integer from 'euint128' to 'euint32'. */ - function asEuint8(einput inputHandle, bytes memory inputProof) internal returns (euint8) { - return euint8.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint8_t)); + function asEuint32(euint128 value) internal returns (euint32) { + return euint32.wrap(Impl.cast(euint128.unwrap(value), FheType.Uint32)); } /** - * @dev Convert a plaintext value to an encrypted euint8 integer. + * @dev Casts an encrypted integer from 'euint256' to 'euint32'. */ - function asEuint8(uint256 value) internal returns (euint8) { - return euint8.wrap(Impl.trivialEncrypt(value, Common.euint8_t)); + function asEuint32(euint256 value) internal returns (euint32) { + return euint32.wrap(Impl.cast(euint256.unwrap(value), FheType.Uint32)); } /** - * @dev Convert an inputHandle with corresponding inputProof to an encrypted euint16 integer. + /** + * @dev Converts an 'ebool' to an 'euint32'. */ - function asEuint16(einput inputHandle, bytes memory inputProof) internal returns (euint16) { - return euint16.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint16_t)); + function asEuint32(ebool b) internal returns (euint32) { + return euint32.wrap(Impl.cast(ebool.unwrap(b), FheType.Uint32)); } /** - * @dev Convert a plaintext value to an encrypted euint16 integer. + * @dev Casts an encrypted integer from 'euint32' to 'ebool'. */ - function asEuint16(uint256 value) internal returns (euint16) { - return euint16.wrap(Impl.trivialEncrypt(value, Common.euint16_t)); + function asEbool(euint32 value) internal returns (ebool) { + return ne(value, 0); } /** - * @dev Convert an inputHandle with corresponding inputProof to an encrypted euint32 integer. + * @dev Casts an encrypted integer from 'euint8' to 'euint64'. */ - function asEuint32(einput inputHandle, bytes memory inputProof) internal returns (euint32) { - return euint32.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint32_t)); + function asEuint64(euint8 value) internal returns (euint64) { + return euint64.wrap(Impl.cast(euint8.unwrap(value), FheType.Uint64)); } /** - * @dev Convert a plaintext value to an encrypted euint32 integer. + * @dev Casts an encrypted integer from 'euint16' to 'euint64'. */ - function asEuint32(uint256 value) internal returns (euint32) { - return euint32.wrap(Impl.trivialEncrypt(value, Common.euint32_t)); + function asEuint64(euint16 value) internal returns (euint64) { + return euint64.wrap(Impl.cast(euint16.unwrap(value), FheType.Uint64)); } /** - * @dev Convert an inputHandle with corresponding inputProof to an encrypted euint64 integer. + * @dev Casts an encrypted integer from 'euint32' to 'euint64'. */ - function asEuint64(einput inputHandle, bytes memory inputProof) internal returns (euint64) { - return euint64.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint64_t)); + function asEuint64(euint32 value) internal returns (euint64) { + return euint64.wrap(Impl.cast(euint32.unwrap(value), FheType.Uint64)); } /** - * @dev Convert a plaintext value to an encrypted euint64 integer. + * @dev Casts an encrypted integer from 'euint128' to 'euint64'. */ - function asEuint64(uint256 value) internal returns (euint64) { - return euint64.wrap(Impl.trivialEncrypt(value, Common.euint64_t)); + function asEuint64(euint128 value) internal returns (euint64) { + return euint64.wrap(Impl.cast(euint128.unwrap(value), FheType.Uint64)); } /** - * @dev Convert an inputHandle with corresponding inputProof to an encrypted euint128 integer. + * @dev Casts an encrypted integer from 'euint256' to 'euint64'. */ - function asEuint128(einput inputHandle, bytes memory inputProof) internal returns (euint128) { - return euint128.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint128_t)); + function asEuint64(euint256 value) internal returns (euint64) { + return euint64.wrap(Impl.cast(euint256.unwrap(value), FheType.Uint64)); } /** - * @dev Convert a plaintext value to an encrypted euint128 integer. + /** + * @dev Converts an 'ebool' to an 'euint64'. */ - function asEuint128(uint256 value) internal returns (euint128) { - return euint128.wrap(Impl.trivialEncrypt(value, Common.euint128_t)); + function asEuint64(ebool b) internal returns (euint64) { + return euint64.wrap(Impl.cast(ebool.unwrap(b), FheType.Uint64)); } /** - * @dev Convert an inputHandle with corresponding inputProof to an encrypted euint256 integer. + * @dev Casts an encrypted integer from 'euint64' to 'ebool'. */ - function asEuint256(einput inputHandle, bytes memory inputProof) internal returns (euint256) { - return euint256.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint256_t)); + function asEbool(euint64 value) internal returns (ebool) { + return ne(value, 0); } /** - * @dev Convert a plaintext value to an encrypted euint256 integer. + * @dev Casts an encrypted integer from 'euint8' to 'euint128'. */ - function asEuint256(uint256 value) internal returns (euint256) { - return euint256.wrap(Impl.trivialEncrypt(value, Common.euint256_t)); + function asEuint128(euint8 value) internal returns (euint128) { + return euint128.wrap(Impl.cast(euint8.unwrap(value), FheType.Uint128)); } /** - * @dev Generates a random encrypted boolean. + * @dev Casts an encrypted integer from 'euint16' to 'euint128'. */ - function randEbool() internal returns (ebool) { - return ebool.wrap(Impl.rand(Common.ebool_t)); + function asEuint128(euint16 value) internal returns (euint128) { + return euint128.wrap(Impl.cast(euint16.unwrap(value), FheType.Uint128)); } /** - * @dev Generates a random encrypted 4-bit unsigned integer. + * @dev Casts an encrypted integer from 'euint32' to 'euint128'. */ - function randEuint4() internal returns (euint4) { - return euint4.wrap(Impl.rand(Common.euint4_t)); + function asEuint128(euint32 value) internal returns (euint128) { + return euint128.wrap(Impl.cast(euint32.unwrap(value), FheType.Uint128)); } /** - * @dev Generates a random encrypted 4-bit unsigned integer in the [0, upperBound) range. - * The upperBound must be a power of 2. + * @dev Casts an encrypted integer from 'euint64' to 'euint128'. */ - function randEuint4(uint8 upperBound) internal returns (euint4) { - return euint4.wrap(Impl.randBounded(upperBound, Common.euint4_t)); + function asEuint128(euint64 value) internal returns (euint128) { + return euint128.wrap(Impl.cast(euint64.unwrap(value), FheType.Uint128)); } /** - * @dev Generates a random encrypted 8-bit unsigned integer. + * @dev Casts an encrypted integer from 'euint256' to 'euint128'. */ - function randEuint8() internal returns (euint8) { - return euint8.wrap(Impl.rand(Common.euint8_t)); + function asEuint128(euint256 value) internal returns (euint128) { + return euint128.wrap(Impl.cast(euint256.unwrap(value), FheType.Uint128)); } /** - * @dev Generates a random encrypted 8-bit unsigned integer in the [0, upperBound) range. - * The upperBound must be a power of 2. + /** + * @dev Converts an 'ebool' to an 'euint128'. */ - function randEuint8(uint8 upperBound) internal returns (euint8) { - return euint8.wrap(Impl.randBounded(upperBound, Common.euint8_t)); + function asEuint128(ebool b) internal returns (euint128) { + return euint128.wrap(Impl.cast(ebool.unwrap(b), FheType.Uint128)); } /** - * @dev Generates a random encrypted 16-bit unsigned integer. + * @dev Casts an encrypted integer from 'euint128' to 'ebool'. */ - function randEuint16() internal returns (euint16) { - return euint16.wrap(Impl.rand(Common.euint16_t)); + function asEbool(euint128 value) internal returns (ebool) { + return ne(value, 0); } /** - * @dev Generates a random encrypted 16-bit unsigned integer in the [0, upperBound) range. - * The upperBound must be a power of 2. + * @dev Casts an encrypted integer from 'euint8' to 'euint256'. */ - function randEuint16(uint16 upperBound) internal returns (euint16) { - return euint16.wrap(Impl.randBounded(upperBound, Common.euint16_t)); + function asEuint256(euint8 value) internal returns (euint256) { + return euint256.wrap(Impl.cast(euint8.unwrap(value), FheType.Uint256)); } /** - * @dev Generates a random encrypted 32-bit unsigned integer. + * @dev Casts an encrypted integer from 'euint16' to 'euint256'. */ - function randEuint32() internal returns (euint32) { - return euint32.wrap(Impl.rand(Common.euint32_t)); + function asEuint256(euint16 value) internal returns (euint256) { + return euint256.wrap(Impl.cast(euint16.unwrap(value), FheType.Uint256)); } /** - * @dev Generates a random encrypted 32-bit unsigned integer in the [0, upperBound) range. - * The upperBound must be a power of 2. + * @dev Casts an encrypted integer from 'euint32' to 'euint256'. */ - function randEuint32(uint32 upperBound) internal returns (euint32) { - return euint32.wrap(Impl.randBounded(upperBound, Common.euint32_t)); + function asEuint256(euint32 value) internal returns (euint256) { + return euint256.wrap(Impl.cast(euint32.unwrap(value), FheType.Uint256)); } /** - * @dev Generates a random encrypted 64-bit unsigned integer. + * @dev Casts an encrypted integer from 'euint64' to 'euint256'. */ - function randEuint64() internal returns (euint64) { - return euint64.wrap(Impl.rand(Common.euint64_t)); + function asEuint256(euint64 value) internal returns (euint256) { + return euint256.wrap(Impl.cast(euint64.unwrap(value), FheType.Uint256)); } /** - * @dev Generates a random encrypted 64-bit unsigned integer in the [0, upperBound) range. - * The upperBound must be a power of 2. + * @dev Casts an encrypted integer from 'euint128' to 'euint256'. */ - function randEuint64(uint64 upperBound) internal returns (euint64) { - return euint64.wrap(Impl.randBounded(upperBound, Common.euint64_t)); + function asEuint256(euint128 value) internal returns (euint256) { + return euint256.wrap(Impl.cast(euint128.unwrap(value), FheType.Uint256)); } /** - * @dev Generates a random encrypted 128-bit unsigned integer. + /** + * @dev Converts an 'ebool' to an 'euint256'. */ - function randEuint128() internal returns (euint128) { - return euint128.wrap(Impl.rand(Common.euint128_t)); + function asEuint256(ebool b) internal returns (euint256) { + return euint256.wrap(Impl.cast(ebool.unwrap(b), FheType.Uint256)); } /** - * @dev Generates a random encrypted 128-bit unsigned integer in the [0, upperBound) range. - * The upperBound must be a power of 2. + * @dev Casts an encrypted integer from 'euint256' to 'ebool'. */ - function randEuint128(uint128 upperBound) internal returns (euint128) { - return euint128.wrap(Impl.randBounded(upperBound, Common.euint128_t)); + function asEbool(euint256 value) internal returns (ebool) { + return ne(value, 0); } /** - * @dev Generates a random encrypted 256-bit unsigned integer. + * @dev Evaluates not(ebool value) and returns the result. */ - function randEuint256() internal returns (euint256) { - return euint256.wrap(Impl.rand(Common.euint256_t)); + function not(ebool value) internal returns (ebool) { + return ebool.wrap(Impl.not(ebool.unwrap(value))); } /** - * @dev Generates a random encrypted 256-bit unsigned integer in the [0, upperBound) range. - * The upperBound must be a power of 2. + * @dev Evaluates neg(euint8 value) and returns the result. */ - function randEuint256(uint256 upperBound) internal returns (euint256) { - return euint256.wrap(Impl.randBounded(upperBound, Common.euint256_t)); + function neg(euint8 value) internal returns (euint8) { + return euint8.wrap(Impl.neg(euint8.unwrap(value))); } /** - * @dev Generates a random encrypted 512-bit unsigned integer. + * @dev Evaluates not(euint8 value) and returns the result. */ - function randEbytes64() internal returns (ebytes64) { - return ebytes64.wrap(Impl.rand(Common.ebytes64_t)); + function not(euint8 value) internal returns (euint8) { + return euint8.wrap(Impl.not(euint8.unwrap(value))); } /** - * @dev Generates a random encrypted 1024-bit unsigned integer. + * @dev Evaluates neg(euint16 value) and returns the result. */ - function randEbytes128() internal returns (ebytes128) { - return ebytes128.wrap(Impl.rand(Common.ebytes128_t)); + function neg(euint16 value) internal returns (euint16) { + return euint16.wrap(Impl.neg(euint16.unwrap(value))); } /** - * @dev Generates a random encrypted 2048-bit unsigned integer. + * @dev Evaluates not(euint16 value) and returns the result. */ - function randEbytes256() internal returns (ebytes256) { - return ebytes256.wrap(Impl.rand(Common.ebytes256_t)); + function not(euint16 value) internal returns (euint16) { + return euint16.wrap(Impl.not(euint16.unwrap(value))); } /** - * @dev Convert an inputHandle with corresponding inputProof to an encrypted eaddress. + * @dev Evaluates neg(euint32 value) and returns the result. */ - function asEaddress(einput inputHandle, bytes memory inputProof) internal returns (eaddress) { - return eaddress.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.euint160_t)); + function neg(euint32 value) internal returns (euint32) { + return euint32.wrap(Impl.neg(euint32.unwrap(value))); } /** - * @dev Convert a plaintext value to an encrypted address. + * @dev Evaluates not(euint32 value) and returns the result. */ - function asEaddress(address value) internal returns (eaddress) { - return eaddress.wrap(Impl.trivialEncrypt(uint160(value), Common.euint160_t)); + function not(euint32 value) internal returns (euint32) { + return euint32.wrap(Impl.not(euint32.unwrap(value))); } /** - * @dev Convert the given inputHandle and inputProof to an encrypted ebytes64 value. + * @dev Evaluates neg(euint64 value) and returns the result. */ - function asEbytes64(einput inputHandle, bytes memory inputProof) internal returns (ebytes64) { - return ebytes64.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebytes64_t)); + function neg(euint64 value) internal returns (euint64) { + return euint64.wrap(Impl.neg(euint64.unwrap(value))); } /** - * @dev Left-pad a bytes array with zeros such that it becomes of length 64. + * @dev Evaluates not(euint64 value) and returns the result. */ - function padToBytes64(bytes memory input) internal pure returns (bytes memory) { - uint256 inputLength = input.length; - - if (inputLength > 64) { - revert InputLengthAbove64Bytes(inputLength); - } - - bytes memory result = new bytes(64); - uint256 paddingLength = 64 - inputLength; - - for (uint256 i = 0; i < paddingLength; i++) { - result[i] = 0; - } - for (uint256 i = 0; i < inputLength; i++) { - result[paddingLength + i] = input[i]; - } - return result; + function not(euint64 value) internal returns (euint64) { + return euint64.wrap(Impl.not(euint64.unwrap(value))); } /** - * @dev Convert a plaintext value - must be a bytes array of size 64 - to an encrypted Bytes64. + * @dev Evaluates neg(euint128 value) and returns the result. */ - function asEbytes64(bytes memory value) internal returns (ebytes64) { - return ebytes64.wrap(Impl.trivialEncrypt(value, Common.ebytes64_t)); + function neg(euint128 value) internal returns (euint128) { + return euint128.wrap(Impl.neg(euint128.unwrap(value))); } /** - * @dev Convert the given inputHandle and inputProof to an encrypted ebytes128 value. + * @dev Evaluates not(euint128 value) and returns the result. */ - function asEbytes128(einput inputHandle, bytes memory inputProof) internal returns (ebytes128) { - return ebytes128.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebytes128_t)); + function not(euint128 value) internal returns (euint128) { + return euint128.wrap(Impl.not(euint128.unwrap(value))); } /** - * @dev Left-pad a bytes array with zeros such that it becomes of length 128. + * @dev Evaluates neg(euint256 value) and returns the result. */ - function padToBytes128(bytes memory input) internal pure returns (bytes memory) { - uint256 inputLength = input.length; - - if (inputLength > 128) { - revert InputLengthAbove128Bytes(inputLength); - } - - bytes memory result = new bytes(128); - uint256 paddingLength = 128 - inputLength; - for (uint256 i = 0; i < paddingLength; i++) { - result[i] = 0; - } - for (uint256 i = 0; i < inputLength; i++) { - result[paddingLength + i] = input[i]; - } - return result; + function neg(euint256 value) internal returns (euint256) { + return euint256.wrap(Impl.neg(euint256.unwrap(value))); } /** - * @dev Convert a plaintext value - must be a bytes array of size 128 - to an encrypted Bytes128. + * @dev Evaluates not(euint256 value) and returns the result. */ - function asEbytes128(bytes memory value) internal returns (ebytes128) { - return ebytes128.wrap(Impl.trivialEncrypt(value, Common.ebytes128_t)); + function not(euint256 value) internal returns (euint256) { + return euint256.wrap(Impl.not(euint256.unwrap(value))); } /** - * @dev Convert the given inputHandle and inputProof to an encrypted ebytes256 value. + * @dev Convert an inputHandle with corresponding inputProof to an encrypted ebool integer. */ - function asEbytes256(einput inputHandle, bytes memory inputProof) internal returns (ebytes256) { - return ebytes256.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, Common.ebytes256_t)); + function asEbool(einput inputHandle, bytes memory inputProof) internal returns (ebool) { + return ebool.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, FheType.Bool)); } /** - * @dev Left-pad a bytes array with zeros such that it becomes of length 256. + * @dev Converts a plaintext boolean to an encrypted boolean. */ - function padToBytes256(bytes memory input) internal pure returns (bytes memory) { - uint256 inputLength = input.length; - - if (inputLength > 256) { - revert InputLengthAbove256Bytes(inputLength); - } - - bytes memory result = new bytes(256); - uint256 paddingLength = 256 - inputLength; - for (uint256 i = 0; i < paddingLength; i++) { - result[i] = 0; - } - for (uint256 i = 0; i < inputLength; i++) { - result[paddingLength + i] = input[i]; - } - return result; + function asEbool(bool value) internal returns (ebool) { + return ebool.wrap(Impl.trivialEncrypt(value ? 1 : 0, FheType.Bool)); } /** - * @dev Convert a plaintext value - must be a bytes array of size 256 - to an encrypted Bytes256. + * @dev Convert an inputHandle with corresponding inputProof to an encrypted euint8 integer. */ - function asEbytes256(bytes memory value) internal returns (ebytes256) { - return ebytes256.wrap(Impl.trivialEncrypt(value, Common.ebytes256_t)); + function asEuint8(einput inputHandle, bytes memory inputProof) internal returns (euint8) { + return euint8.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, FheType.Uint8)); } /** - * @dev Returns true if the encrypted address is initialized and false otherwise. + * @dev Convert a plaintext value to an encrypted euint8 integer. */ - function isInitialized(eaddress v) internal pure returns (bool) { - return eaddress.unwrap(v) != 0; + function asEuint8(uint8 value) internal returns (euint8) { + return euint8.wrap(Impl.trivialEncrypt(uint256(value), FheType.Uint8)); } /** - * @dev Returns true if the encrypted value is initialized and false otherwise. + * @dev Convert an inputHandle with corresponding inputProof to an encrypted euint16 integer. */ - function isInitialized(ebytes64 v) internal pure returns (bool) { - return ebytes64.unwrap(v) != 0; + function asEuint16(einput inputHandle, bytes memory inputProof) internal returns (euint16) { + return euint16.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, FheType.Uint16)); } /** - * @dev Returns true if the encrypted value is initialized and false otherwise. + * @dev Convert a plaintext value to an encrypted euint16 integer. */ - function isInitialized(ebytes128 v) internal pure returns (bool) { - return ebytes128.unwrap(v) != 0; + function asEuint16(uint16 value) internal returns (euint16) { + return euint16.wrap(Impl.trivialEncrypt(uint256(value), FheType.Uint16)); } /** - * @dev Returns true if the encrypted value is initialized and false otherwise. + * @dev Convert an inputHandle with corresponding inputProof to an encrypted euint32 integer. */ - function isInitialized(ebytes256 v) internal pure returns (bool) { - return ebytes256.unwrap(v) != 0; + function asEuint32(einput inputHandle, bytes memory inputProof) internal returns (euint32) { + return euint32.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, FheType.Uint32)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Convert a plaintext value to an encrypted euint32 integer. */ - function eq(ebool a, ebool b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbool(false); - } - if (!isInitialized(b)) { - b = asEbool(false); - } - return ebool.wrap(Impl.eq(ebool.unwrap(a), ebool.unwrap(b), false)); + function asEuint32(uint32 value) internal returns (euint32) { + return euint32.wrap(Impl.trivialEncrypt(uint256(value), FheType.Uint32)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Convert an inputHandle with corresponding inputProof to an encrypted euint64 integer. */ - function ne(ebool a, ebool b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbool(false); - } - if (!isInitialized(b)) { - b = asEbool(false); - } - return ebool.wrap(Impl.ne(ebool.unwrap(a), ebool.unwrap(b), false)); + function asEuint64(einput inputHandle, bytes memory inputProof) internal returns (euint64) { + return euint64.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, FheType.Uint64)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Convert a plaintext value to an encrypted euint64 integer. */ - function eq(ebool a, bool b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbool(false); - } - uint256 bProc = b ? 1 : 0; - return ebool.wrap(Impl.eq(ebool.unwrap(a), bytes32(bProc), true)); + function asEuint64(uint64 value) internal returns (euint64) { + return euint64.wrap(Impl.trivialEncrypt(uint256(value), FheType.Uint64)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Convert an inputHandle with corresponding inputProof to an encrypted euint128 integer. */ - function eq(bool b, ebool a) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbool(false); - } - uint256 bProc = b ? 1 : 0; - return ebool.wrap(Impl.eq(ebool.unwrap(a), bytes32(bProc), true)); + function asEuint128(einput inputHandle, bytes memory inputProof) internal returns (euint128) { + return euint128.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, FheType.Uint128)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Convert a plaintext value to an encrypted euint128 integer. */ - function ne(ebool a, bool b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbool(false); - } - uint256 bProc = b ? 1 : 0; - return ebool.wrap(Impl.ne(ebool.unwrap(a), bytes32(bProc), true)); + function asEuint128(uint128 value) internal returns (euint128) { + return euint128.wrap(Impl.trivialEncrypt(uint256(value), FheType.Uint128)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Convert an inputHandle with corresponding inputProof to an encrypted eaddress integer. */ - function ne(bool b, ebool a) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbool(false); - } - uint256 bProc = b ? 1 : 0; - return ebool.wrap(Impl.ne(ebool.unwrap(a), bytes32(bProc), true)); + function asEaddress(einput inputHandle, bytes memory inputProof) internal returns (eaddress) { + return eaddress.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, FheType.Uint160)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Convert a plaintext value to an encrypted eaddress integer. */ - function eq(eaddress a, eaddress b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEaddress(address(0)); - } - if (!isInitialized(b)) { - b = asEaddress(address(0)); - } - return ebool.wrap(Impl.eq(eaddress.unwrap(a), eaddress.unwrap(b), false)); + function asEaddress(address value) internal returns (eaddress) { + return eaddress.wrap(Impl.trivialEncrypt(uint256(uint160(value)), FheType.Uint160)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Convert an inputHandle with corresponding inputProof to an encrypted euint256 integer. */ - function ne(eaddress a, eaddress b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEaddress(address(0)); - } - if (!isInitialized(b)) { - b = asEaddress(address(0)); - } - return ebool.wrap(Impl.ne(eaddress.unwrap(a), eaddress.unwrap(b), false)); + function asEuint256(einput inputHandle, bytes memory inputProof) internal returns (euint256) { + return euint256.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, FheType.Uint256)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Convert a plaintext value to an encrypted euint256 integer. */ - function eq(eaddress a, address b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEaddress(address(0)); - } - bytes32 bProc = bytes32(uint256(uint160(b))); - return ebool.wrap(Impl.eq(eaddress.unwrap(a), bProc, true)); + function asEuint256(uint256 value) internal returns (euint256) { + return euint256.wrap(Impl.trivialEncrypt(uint256(value), FheType.Uint256)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Convert an inputHandle with corresponding inputProof to an encrypted ebytes64 integer. */ - function eq(address b, eaddress a) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEaddress(address(0)); - } - bytes32 bProc = bytes32(uint256(uint160(b))); - return ebool.wrap(Impl.eq(eaddress.unwrap(a), bProc, true)); + function asEbytes64(einput inputHandle, bytes memory inputProof) internal returns (ebytes64) { + return ebytes64.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, FheType.Uint512)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Convert the plaintext bytes to a ebytes64 value. */ - function ne(eaddress a, address b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEaddress(address(0)); - } - bytes32 bProc = bytes32(uint256(uint160(b))); - return ebool.wrap(Impl.ne(eaddress.unwrap(a), bProc, true)); + function asEbytes64(bytes memory value) internal returns (ebytes64) { + return ebytes64.wrap(Impl.trivialEncrypt(value, FheType.Uint512)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Convert an inputHandle with corresponding inputProof to an encrypted ebytes128 integer. */ - function ne(address b, eaddress a) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEaddress(address(0)); - } - bytes32 bProc = bytes32(uint256(uint160(b))); - return ebool.wrap(Impl.ne(eaddress.unwrap(a), bProc, true)); + function asEbytes128(einput inputHandle, bytes memory inputProof) internal returns (ebytes128) { + return ebytes128.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, FheType.Uint1024)); } /** - * @dev If 'control''s value is 'true', the result has the same value as 'a'. - * If 'control''s value is 'false', the result has the same value as 'b'. + * @dev Convert the plaintext bytes to a ebytes128 value. */ - function select(ebool control, ebool a, ebool b) internal returns (ebool) { - return ebool.wrap(Impl.select(ebool.unwrap(control), ebool.unwrap(a), ebool.unwrap(b))); + function asEbytes128(bytes memory value) internal returns (ebytes128) { + return ebytes128.wrap(Impl.trivialEncrypt(value, FheType.Uint1024)); } /** - * @dev If 'control''s value is 'true', the result has the same value as 'a'. - * If 'control''s value is 'false', the result has the same value as 'b'. + * @dev Convert an inputHandle with corresponding inputProof to an encrypted ebytes256 integer. */ - function select(ebool control, eaddress a, eaddress b) internal returns (eaddress) { - return eaddress.wrap(Impl.select(ebool.unwrap(control), eaddress.unwrap(a), eaddress.unwrap(b))); + function asEbytes256(einput inputHandle, bytes memory inputProof) internal returns (ebytes256) { + return ebytes256.wrap(Impl.verify(einput.unwrap(inputHandle), inputProof, FheType.Uint2048)); } /** - * @dev If 'control''s value is 'true', the result has the same value as 'a'. - * If 'control''s value is 'false', the result has the same value as 'b'. + * @dev Convert the plaintext bytes to a ebytes256 value. */ - function select(ebool control, ebytes64 a, ebytes64 b) internal returns (ebytes64) { - return ebytes64.wrap(Impl.select(ebool.unwrap(control), ebytes64.unwrap(a), ebytes64.unwrap(b))); + function asEbytes256(bytes memory value) internal returns (ebytes256) { + return ebytes256.wrap(Impl.trivialEncrypt(value, FheType.Uint2048)); } /** - * @dev If 'control''s value is 'true', the result has the same value as 'a'. - * If 'control''s value is 'false', the result has the same value as 'b'. + * @dev Generates a random encrypted value. */ - function select(ebool control, ebytes128 a, ebytes128 b) internal returns (ebytes128) { - return ebytes128.wrap(Impl.select(ebool.unwrap(control), ebytes128.unwrap(a), ebytes128.unwrap(b))); + function randEbool() internal returns (ebool) { + return ebool.wrap(Impl.rand(FheType.Bool)); } /** - * @dev If 'control''s value is 'true', the result has the same value as 'a'. - * If 'control''s value is 'false', the result has the same value as 'b'. + * @dev Generates a random encrypted value. */ - function select(ebool control, ebytes256 a, ebytes256 b) internal returns (ebytes256) { - return ebytes256.wrap(Impl.select(ebool.unwrap(control), ebytes256.unwrap(a), ebytes256.unwrap(b))); + function randEuint8() internal returns (euint8) { + return euint8.wrap(Impl.rand(FheType.Uint8)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Generates a random encrypted 8-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. */ - function eq(ebytes64 a, ebytes64 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes64(padToBytes64(hex"")); - } - if (!isInitialized(b)) { - b = asEbytes64(padToBytes64(hex"")); - } - return ebool.wrap(Impl.eq(ebytes64.unwrap(a), ebytes64.unwrap(b), false)); + function randEuint8(uint8 upperBound) internal returns (euint8) { + return euint8.wrap(Impl.randBounded(upperBound, FheType.Uint8)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Generates a random encrypted value. */ - function eq(ebytes64 a, bytes memory b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes64(padToBytes64(hex"")); - } - return ebool.wrap(Impl.eq(ebytes64.unwrap(a), b, true)); + function randEuint16() internal returns (euint16) { + return euint16.wrap(Impl.rand(FheType.Uint16)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Generates a random encrypted 16-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. */ - function eq(bytes memory a, ebytes64 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEbytes64(padToBytes64(hex"")); - } - return ebool.wrap(Impl.eq(ebytes64.unwrap(b), a, true)); + function randEuint16(uint16 upperBound) internal returns (euint16) { + return euint16.wrap(Impl.randBounded(upperBound, FheType.Uint16)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Generates a random encrypted value. */ - function ne(ebytes64 a, ebytes64 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes64(padToBytes64(hex"")); - } - if (!isInitialized(b)) { - b = asEbytes64(padToBytes64(hex"")); - } - return ebool.wrap(Impl.ne(ebytes64.unwrap(a), ebytes64.unwrap(b), false)); + function randEuint32() internal returns (euint32) { + return euint32.wrap(Impl.rand(FheType.Uint32)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Generates a random encrypted 32-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. */ - function ne(ebytes64 a, bytes memory b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes64(padToBytes64(hex"")); - } - return ebool.wrap(Impl.ne(ebytes64.unwrap(a), b, true)); + function randEuint32(uint32 upperBound) internal returns (euint32) { + return euint32.wrap(Impl.randBounded(upperBound, FheType.Uint32)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Generates a random encrypted value. */ - function ne(bytes memory a, ebytes64 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEbytes64(padToBytes64(hex"")); - } - return ebool.wrap(Impl.ne(ebytes64.unwrap(b), a, true)); + function randEuint64() internal returns (euint64) { + return euint64.wrap(Impl.rand(FheType.Uint64)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Generates a random encrypted 64-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. */ - function eq(ebytes128 a, ebytes128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes128(padToBytes128(hex"")); - } - if (!isInitialized(b)) { - b = asEbytes128(padToBytes128(hex"")); - } - return ebool.wrap(Impl.eq(ebytes128.unwrap(a), ebytes128.unwrap(b), false)); + function randEuint64(uint64 upperBound) internal returns (euint64) { + return euint64.wrap(Impl.randBounded(upperBound, FheType.Uint64)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Generates a random encrypted value. */ - function eq(ebytes128 a, bytes memory b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes128(padToBytes128(hex"")); - } - return ebool.wrap(Impl.eq(ebytes128.unwrap(a), b, true)); + function randEuint128() internal returns (euint128) { + return euint128.wrap(Impl.rand(FheType.Uint128)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Generates a random encrypted 128-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. */ - function eq(bytes memory a, ebytes128 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEbytes128(padToBytes128(hex"")); - } - return ebool.wrap(Impl.eq(ebytes128.unwrap(b), a, true)); + function randEuint128(uint128 upperBound) internal returns (euint128) { + return euint128.wrap(Impl.randBounded(upperBound, FheType.Uint128)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Generates a random encrypted value. */ - function ne(ebytes128 a, ebytes128 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes128(padToBytes128(hex"")); - } - if (!isInitialized(b)) { - b = asEbytes128(padToBytes128(hex"")); - } - return ebool.wrap(Impl.ne(ebytes128.unwrap(a), ebytes128.unwrap(b), false)); + function randEuint256() internal returns (euint256) { + return euint256.wrap(Impl.rand(FheType.Uint256)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Generates a random encrypted 256-bit unsigned integer in the [0, upperBound) range. + * The upperBound must be a power of 2. */ - function ne(ebytes128 a, bytes memory b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes128(padToBytes128(hex"")); - } - return ebool.wrap(Impl.ne(ebytes128.unwrap(a), b, true)); + function randEuint256(uint256 upperBound) internal returns (euint256) { + return euint256.wrap(Impl.randBounded(upperBound, FheType.Uint256)); } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Generates a random encrypted value. */ - function ne(bytes memory a, ebytes128 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEbytes128(padToBytes128(hex"")); - } - return ebool.wrap(Impl.ne(ebytes128.unwrap(b), a, true)); + function randEbytes64() internal returns (ebytes64) { + return ebytes64.wrap(Impl.rand(FheType.Uint512)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Generates a random encrypted value. */ - function eq(ebytes256 a, ebytes256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes256(padToBytes256(hex"")); - } - if (!isInitialized(b)) { - b = asEbytes256(padToBytes256(hex"")); - } - return ebool.wrap(Impl.eq(ebytes256.unwrap(a), ebytes256.unwrap(b), false)); + function randEbytes128() internal returns (ebytes128) { + return ebytes128.wrap(Impl.rand(FheType.Uint1024)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Generates a random encrypted value. */ - function eq(ebytes256 a, bytes memory b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes256(padToBytes256(hex"")); - } - return ebool.wrap(Impl.eq(ebytes256.unwrap(a), b, true)); + function randEbytes256() internal returns (ebytes256) { + return ebytes256.wrap(Impl.rand(FheType.Uint2048)); } /** - * @dev Evaluates eq(a, b) and returns the result. + * @dev Left-pad a bytes array with zeros such that it becomes of length 64. */ - function eq(bytes memory a, ebytes256 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEbytes256(padToBytes256(hex"")); + function padToBytes64(bytes memory input) internal pure returns (bytes memory) { + uint256 inputLength = input.length; + + if (inputLength > 64) { + revert InputLengthAbove64Bytes(inputLength); } - return ebool.wrap(Impl.eq(ebytes256.unwrap(b), a, true)); - } - /** - * @dev Evaluates ne(a, b) and returns the result. - */ - function ne(ebytes256 a, ebytes256 b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes256(padToBytes256(hex"")); + bytes memory result = new bytes(64); + uint256 paddingLength = 64 - inputLength; + + for (uint256 i = 0; i < paddingLength; i++) { + result[i] = 0; } - if (!isInitialized(b)) { - b = asEbytes256(padToBytes256(hex"")); + + for (uint256 i = 0; i < inputLength; i++) { + result[paddingLength + i] = input[i]; } - return ebool.wrap(Impl.ne(ebytes256.unwrap(a), ebytes256.unwrap(b), false)); + return result; } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Left-pad a bytes array with zeros such that it becomes of length 128. */ - function ne(ebytes256 a, bytes memory b) internal returns (ebool) { - if (!isInitialized(a)) { - a = asEbytes256(padToBytes256(hex"")); + function padToBytes128(bytes memory input) internal pure returns (bytes memory) { + uint256 inputLength = input.length; + + if (inputLength > 128) { + revert InputLengthAbove128Bytes(inputLength); + } + + bytes memory result = new bytes(128); + uint256 paddingLength = 128 - inputLength; + + for (uint256 i = 0; i < paddingLength; i++) { + result[i] = 0; + } + + for (uint256 i = 0; i < inputLength; i++) { + result[paddingLength + i] = input[i]; } - return ebool.wrap(Impl.ne(ebytes256.unwrap(a), b, true)); + return result; } /** - * @dev Evaluates ne(a, b) and returns the result. + * @dev Left-pad a bytes array with zeros such that it becomes of length 256. */ - function ne(bytes memory a, ebytes256 b) internal returns (ebool) { - if (!isInitialized(b)) { - b = asEbytes256(padToBytes256(hex"")); + function padToBytes256(bytes memory input) internal pure returns (bytes memory) { + uint256 inputLength = input.length; + + if (inputLength > 256) { + revert InputLengthAbove256Bytes(inputLength); } - return ebool.wrap(Impl.ne(ebytes256.unwrap(b), a, true)); + + bytes memory result = new bytes(256); + uint256 paddingLength = 256 - inputLength; + + for (uint256 i = 0; i < paddingLength; i++) { + result[i] = 0; + } + + for (uint256 i = 0; i < inputLength; i++) { + result[paddingLength + i] = input[i]; + } + return result; } /** * @dev This function cleans the transient storage for the ACL (accounts) and the InputVerifier * (input proofs). * This could be useful for integration with Account Abstraction when bundling several - * UserOps calling the TFHEExecutorCoprocessor. + * UserOps calling the HTTPZExecutor. */ function cleanTransientStorage() internal { Impl.cleanTransientStorageACL(); @@ -13117,80 +8796,79 @@ library TFHE { } /** - * @dev Returns whether the account is allowed to use the value. - */ - function isAllowed(euint4 value, address account) internal view returns (bool) { - return Impl.isAllowed(euint4.unwrap(value), account); - } - /** - * @dev Returns whether the account is allowed to use the value. - */ - function isAllowed(euint8 value, address account) internal view returns (bool) { - return Impl.isAllowed(euint8.unwrap(value), account); - } - /** - * @dev Returns whether the account is allowed to use the value. + * @dev Returns whether the sender is allowed to use the value. */ - function isAllowed(euint16 value, address account) internal view returns (bool) { - return Impl.isAllowed(euint16.unwrap(value), account); + function isSenderAllowed(ebool value) internal view returns (bool) { + return Impl.isAllowed(ebool.unwrap(value), msg.sender); } + /** - * @dev Returns whether the account is allowed to use the value. + * @dev Allows the use of value for the address account. */ - function isAllowed(euint32 value, address account) internal view returns (bool) { - return Impl.isAllowed(euint32.unwrap(value), account); + function allow(ebool value, address account) internal returns (ebool) { + Impl.allow(ebool.unwrap(value), account); + return value; } + /** - * @dev Returns whether the account is allowed to use the value. + * @dev Allows the use of value for this address (address(this)). */ - function isAllowed(euint64 value, address account) internal view returns (bool) { - return Impl.isAllowed(euint64.unwrap(value), account); + function allowThis(ebool value) internal returns (ebool) { + Impl.allow(ebool.unwrap(value), address(this)); + return value; } + /** - * @dev Returns whether the account is allowed to use the value. + * @dev Allows the use of value by address account for this transaction. */ - function isAllowed(euint128 value, address account) internal view returns (bool) { - return Impl.isAllowed(euint128.unwrap(value), account); + function allowTransient(ebool value, address account) internal returns (ebool) { + Impl.allowTransient(ebool.unwrap(value), account); + return value; } + /** * @dev Returns whether the account is allowed to use the value. */ - function isAllowed(euint256 value, address account) internal view returns (bool) { - return Impl.isAllowed(euint256.unwrap(value), account); + function isAllowed(euint8 value, address account) internal view returns (bool) { + return Impl.isAllowed(euint8.unwrap(value), account); } + /** - * @dev Returns whether the account is allowed to use the value. + * @dev Returns whether the sender is allowed to use the value. */ - function isAllowed(eaddress value, address account) internal view returns (bool) { - return Impl.isAllowed(eaddress.unwrap(value), account); + function isSenderAllowed(euint8 value) internal view returns (bool) { + return Impl.isAllowed(euint8.unwrap(value), msg.sender); } /** - * @dev Returns whether the account is allowed to use the value. + * @dev Allows the use of value for the address account. */ - function isAllowed(ebytes256 value, address account) internal view returns (bool) { - return Impl.isAllowed(ebytes256.unwrap(value), account); + function allow(euint8 value, address account) internal returns (euint8) { + Impl.allow(euint8.unwrap(value), account); + return value; } /** - * @dev Returns whether the sender is allowed to use the value. + * @dev Allows the use of value for this address (address(this)). */ - function isSenderAllowed(ebool value) internal view returns (bool) { - return Impl.isAllowed(ebool.unwrap(value), msg.sender); + function allowThis(euint8 value) internal returns (euint8) { + Impl.allow(euint8.unwrap(value), address(this)); + return value; } /** - * @dev Returns whether the sender is allowed to use the value. + * @dev Allows the use of value by address account for this transaction. */ - function isSenderAllowed(euint4 value) internal view returns (bool) { - return Impl.isAllowed(euint4.unwrap(value), msg.sender); + function allowTransient(euint8 value, address account) internal returns (euint8) { + Impl.allowTransient(euint8.unwrap(value), account); + return value; } /** - * @dev Returns whether the sender is allowed to use the value. + * @dev Returns whether the account is allowed to use the value. */ - function isSenderAllowed(euint8 value) internal view returns (bool) { - return Impl.isAllowed(euint8.unwrap(value), msg.sender); + function isAllowed(euint16 value, address account) internal view returns (bool) { + return Impl.isAllowed(euint16.unwrap(value), account); } /** @@ -13201,290 +8879,330 @@ library TFHE { } /** - * @dev Returns whether the sender is allowed to use the value. + * @dev Allows the use of value for the address account. */ - function isSenderAllowed(euint32 value) internal view returns (bool) { - return Impl.isAllowed(euint32.unwrap(value), msg.sender); + function allow(euint16 value, address account) internal returns (euint16) { + Impl.allow(euint16.unwrap(value), account); + return value; } /** - * @dev Returns whether the sender is allowed to use the value. + * @dev Allows the use of value for this address (address(this)). */ - function isSenderAllowed(euint64 value) internal view returns (bool) { - return Impl.isAllowed(euint64.unwrap(value), msg.sender); + function allowThis(euint16 value) internal returns (euint16) { + Impl.allow(euint16.unwrap(value), address(this)); + return value; } /** - * @dev Returns whether the sender is allowed to use the value. + * @dev Allows the use of value by address account for this transaction. */ - function isSenderAllowed(euint128 value) internal view returns (bool) { - return Impl.isAllowed(euint128.unwrap(value), msg.sender); + function allowTransient(euint16 value, address account) internal returns (euint16) { + Impl.allowTransient(euint16.unwrap(value), account); + return value; } /** - * @dev Returns whether the sender is allowed to use the value. + * @dev Returns whether the account is allowed to use the value. */ - function isSenderAllowed(euint256 value) internal view returns (bool) { - return Impl.isAllowed(euint256.unwrap(value), msg.sender); + function isAllowed(euint32 value, address account) internal view returns (bool) { + return Impl.isAllowed(euint32.unwrap(value), account); } /** * @dev Returns whether the sender is allowed to use the value. */ - function isSenderAllowed(eaddress value) internal view returns (bool) { - return Impl.isAllowed(eaddress.unwrap(value), msg.sender); + function isSenderAllowed(euint32 value) internal view returns (bool) { + return Impl.isAllowed(euint32.unwrap(value), msg.sender); } /** - * @dev Returns whether the sender is allowed to use the value. + * @dev Allows the use of value for the address account. */ - function isSenderAllowed(ebytes256 value) internal view returns (bool) { - return Impl.isAllowed(ebytes256.unwrap(value), msg.sender); + function allow(euint32 value, address account) internal returns (euint32) { + Impl.allow(euint32.unwrap(value), account); + return value; } - function allow(ebool value, address account) internal { - Impl.allow(ebool.unwrap(value), account); + /** + * @dev Allows the use of value for this address (address(this)). + */ + function allowThis(euint32 value) internal returns (euint32) { + Impl.allow(euint32.unwrap(value), address(this)); + return value; } - function allowThis(ebool value) internal { - Impl.allow(ebool.unwrap(value), address(this)); + /** + * @dev Allows the use of value by address account for this transaction. + */ + function allowTransient(euint32 value, address account) internal returns (euint32) { + Impl.allowTransient(euint32.unwrap(value), account); + return value; } /** - * @dev Allows the use of value for the address account. + * @dev Returns whether the account is allowed to use the value. */ - function allow(euint4 value, address account) internal { - Impl.allow(euint4.unwrap(value), account); + function isAllowed(euint64 value, address account) internal view returns (bool) { + return Impl.isAllowed(euint64.unwrap(value), account); } /** - * @dev Allows the use of value for this address (address(this)). + * @dev Returns whether the sender is allowed to use the value. */ - function allowThis(euint4 value) internal { - Impl.allow(euint4.unwrap(value), address(this)); + function isSenderAllowed(euint64 value) internal view returns (bool) { + return Impl.isAllowed(euint64.unwrap(value), msg.sender); } /** * @dev Allows the use of value for the address account. */ - function allow(euint8 value, address account) internal { - Impl.allow(euint8.unwrap(value), account); + function allow(euint64 value, address account) internal returns (euint64) { + Impl.allow(euint64.unwrap(value), account); + return value; } /** * @dev Allows the use of value for this address (address(this)). */ - function allowThis(euint8 value) internal { - Impl.allow(euint8.unwrap(value), address(this)); + function allowThis(euint64 value) internal returns (euint64) { + Impl.allow(euint64.unwrap(value), address(this)); + return value; } /** - * @dev Allows the use of value for the address account. + * @dev Allows the use of value by address account for this transaction. */ - function allow(euint16 value, address account) internal { - Impl.allow(euint16.unwrap(value), account); + function allowTransient(euint64 value, address account) internal returns (euint64) { + Impl.allowTransient(euint64.unwrap(value), account); + return value; } /** - * @dev Allows the use of value for this address (address(this)). + * @dev Returns whether the account is allowed to use the value. */ - function allowThis(euint16 value) internal { - Impl.allow(euint16.unwrap(value), address(this)); + function isAllowed(euint128 value, address account) internal view returns (bool) { + return Impl.isAllowed(euint128.unwrap(value), account); } /** - * @dev Allows the use of value for the address account. + * @dev Returns whether the sender is allowed to use the value. */ - function allow(euint32 value, address account) internal { - Impl.allow(euint32.unwrap(value), account); + function isSenderAllowed(euint128 value) internal view returns (bool) { + return Impl.isAllowed(euint128.unwrap(value), msg.sender); } /** - * @dev Allows the use of value for this address (address(this)). + * @dev Allows the use of value for the address account. */ - function allowThis(euint32 value) internal { - Impl.allow(euint32.unwrap(value), address(this)); + function allow(euint128 value, address account) internal returns (euint128) { + Impl.allow(euint128.unwrap(value), account); + return value; } /** - * @dev Allows the use of value for the address account. + * @dev Allows the use of value for this address (address(this)). */ - function allow(euint64 value, address account) internal { - Impl.allow(euint64.unwrap(value), account); + function allowThis(euint128 value) internal returns (euint128) { + Impl.allow(euint128.unwrap(value), address(this)); + return value; } /** - * @dev Allows the use of value for this address (address(this)). + * @dev Allows the use of value by address account for this transaction. */ - function allowThis(euint64 value) internal { - Impl.allow(euint64.unwrap(value), address(this)); + function allowTransient(euint128 value, address account) internal returns (euint128) { + Impl.allowTransient(euint128.unwrap(value), account); + return value; } /** - * @dev Allows the use of value for the address account. + * @dev Returns whether the account is allowed to use the value. */ - function allow(euint128 value, address account) internal { - Impl.allow(euint128.unwrap(value), account); + function isAllowed(eaddress value, address account) internal view returns (bool) { + return Impl.isAllowed(eaddress.unwrap(value), account); } /** - * @dev Allows the use of value for this address (address(this)). + * @dev Returns whether the sender is allowed to use the value. */ - function allowThis(euint128 value) internal { - Impl.allow(euint128.unwrap(value), address(this)); + function isSenderAllowed(eaddress value) internal view returns (bool) { + return Impl.isAllowed(eaddress.unwrap(value), msg.sender); } /** * @dev Allows the use of value for the address account. */ - function allow(euint256 value, address account) internal { - Impl.allow(euint256.unwrap(value), account); + function allow(eaddress value, address account) internal returns (eaddress) { + Impl.allow(eaddress.unwrap(value), account); + return value; } /** * @dev Allows the use of value for this address (address(this)). */ - function allowThis(euint256 value) internal { - Impl.allow(euint256.unwrap(value), address(this)); + function allowThis(eaddress value) internal returns (eaddress) { + Impl.allow(eaddress.unwrap(value), address(this)); + return value; } /** - * @dev Allows the use of value for the address account. + * @dev Allows the use of value by address account for this transaction. */ - function allow(eaddress value, address account) internal { - Impl.allow(eaddress.unwrap(value), account); + function allowTransient(eaddress value, address account) internal returns (eaddress) { + Impl.allowTransient(eaddress.unwrap(value), account); + return value; } /** - * @dev Allows the use of value for this address (address(this)). + * @dev Returns whether the account is allowed to use the value. */ - function allowThis(eaddress value) internal { - Impl.allow(eaddress.unwrap(value), address(this)); + function isAllowed(euint256 value, address account) internal view returns (bool) { + return Impl.isAllowed(euint256.unwrap(value), account); + } + + /** + * @dev Returns whether the sender is allowed to use the value. + */ + function isSenderAllowed(euint256 value) internal view returns (bool) { + return Impl.isAllowed(euint256.unwrap(value), msg.sender); } /** * @dev Allows the use of value for the address account. */ - function allow(ebytes64 value, address account) internal { - Impl.allow(ebytes64.unwrap(value), account); + function allow(euint256 value, address account) internal returns (euint256) { + Impl.allow(euint256.unwrap(value), account); + return value; } /** * @dev Allows the use of value for this address (address(this)). */ - function allowThis(ebytes64 value) internal { - Impl.allow(ebytes64.unwrap(value), address(this)); + function allowThis(euint256 value) internal returns (euint256) { + Impl.allow(euint256.unwrap(value), address(this)); + return value; } /** - * @dev Allows the use of value for the address account. + * @dev Allows the use of value by address account for this transaction. */ - function allow(ebytes128 value, address account) internal { - Impl.allow(ebytes128.unwrap(value), account); + function allowTransient(euint256 value, address account) internal returns (euint256) { + Impl.allowTransient(euint256.unwrap(value), account); + return value; } /** - * @dev Allows the use of value for this address (address(this)). + * @dev Returns whether the account is allowed to use the value. */ - function allowThis(ebytes128 value) internal { - Impl.allow(ebytes128.unwrap(value), address(this)); + function isAllowed(ebytes64 value, address account) internal view returns (bool) { + return Impl.isAllowed(ebytes64.unwrap(value), account); } /** - * @dev Allows the use of value for the address account. + * @dev Returns whether the sender is allowed to use the value. */ - function allow(ebytes256 value, address account) internal { - Impl.allow(ebytes256.unwrap(value), account); + function isSenderAllowed(ebytes64 value) internal view returns (bool) { + return Impl.isAllowed(ebytes64.unwrap(value), msg.sender); } /** - * @dev Allows the use of value for this address (address(this)). + * @dev Allows the use of value for the address account. */ - function allowThis(ebytes256 value) internal { - Impl.allow(ebytes256.unwrap(value), address(this)); + function allow(ebytes64 value, address account) internal returns (ebytes64) { + Impl.allow(ebytes64.unwrap(value), account); + return value; } /** - * @dev Allows the use of value by address account for this transaction. + * @dev Allows the use of value for this address (address(this)). */ - function allowTransient(ebool value, address account) internal { - Impl.allowTransient(ebool.unwrap(value), account); + function allowThis(ebytes64 value) internal returns (ebytes64) { + Impl.allow(ebytes64.unwrap(value), address(this)); + return value; } /** * @dev Allows the use of value by address account for this transaction. */ - function allowTransient(euint4 value, address account) internal { - Impl.allowTransient(euint4.unwrap(value), account); + function allowTransient(ebytes64 value, address account) internal returns (ebytes64) { + Impl.allowTransient(ebytes64.unwrap(value), account); + return value; } /** - * @dev Allows the use of value by address account for this transaction. + * @dev Returns whether the account is allowed to use the value. */ - function allowTransient(euint8 value, address account) internal { - Impl.allowTransient(euint8.unwrap(value), account); + function isAllowed(ebytes128 value, address account) internal view returns (bool) { + return Impl.isAllowed(ebytes128.unwrap(value), account); } /** - * @dev Allows the use of value by address account for this transaction. + * @dev Returns whether the sender is allowed to use the value. */ - function allowTransient(euint16 value, address account) internal { - Impl.allowTransient(euint16.unwrap(value), account); + function isSenderAllowed(ebytes128 value) internal view returns (bool) { + return Impl.isAllowed(ebytes128.unwrap(value), msg.sender); } /** - * @dev Allows the use of value by address account for this transaction. + * @dev Allows the use of value for the address account. */ - function allowTransient(euint32 value, address account) internal { - Impl.allowTransient(euint32.unwrap(value), account); + function allow(ebytes128 value, address account) internal returns (ebytes128) { + Impl.allow(ebytes128.unwrap(value), account); + return value; } /** - * @dev Allows the use of value by address account for this transaction. + * @dev Allows the use of value for this address (address(this)). */ - function allowTransient(euint64 value, address account) internal { - Impl.allowTransient(euint64.unwrap(value), account); + function allowThis(ebytes128 value) internal returns (ebytes128) { + Impl.allow(ebytes128.unwrap(value), address(this)); + return value; } /** * @dev Allows the use of value by address account for this transaction. */ - function allowTransient(euint128 value, address account) internal { - Impl.allowTransient(euint128.unwrap(value), account); + function allowTransient(ebytes128 value, address account) internal returns (ebytes128) { + Impl.allowTransient(ebytes128.unwrap(value), account); + return value; } /** - * @dev Allows the use of value by address account for this transaction. + * @dev Returns whether the account is allowed to use the value. */ - function allowTransient(euint256 value, address account) internal { - Impl.allowTransient(euint256.unwrap(value), account); + function isAllowed(ebytes256 value, address account) internal view returns (bool) { + return Impl.isAllowed(ebytes256.unwrap(value), account); } /** - * @dev Allows the use of value by address account for this transaction. + * @dev Returns whether the sender is allowed to use the value. */ - function allowTransient(eaddress value, address account) internal { - Impl.allowTransient(eaddress.unwrap(value), account); + function isSenderAllowed(ebytes256 value) internal view returns (bool) { + return Impl.isAllowed(ebytes256.unwrap(value), msg.sender); } /** - * @dev Allows the use of value by address account for this transaction. + * @dev Allows the use of value for the address account. */ - function allowTransient(ebytes64 value, address account) internal { - Impl.allowTransient(ebytes64.unwrap(value), account); + function allow(ebytes256 value, address account) internal returns (ebytes256) { + Impl.allow(ebytes256.unwrap(value), account); + return value; } /** - * @dev Allows the use of value by address account for this transaction. + * @dev Allows the use of value for this address (address(this)). */ - function allowTransient(ebytes128 value, address account) internal { - Impl.allowTransient(ebytes128.unwrap(value), account); + function allowThis(ebytes256 value) internal returns (ebytes256) { + Impl.allow(ebytes256.unwrap(value), address(this)); + return value; } /** * @dev Allows the use of value by address account for this transaction. */ - function allowTransient(ebytes256 value, address account) internal { + function allowTransient(ebytes256 value, address account) internal returns (ebytes256) { Impl.allowTransient(ebytes256.unwrap(value), account); + return value; } } diff --git a/contracts/lib/FHEVMConfig.sol b/contracts/lib/HTTPZConfig.sol similarity index 62% rename from contracts/lib/FHEVMConfig.sol rename to contracts/lib/HTTPZConfig.sol index c4947553..63920809 100644 --- a/contracts/lib/FHEVMConfig.sol +++ b/contracts/lib/HTTPZConfig.sol @@ -5,17 +5,17 @@ pragma solidity ^0.8.24; import "../addresses/ACLAddress.sol"; import "../addresses/KMSVerifierAddress.sol"; import "../addresses/InputVerifierAddress.sol"; -import "../addresses/TFHEExecutorAddress.sol"; +import "../addresses/HTTPZExecutorAddress.sol"; -import {FHEVMConfigStruct} from "./TFHE.sol"; +import {HTTPZConfigStruct} from "./HTTPZ.sol"; -library FHEVMConfig { +library HTTPZConfig { /// @dev Function to return an immutable struct - function defaultConfig() internal pure returns (FHEVMConfigStruct memory) { + function defaultConfig() internal pure returns (HTTPZConfigStruct memory) { return - FHEVMConfigStruct({ + HTTPZConfigStruct({ ACLAddress: aclAdd, - TFHEExecutorAddress: tfheExecutorAdd, + HTTPZExecutorAddress: httpzExecutorAdd, KMSVerifierAddress: kmsVerifierAdd, InputVerifierAddress: inputVerifierAdd }); diff --git a/contracts/lib/Impl.sol b/contracts/lib/Impl.sol index 0223addf..dbd7f535 100644 --- a/contracts/lib/Impl.sol +++ b/contracts/lib/Impl.sol @@ -1,24 +1,24 @@ // SPDX-License-Identifier: BSD-3-Clause-Clear pragma solidity ^0.8.24; -import "./TFHE.sol"; +import {FheType} from "../contracts/FheType.sol"; /** - * @title FHEVMConfigStruct + * @title HTTPZConfigStruct * @notice This struct contains all addresses of core contracts, which are needed in a typical dApp. */ -struct FHEVMConfigStruct { +struct HTTPZConfigStruct { address ACLAddress; - address TFHEExecutorAddress; + address HTTPZExecutorAddress; address KMSVerifierAddress; address InputVerifierAddress; } /** - * @title ITFHEExecutor + * @title IHTTPZExecutor * @notice This interface contains all functions to conduct FHE operations. */ -interface ITFHEExecutor { +interface IHTTPZExecutor { /** * @notice Computes fheAdd operation. * @param lhs LHS. @@ -224,7 +224,7 @@ interface ITFHEExecutor { bytes32 inputHandle, address callerAddress, bytes memory inputProof, - bytes1 inputType + FheType inputType ) external returns (bytes32 result); /** @@ -233,7 +233,7 @@ interface ITFHEExecutor { * @param toType Target type. * @return result Result value of the target type. */ - function cast(bytes32 ct, bytes1 toType) external returns (bytes32 result); + function cast(bytes32 ct, FheType toType) external returns (bytes32 result); /** * @notice Does trivial encryption. @@ -241,7 +241,7 @@ interface ITFHEExecutor { * @param toType Target type. * @return result Result value of the target type. */ - function trivialEncrypt(uint256 ct, bytes1 toType) external returns (bytes32 result); + function trivialEncrypt(uint256 ct, FheType toType) external returns (bytes32 result); /** * @notice Does trivial encryption. @@ -249,7 +249,7 @@ interface ITFHEExecutor { * @param toType Target type. * @return result Result value of the target type. */ - function trivialEncrypt(bytes memory ct, bytes1 toType) external returns (bytes32 result); + function trivialEncrypt(bytes memory ct, FheType toType) external returns (bytes32 result); /** * @notice Computes FHEEq operation. @@ -283,7 +283,7 @@ interface ITFHEExecutor { * @param randType Type for the random result. * @return result Result. */ - function fheRand(bytes1 randType) external returns (bytes32 result); + function fheRand(FheType randType) external returns (bytes32 result); /** * @notice Computes FHERandBounded operation. @@ -291,7 +291,7 @@ interface ITFHEExecutor { * @param randType Type for the random result. * @return result Result. */ - function fheRandBounded(uint256 upperBound, bytes1 randType) external returns (bytes32 result); + function fheRandBounded(uint256 upperBound, FheType randType) external returns (bytes32 result); } /** @@ -320,7 +320,7 @@ interface IACL { /** * @dev This function removes the transient allowances, which could be useful for integration with - * Account Abstraction when bundling several UserOps calling the TFHEExecutorCoprocessor. + * Account Abstraction when bundling several UserOps calling the HTTPZExecutor Coprocessor. */ function cleanTransientStorage() external; @@ -347,7 +347,7 @@ interface IACL { interface IInputVerifier { /** * @dev This function removes the transient allowances, which could be useful for integration with - * Account Abstraction when bundling several UserOps calling the TFHEExecutorCoprocessor. + * Account Abstraction when bundling several UserOps calling the HTTPZExecutor Coprocessor. */ function cleanTransientStorage() external; } @@ -357,32 +357,32 @@ interface IInputVerifier { * @notice This library is the core implementation for computing FHE operations (e.g. add, sub, xor). */ library Impl { - /// @dev keccak256(abi.encode(uint256(keccak256("fhevm.storage.FHEVMConfig")) - 1)) & ~bytes32(uint256(0xff)) - bytes32 private constant FHEVMConfigLocation = 0xed8d60e34876f751cc8b014c560745351147d9de11b9347c854e881b128ea600; + /// keccak256(abi.encode(uint256(keccak256("httpz.storage.HTTPZConfig")) - 1)) & ~bytes32(uint256(0xff)) + bytes32 private constant HTTPZConfigLocation = 0x15b1d18ad3df4183245a6a11b17d9fa31dc4c35ffbf591bdfd0f9704a799c300; /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ - function getFHEVMConfig() internal pure returns (FHEVMConfigStruct storage $) { + function getHTTPZConfig() internal pure returns (HTTPZConfigStruct storage $) { assembly { - $.slot := FHEVMConfigLocation + $.slot := HTTPZConfigLocation } } /** - * @notice Sets the FHEVM addresses. - * @param fhevmConfig FHEVM config struct that contains contract addresses. + * @notice Sets the coprocessor addresses. + * @param httpzConfig HTTPZ config struct that contains contract addresses. */ - function setFHEVM(FHEVMConfigStruct memory fhevmConfig) internal { - FHEVMConfigStruct storage $ = getFHEVMConfig(); - $.ACLAddress = fhevmConfig.ACLAddress; - $.TFHEExecutorAddress = fhevmConfig.TFHEExecutorAddress; - $.KMSVerifierAddress = fhevmConfig.KMSVerifierAddress; - $.InputVerifierAddress = fhevmConfig.InputVerifierAddress; + function setCoprocessor(HTTPZConfigStruct memory httpzConfig) internal { + HTTPZConfigStruct storage $ = getHTTPZConfig(); + $.ACLAddress = httpzConfig.ACLAddress; + $.HTTPZExecutorAddress = httpzConfig.HTTPZExecutorAddress; + $.KMSVerifierAddress = httpzConfig.KMSVerifierAddress; + $.InputVerifierAddress = httpzConfig.InputVerifierAddress; } /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function add(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) { bytes1 scalarByte; @@ -391,12 +391,12 @@ library Impl { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheAdd(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheAdd(lhs, rhs, scalarByte); } /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function sub(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) { bytes1 scalarByte; @@ -405,12 +405,12 @@ library Impl { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheSub(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheSub(lhs, rhs, scalarByte); } /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function mul(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) { bytes1 scalarByte; @@ -419,30 +419,30 @@ library Impl { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheMul(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheMul(lhs, rhs, scalarByte); } /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function div(bytes32 lhs, bytes32 rhs) internal returns (bytes32 result) { bytes1 scalarByte = 0x01; - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheDiv(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheDiv(lhs, rhs, scalarByte); } /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function rem(bytes32 lhs, bytes32 rhs) internal returns (bytes32 result) { bytes1 scalarByte = 0x01; - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheRem(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheRem(lhs, rhs, scalarByte); } /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function and(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) { bytes1 scalarByte; @@ -451,12 +451,12 @@ library Impl { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheBitAnd(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheBitAnd(lhs, rhs, scalarByte); } /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function or(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) { bytes1 scalarByte; @@ -465,12 +465,12 @@ library Impl { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheBitOr(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheBitOr(lhs, rhs, scalarByte); } /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function xor(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) { bytes1 scalarByte; @@ -479,12 +479,12 @@ library Impl { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheBitXor(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheBitXor(lhs, rhs, scalarByte); } /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function shl(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) { bytes1 scalarByte; @@ -493,12 +493,12 @@ library Impl { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheShl(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheShl(lhs, rhs, scalarByte); } /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function shr(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) { bytes1 scalarByte; @@ -507,12 +507,12 @@ library Impl { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheShr(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheShr(lhs, rhs, scalarByte); } /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function rotl(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) { bytes1 scalarByte; @@ -521,12 +521,12 @@ library Impl { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheRotl(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheRotl(lhs, rhs, scalarByte); } /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function rotr(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) { bytes1 scalarByte; @@ -535,12 +535,12 @@ library Impl { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheRotr(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheRotr(lhs, rhs, scalarByte); } /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function eq(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) { bytes1 scalarByte; @@ -549,12 +549,12 @@ library Impl { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheEq(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheEq(lhs, rhs, scalarByte); } /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function ne(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) { bytes1 scalarByte; @@ -563,12 +563,12 @@ library Impl { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheNe(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheNe(lhs, rhs, scalarByte); } /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function ge(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) { bytes1 scalarByte; @@ -577,12 +577,12 @@ library Impl { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheGe(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheGe(lhs, rhs, scalarByte); } /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function gt(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) { bytes1 scalarByte; @@ -591,12 +591,12 @@ library Impl { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheGt(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheGt(lhs, rhs, scalarByte); } /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function le(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) { bytes1 scalarByte; @@ -605,12 +605,12 @@ library Impl { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheLe(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheLe(lhs, rhs, scalarByte); } /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function lt(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) { bytes1 scalarByte; @@ -619,12 +619,12 @@ library Impl { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheLt(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheLt(lhs, rhs, scalarByte); } /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function min(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) { bytes1 scalarByte; @@ -633,12 +633,12 @@ library Impl { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheMin(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheMin(lhs, rhs, scalarByte); } /** - * @dev Returns the FHEVM config. + * @dev Returns the HTTPZ config. */ function max(bytes32 lhs, bytes32 rhs, bool scalar) internal returns (bytes32 result) { bytes1 scalarByte; @@ -647,44 +647,39 @@ library Impl { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheMax(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheMax(lhs, rhs, scalarByte); } function neg(bytes32 ct) internal returns (bytes32 result) { - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheNeg(ct); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheNeg(ct); } function not(bytes32 ct) internal returns (bytes32 result) { - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheNot(ct); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheNot(ct); } /** * @dev If 'control's value is 'true', the result has the same value as 'ifTrue'. - * If 'control's value is 'false', the result has the same value as 'ifFalse'. + * If 'control's value is 'false', the result has the same value as 'ifFalse'. */ function select(bytes32 control, bytes32 ifTrue, bytes32 ifFalse) internal returns (bytes32 result) { - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheIfThenElse(control, ifTrue, ifFalse); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheIfThenElse(control, ifTrue, ifFalse); } /** - * @notice Verifies the ciphertext (TFHEExecutor) and allows transient (ACL). + * @notice Verifies the ciphertext (HTTPZExecutor) and allows transient (ACL). * @param inputHandle Input handle. * @param inputProof Input proof. * @param toType Input type. * @return result Result. */ - function verify(bytes32 inputHandle, bytes memory inputProof, uint8 toType) internal returns (bytes32 result) { - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).verifyCiphertext( - inputHandle, - msg.sender, - inputProof, - bytes1(toType) - ); + function verify(bytes32 inputHandle, bytes memory inputProof, FheType toType) internal returns (bytes32 result) { + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).verifyCiphertext(inputHandle, msg.sender, inputProof, toType); IACL($.ACLAddress).allowTransient(result, msg.sender); } @@ -694,9 +689,9 @@ library Impl { * @param toType Target type. * @return result Result value of the target type. */ - function cast(bytes32 ciphertext, uint8 toType) internal returns (bytes32 result) { - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).cast(ciphertext, bytes1(toType)); + function cast(bytes32 ciphertext, FheType toType) internal returns (bytes32 result) { + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).cast(ciphertext, toType); } /** @@ -705,9 +700,9 @@ library Impl { * @param toType Target type. * @return result Result value of the target type. */ - function trivialEncrypt(uint256 value, uint8 toType) internal returns (bytes32 result) { - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).trivialEncrypt(value, bytes1(toType)); + function trivialEncrypt(uint256 value, FheType toType) internal returns (bytes32 result) { + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).trivialEncrypt(value, toType); } /** @@ -716,9 +711,9 @@ library Impl { * @param toType Target type. * @return result Result value of the target type. */ - function trivialEncrypt(bytes memory value, uint8 toType) internal returns (bytes32 result) { - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).trivialEncrypt(value, bytes1(toType)); + function trivialEncrypt(bytes memory value, FheType toType) internal returns (bytes32 result) { + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).trivialEncrypt(value, toType); } /** @@ -735,8 +730,8 @@ library Impl { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheEq(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheEq(lhs, rhs, scalarByte); } /** @@ -753,18 +748,18 @@ library Impl { } else { scalarByte = 0x00; } - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheNe(lhs, rhs, scalarByte); + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheNe(lhs, rhs, scalarByte); } - function rand(uint8 randType) internal returns (bytes32 result) { - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheRand(bytes1(randType)); + function rand(FheType randType) internal returns (bytes32 result) { + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheRand(randType); } - function randBounded(uint256 upperBound, uint8 randType) internal returns (bytes32 result) { - FHEVMConfigStruct storage $ = getFHEVMConfig(); - result = ITFHEExecutor($.TFHEExecutorAddress).fheRandBounded(upperBound, bytes1(randType)); + function randBounded(uint256 upperBound, FheType randType) internal returns (bytes32 result) { + HTTPZConfigStruct storage $ = getHTTPZConfig(); + result = IHTTPZExecutor($.HTTPZExecutorAddress).fheRandBounded(upperBound, randType); } /** @@ -776,7 +771,7 @@ library Impl { * @param account Address of the account. */ function allowTransient(bytes32 handle, address account) internal { - FHEVMConfigStruct storage $ = getFHEVMConfig(); + HTTPZConfigStruct storage $ = getHTTPZConfig(); IACL($.ACLAddress).allowTransient(handle, account); } @@ -787,25 +782,25 @@ library Impl { * @param account Address of the account. */ function allow(bytes32 handle, address account) internal { - FHEVMConfigStruct storage $ = getFHEVMConfig(); + HTTPZConfigStruct storage $ = getHTTPZConfig(); IACL($.ACLAddress).allow(handle, account); } /** * @dev This function removes the transient allowances in the ACL, which could be useful for integration - * with Account Abstraction when bundling several UserOps calling the TFHEExecutorCoprocessor. + * with Account Abstraction when bundling several UserOps calling the HTTPZExecutor Coprocessor. */ function cleanTransientStorageACL() internal { - FHEVMConfigStruct storage $ = getFHEVMConfig(); + HTTPZConfigStruct storage $ = getHTTPZConfig(); IACL($.ACLAddress).cleanTransientStorage(); } /** * @dev This function removes the transient proofs in the InputVerifier, which could be useful for integration - * with Account Abstraction when bundling several UserOps calling the TFHEExecutorCoprocessor. + * with Account Abstraction when bundling several UserOps calling the HTTPZExecutor Coprocessor. */ function cleanTransientStorageInputVerifier() internal { - FHEVMConfigStruct storage $ = getFHEVMConfig(); + HTTPZConfigStruct storage $ = getHTTPZConfig(); IInputVerifier($.InputVerifierAddress).cleanTransientStorage(); } @@ -817,7 +812,7 @@ library Impl { * @return isAllowed Whether the account can access the handle. */ function isAllowed(bytes32 handle, address account) internal view returns (bool) { - FHEVMConfigStruct storage $ = getFHEVMConfig(); + HTTPZConfigStruct storage $ = getHTTPZConfig(); return IACL($.ACLAddress).isAllowed(handle, account); } } diff --git a/contracts/package-lock.json b/contracts/package-lock.json index 0862f08c..95848a04 100644 --- a/contracts/package-lock.json +++ b/contracts/package-lock.json @@ -1,12 +1,12 @@ { - "name": "fhevm-core-contracts", - "version": "0.7.0-4", + "name": "@httpz/core-contracts", + "version": "0.7.0-5", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "fhevm-core-contracts", - "version": "0.7.0-4", + "name": "@httpz/core-contracts", + "version": "0.7.0-5", "license": "BSD-3-Clause", "devDependencies": { "@nomicfoundation/hardhat-toolbox": "^5.0.0", diff --git a/contracts/package.json b/contracts/package.json index ca125e03..d201b096 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -1,10 +1,10 @@ { - "name": "fhevm-core-contracts", - "version": "0.7.0-4", - "description": "fhEVM contracts", + "name": "@httpz/core-contracts", + "version": "0.7.0-5", + "description": "HTTPZ backend contracts", "repository": { "type": "git", - "url": "git+https://github.com/zama-ai/fhevm-backend.git" + "url": "git+https://github.com/zama-ai/httpz-backend.git" }, "main": "index.js", "scripts": { diff --git a/contracts/tasks/etherscanVerify.ts b/contracts/tasks/etherscanVerify.ts index 04c13109..16b45b95 100644 --- a/contracts/tasks/etherscanVerify.ts +++ b/contracts/tasks/etherscanVerify.ts @@ -16,16 +16,16 @@ task('task:verifyACL').setAction(async function (taskArguments, { upgrades, run }); }); -task('task:verifyTFHEExecutor').setAction(async function (taskArguments, { upgrades, run }) { - const parsedEnvTFHEExecutor = dotenv.parse(fs.readFileSync('addresses/.env.exec')); - const proxyTFHEExecutorAddress = parsedEnvTFHEExecutor.TFHE_EXECUTOR_CONTRACT_ADDRESS; - const implementationTFHEExecutorAddress = await upgrades.erc1967.getImplementationAddress(proxyTFHEExecutorAddress); +task('task:verifyHTTPZExecutor').setAction(async function (taskArguments, { upgrades, run }) { + const parsedEnvHTTPZExecutor = dotenv.parse(fs.readFileSync('addresses/.env.exec')); + const proxyHTTPZExecutorAddress = parsedEnvHTTPZExecutor.HTTPZ_EXECUTOR_CONTRACT_ADDRESS; + const implementationHTTPZExecutorAddress = await upgrades.erc1967.getImplementationAddress(proxyHTTPZExecutorAddress); await run('verify:verify', { - address: implementationTFHEExecutorAddress, + address: implementationHTTPZExecutorAddress, constructorArguments: [], }); await run('verify:verify', { - address: proxyTFHEExecutorAddress, + address: proxyHTTPZExecutorAddress, constructorArguments: [], }); }); diff --git a/contracts/tasks/taskDeploy.ts b/contracts/tasks/taskDeploy.ts index 046f1b46..f6d2d0c5 100644 --- a/contracts/tasks/taskDeploy.ts +++ b/contracts/tasks/taskDeploy.ts @@ -30,9 +30,9 @@ task('task:deployEmptyUUPSProxies').setAction(async function (taskArguments: Tas address: aclAddress, }); - const tfheExecutorAddress = await deployEmptyUUPS(ethers, upgrades, deployer); - await run('task:setTFHEExecutorAddress', { - address: tfheExecutorAddress, + const httpzExecutorAddress = await deployEmptyUUPS(ethers, upgrades, deployer); + await run('task:setHTTPZExecutorAddress', { + address: httpzExecutorAddress, }); const kmsVerifierAddress = await deployEmptyUUPS(ethers, upgrades, deployer); @@ -80,16 +80,16 @@ task('task:deployACL').setAction(async function (taskArguments: TaskArguments, { console.log('ACL code set successfully at address:', proxyAddress); }); -task('task:deployTFHEExecutor').setAction(async function (taskArguments: TaskArguments, { ethers, upgrades }) { +task('task:deployHTTPZExecutor').setAction(async function (taskArguments: TaskArguments, { ethers, upgrades }) { const privateKey = getRequiredEnvVar('DEPLOYER_PRIVATE_KEY'); const deployer = new ethers.Wallet(privateKey).connect(ethers.provider); const currentImplementation = await ethers.getContractFactory('EmptyUUPSProxy', deployer); - const newImplem = await ethers.getContractFactory('./contracts/TFHEExecutor.sol:TFHEExecutor', deployer); + const newImplem = await ethers.getContractFactory('./contracts/HTTPZExecutor.sol:HTTPZExecutor', deployer); const parsedEnv = dotenv.parse(fs.readFileSync('addresses/.env.exec')); - const proxyAddress = parsedEnv.TFHE_EXECUTOR_CONTRACT_ADDRESS; + const proxyAddress = parsedEnv.HTTPZ_EXECUTOR_CONTRACT_ADDRESS; const proxy = await upgrades.forceImport(proxyAddress, currentImplementation); await upgrades.upgradeProxy(proxy, newImplem); - console.log('TFHEExecutor code set successfully at address:', proxyAddress); + console.log('HTTPZExecutor code set successfully at address:', proxyAddress); }); task('task:deployKMSVerifier') @@ -178,7 +178,7 @@ task('task:deployFHEGasLimit').setAction(async function (taskArguments: TaskArgu console.log('FHEGasLimit code set successfully at address:', proxyAddress); }); -task('task:getAllSigners') +task('task:getKmsSigners') .addOptionalParam( 'customKmsVerifierAddress', 'Use a custom address for the KMSVerifier contract instead of the default one - ie stored inside .env.kmsverifier', @@ -191,11 +191,32 @@ task('task:getAllSigners') } else { kmsAdd = dotenv.parse(fs.readFileSync('addresses/.env.kmsverifier')).KMS_VERIFIER_CONTRACT_ADDRESS; } - const kmsVerifier = (await factory.attach(kmsAdd).connect(ethers.provider)) as KMSVerifier; - const listCurrentKMSSigners = await kmsVerifier.getSigners(); + const kmsVerifier = factory.attach(kmsAdd).connect(ethers.provider) as KMSVerifier; + const listCurrentKMSSigners = await kmsVerifier.getKmsSigners(); console.log('The list of current KMS Signers stored inside KMSVerifier contract is: ', listCurrentKMSSigners); }); +task('task:getCoprocessorSigners') + .addOptionalParam( + 'customInputVerifierAddress', + 'Use a custom address for the InputVerifier contract instead of the default one - ie stored inside .env.inputverifier', + ) + .setAction(async function (taskArguments: TaskArguments, { ethers }) { + const factory = await ethers.getContractFactory('./contracts/InputVerifier.sol:InputVerifier'); + let inputVerifierAdd; + if (taskArguments.customInputVerifierAddress) { + inputVerifierAdd = taskArguments.customInputVerifierAddress; + } else { + inputVerifierAdd = dotenv.parse(fs.readFileSync('addresses/.env.inputverifier')).INPUT_VERIFIER_CONTRACT_ADDRESS; + } + const inputVerifier = factory.attach(inputVerifierAdd).connect(ethers.provider) as InputVerifier; + const listCurrentCoprocessorSigners = await inputVerifier.getCoprocessorSigners(); + console.log( + 'The list of current Coprocessor Signers stored inside InputVerifier contract is: ', + listCurrentCoprocessorSigners, + ); + }); + task('task:setDecryptionOracleAddress') .addParam('address', 'The address of the contract') .setAction(async function (taskArguments: TaskArguments, { ethers }) { @@ -255,32 +276,32 @@ address constant aclAdd = ${taskArguments.address};\n`; } }); -task('task:setTFHEExecutorAddress') +task('task:setHTTPZExecutorAddress') .addParam('address', 'The address of the contract') .setAction(async function (taskArguments: TaskArguments, { ethers }) { const envFilePath = path.join(__dirname, '../addresses/.env.exec'); - const content = `TFHE_EXECUTOR_CONTRACT_ADDRESS=${taskArguments.address}\n`; + const content = `HTTPZ_EXECUTOR_CONTRACT_ADDRESS=${taskArguments.address}\n`; try { fs.writeFileSync(envFilePath, content, { flag: 'w' }); - console.log(`TFHEExecutor address ${taskArguments.address} written successfully!`); + console.log(`HTTPZExecutor address ${taskArguments.address} written successfully!`); } catch (err) { - console.error('Failed to write TFHEExecutor address:', err); + console.error('Failed to write HTTPZExecutor address:', err); } const solidityTemplateCoprocessor = `// SPDX-License-Identifier: BSD-3-Clause-Clear pragma solidity ^0.8.24; -address constant tfheExecutorAdd = ${taskArguments.address};\n`; +address constant httpzExecutorAdd = ${taskArguments.address};\n`; try { - fs.writeFileSync('./addresses/TFHEExecutorAddress.sol', solidityTemplateCoprocessor, { + fs.writeFileSync('./addresses/HTTPZExecutorAddress.sol', solidityTemplateCoprocessor, { encoding: 'utf8', flag: 'w', }); - console.log('./addresses/TFHEExecutorAddress.sol file generated successfully!'); + console.log('./addresses/HTTPZExecutorAddress.sol file generated successfully!'); } catch (error) { - console.error('Failed to write ./addresses/TFHEExecutorAddress.sol', error); + console.error('Failed to write ./addresses/HTTPZExecutorAddress.sol', error); } }); @@ -423,7 +444,7 @@ task('task:deployAllHostContracts').setAction(async function (_, hre) { await hre.run('compile:specific', { contract: 'decryptionOracle' }); await hre.run('task:deployACL'); - await hre.run('task:deployTFHEExecutor'); + await hre.run('task:deployHTTPZExecutor'); await hre.run('task:deployKMSVerifier'); await hre.run('task:deployInputVerifier'); await hre.run('task:deployFHEGasLimit'); diff --git a/contracts/tasks/upgradeProxy.ts b/contracts/tasks/upgradeProxy.ts index 13105ff2..ea000185 100644 --- a/contracts/tasks/upgradeProxy.ts +++ b/contracts/tasks/upgradeProxy.ts @@ -72,14 +72,14 @@ task('task:upgradeACL') ); }); -task('task:upgradeTFHEExecutor') +task('task:upgradeHTTPZExecutor') .addParam( 'currentImplementation', - 'The currently deployed implementation solidity contract path and name, eg: contracts/TFHEExecutor.sol:TFHEExecutor', + 'The currently deployed implementation solidity contract path and name, eg: contracts/HTTPZExecutor.sol:HTTPZExecutor', ) .addParam( 'newImplementation', - 'The new implementation solidity contract path and name, eg: examples/TFHEExecutorUpgradedExample.sol:TFHEExecutorUpgradedExample', + 'The new implementation solidity contract path and name, eg: examples/HTTPZExecutorUpgradedExample.sol:HTTPZExecutorUpgradedExample', ) .addParam('privateKey', 'The deployer private key') .addOptionalParam( diff --git a/contracts/test/acl/acl.t.sol b/contracts/test/acl/acl.t.sol index e435750f..f376d995 100644 --- a/contracts/test/acl/acl.t.sol +++ b/contracts/test/acl/acl.t.sol @@ -7,7 +7,7 @@ import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Own import {ACL} from "../../contracts/ACL.sol"; import {EmptyUUPSProxy} from "../../contracts/emptyProxy/EmptyUUPSProxy.sol"; -import {tfheExecutorAdd} from "../../addresses/TFHEExecutorAddress.sol"; +import {httpzExecutorAdd} from "../../addresses/HTTPZExecutorAddress.sol"; contract ACLTest is Test { ACL internal acl; @@ -16,11 +16,11 @@ contract ACLTest is Test { address internal proxy; address internal implementation; - address internal tfheExecutor; + address internal httpzExecutor; /// @dev This helper function allows to add any handle for any account. function _allowHandle(bytes32 handle, address account) internal { - vm.prank(tfheExecutor); + vm.prank(httpzExecutor); acl.allowTransient(handle, account); vm.prank(account); acl.allow(handle, account); @@ -37,7 +37,7 @@ contract ACLTest is Test { implementation = address(new ACL()); UnsafeUpgrades.upgradeProxy(proxy, implementation, "", owner); acl = ACL(proxy); - tfheExecutor = acl.getTFHEExecutorAddress(); + httpzExecutor = acl.getHTTPZExecutorAddress(); assertEq(acl.owner(), owner); } @@ -46,8 +46,8 @@ contract ACLTest is Test { assertEq(acl.getVersion(), string(abi.encodePacked("ACL v0.1.0"))); } - function test_TFHEExecutorAddress() public view { - assertEq(acl.getTFHEExecutorAddress(), tfheExecutorAdd); + function test_HTTPZExecutorAddress() public view { + assertEq(acl.getHTTPZExecutorAddress(), httpzExecutorAdd); } function test_isAllowedReturnsFalseIfNotAllowed(bytes32 handle, address account) public view { @@ -76,15 +76,15 @@ contract ACLTest is Test { acl.allowTransient(handle, account); } - function test_CanAllowTransientIfTFHEExecutor(bytes32 handle, address account) public { - vm.prank(tfheExecutor); + function test_CanAllowTransientIfhttpzAddress(bytes32 handle, address account) public { + vm.prank(httpzExecutor); acl.allowTransient(handle, account); assertTrue(acl.allowedTransient(handle, account)); assertTrue(acl.isAllowed(handle, account)); } - function test_CanAllowTransientIfTFHEExecutorButOnlyUntilItGetsCleaned(bytes32 handle, address account) public { - vm.prank(tfheExecutor); + function test_CanAllowTransientIfhttpzAddressButOnlyUntilItGetsCleaned(bytes32 handle, address account) public { + vm.prank(httpzExecutor); acl.allowTransient(handle, account); acl.cleanTransientStorage(); assertFalse(acl.allowedTransient(handle, account)); diff --git a/contracts/test/acl/acl.ts b/contracts/test/acl/acl.ts index f08c58e4..a8891177 100644 --- a/contracts/test/acl/acl.ts +++ b/contracts/test/acl/acl.ts @@ -15,18 +15,18 @@ describe('ACL', function () { const acl = await aclFactory.deploy(); await acl.waitForDeployment(); this.acl = acl; - this.tfheAddress = await acl.getTFHEExecutorAddress(); + this.httpzAddress = await acl.getHTTPZExecutorAddress(); const amountToDistribute = BigInt(100 * 1e24); - await ethers.provider.send('hardhat_impersonateAccount', [this.tfheAddress]); - await ethers.provider.send('hardhat_setBalance', [this.tfheAddress, '0x' + amountToDistribute.toString(16)]); - this.tfheExecutor = await ethers.getSigner(this.tfheAddress); + await ethers.provider.send('hardhat_impersonateAccount', [this.httpzAddress]); + await ethers.provider.send('hardhat_setBalance', [this.httpzAddress, '0x' + amountToDistribute.toString(16)]); + this.httpzExecutor = await ethers.getSigner(this.httpzAddress); }); it('allowTransient() is not persistent', async function () { const randomHandle = '0x7345544800000000000000000000000000000000000000000000000000000000'; const randomAccount = this.signers.bob.address; - await this.acl.connect(this.tfheExecutor).allowTransient(randomHandle, randomAccount); + await this.acl.connect(this.httpzExecutor).allowTransient(randomHandle, randomAccount); /// @dev The isAllowed returns false since it is transient. expect(await this.acl.isAllowed(randomHandle, randomAccount)).to.be.eq(false); diff --git a/contracts/test/asyncDecrypt.ts b/contracts/test/asyncDecrypt.ts index 67eb1596..7299dd3b 100644 --- a/contracts/test/asyncDecrypt.ts +++ b/contracts/test/asyncDecrypt.ts @@ -1,7 +1,7 @@ import dotenv from 'dotenv'; import { Signer } from 'ethers'; import fs from 'fs'; -import { ethers, network } from 'hardhat'; +import { ethers, hardhatArguments as hre, network } from 'hardhat'; import { getRequiredEnvVar } from '../tasks/utils/loadVariables'; import { DecryptionOracle } from '../types'; @@ -24,9 +24,13 @@ async function getKMSSigners() { return kmsSigners; } +/** + * An object that maps numeric keys to their corresponding ciphertext types. + * The keys represent different types of ciphertexts, and the values are their + * respective type names as strings. + */ const CiphertextType = { 0: 'bool', - 1: 'uint8', // corresponding to euint4 2: 'uint8', // corresponding to euint8 3: 'uint16', 4: 'uint32', @@ -62,7 +66,7 @@ let lastBlockSnapshotForDecrypt: number; export const initDecryptionOracle = async (): Promise => { firstBlockListening = await ethers.provider.getBlockNumber(); - if (networkName === 'hardhat' && hre.__SOLIDITY_COVERAGE_RUNNING !== true) { + if (networkName === 'hardhat' && process.env.SOLIDITY_COVERAGE_RUNNING !== 'true') { // evm_snapshot is not supported in coverage mode await ethers.provider.send('set_lastBlockSnapshotForDecrypt', [firstBlockListening]); } @@ -111,6 +115,9 @@ const fulfillAllPastRequestsIds = async (mocked: boolean) => { for (const request of pastRequests) { const event = ifaceEventDecryption.parseLog(request); + if (!event) { + throw new Error('Event is null'); + } const requestID = event.args[1]; const handles = event.args[2]; const contractCaller = event.args[3]; @@ -123,7 +130,7 @@ const fulfillAllPastRequestsIds = async (mocked: boolean) => { // first check tat all handles are allowed for decryption const aclFactory = await ethers.getContractFactory('ACL'); - const acl = aclFactory.attach(aclAdd); + const acl = aclFactory.attach(aclAdd) as ACL; const isAllowedForDec = await Promise.all( handles.map(async (handle: string) => acl.isAllowedForDecryption(handle)), ); @@ -171,7 +178,11 @@ const fulfillAllPastRequestsIds = async (mocked: boolean) => { const tx = await relayer.sendTransaction(txData); await tx.wait(); } catch (error) { - console.log('Gateway fulfillment tx failed with the following error:', error.message); + if (error instanceof Error) { + console.log('Gateway fulfillment tx failed with the following error:', error.message); + } else { + console.log('Gateway fulfillment tx failed with an unknown error'); + } toSkip.push(requestID); throw error; } diff --git a/contracts/test/coprocessorUtils.ts b/contracts/test/coprocessorUtils.ts index 99d60284..6c3bca26 100644 --- a/contracts/test/coprocessorUtils.ts +++ b/contracts/test/coprocessorUtils.ts @@ -5,10 +5,12 @@ import { ethers } from 'hardhat'; import hre from 'hardhat'; import { Database } from 'sqlite3'; +import { FheType } from '../codegen/common'; import operatorsPrices from '../codegen/operatorsPrices.json'; +import { ALL_FHE_TYPES } from '../codegen/types'; const parsedEnvCoprocessor = dotenv.parse(fs.readFileSync('addresses/.env.exec')); -const coprocAddress = parsedEnvCoprocessor.TFHE_EXECUTOR_CONTRACT_ADDRESS; +const coprocAddress = parsedEnvCoprocessor.HTTPZ_EXECUTOR_CONTRACT_ADDRESS; let firstBlockListening = 0; let lastBlockSnapshot = 0; @@ -63,7 +65,6 @@ interface FHEVMEvent { const NumBits = { 0: 1n, //ebool - 1: 4n, //euint4 2: 8n, //euint8 3: 16n, //euint16 4: 32n, //euint32 @@ -91,6 +92,7 @@ function getRandomBigInt(numBits: number): bigint { if (numBits <= 0) { throw new Error('Number of bits must be greater than 0'); } + const numBytes = Math.ceil(numBits / 8); const randomBytes = new Uint8Array(numBytes); crypto.getRandomValues(randomBytes); @@ -98,6 +100,7 @@ function getRandomBigInt(numBits: number): bigint { for (let i = 0; i < numBytes; i++) { randomBigInt = (randomBigInt << BigInt(8)) | BigInt(randomBytes[i]); } + const mask = (BigInt(1) << BigInt(numBits)) - BigInt(1); randomBigInt = randomBigInt & mask; return randomBigInt; @@ -117,7 +120,7 @@ function bitwiseNotUintBits(value: BigInt, numBits: number) { export const awaitCoprocessor = async (): Promise => { chainId = (await ethers.provider.getNetwork()).chainId; - await processAllPastTFHEExecutorEvents(); + await processAllPastHTTPZExecutorEvents(); }; const abi = [ @@ -145,16 +148,16 @@ const abi = [ 'event FheMax(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result)', 'event FheNeg(address indexed caller, bytes32 ct, bytes32 result)', 'event FheNot(address indexed caller, bytes32 ct, bytes32 result)', - 'event VerifyCiphertext(address indexed caller, bytes32 inputHandle,address userAddress,bytes inputProof,bytes1 inputType,bytes32 result)', - 'event Cast(address indexed caller, bytes32 ct, bytes1 toType, bytes32 result)', - 'event TrivialEncrypt(address indexed caller, uint256 pt, bytes1 toType, bytes32 result)', - 'event TrivialEncryptBytes(address indexed caller, bytes pt, bytes1 toType, bytes32 result)', + 'event VerifyCiphertext(address indexed caller, bytes32 inputHandle, address userAddress, bytes inputProof, uint8 inputType, bytes32 result)', + 'event Cast(address indexed caller, bytes32 ct, uint8 toType, bytes32 result)', + 'event TrivialEncrypt(address indexed caller, uint256 pt, uint8 toType, bytes32 result)', + 'event TrivialEncryptBytes(address indexed caller, bytes pt, uint8 toType, bytes32 result)', 'event FheIfThenElse(address indexed caller, bytes32 control, bytes32 ifTrue, bytes32 ifFalse, bytes32 result)', - 'event FheRand(address indexed caller, bytes1 randType, bytes16 seed, bytes32 result)', - 'event FheRandBounded(address indexed caller, uint256 upperBound, bytes1 randType, bytes16 seed, bytes32 result)', + 'event FheRand(address indexed caller, uint8 randType, bytes16 seed, bytes32 result)', + 'event FheRandBounded(address indexed caller, uint256 upperBound, uint8 randType, bytes16 seed, bytes32 result)', ]; -async function processAllPastTFHEExecutorEvents() { +async function processAllPastHTTPZExecutorEvents() { const provider = ethers.provider; const latestBlockNumber = await provider.getBlockNumber(); @@ -584,7 +587,7 @@ async function insertHandleFromEvent(event: FHEVMEvent) { break; case 'FheRand': - resultType = parseInt(event.args[1], 16); + resultType = parseInt(event.args[1]); handle = ethers.toBeHex(event.args[3], 32); clearText = getRandomBigInt(Number(NumBits[resultType])); insertSQL(handle, clearText, true); @@ -592,7 +595,7 @@ async function insertHandleFromEvent(event: FHEVMEvent) { break; case 'FheRandBounded': - resultType = parseInt(event.args[2], 16); + resultType = parseInt(event.args[2]); handle = ethers.toBeHex(event.args[4], 32); clearText = getRandomBigInt(Number(log2(BigInt(event.args[1])))); insertSQL(handle, clearText, true); @@ -601,7 +604,10 @@ async function insertHandleFromEvent(event: FHEVMEvent) { } } -export function getFHEGasFromTxReceipt(receipt: ethers.TransactionReceipt): number { +export function getFHEGasFromTxReceipt( + receipt: ethers.TransactionReceipt, + FheTypes: FheType[] = ALL_FHE_TYPES, +): number { if (receipt.status === 0) { throw new Error('Transaction reverted'); } @@ -632,54 +638,86 @@ export function getFHEGasFromTxReceipt(receipt: ethers.TransactionReceipt): numb }); let FHEGasConsumed = 0; for (const event of FHELogs) { - let type; + let type: string | undefined; + let typeIndex: number; let handle; switch (event.name) { case 'TrivialEncrypt': - type = parseInt(event.args[2], 16); - FHEGasConsumed += operatorsPrices['trivialEncrypt'].types[type]; + typeIndex = parseInt(event.args[2]); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } + + FHEGasConsumed += (operatorsPrices['trivialEncrypt'].types as Record)[type]; break; case 'TrivialEncryptBytes': - type = parseInt(event.args[2], 16); - FHEGasConsumed += operatorsPrices['trivialEncrypt'].types[type]; + typeIndex = parseInt(event.args[2]); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } + FHEGasConsumed += (operatorsPrices['trivialEncrypt'].types as Record)[type]; break; case 'FheAdd': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } + if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheAdd'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheAdd'].scalar as Record)[type]; } else { - FHEGasConsumed += operatorsPrices['fheAdd'].nonScalar[type]; + FHEGasConsumed += (operatorsPrices['fheAdd'].nonScalar as Record)[type]; } + break; case 'FheSub': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } + if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheSub'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheSub'].scalar as Record)[type]; } else { - FHEGasConsumed += operatorsPrices['fheSub'].nonScalar[type]; + FHEGasConsumed += (operatorsPrices['fheSub'].nonScalar as Record)[type]; } break; case 'FheMul': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheMul'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheMul'].scalar as Record)[type]; } else { - FHEGasConsumed += operatorsPrices['fheMul'].nonScalar[type]; + FHEGasConsumed += (operatorsPrices['fheMul'].nonScalar as Record)[type]; } break; case 'FheDiv': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheDiv'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheDiv'].scalar as Record)[type]; } else { throw new Error('Non-scalar div not implemented yet'); } @@ -687,9 +725,13 @@ export function getFHEGasFromTxReceipt(receipt: ethers.TransactionReceipt): numb case 'FheRem': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheRem'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheRem'].scalar as Record)[type]; } else { throw new Error('Non-scalar rem not implemented yet'); } @@ -697,205 +739,297 @@ export function getFHEGasFromTxReceipt(receipt: ethers.TransactionReceipt): numb case 'FheBitAnd': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheBitAnd'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheBitAnd'].scalar as Record)[type]; } else { - FHEGasConsumed += operatorsPrices['fheBitAnd'].nonScalar[type]; + FHEGasConsumed += (operatorsPrices['fheBitAnd'].nonScalar as Record)[type]; } break; case 'FheBitOr': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheBitOr'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheBitOr'].scalar as Record)[type]; } else { - FHEGasConsumed += operatorsPrices['fheBitOr'].nonScalar[type]; + FHEGasConsumed += (operatorsPrices['fheBitOr'].nonScalar as Record)[type]; } break; case 'FheBitXor': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheBitXor'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheBitXor'].scalar as Record)[type]; } else { - FHEGasConsumed += operatorsPrices['fheBitXor'].nonScalar[type]; + FHEGasConsumed += (operatorsPrices['fheBitXor'].nonScalar as Record)[type]; } break; case 'FheShl': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheBitShl'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheShl'].scalar as Record)[type]; } else { - FHEGasConsumed += operatorsPrices['fheBitShl'].nonScalar[type]; + FHEGasConsumed += (operatorsPrices['fheShl'].nonScalar as Record)[type]; } break; case 'FheShr': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheBitShr'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheShr'].scalar as Record)[type]; } else { - FHEGasConsumed += operatorsPrices['fheBitShr'].nonScalar[type]; + FHEGasConsumed += (operatorsPrices['fheShr'].nonScalar as Record)[type]; } break; case 'FheRotl': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheRotl'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheRotl'].scalar as Record)[type]; } else { - FHEGasConsumed += operatorsPrices['fheRotl'].nonScalar[type]; + FHEGasConsumed += (operatorsPrices['fheRotl'].nonScalar as Record)[type]; } break; case 'FheRotr': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheRotr'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheRotr'].scalar as Record)[type]; } else { - FHEGasConsumed += operatorsPrices['fheRotr'].nonScalar[type]; + FHEGasConsumed += (operatorsPrices['fheRotr'].nonScalar as Record)[type]; } break; case 'FheEq': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheEq'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheEq'].scalar as Record)[type]; } else { - FHEGasConsumed += operatorsPrices['fheEq'].nonScalar[type]; + FHEGasConsumed += (operatorsPrices['fheEq'].nonScalar as Record)[type]; } break; case 'FheEqBytes': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheEq'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheEq'].scalar as Record)[type]; } else { - FHEGasConsumed += operatorsPrices['fheEq'].nonScalar[type]; + FHEGasConsumed += (operatorsPrices['fheEq'].nonScalar as Record)[type]; } case 'FheNe': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheNe'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheNe'].scalar as Record)[type]; } else { - FHEGasConsumed += operatorsPrices['fheNe'].nonScalar[type]; + FHEGasConsumed += (operatorsPrices['fheNe'].nonScalar as Record)[type]; } break; case 'FheNeBytes': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheNe'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheNe'].scalar as Record)[type]; } else { - FHEGasConsumed += operatorsPrices['fheNe'].nonScalar[type]; + FHEGasConsumed += (operatorsPrices['fheNe'].nonScalar as Record)[type]; } break; case 'FheGe': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheGe'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheGe'].scalar as Record)[type]; } else { - FHEGasConsumed += operatorsPrices['fheGe'].nonScalar[type]; + FHEGasConsumed += (operatorsPrices['fheGe'].nonScalar as Record)[type]; } break; case 'FheGt': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheGt'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheGt'].scalar as Record)[type]; } else { - FHEGasConsumed += operatorsPrices['fheGt'].nonScalar[type]; + FHEGasConsumed += (operatorsPrices['fheGt'].nonScalar as Record)[type]; } break; case 'FheLe': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheLe'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheLe'].scalar as Record)[type]; } else { - FHEGasConsumed += operatorsPrices['fheLe'].nonScalar[type]; + FHEGasConsumed += (operatorsPrices['fheLe'].nonScalar as Record)[type]; } break; case 'FheLt': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheLt'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheLt'].scalar as Record)[type]; } else { - FHEGasConsumed += operatorsPrices['fheLt'].nonScalar[type]; + FHEGasConsumed += (operatorsPrices['fheLt'].nonScalar as Record)[type]; } break; case 'FheMax': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheMax'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheMax'].scalar as Record)[type]; } else { - FHEGasConsumed += operatorsPrices['fheMax'].nonScalar[type]; + FHEGasConsumed += (operatorsPrices['fheMax'].nonScalar as Record)[type]; } break; case 'FheMin': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } if (event.args[3] === '0x01') { - FHEGasConsumed += operatorsPrices['fheMin'].scalar[type]; + FHEGasConsumed += (operatorsPrices['fheMin'].scalar as Record)[type]; } else { - FHEGasConsumed += operatorsPrices['fheMin'].nonScalar[type]; + FHEGasConsumed += (operatorsPrices['fheMin'].nonScalar as Record)[type]; } break; case 'Cast': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); - FHEGasConsumed += operatorsPrices['cast'].types[type]; + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } + FHEGasConsumed += (operatorsPrices['cast'].types as Record)[type]; break; case 'FheNot': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); - FHEGasConsumed += operatorsPrices['fheNot'].types[type]; + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } + FHEGasConsumed += (operatorsPrices['fheNot'].types as Record)[type]; break; case 'FheNeg': handle = ethers.toBeHex(event.args[1], 32); - type = parseInt(handle.slice(-4, -2), 16); - FHEGasConsumed += operatorsPrices['fheNeg'].types[type]; + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } + FHEGasConsumed += (operatorsPrices['fheNeg'].types as Record)[type]; break; case 'FheIfThenElse': handle = ethers.toBeHex(event.args[4], 32); - type = parseInt(handle.slice(-4, -2), 16); - FHEGasConsumed += operatorsPrices['ifThenElse'].types[type]; + typeIndex = parseInt(handle.slice(-4, -2), 16); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } + FHEGasConsumed += (operatorsPrices['ifThenElse'].types as Record)[type]; break; case 'FheRand': - type = parseInt(event.args[1], 16); - FHEGasConsumed += operatorsPrices['fheRand'].types[type]; + typeIndex = parseInt(event.args[1]); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } + FHEGasConsumed += (operatorsPrices['fheRand'].types as Record)[type]; break; case 'FheRandBounded': - type = parseInt(event.args[2], 16); - FHEGasConsumed += operatorsPrices['fheRandBounded'].types[type]; + typeIndex = parseInt(event.args[2]); + type = FheTypes.find((t) => t.value === typeIndex)?.type; + if (!type) { + throw new Error(`Invalid FheType index: ${typeIndex}`); + } + FHEGasConsumed += (operatorsPrices['fheRandBounded'].types as Record)[type]; break; } } diff --git a/contracts/test/encryptedERC20/EncryptedERC20.FHEGas.ts b/contracts/test/encryptedERC20/EncryptedERC20.FHEGas.ts index 76ea4424..bb5187f9 100644 --- a/contracts/test/encryptedERC20/EncryptedERC20.FHEGas.ts +++ b/contracts/test/encryptedERC20/EncryptedERC20.FHEGas.ts @@ -37,6 +37,7 @@ describe('EncryptedERC20:FHEGas', function () { const FHEGasConsumedTransfer = getFHEGasFromTxReceipt(t2); console.log('FHEGas Consumed in transfer', FHEGasConsumedTransfer); console.log('Native Gas Consumed in transfer', t2.gasUsed); + expect(FHEGasConsumedTransfer).to.eq(586200, 'FHEGas incorrect'); }); it('should be able to transferFrom only if allowance is sufficient', async function () { @@ -68,5 +69,6 @@ describe('EncryptedERC20:FHEGas', function () { const FHEGasConsumedTransferFrom = getFHEGasFromTxReceipt(t3); console.log('FHEGas Consumed in transferFrom', FHEGasConsumedTransferFrom); console.log('Native Gas Consumed in transferFrom', t3.gasUsed); + expect(FHEGasConsumedTransferFrom).to.eq(1009200, 'FHEGas incorrect'); }); }); diff --git a/contracts/test/encryptedERC20/EncryptedERC20.ts b/contracts/test/encryptedERC20/EncryptedERC20.ts index e8500619..e8935683 100644 --- a/contracts/test/encryptedERC20/EncryptedERC20.ts +++ b/contracts/test/encryptedERC20/EncryptedERC20.ts @@ -1,4 +1,5 @@ -import { expect } from 'chai'; +import { assert, expect } from 'chai'; +import hre from 'hardhat'; import { createInstances } from '../instance'; import { getSigners, initSigners } from '../signers'; @@ -24,6 +25,18 @@ describe('EncryptedERC20', function () { // Reencrypt Alice's balance const balanceHandleAlice = await this.erc20.balanceOf(this.signers.alice); + // Balance handle is deterministic so we can verify the last bytes of the handle + // Byte 21 was set to 0xff. + expect(balanceHandleAlice.slice(44, 46)).to.eq('ff'); + // Bytes 22-29 must be the chainId + const chainId = process.env.SOLIDITY_COVERAGE ? 31337 : hre.network.config.chainId; + assert(chainId, 'Host chainId not set'); + expect(balanceHandleAlice.slice(46, 62)).to.eq(chainId.toString(16).padStart(16, '0')); + // Byte30: type is euint64 (so position 5 in the FheType enum) + expect(balanceHandleAlice.slice(62, 64)).to.eq('05'); + // Byte31: handle version is 0 + expect(balanceHandleAlice.slice(64, 66)).to.eq('00'); + const { publicKey: publicKeyAlice, privateKey: privateKeyAlice } = this.instances.alice.generateKeypair(); const eip712 = this.instances.alice.createEIP712(publicKeyAlice, this.contractAddress); const signatureAlice = await this.signers.alice.signTypedData( diff --git a/contracts/test/fhevmjsMocked.ts b/contracts/test/fhevmjsMocked.ts index 38703868..4daaddb4 100644 --- a/contracts/test/fhevmjsMocked.ts +++ b/contracts/test/fhevmjsMocked.ts @@ -4,6 +4,7 @@ import crypto from 'crypto'; import dotenv from 'dotenv'; import { Wallet, ethers } from 'ethers'; import * as fs from 'fs'; +import hre from 'hardhat'; import { Keccak } from 'sha3'; import { isAddress } from 'web3-validator'; @@ -12,8 +13,6 @@ import { insertSQL } from './coprocessorUtils'; import { awaitCoprocessor, getClearText } from './coprocessorUtils'; import { checkIsHardhatSigner } from './utils'; -const hre = require('hardhat'); - async function getCoprocessorSigners() { const coprocessorSigners = []; const numKMSSigners = getRequiredEnvVar('NUM_COPROCESSORS'); @@ -30,17 +29,16 @@ const aclAdd = parsedEnvACL.ACL_CONTRACT_ADDRESS; enum Types { ebool = 0, - euint4, - euint8, - euint16, - euint32, - euint64, - euint128, - eaddress, - euint256, - ebytes64, - ebytes128, - ebytes256, + euint8 = 2, + euint16 = 3, + euint32 = 4, + euint64 = 5, + euint128 = 6, + eaddress = 7, + euint256 = 8, + ebytes64 = 9, + ebytes128 = 10, + ebytes256 = 11, } const sum = (arr: number[]) => arr.reduce((acc, val) => acc + val, 0); @@ -71,10 +69,6 @@ function createUintToUint8ArrayFunction(numBits: number) { byteBuffer = Buffer.from([Types.ebool]); totalBuffer = Buffer.concat([byteBuffer, combinedBuffer]); break; - case 4: - byteBuffer = Buffer.from([Types.euint4]); - totalBuffer = Buffer.concat([byteBuffer, combinedBuffer]); - break; case 8: byteBuffer = Buffer.from([Types.euint8]); totalBuffer = Buffer.concat([byteBuffer, combinedBuffer]); @@ -191,14 +185,6 @@ export const createEncryptedInputMocked = (contractAddress: string, userAddress: if (bits.length > 256) throw Error('Packing more than 256 variables in a single input ciphertext is unsupported'); return this; }, - add4(value: number | bigint) { - checkEncryptedValue(value, 4); - values.push(BigInt(value)); - bits.push(4); - if (sum(bits) > 2048) throw Error('Packing more than 2048 bits in a single input ciphertext is unsupported'); - if (bits.length > 256) throw Error('Packing more than 256 variables in a single input ciphertext is unsupported'); - return this; - }, add8(value: number | bigint) { checkEncryptedValue(value, 8); values.push(BigInt(value)); @@ -308,6 +294,11 @@ export const createEncryptedInputMocked = (contractAddress: string, userAddress: const encryptedArray = new Uint8Array(encrypted); const hash = new Keccak(256).update(Buffer.from(encryptedArray)).digest(); + const chainId = process.env.SOLIDITY_COVERAGE_RUNNING === 'true' ? 31337 : hre.network.config.chainId; + if (chainId === undefined) { + throw new Error('Chain ID is not defined'); + } + const handles = bits.map((v, i) => { const dataWithIndex = new Uint8Array(hash.length + 1); dataWithIndex.set(hash, 0); @@ -315,9 +306,21 @@ export const createEncryptedInputMocked = (contractAddress: string, userAddress: const finalHash = new Keccak(256).update(Buffer.from(dataWithIndex)).digest(); const dataInput = new Uint8Array(32); dataInput.set(finalHash, 0); - dataInput.set([i, ENCRYPTION_TYPES[v], 0], 29); + // Put the index at byte21 + dataInput.set([i], 21); + + // Split the chainId over 8 bytes + const chainIdBuffer = Buffer.alloc(8); + chainIdBuffer.writeBigUInt64BE(BigInt(chainId), 0); + + // Add the chainId to bytes22-29 + dataInput.set(chainIdBuffer, 22); + + // Add encryption type and handle_version (which is 0) to bytes30-31 + dataInput.set([ENCRYPTION_TYPES[v], 0], 30); return dataInput; }); + let inputProof = '0x' + numberToHex(handles.length); // numHandles + numCoprocessorSigners + list_handles + signatureCoprocessorSigners (total len : 1+1+32+NUM_HANDLES*32+65*numSigners) const numSigners = +process.env.NUM_COPROCESSORS!; inputProof += numberToHex(numSigners); diff --git a/contracts/test/gatewayDecrypt/testAsyncDecrypt.ts b/contracts/test/gatewayDecrypt/testAsyncDecrypt.ts index 46315aa5..0d9b02a7 100644 --- a/contracts/test/gatewayDecrypt/testAsyncDecrypt.ts +++ b/contracts/test/gatewayDecrypt/testAsyncDecrypt.ts @@ -70,36 +70,6 @@ describe('TestAsyncDecrypt', function () { } }); - it('test async decrypt uint4', async function () { - const balanceBefore = await ethers.provider.getBalance(this.relayerAddress); - const tx2 = await this.contract.connect(this.signers.carol).requestUint4(); - await tx2.wait(); - await awaitAllDecryptionResults(); - const y = await this.contract.yUint4(); - expect(y).to.equal(4); - const balanceAfter = await ethers.provider.getBalance(this.relayerAddress); - console.log(balanceBefore - balanceAfter); - }); - - it.skip('test async decrypt FAKE uint4', async function () { - if (network.name !== 'hardhat') { - // only in fhevm mode - const txObject = await this.contract.requestFakeUint4.populateTransaction(); - const tx = await this.signers.carol.sendTransaction(txObject); - let receipt = null; - let waitTime = 0; - while (receipt === null && waitTime < 15000) { - receipt = await ethers.provider.getTransactionReceipt(tx.hash); - if (receipt === null) { - console.log('Trying again to fetch txn receipt....'); - await new Promise((resolve) => setTimeout(resolve, 5000)); // Wait for 5 seconds - waitTime += 5000; - } - } - expect(waitTime >= 15000).to.be.true; - } - }); - it('test async decrypt uint8', async function () { const tx2 = await this.contract.connect(this.signers.carol).requestUint8(); await tx2.wait(); diff --git a/contracts/test/httpzExecutor/httpzExecutor.t.sol b/contracts/test/httpzExecutor/httpzExecutor.t.sol new file mode 100644 index 00000000..57ee46be --- /dev/null +++ b/contracts/test/httpzExecutor/httpzExecutor.t.sol @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import {Test} from "forge-std/Test.sol"; +import {UnsafeUpgrades} from "@openzeppelin/foundry-upgrades/src/Upgrades.sol"; +import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; + +import {HTTPZExecutorNoEvents} from "../../contracts/HTTPZExecutorNoEvents.sol"; +import {EmptyUUPSProxy} from "../../contracts/emptyProxy/EmptyUUPSProxy.sol"; + +contract HTTPZExecutorTest is Test { + HTTPZExecutorNoEvents internal httpzExecutor; + + address internal constant owner = address(456); + + address internal proxy; + address internal implementation; + + /** + * @dev Internal function to deploy a UUPS proxy contract. + * The proxy is deployed using the UnsafeUpgrades library and initialized with the owner address. + */ + function _deployProxy() internal { + proxy = UnsafeUpgrades.deployUUPSProxy( + address(new EmptyUUPSProxy()), + abi.encodeCall(EmptyUUPSProxy.initialize, owner) + ); + } + + /** + * @dev Internal function to upgrade the deployed proxy to a new implementation. + * The new implementation is an instance of the HTTPZExecutorNoEvents contract. + * The proxy is upgraded using the UnsafeUpgrades library and the owner address. + */ + function _upgradeProxy() internal { + implementation = address(new HTTPZExecutorNoEvents()); + UnsafeUpgrades.upgradeProxy(proxy, implementation, "", owner); + httpzExecutor = HTTPZExecutorNoEvents(proxy); + } + + /** + * @dev Public function to set up the test environment. + * This function deploys the proxy, upgrades it to the HTTPZExecutorNoEvents implementation. + */ + function setUp() public { + _deployProxy(); + _upgradeProxy(); + } +} diff --git a/contracts/test/httpzOperations/httpzOperations1.ts b/contracts/test/httpzOperations/httpzOperations1.ts new file mode 100644 index 00000000..f6918719 --- /dev/null +++ b/contracts/test/httpzOperations/httpzOperations1.ts @@ -0,0 +1,3136 @@ +import { expect } from 'chai'; +import { ethers } from 'hardhat'; + +import type { HTTPZTestSuite1 } from '../../types/contracts/tests/HTTPZTestSuite1'; +import type { HTTPZTestSuite2 } from '../../types/contracts/tests/HTTPZTestSuite2'; +import type { HTTPZTestSuite3 } from '../../types/contracts/tests/HTTPZTestSuite3'; +import type { HTTPZTestSuite4 } from '../../types/contracts/tests/HTTPZTestSuite4'; +import type { HTTPZTestSuite5 } from '../../types/contracts/tests/HTTPZTestSuite5'; +import type { HTTPZTestSuite6 } from '../../types/contracts/tests/HTTPZTestSuite6'; +import type { HTTPZTestSuite7 } from '../../types/contracts/tests/HTTPZTestSuite7'; +import { + createInstances, + decrypt8, + decrypt16, + decrypt32, + decrypt64, + decrypt128, + decrypt256, + decryptBool, +} from '../instance'; +import { getSigners, initSigners } from '../signers'; + +async function deployHTTPZTestFixture1(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite1'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture2(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite2'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture3(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite3'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture4(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite4'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture5(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite5'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture6(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite6'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture7(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite7'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +describe('HTTPZ operations 1', function () { + before(async function () { + await initSigners(1); + this.signers = await getSigners(); + + const contract1 = await deployHTTPZTestFixture1(); + this.contract1Address = await contract1.getAddress(); + this.contract1 = contract1; + + const contract2 = await deployHTTPZTestFixture2(); + this.contract2Address = await contract2.getAddress(); + this.contract2 = contract2; + + const contract3 = await deployHTTPZTestFixture3(); + this.contract3Address = await contract3.getAddress(); + this.contract3 = contract3; + + const contract4 = await deployHTTPZTestFixture4(); + this.contract4Address = await contract4.getAddress(); + this.contract4 = contract4; + + const contract5 = await deployHTTPZTestFixture5(); + this.contract5Address = await contract5.getAddress(); + this.contract5 = contract5; + + const contract6 = await deployHTTPZTestFixture6(); + this.contract6Address = await contract6.getAddress(); + this.contract6 = contract6; + + const contract7 = await deployHTTPZTestFixture7(); + this.contract7Address = await contract7.getAddress(); + this.contract7 = contract7; + + const instances = await createInstances(this.signers); + this.instances = instances; + }); + + it('test operator "add" overload (euint8, euint8) => euint8 test 1 (80, 61)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(80n); + input.add8(61n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(141n); + }); + + it('test operator "add" overload (euint8, euint8) => euint8 test 2 (117, 121)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(117n); + input.add8(121n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(238n); + }); + + it('test operator "add" overload (euint8, euint8) => euint8 test 3 (121, 121)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(121n); + input.add8(121n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(242n); + }); + + it('test operator "add" overload (euint8, euint8) => euint8 test 4 (121, 117)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(121n); + input.add8(117n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(238n); + }); + + it('test operator "sub" overload (euint8, euint8) => euint8 test 1 (58, 58)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(58n); + input.add8(58n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.sub_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint8, euint8) => euint8 test 2 (58, 54)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(58n); + input.add8(54n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.sub_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint8, euint8) => euint8 test 1 (11, 22)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(11n); + input.add8(22n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(242n); + }); + + it('test operator "mul" overload (euint8, euint8) => euint8 test 2 (10, 11)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(10n); + input.add8(11n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(110n); + }); + + it('test operator "mul" overload (euint8, euint8) => euint8 test 3 (11, 11)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(11n); + input.add8(11n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(121n); + }); + + it('test operator "mul" overload (euint8, euint8) => euint8 test 4 (11, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(11n); + input.add8(10n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(110n); + }); + + it('test operator "and" overload (euint8, euint8) => euint8 test 1 (112, 244)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(112n); + input.add8(244n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(112n); + }); + + it('test operator "and" overload (euint8, euint8) => euint8 test 2 (108, 112)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(108n); + input.add8(112n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(96n); + }); + + it('test operator "and" overload (euint8, euint8) => euint8 test 3 (112, 112)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(112n); + input.add8(112n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(112n); + }); + + it('test operator "and" overload (euint8, euint8) => euint8 test 4 (112, 108)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(112n); + input.add8(108n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(96n); + }); + + it('test operator "or" overload (euint8, euint8) => euint8 test 1 (244, 114)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(244n); + input.add8(114n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(246n); + }); + + it('test operator "or" overload (euint8, euint8) => euint8 test 2 (110, 114)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(110n); + input.add8(114n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(126n); + }); + + it('test operator "or" overload (euint8, euint8) => euint8 test 3 (114, 114)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(114n); + input.add8(114n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(114n); + }); + + it('test operator "or" overload (euint8, euint8) => euint8 test 4 (114, 110)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(114n); + input.add8(110n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(126n); + }); + + it('test operator "xor" overload (euint8, euint8) => euint8 test 1 (63, 161)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(63n); + input.add8(161n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(158n); + }); + + it('test operator "xor" overload (euint8, euint8) => euint8 test 2 (59, 63)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(59n); + input.add8(63n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint8, euint8) => euint8 test 3 (63, 63)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(63n); + input.add8(63n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint8, euint8) => euint8 test 4 (63, 59)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(63n); + input.add8(59n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(4n); + }); + + it('test operator "eq" overload (euint8, euint8) => ebool test 1 (143, 90)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(143n); + input.add8(90n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint8, euint8) => ebool test 2 (86, 90)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(86n); + input.add8(90n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint8, euint8) => ebool test 3 (90, 90)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(90n); + input.add8(90n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint8, euint8) => ebool test 4 (90, 86)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(90n); + input.add8(86n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint8, euint8) => ebool test 1 (140, 239)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(140n); + input.add8(239n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint8, euint8) => ebool test 2 (136, 140)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(136n); + input.add8(140n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint8, euint8) => ebool test 3 (140, 140)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(140n); + input.add8(140n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint8, euint8) => ebool test 4 (140, 136)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(140n); + input.add8(136n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint8, euint8) => ebool test 1 (6, 250)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(6n); + input.add8(250n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint8, euint8) => ebool test 2 (2, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(2n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint8, euint8) => ebool test 3 (6, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(6n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint8, euint8) => ebool test 4 (6, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(6n); + input.add8(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint8, euint8) => ebool test 1 (41, 144)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(41n); + input.add8(144n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint8, euint8) => ebool test 2 (37, 41)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(37n); + input.add8(41n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint8, euint8) => ebool test 3 (41, 41)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(41n); + input.add8(41n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint8, euint8) => ebool test 4 (41, 37)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(41n); + input.add8(37n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, euint8) => ebool test 1 (136, 179)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(136n); + input.add8(179n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, euint8) => ebool test 2 (132, 136)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(132n); + input.add8(136n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, euint8) => ebool test 3 (136, 136)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(136n); + input.add8(136n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, euint8) => ebool test 4 (136, 132)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(136n); + input.add8(132n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint8, euint8) => ebool test 1 (177, 168)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(177n); + input.add8(168n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint8, euint8) => ebool test 2 (164, 168)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(164n); + input.add8(168n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint8, euint8) => ebool test 3 (168, 168)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(168n); + input.add8(168n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint8, euint8) => ebool test 4 (168, 164)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(168n); + input.add8(164n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint8, euint8) => euint8 test 1 (5, 73)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(5n); + input.add8(73n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(5n); + }); + + it('test operator "min" overload (euint8, euint8) => euint8 test 2 (1, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(1n); + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(1n); + }); + + it('test operator "min" overload (euint8, euint8) => euint8 test 3 (5, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(5n); + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(5n); + }); + + it('test operator "min" overload (euint8, euint8) => euint8 test 4 (5, 1)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(5n); + input.add8(1n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(1n); + }); + + it('test operator "max" overload (euint8, euint8) => euint8 test 1 (249, 182)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(249n); + input.add8(182n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(249n); + }); + + it('test operator "max" overload (euint8, euint8) => euint8 test 2 (178, 182)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(178n); + input.add8(182n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(182n); + }); + + it('test operator "max" overload (euint8, euint8) => euint8 test 3 (182, 182)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(182n); + input.add8(182n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(182n); + }); + + it('test operator "max" overload (euint8, euint8) => euint8 test 4 (182, 178)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(182n); + input.add8(178n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract1.resEuint8()); + expect(res).to.equal(182n); + }); + + it('test operator "add" overload (euint8, euint16) => euint16 test 1 (2, 143)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(2n); + input.add16(143n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(145n); + }); + + it('test operator "add" overload (euint8, euint16) => euint16 test 2 (40, 44)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(40n); + input.add16(44n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(84n); + }); + + it('test operator "add" overload (euint8, euint16) => euint16 test 3 (44, 44)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(44n); + input.add16(44n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(88n); + }); + + it('test operator "add" overload (euint8, euint16) => euint16 test 4 (44, 40)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(44n); + input.add16(40n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(84n); + }); + + it('test operator "sub" overload (euint8, euint16) => euint16 test 1 (107, 107)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(107n); + input.add16(107n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.sub_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint8, euint16) => euint16 test 2 (107, 103)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(107n); + input.add16(103n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.sub_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint8, euint16) => euint16 test 1 (3, 58)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(3n); + input.add16(58n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(174n); + }); + + it('test operator "mul" overload (euint8, euint16) => euint16 test 2 (9, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(9n); + input.add16(9n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(81n); + }); + + it('test operator "mul" overload (euint8, euint16) => euint16 test 3 (9, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(9n); + input.add16(9n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(81n); + }); + + it('test operator "mul" overload (euint8, euint16) => euint16 test 4 (9, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(9n); + input.add16(9n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(81n); + }); + + it('test operator "and" overload (euint8, euint16) => euint16 test 1 (58, 17624)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(58n); + input.add16(17624n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(24n); + }); + + it('test operator "and" overload (euint8, euint16) => euint16 test 2 (54, 58)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(54n); + input.add16(58n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(50n); + }); + + it('test operator "and" overload (euint8, euint16) => euint16 test 3 (58, 58)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(58n); + input.add16(58n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(58n); + }); + + it('test operator "and" overload (euint8, euint16) => euint16 test 4 (58, 54)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(58n); + input.add16(54n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(50n); + }); + + it('test operator "or" overload (euint8, euint16) => euint16 test 1 (21, 62721)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(21n); + input.add16(62721n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(62741n); + }); + + it('test operator "or" overload (euint8, euint16) => euint16 test 2 (17, 21)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(17n); + input.add16(21n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(21n); + }); + + it('test operator "or" overload (euint8, euint16) => euint16 test 3 (21, 21)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(21n); + input.add16(21n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(21n); + }); + + it('test operator "or" overload (euint8, euint16) => euint16 test 4 (21, 17)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(21n); + input.add16(17n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(21n); + }); + + it('test operator "xor" overload (euint8, euint16) => euint16 test 1 (242, 45052)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(242n); + input.add16(45052n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(44814n); + }); + + it('test operator "xor" overload (euint8, euint16) => euint16 test 2 (238, 242)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(238n); + input.add16(242n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(28n); + }); + + it('test operator "xor" overload (euint8, euint16) => euint16 test 3 (242, 242)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(242n); + input.add16(242n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint8, euint16) => euint16 test 4 (242, 238)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(242n); + input.add16(238n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(28n); + }); + + it('test operator "eq" overload (euint8, euint16) => ebool test 1 (123, 58030)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(123n); + input.add16(58030n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint8, euint16) => ebool test 2 (119, 123)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(119n); + input.add16(123n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint8, euint16) => ebool test 3 (123, 123)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(123n); + input.add16(123n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint8, euint16) => ebool test 4 (123, 119)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(123n); + input.add16(119n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint8, euint16) => ebool test 1 (20, 13572)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(20n); + input.add16(13572n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint8, euint16) => ebool test 2 (16, 20)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(16n); + input.add16(20n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint8, euint16) => ebool test 3 (20, 20)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(20n); + input.add16(20n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint8, euint16) => ebool test 4 (20, 16)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(20n); + input.add16(16n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint8, euint16) => ebool test 1 (212, 4744)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(212n); + input.add16(4744n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint8, euint16) => ebool test 2 (208, 212)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(208n); + input.add16(212n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint8, euint16) => ebool test 3 (212, 212)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(212n); + input.add16(212n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint8, euint16) => ebool test 4 (212, 208)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(212n); + input.add16(208n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint8, euint16) => ebool test 1 (204, 60999)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(204n); + input.add16(60999n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint8, euint16) => ebool test 2 (200, 204)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(200n); + input.add16(204n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint8, euint16) => ebool test 3 (204, 204)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(204n); + input.add16(204n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint8, euint16) => ebool test 4 (204, 200)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(204n); + input.add16(200n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, euint16) => ebool test 1 (68, 28953)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(68n); + input.add16(28953n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, euint16) => ebool test 2 (64, 68)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(64n); + input.add16(68n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, euint16) => ebool test 3 (68, 68)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(68n); + input.add16(68n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, euint16) => ebool test 4 (68, 64)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(68n); + input.add16(64n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint8, euint16) => ebool test 1 (123, 3825)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(123n); + input.add16(3825n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint8, euint16) => ebool test 2 (119, 123)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(119n); + input.add16(123n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint8, euint16) => ebool test 3 (123, 123)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(123n); + input.add16(123n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint8, euint16) => ebool test 4 (123, 119)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(123n); + input.add16(119n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint8, euint16) => euint16 test 1 (250, 45165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(250n); + input.add16(45165n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(250n); + }); + + it('test operator "min" overload (euint8, euint16) => euint16 test 2 (246, 250)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(246n); + input.add16(250n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(246n); + }); + + it('test operator "min" overload (euint8, euint16) => euint16 test 3 (250, 250)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(250n); + input.add16(250n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(250n); + }); + + it('test operator "min" overload (euint8, euint16) => euint16 test 4 (250, 246)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(250n); + input.add16(246n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(246n); + }); + + it('test operator "max" overload (euint8, euint16) => euint16 test 1 (247, 10102)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(247n); + input.add16(10102n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(10102n); + }); + + it('test operator "max" overload (euint8, euint16) => euint16 test 2 (243, 247)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(243n); + input.add16(247n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(247n); + }); + + it('test operator "max" overload (euint8, euint16) => euint16 test 3 (247, 247)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(247n); + input.add16(247n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(247n); + }); + + it('test operator "max" overload (euint8, euint16) => euint16 test 4 (247, 243)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(247n); + input.add16(243n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint8_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(247n); + }); + + it('test operator "add" overload (euint8, euint32) => euint32 test 1 (2, 233)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(2n); + input.add32(233n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(235n); + }); + + it('test operator "add" overload (euint8, euint32) => euint32 test 2 (121, 123)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(121n); + input.add32(123n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(244n); + }); + + it('test operator "add" overload (euint8, euint32) => euint32 test 3 (123, 123)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(123n); + input.add32(123n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(246n); + }); + + it('test operator "add" overload (euint8, euint32) => euint32 test 4 (123, 121)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(123n); + input.add32(121n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(244n); + }); + + it('test operator "sub" overload (euint8, euint32) => euint32 test 1 (224, 224)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(224n); + input.add32(224n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.sub_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint8, euint32) => euint32 test 2 (224, 220)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(224n); + input.add32(220n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.sub_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint8, euint32) => euint32 test 1 (2, 67)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(2n); + input.add32(67n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(134n); + }); + + it('test operator "mul" overload (euint8, euint32) => euint32 test 2 (9, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(9n); + input.add32(9n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(81n); + }); + + it('test operator "mul" overload (euint8, euint32) => euint32 test 3 (9, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(9n); + input.add32(9n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(81n); + }); + + it('test operator "mul" overload (euint8, euint32) => euint32 test 4 (9, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(9n); + input.add32(9n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(81n); + }); + + it('test operator "and" overload (euint8, euint32) => euint32 test 1 (223, 1939384274)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(223n); + input.add32(1939384274n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(210n); + }); + + it('test operator "and" overload (euint8, euint32) => euint32 test 2 (219, 223)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(219n); + input.add32(223n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(219n); + }); + + it('test operator "and" overload (euint8, euint32) => euint32 test 3 (223, 223)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(223n); + input.add32(223n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(223n); + }); + + it('test operator "and" overload (euint8, euint32) => euint32 test 4 (223, 219)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(223n); + input.add32(219n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(219n); + }); + + it('test operator "or" overload (euint8, euint32) => euint32 test 1 (116, 1474869154)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(116n); + input.add32(1474869154n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(1474869238n); + }); + + it('test operator "or" overload (euint8, euint32) => euint32 test 2 (112, 116)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(112n); + input.add32(116n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(116n); + }); + + it('test operator "or" overload (euint8, euint32) => euint32 test 3 (116, 116)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(116n); + input.add32(116n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(116n); + }); + + it('test operator "or" overload (euint8, euint32) => euint32 test 4 (116, 112)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(116n); + input.add32(112n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(116n); + }); + + it('test operator "xor" overload (euint8, euint32) => euint32 test 1 (136, 2874647321)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(136n); + input.add32(2874647321n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(2874647441n); + }); + + it('test operator "xor" overload (euint8, euint32) => euint32 test 2 (132, 136)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(132n); + input.add32(136n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(12n); + }); + + it('test operator "xor" overload (euint8, euint32) => euint32 test 3 (136, 136)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(136n); + input.add32(136n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint8, euint32) => euint32 test 4 (136, 132)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(136n); + input.add32(132n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(12n); + }); + + it('test operator "eq" overload (euint8, euint32) => ebool test 1 (10, 3748083816)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(10n); + input.add32(3748083816n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint8, euint32) => ebool test 2 (6, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(6n); + input.add32(10n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint8, euint32) => ebool test 3 (10, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(10n); + input.add32(10n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint8, euint32) => ebool test 4 (10, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(10n); + input.add32(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint8, euint32) => ebool test 1 (47, 227190832)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(47n); + input.add32(227190832n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint8, euint32) => ebool test 2 (43, 47)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(43n); + input.add32(47n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint8, euint32) => ebool test 3 (47, 47)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(47n); + input.add32(47n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint8, euint32) => ebool test 4 (47, 43)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(47n); + input.add32(43n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint8, euint32) => ebool test 1 (163, 4218482325)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(163n); + input.add32(4218482325n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint8, euint32) => ebool test 2 (159, 163)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(159n); + input.add32(163n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint8, euint32) => ebool test 3 (163, 163)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(163n); + input.add32(163n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint8, euint32) => ebool test 4 (163, 159)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(163n); + input.add32(159n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint8, euint32) => ebool test 1 (27, 3492747848)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(27n); + input.add32(3492747848n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint8, euint32) => ebool test 2 (23, 27)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(23n); + input.add32(27n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint8, euint32) => ebool test 3 (27, 27)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(27n); + input.add32(27n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint8, euint32) => ebool test 4 (27, 23)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(27n); + input.add32(23n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, euint32) => ebool test 1 (177, 1867522397)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(177n); + input.add32(1867522397n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, euint32) => ebool test 2 (173, 177)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(173n); + input.add32(177n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, euint32) => ebool test 3 (177, 177)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(177n); + input.add32(177n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, euint32) => ebool test 4 (177, 173)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(177n); + input.add32(173n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint8, euint32) => ebool test 1 (157, 2698749031)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(157n); + input.add32(2698749031n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint8, euint32) => ebool test 2 (153, 157)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(153n); + input.add32(157n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint8, euint32) => ebool test 3 (157, 157)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(157n); + input.add32(157n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint8, euint32) => ebool test 4 (157, 153)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(157n); + input.add32(153n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint8, euint32) => euint32 test 1 (42, 674467172)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(42n); + input.add32(674467172n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(42n); + }); + + it('test operator "min" overload (euint8, euint32) => euint32 test 2 (38, 42)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(38n); + input.add32(42n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(38n); + }); + + it('test operator "min" overload (euint8, euint32) => euint32 test 3 (42, 42)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(42n); + input.add32(42n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(42n); + }); + + it('test operator "min" overload (euint8, euint32) => euint32 test 4 (42, 38)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(42n); + input.add32(38n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(38n); + }); + + it('test operator "max" overload (euint8, euint32) => euint32 test 1 (228, 3112442613)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(228n); + input.add32(3112442613n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(3112442613n); + }); + + it('test operator "max" overload (euint8, euint32) => euint32 test 2 (224, 228)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(224n); + input.add32(228n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(228n); + }); + + it('test operator "max" overload (euint8, euint32) => euint32 test 3 (228, 228)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(228n); + input.add32(228n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(228n); + }); + + it('test operator "max" overload (euint8, euint32) => euint32 test 4 (228, 224)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(228n); + input.add32(224n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint8_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract1.resEuint32()); + expect(res).to.equal(228n); + }); + + it('test operator "add" overload (euint8, euint64) => euint64 test 1 (2, 129)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(2n); + input.add64(129n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(131n); + }); + + it('test operator "add" overload (euint8, euint64) => euint64 test 2 (67, 69)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(67n); + input.add64(69n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(136n); + }); + + it('test operator "add" overload (euint8, euint64) => euint64 test 3 (69, 69)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(69n); + input.add64(69n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(138n); + }); + + it('test operator "add" overload (euint8, euint64) => euint64 test 4 (69, 67)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(69n); + input.add64(67n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(136n); + }); + + it('test operator "sub" overload (euint8, euint64) => euint64 test 1 (33, 33)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(33n); + input.add64(33n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.sub_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint8, euint64) => euint64 test 2 (33, 29)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(33n); + input.add64(29n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.sub_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint8, euint64) => euint64 test 1 (2, 65)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(2n); + input.add64(65n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(130n); + }); + + it('test operator "mul" overload (euint8, euint64) => euint64 test 2 (1, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(1n); + input.add64(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(5n); + }); + + it('test operator "mul" overload (euint8, euint64) => euint64 test 3 (5, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(5n); + input.add64(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(25n); + }); + + it('test operator "mul" overload (euint8, euint64) => euint64 test 4 (5, 1)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(5n); + input.add64(1n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(5n); + }); + + it('test operator "and" overload (euint8, euint64) => euint64 test 1 (75, 18443905121357369457)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(75n); + input.add64(18443905121357369457n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(65n); + }); + + it('test operator "and" overload (euint8, euint64) => euint64 test 2 (71, 75)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(71n); + input.add64(75n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(67n); + }); + + it('test operator "and" overload (euint8, euint64) => euint64 test 3 (75, 75)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(75n); + input.add64(75n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(75n); + }); + + it('test operator "and" overload (euint8, euint64) => euint64 test 4 (75, 71)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(75n); + input.add64(71n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(67n); + }); + + it('test operator "or" overload (euint8, euint64) => euint64 test 1 (220, 18439424040301617993)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(220n); + input.add64(18439424040301617993n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(18439424040301618141n); + }); + + it('test operator "or" overload (euint8, euint64) => euint64 test 2 (216, 220)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(216n); + input.add64(220n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(220n); + }); + + it('test operator "or" overload (euint8, euint64) => euint64 test 3 (220, 220)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(220n); + input.add64(220n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(220n); + }); + + it('test operator "or" overload (euint8, euint64) => euint64 test 4 (220, 216)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(220n); + input.add64(216n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(220n); + }); + + it('test operator "xor" overload (euint8, euint64) => euint64 test 1 (239, 18443965601336513263)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(239n); + input.add64(18443965601336513263n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(18443965601336513024n); + }); + + it('test operator "xor" overload (euint8, euint64) => euint64 test 2 (235, 239)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(235n); + input.add64(239n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint8, euint64) => euint64 test 3 (239, 239)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(239n); + input.add64(239n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint8, euint64) => euint64 test 4 (239, 235)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(239n); + input.add64(235n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(4n); + }); + + it('test operator "eq" overload (euint8, euint64) => ebool test 1 (112, 18441797542442137655)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(112n); + input.add64(18441797542442137655n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint8, euint64) => ebool test 2 (108, 112)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(108n); + input.add64(112n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint8, euint64) => ebool test 3 (112, 112)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(112n); + input.add64(112n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint8, euint64) => ebool test 4 (112, 108)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(112n); + input.add64(108n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint8, euint64) => ebool test 1 (5, 18445907386035380693)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(5n); + input.add64(18445907386035380693n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint8, euint64) => ebool test 2 (1, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(1n); + input.add64(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint8, euint64) => ebool test 3 (5, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(5n); + input.add64(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint8, euint64) => ebool test 4 (5, 1)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(5n); + input.add64(1n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint8, euint64) => ebool test 1 (124, 18446273172900886433)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(124n); + input.add64(18446273172900886433n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint8, euint64) => ebool test 2 (120, 124)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(120n); + input.add64(124n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint8, euint64) => ebool test 3 (124, 124)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(124n); + input.add64(124n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint8, euint64) => ebool test 4 (124, 120)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(124n); + input.add64(120n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint8, euint64) => ebool test 1 (128, 18439174394133754227)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(128n); + input.add64(18439174394133754227n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint8, euint64) => ebool test 2 (124, 128)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(124n); + input.add64(128n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint8, euint64) => ebool test 3 (128, 128)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(128n); + input.add64(128n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint8, euint64) => ebool test 4 (128, 124)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(128n); + input.add64(124n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); +}); diff --git a/contracts/test/httpzOperations/httpzOperations10.ts b/contracts/test/httpzOperations/httpzOperations10.ts new file mode 100644 index 00000000..a1ae7d24 --- /dev/null +++ b/contracts/test/httpzOperations/httpzOperations10.ts @@ -0,0 +1,3134 @@ +import { expect } from 'chai'; +import { ethers } from 'hardhat'; + +import type { HTTPZTestSuite1 } from '../../types/contracts/tests/HTTPZTestSuite1'; +import type { HTTPZTestSuite2 } from '../../types/contracts/tests/HTTPZTestSuite2'; +import type { HTTPZTestSuite3 } from '../../types/contracts/tests/HTTPZTestSuite3'; +import type { HTTPZTestSuite4 } from '../../types/contracts/tests/HTTPZTestSuite4'; +import type { HTTPZTestSuite5 } from '../../types/contracts/tests/HTTPZTestSuite5'; +import type { HTTPZTestSuite6 } from '../../types/contracts/tests/HTTPZTestSuite6'; +import type { HTTPZTestSuite7 } from '../../types/contracts/tests/HTTPZTestSuite7'; +import { + createInstances, + decrypt8, + decrypt16, + decrypt32, + decrypt64, + decrypt128, + decrypt256, + decryptBool, +} from '../instance'; +import { getSigners, initSigners } from '../signers'; + +async function deployHTTPZTestFixture1(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite1'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture2(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite2'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture3(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite3'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture4(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite4'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture5(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite5'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture6(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite6'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture7(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite7'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +describe('HTTPZ operations 10', function () { + before(async function () { + await initSigners(1); + this.signers = await getSigners(); + + const contract1 = await deployHTTPZTestFixture1(); + this.contract1Address = await contract1.getAddress(); + this.contract1 = contract1; + + const contract2 = await deployHTTPZTestFixture2(); + this.contract2Address = await contract2.getAddress(); + this.contract2 = contract2; + + const contract3 = await deployHTTPZTestFixture3(); + this.contract3Address = await contract3.getAddress(); + this.contract3 = contract3; + + const contract4 = await deployHTTPZTestFixture4(); + this.contract4Address = await contract4.getAddress(); + this.contract4 = contract4; + + const contract5 = await deployHTTPZTestFixture5(); + this.contract5Address = await contract5.getAddress(); + this.contract5 = contract5; + + const contract6 = await deployHTTPZTestFixture6(); + this.contract6Address = await contract6.getAddress(); + this.contract6 = contract6; + + const contract7 = await deployHTTPZTestFixture7(); + this.contract7Address = await contract7.getAddress(); + this.contract7 = contract7; + + const instances = await createInstances(this.signers); + this.instances = instances; + }); + + it('test operator "sub" overload (uint32, euint32) => euint32 test 1 (198498580, 198498580)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(198498580n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.sub_uint32_euint32( + 198498580n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (uint32, euint32) => euint32 test 2 (198498580, 198498576)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(198498576n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.sub_uint32_euint32( + 198498580n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint32, uint32) => euint32 test 1 (44032, 45272)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(44032n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_euint32_uint32(encryptedAmount.handles[0], 45272n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1993416704n); + }); + + it('test operator "mul" overload (euint32, uint32) => euint32 test 2 (37165, 37165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(37165n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_euint32_uint32(encryptedAmount.handles[0], 37165n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1381237225n); + }); + + it('test operator "mul" overload (euint32, uint32) => euint32 test 3 (37165, 37165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(37165n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_euint32_uint32(encryptedAmount.handles[0], 37165n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1381237225n); + }); + + it('test operator "mul" overload (euint32, uint32) => euint32 test 4 (37165, 37165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(37165n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_euint32_uint32(encryptedAmount.handles[0], 37165n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1381237225n); + }); + + it('test operator "mul" overload (uint32, euint32) => euint32 test 1 (27156, 45272)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(45272n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_uint32_euint32(27156n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1229406432n); + }); + + it('test operator "mul" overload (uint32, euint32) => euint32 test 2 (37165, 37165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(37165n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_uint32_euint32(37165n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1381237225n); + }); + + it('test operator "mul" overload (uint32, euint32) => euint32 test 3 (37165, 37165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(37165n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_uint32_euint32(37165n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1381237225n); + }); + + it('test operator "mul" overload (uint32, euint32) => euint32 test 4 (37165, 37165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(37165n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_uint32_euint32(37165n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1381237225n); + }); + + it('test operator "div" overload (euint32, uint32) => euint32 test 1 (2350474397, 1707562655)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(2350474397n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.div_euint32_uint32( + encryptedAmount.handles[0], + 1707562655n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1n); + }); + + it('test operator "div" overload (euint32, uint32) => euint32 test 2 (2350474393, 2350474397)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(2350474393n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.div_euint32_uint32( + encryptedAmount.handles[0], + 2350474397n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "div" overload (euint32, uint32) => euint32 test 3 (2350474397, 2350474397)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(2350474397n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.div_euint32_uint32( + encryptedAmount.handles[0], + 2350474397n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1n); + }); + + it('test operator "div" overload (euint32, uint32) => euint32 test 4 (2350474397, 2350474393)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(2350474397n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.div_euint32_uint32( + encryptedAmount.handles[0], + 2350474393n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1n); + }); + + it('test operator "rem" overload (euint32, uint32) => euint32 test 1 (1936403572, 4101525157)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1936403572n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.rem_euint32_uint32( + encryptedAmount.handles[0], + 4101525157n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1936403572n); + }); + + it('test operator "rem" overload (euint32, uint32) => euint32 test 2 (1936403568, 1936403572)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1936403568n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.rem_euint32_uint32( + encryptedAmount.handles[0], + 1936403572n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1936403568n); + }); + + it('test operator "rem" overload (euint32, uint32) => euint32 test 3 (1936403572, 1936403572)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1936403572n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.rem_euint32_uint32( + encryptedAmount.handles[0], + 1936403572n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "rem" overload (euint32, uint32) => euint32 test 4 (1936403572, 1936403568)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1936403572n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.rem_euint32_uint32( + encryptedAmount.handles[0], + 1936403568n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(4n); + }); + + it('test operator "and" overload (euint32, uint32) => euint32 test 1 (43000343, 1521714237)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(43000343n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_euint32_uint32( + encryptedAmount.handles[0], + 1521714237n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(42991637n); + }); + + it('test operator "and" overload (euint32, uint32) => euint32 test 2 (43000339, 43000343)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(43000339n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_euint32_uint32( + encryptedAmount.handles[0], + 43000343n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(43000339n); + }); + + it('test operator "and" overload (euint32, uint32) => euint32 test 3 (43000343, 43000343)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(43000343n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_euint32_uint32( + encryptedAmount.handles[0], + 43000343n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(43000343n); + }); + + it('test operator "and" overload (euint32, uint32) => euint32 test 4 (43000343, 43000339)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(43000343n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_euint32_uint32( + encryptedAmount.handles[0], + 43000339n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(43000339n); + }); + + it('test operator "and" overload (uint32, euint32) => euint32 test 1 (372793876, 1521714237)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1521714237n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_uint32_euint32( + 372793876n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(305135636n); + }); + + it('test operator "and" overload (uint32, euint32) => euint32 test 2 (43000339, 43000343)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(43000343n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_uint32_euint32( + 43000339n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(43000339n); + }); + + it('test operator "and" overload (uint32, euint32) => euint32 test 3 (43000343, 43000343)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(43000343n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_uint32_euint32( + 43000343n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(43000343n); + }); + + it('test operator "and" overload (uint32, euint32) => euint32 test 4 (43000343, 43000339)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(43000339n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_uint32_euint32( + 43000343n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(43000339n); + }); + + it('test operator "or" overload (euint32, uint32) => euint32 test 1 (1256320048, 2167566019)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1256320048n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_euint32_uint32( + encryptedAmount.handles[0], + 2167566019n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(3421761267n); + }); + + it('test operator "or" overload (euint32, uint32) => euint32 test 2 (1256320044, 1256320048)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1256320044n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_euint32_uint32( + encryptedAmount.handles[0], + 1256320048n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1256320060n); + }); + + it('test operator "or" overload (euint32, uint32) => euint32 test 3 (1256320048, 1256320048)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1256320048n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_euint32_uint32( + encryptedAmount.handles[0], + 1256320048n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1256320048n); + }); + + it('test operator "or" overload (euint32, uint32) => euint32 test 4 (1256320048, 1256320044)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1256320048n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_euint32_uint32( + encryptedAmount.handles[0], + 1256320044n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1256320060n); + }); + + it('test operator "or" overload (uint32, euint32) => euint32 test 1 (1747906183, 2167566019)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(2167566019n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_uint32_euint32( + 1747906183n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(3913215687n); + }); + + it('test operator "or" overload (uint32, euint32) => euint32 test 2 (1256320044, 1256320048)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1256320048n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_uint32_euint32( + 1256320044n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1256320060n); + }); + + it('test operator "or" overload (uint32, euint32) => euint32 test 3 (1256320048, 1256320048)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1256320048n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_uint32_euint32( + 1256320048n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1256320048n); + }); + + it('test operator "or" overload (uint32, euint32) => euint32 test 4 (1256320048, 1256320044)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1256320044n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_uint32_euint32( + 1256320048n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1256320060n); + }); + + it('test operator "xor" overload (euint32, uint32) => euint32 test 1 (3964432894, 4138262916)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(3964432894n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_euint32_uint32( + encryptedAmount.handles[0], + 4138262916n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(451186810n); + }); + + it('test operator "xor" overload (euint32, uint32) => euint32 test 2 (3636800631, 3636800635)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(3636800631n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_euint32_uint32( + encryptedAmount.handles[0], + 3636800635n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(12n); + }); + + it('test operator "xor" overload (euint32, uint32) => euint32 test 3 (3636800635, 3636800635)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(3636800635n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_euint32_uint32( + encryptedAmount.handles[0], + 3636800635n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint32, uint32) => euint32 test 4 (3636800635, 3636800631)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(3636800635n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_euint32_uint32( + encryptedAmount.handles[0], + 3636800631n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(12n); + }); + + it('test operator "xor" overload (uint32, euint32) => euint32 test 1 (1426996983, 4138262916)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(4138262916n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_uint32_euint32( + 1426996983n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(2745622387n); + }); + + it('test operator "xor" overload (uint32, euint32) => euint32 test 2 (3636800631, 3636800635)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(3636800635n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_uint32_euint32( + 3636800631n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(12n); + }); + + it('test operator "xor" overload (uint32, euint32) => euint32 test 3 (3636800635, 3636800635)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(3636800635n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_uint32_euint32( + 3636800635n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (uint32, euint32) => euint32 test 4 (3636800635, 3636800631)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(3636800631n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_uint32_euint32( + 3636800635n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(12n); + }); + + it('test operator "eq" overload (euint32, uint32) => ebool test 1 (2005621880, 4004162980)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(2005621880n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_euint32_uint32( + encryptedAmount.handles[0], + 4004162980n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint32, uint32) => ebool test 2 (1262678375, 1262678379)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1262678375n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_euint32_uint32( + encryptedAmount.handles[0], + 1262678379n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint32, uint32) => ebool test 3 (1262678379, 1262678379)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1262678379n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_euint32_uint32( + encryptedAmount.handles[0], + 1262678379n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint32, uint32) => ebool test 4 (1262678379, 1262678375)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1262678379n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_euint32_uint32( + encryptedAmount.handles[0], + 1262678375n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (uint32, euint32) => ebool test 1 (201728852, 4004162980)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(4004162980n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_uint32_euint32( + 201728852n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (uint32, euint32) => ebool test 2 (1262678375, 1262678379)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1262678379n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_uint32_euint32( + 1262678375n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (uint32, euint32) => ebool test 3 (1262678379, 1262678379)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1262678379n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_uint32_euint32( + 1262678379n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (uint32, euint32) => ebool test 4 (1262678379, 1262678375)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1262678375n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_uint32_euint32( + 1262678379n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint32, uint32) => ebool test 1 (284274034, 4272880075)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(284274034n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_euint32_uint32( + encryptedAmount.handles[0], + 4272880075n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint32, uint32) => ebool test 2 (196977487, 196977491)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(196977487n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_euint32_uint32( + encryptedAmount.handles[0], + 196977491n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint32, uint32) => ebool test 3 (196977491, 196977491)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(196977491n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_euint32_uint32( + encryptedAmount.handles[0], + 196977491n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint32, uint32) => ebool test 4 (196977491, 196977487)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(196977491n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_euint32_uint32( + encryptedAmount.handles[0], + 196977487n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (uint32, euint32) => ebool test 1 (2594362079, 4272880075)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(4272880075n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_uint32_euint32( + 2594362079n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (uint32, euint32) => ebool test 2 (196977487, 196977491)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(196977491n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_uint32_euint32( + 196977487n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (uint32, euint32) => ebool test 3 (196977491, 196977491)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(196977491n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_uint32_euint32( + 196977491n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (uint32, euint32) => ebool test 4 (196977491, 196977487)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(196977487n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_uint32_euint32( + 196977491n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint32, uint32) => ebool test 1 (1262541356, 2481212262)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1262541356n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_euint32_uint32( + encryptedAmount.handles[0], + 2481212262n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint32, uint32) => ebool test 2 (1262541352, 1262541356)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1262541352n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_euint32_uint32( + encryptedAmount.handles[0], + 1262541356n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint32, uint32) => ebool test 3 (1262541356, 1262541356)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1262541356n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_euint32_uint32( + encryptedAmount.handles[0], + 1262541356n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint32, uint32) => ebool test 4 (1262541356, 1262541352)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1262541356n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_euint32_uint32( + encryptedAmount.handles[0], + 1262541352n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (uint32, euint32) => ebool test 1 (32238580, 2481212262)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(2481212262n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_uint32_euint32( + 32238580n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (uint32, euint32) => ebool test 2 (1262541352, 1262541356)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1262541356n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_uint32_euint32( + 1262541352n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (uint32, euint32) => ebool test 3 (1262541356, 1262541356)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1262541356n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_uint32_euint32( + 1262541356n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (uint32, euint32) => ebool test 4 (1262541356, 1262541352)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1262541352n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_uint32_euint32( + 1262541356n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint32, uint32) => ebool test 1 (167939907, 3731881133)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(167939907n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_euint32_uint32( + encryptedAmount.handles[0], + 3731881133n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint32, uint32) => ebool test 2 (167939903, 167939907)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(167939903n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_euint32_uint32( + encryptedAmount.handles[0], + 167939907n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint32, uint32) => ebool test 3 (167939907, 167939907)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(167939907n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_euint32_uint32( + encryptedAmount.handles[0], + 167939907n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint32, uint32) => ebool test 4 (167939907, 167939903)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(167939907n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_euint32_uint32( + encryptedAmount.handles[0], + 167939903n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (uint32, euint32) => ebool test 1 (3047453138, 3731881133)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(3731881133n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_uint32_euint32( + 3047453138n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (uint32, euint32) => ebool test 2 (167939903, 167939907)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(167939907n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_uint32_euint32( + 167939903n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (uint32, euint32) => ebool test 3 (167939907, 167939907)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(167939907n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_uint32_euint32( + 167939907n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (uint32, euint32) => ebool test 4 (167939907, 167939903)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(167939903n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_uint32_euint32( + 167939907n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, uint32) => ebool test 1 (2864379306, 812859773)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(2864379306n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_euint32_uint32( + encryptedAmount.handles[0], + 812859773n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (euint32, uint32) => ebool test 2 (2864379302, 2864379306)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(2864379302n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_euint32_uint32( + encryptedAmount.handles[0], + 2864379306n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, uint32) => ebool test 3 (2864379306, 2864379306)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(2864379306n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_euint32_uint32( + encryptedAmount.handles[0], + 2864379306n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, uint32) => ebool test 4 (2864379306, 2864379302)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(2864379306n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_euint32_uint32( + encryptedAmount.handles[0], + 2864379302n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (uint32, euint32) => ebool test 1 (2448644127, 812859773)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(812859773n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_uint32_euint32( + 2448644127n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (uint32, euint32) => ebool test 2 (2864379302, 2864379306)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(2864379306n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_uint32_euint32( + 2864379302n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (uint32, euint32) => ebool test 3 (2864379306, 2864379306)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(2864379306n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_uint32_euint32( + 2864379306n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (uint32, euint32) => ebool test 4 (2864379306, 2864379302)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(2864379302n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_uint32_euint32( + 2864379306n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint32, uint32) => ebool test 1 (3207735434, 1129330553)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(3207735434n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_euint32_uint32( + encryptedAmount.handles[0], + 1129330553n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint32, uint32) => ebool test 2 (1089455019, 1089455023)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1089455019n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_euint32_uint32( + encryptedAmount.handles[0], + 1089455023n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint32, uint32) => ebool test 3 (1089455023, 1089455023)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1089455023n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_euint32_uint32( + encryptedAmount.handles[0], + 1089455023n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint32, uint32) => ebool test 4 (1089455023, 1089455019)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1089455023n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_euint32_uint32( + encryptedAmount.handles[0], + 1089455019n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (uint32, euint32) => ebool test 1 (551067207, 1129330553)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1129330553n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_uint32_euint32( + 551067207n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (uint32, euint32) => ebool test 2 (1089455019, 1089455023)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1089455023n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_uint32_euint32( + 1089455019n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (uint32, euint32) => ebool test 3 (1089455023, 1089455023)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1089455023n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_uint32_euint32( + 1089455023n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (uint32, euint32) => ebool test 4 (1089455023, 1089455019)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1089455019n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_uint32_euint32( + 1089455023n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint32, uint32) => euint32 test 1 (3916966196, 2570180268)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(3916966196n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_euint32_uint32( + encryptedAmount.handles[0], + 2570180268n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(2570180268n); + }); + + it('test operator "min" overload (euint32, uint32) => euint32 test 2 (643220252, 643220256)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(643220252n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_euint32_uint32( + encryptedAmount.handles[0], + 643220256n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(643220252n); + }); + + it('test operator "min" overload (euint32, uint32) => euint32 test 3 (643220256, 643220256)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(643220256n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_euint32_uint32( + encryptedAmount.handles[0], + 643220256n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(643220256n); + }); + + it('test operator "min" overload (euint32, uint32) => euint32 test 4 (643220256, 643220252)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(643220256n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_euint32_uint32( + encryptedAmount.handles[0], + 643220252n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(643220252n); + }); + + it('test operator "min" overload (uint32, euint32) => euint32 test 1 (3517107421, 2570180268)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(2570180268n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_uint32_euint32( + 3517107421n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(2570180268n); + }); + + it('test operator "min" overload (uint32, euint32) => euint32 test 2 (643220252, 643220256)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(643220256n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_uint32_euint32( + 643220252n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(643220252n); + }); + + it('test operator "min" overload (uint32, euint32) => euint32 test 3 (643220256, 643220256)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(643220256n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_uint32_euint32( + 643220256n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(643220256n); + }); + + it('test operator "min" overload (uint32, euint32) => euint32 test 4 (643220256, 643220252)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(643220252n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_uint32_euint32( + 643220256n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(643220252n); + }); + + it('test operator "max" overload (euint32, uint32) => euint32 test 1 (3465686838, 3898648721)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(3465686838n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_euint32_uint32( + encryptedAmount.handles[0], + 3898648721n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(3898648721n); + }); + + it('test operator "max" overload (euint32, uint32) => euint32 test 2 (1853095101, 1853095105)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1853095101n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_euint32_uint32( + encryptedAmount.handles[0], + 1853095105n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1853095105n); + }); + + it('test operator "max" overload (euint32, uint32) => euint32 test 3 (1853095105, 1853095105)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1853095105n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_euint32_uint32( + encryptedAmount.handles[0], + 1853095105n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1853095105n); + }); + + it('test operator "max" overload (euint32, uint32) => euint32 test 4 (1853095105, 1853095101)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1853095105n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_euint32_uint32( + encryptedAmount.handles[0], + 1853095101n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1853095105n); + }); + + it('test operator "max" overload (uint32, euint32) => euint32 test 1 (1819353045, 3898648721)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(3898648721n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_uint32_euint32( + 1819353045n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(3898648721n); + }); + + it('test operator "max" overload (uint32, euint32) => euint32 test 2 (1853095101, 1853095105)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1853095105n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_uint32_euint32( + 1853095101n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1853095105n); + }); + + it('test operator "max" overload (uint32, euint32) => euint32 test 3 (1853095105, 1853095105)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1853095105n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_uint32_euint32( + 1853095105n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1853095105n); + }); + + it('test operator "max" overload (uint32, euint32) => euint32 test 4 (1853095105, 1853095101)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1853095101n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_uint32_euint32( + 1853095105n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(1853095105n); + }); + + it('test operator "add" overload (euint64, uint64) => euint64 test 1 (9222708121753265310, 9218971879984242860)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(9222708121753265310n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_euint64_uint64( + encryptedAmount.handles[0], + 9218971879984242860n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18441680001737508170n); + }); + + it('test operator "add" overload (euint64, uint64) => euint64 test 2 (9222708121753265308, 9222708121753265310)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(9222708121753265308n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_euint64_uint64( + encryptedAmount.handles[0], + 9222708121753265310n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18445416243506530618n); + }); + + it('test operator "add" overload (euint64, uint64) => euint64 test 3 (9222708121753265310, 9222708121753265310)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(9222708121753265310n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_euint64_uint64( + encryptedAmount.handles[0], + 9222708121753265310n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18445416243506530620n); + }); + + it('test operator "add" overload (euint64, uint64) => euint64 test 4 (9222708121753265310, 9222708121753265308)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(9222708121753265310n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_euint64_uint64( + encryptedAmount.handles[0], + 9222708121753265308n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18445416243506530618n); + }); + + it('test operator "add" overload (uint64, euint64) => euint64 test 1 (9220534334586931921, 9218971879984242860)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(9218971879984242860n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_uint64_euint64( + 9220534334586931921n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18439506214571174781n); + }); + + it('test operator "add" overload (uint64, euint64) => euint64 test 2 (9222708121753265308, 9222708121753265310)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(9222708121753265310n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_uint64_euint64( + 9222708121753265308n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18445416243506530618n); + }); + + it('test operator "add" overload (uint64, euint64) => euint64 test 3 (9222708121753265310, 9222708121753265310)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(9222708121753265310n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_uint64_euint64( + 9222708121753265310n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18445416243506530620n); + }); + + it('test operator "add" overload (uint64, euint64) => euint64 test 4 (9222708121753265310, 9222708121753265308)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(9222708121753265308n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_uint64_euint64( + 9222708121753265310n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18445416243506530618n); + }); + + it('test operator "sub" overload (euint64, uint64) => euint64 test 1 (18437847236872160075, 18437847236872160075)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18437847236872160075n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.sub_euint64_uint64( + encryptedAmount.handles[0], + 18437847236872160075n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint64, uint64) => euint64 test 2 (18437847236872160075, 18437847236872160071)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18437847236872160075n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.sub_euint64_uint64( + encryptedAmount.handles[0], + 18437847236872160071n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(4n); + }); + + it('test operator "sub" overload (uint64, euint64) => euint64 test 1 (18437847236872160075, 18437847236872160075)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18437847236872160075n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.sub_uint64_euint64( + 18437847236872160075n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (uint64, euint64) => euint64 test 2 (18437847236872160075, 18437847236872160071)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18437847236872160071n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.sub_uint64_euint64( + 18437847236872160075n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint64, uint64) => euint64 test 1 (4293860721, 4294201636)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(4293860721n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_euint64_uint64( + encryptedAmount.handles[0], + 4294201636n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18438703732874339556n); + }); + + it('test operator "mul" overload (euint64, uint64) => euint64 test 2 (4293860721, 4293860721)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(4293860721n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_euint64_uint64( + encryptedAmount.handles[0], + 4293860721n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18437239891346639841n); + }); + + it('test operator "mul" overload (euint64, uint64) => euint64 test 3 (4293860721, 4293860721)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(4293860721n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_euint64_uint64( + encryptedAmount.handles[0], + 4293860721n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18437239891346639841n); + }); + + it('test operator "mul" overload (euint64, uint64) => euint64 test 4 (4293860721, 4293860721)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(4293860721n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_euint64_uint64( + encryptedAmount.handles[0], + 4293860721n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18437239891346639841n); + }); + + it('test operator "mul" overload (uint64, euint64) => euint64 test 1 (4293202005, 4294201636)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(4294201636n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_uint64_euint64( + 4293202005n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18435875073549480180n); + }); + + it('test operator "mul" overload (uint64, euint64) => euint64 test 2 (4293860721, 4293860721)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(4293860721n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_uint64_euint64( + 4293860721n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18437239891346639841n); + }); + + it('test operator "mul" overload (uint64, euint64) => euint64 test 3 (4293860721, 4293860721)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(4293860721n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_uint64_euint64( + 4293860721n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18437239891346639841n); + }); + + it('test operator "mul" overload (uint64, euint64) => euint64 test 4 (4293860721, 4293860721)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(4293860721n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_uint64_euint64( + 4293860721n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18437239891346639841n); + }); + + it('test operator "div" overload (euint64, uint64) => euint64 test 1 (18441726437339887613, 18444535304874427867)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18441726437339887613n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.div_euint64_uint64( + encryptedAmount.handles[0], + 18444535304874427867n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "div" overload (euint64, uint64) => euint64 test 2 (18438040184588871103, 18438040184588871107)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18438040184588871103n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.div_euint64_uint64( + encryptedAmount.handles[0], + 18438040184588871107n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "div" overload (euint64, uint64) => euint64 test 3 (18438040184588871107, 18438040184588871107)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18438040184588871107n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.div_euint64_uint64( + encryptedAmount.handles[0], + 18438040184588871107n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(1n); + }); + + it('test operator "div" overload (euint64, uint64) => euint64 test 4 (18438040184588871107, 18438040184588871103)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18438040184588871107n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.div_euint64_uint64( + encryptedAmount.handles[0], + 18438040184588871103n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(1n); + }); + + it('test operator "rem" overload (euint64, uint64) => euint64 test 1 (18439842328276657339, 18437812745184124445)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18439842328276657339n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.rem_euint64_uint64( + encryptedAmount.handles[0], + 18437812745184124445n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(2029583092532894n); + }); + + it('test operator "rem" overload (euint64, uint64) => euint64 test 2 (18439092202704582089, 18439092202704582093)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18439092202704582089n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.rem_euint64_uint64( + encryptedAmount.handles[0], + 18439092202704582093n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18439092202704582089n); + }); + + it('test operator "rem" overload (euint64, uint64) => euint64 test 3 (18439092202704582093, 18439092202704582093)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18439092202704582093n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.rem_euint64_uint64( + encryptedAmount.handles[0], + 18439092202704582093n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "rem" overload (euint64, uint64) => euint64 test 4 (18439092202704582093, 18439092202704582089)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18439092202704582093n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.rem_euint64_uint64( + encryptedAmount.handles[0], + 18439092202704582089n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(4n); + }); + + it('test operator "and" overload (euint64, uint64) => euint64 test 1 (18444485059375251901, 18442351140023850493)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18444485059375251901n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_euint64_uint64( + encryptedAmount.handles[0], + 18442351140023850493n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18442346165375877565n); + }); + + it('test operator "and" overload (euint64, uint64) => euint64 test 2 (18442680276926096233, 18442680276926096237)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18442680276926096233n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_euint64_uint64( + encryptedAmount.handles[0], + 18442680276926096237n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18442680276926096233n); + }); + + it('test operator "and" overload (euint64, uint64) => euint64 test 3 (18442680276926096237, 18442680276926096237)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18442680276926096237n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_euint64_uint64( + encryptedAmount.handles[0], + 18442680276926096237n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18442680276926096237n); + }); + + it('test operator "and" overload (euint64, uint64) => euint64 test 4 (18442680276926096237, 18442680276926096233)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18442680276926096237n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_euint64_uint64( + encryptedAmount.handles[0], + 18442680276926096233n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18442680276926096233n); + }); + + it('test operator "and" overload (uint64, euint64) => euint64 test 1 (18437950750980290587, 18442351140023850493)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18442351140023850493n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_uint64_euint64( + 18437950750980290587n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18437807810134675481n); + }); + + it('test operator "and" overload (uint64, euint64) => euint64 test 2 (18442680276926096233, 18442680276926096237)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18442680276926096237n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_uint64_euint64( + 18442680276926096233n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18442680276926096233n); + }); + + it('test operator "and" overload (uint64, euint64) => euint64 test 3 (18442680276926096237, 18442680276926096237)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18442680276926096237n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_uint64_euint64( + 18442680276926096237n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18442680276926096237n); + }); + + it('test operator "and" overload (uint64, euint64) => euint64 test 4 (18442680276926096237, 18442680276926096233)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18442680276926096233n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_uint64_euint64( + 18442680276926096237n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18442680276926096233n); + }); + + it('test operator "or" overload (euint64, uint64) => euint64 test 1 (18444283307319986391, 18438338700859459383)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18444283307319986391n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_euint64_uint64( + encryptedAmount.handles[0], + 18438338700859459383n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18444320731517538295n); + }); + + it('test operator "or" overload (euint64, uint64) => euint64 test 2 (18439402373749904107, 18439402373749904111)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18439402373749904107n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_euint64_uint64( + encryptedAmount.handles[0], + 18439402373749904111n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18439402373749904111n); + }); + + it('test operator "or" overload (euint64, uint64) => euint64 test 3 (18439402373749904111, 18439402373749904111)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18439402373749904111n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_euint64_uint64( + encryptedAmount.handles[0], + 18439402373749904111n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18439402373749904111n); + }); + + it('test operator "or" overload (euint64, uint64) => euint64 test 4 (18439402373749904111, 18439402373749904107)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18439402373749904111n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_euint64_uint64( + encryptedAmount.handles[0], + 18439402373749904107n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18439402373749904111n); + }); + + it('test operator "or" overload (uint64, euint64) => euint64 test 1 (18439523972818239627, 18438338700859459383)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18438338700859459383n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_uint64_euint64( + 18439523972818239627n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18439561358899005375n); + }); + + it('test operator "or" overload (uint64, euint64) => euint64 test 2 (18439402373749904107, 18439402373749904111)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18439402373749904111n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_uint64_euint64( + 18439402373749904107n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18439402373749904111n); + }); + + it('test operator "or" overload (uint64, euint64) => euint64 test 3 (18439402373749904111, 18439402373749904111)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18439402373749904111n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_uint64_euint64( + 18439402373749904111n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18439402373749904111n); + }); + + it('test operator "or" overload (uint64, euint64) => euint64 test 4 (18439402373749904111, 18439402373749904107)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18439402373749904107n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_uint64_euint64( + 18439402373749904111n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18439402373749904111n); + }); + + it('test operator "xor" overload (euint64, uint64) => euint64 test 1 (18438626225909262211, 18445180119667052333)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18438626225909262211n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_euint64_uint64( + encryptedAmount.handles[0], + 18445180119667052333n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(7135056688572590n); + }); + + it('test operator "xor" overload (euint64, uint64) => euint64 test 2 (18438626225909262207, 18438626225909262211)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18438626225909262207n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_euint64_uint64( + encryptedAmount.handles[0], + 18438626225909262211n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(252n); + }); + + it('test operator "xor" overload (euint64, uint64) => euint64 test 3 (18438626225909262211, 18438626225909262211)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18438626225909262211n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_euint64_uint64( + encryptedAmount.handles[0], + 18438626225909262211n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint64, uint64) => euint64 test 4 (18438626225909262211, 18438626225909262207)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18438626225909262211n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_euint64_uint64( + encryptedAmount.handles[0], + 18438626225909262207n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(252n); + }); + + it('test operator "xor" overload (uint64, euint64) => euint64 test 1 (18445913636121796515, 18445180119667052333)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18445180119667052333n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_uint64_euint64( + 18445913636121796515n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(2107966665314446n); + }); + + it('test operator "xor" overload (uint64, euint64) => euint64 test 2 (18438626225909262207, 18438626225909262211)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18438626225909262211n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_uint64_euint64( + 18438626225909262207n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(252n); + }); + + it('test operator "xor" overload (uint64, euint64) => euint64 test 3 (18438626225909262211, 18438626225909262211)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18438626225909262211n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_uint64_euint64( + 18438626225909262211n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (uint64, euint64) => euint64 test 4 (18438626225909262211, 18438626225909262207)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18438626225909262207n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_uint64_euint64( + 18438626225909262211n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(252n); + }); + + it('test operator "eq" overload (euint64, uint64) => ebool test 1 (18443919210761555045, 18446264618426237281)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18443919210761555045n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_euint64_uint64( + encryptedAmount.handles[0], + 18446264618426237281n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint64, uint64) => ebool test 2 (18439054868065671389, 18439054868065671393)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18439054868065671389n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_euint64_uint64( + encryptedAmount.handles[0], + 18439054868065671393n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint64, uint64) => ebool test 3 (18439054868065671393, 18439054868065671393)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18439054868065671393n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_euint64_uint64( + encryptedAmount.handles[0], + 18439054868065671393n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint64, uint64) => ebool test 4 (18439054868065671393, 18439054868065671389)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18439054868065671393n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_euint64_uint64( + encryptedAmount.handles[0], + 18439054868065671389n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (uint64, euint64) => ebool test 1 (18440372656817628561, 18446264618426237281)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18446264618426237281n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_uint64_euint64( + 18440372656817628561n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (uint64, euint64) => ebool test 2 (18439054868065671389, 18439054868065671393)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18439054868065671393n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_uint64_euint64( + 18439054868065671389n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (uint64, euint64) => ebool test 3 (18439054868065671393, 18439054868065671393)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18439054868065671393n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_uint64_euint64( + 18439054868065671393n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (uint64, euint64) => ebool test 4 (18439054868065671393, 18439054868065671389)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18439054868065671389n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_uint64_euint64( + 18439054868065671393n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint64, uint64) => ebool test 1 (18439202639227709891, 18441896300683339311)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18439202639227709891n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_euint64_uint64( + encryptedAmount.handles[0], + 18441896300683339311n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint64, uint64) => ebool test 2 (18439202639227709887, 18439202639227709891)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18439202639227709887n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_euint64_uint64( + encryptedAmount.handles[0], + 18439202639227709891n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint64, uint64) => ebool test 3 (18439202639227709891, 18439202639227709891)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18439202639227709891n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_euint64_uint64( + encryptedAmount.handles[0], + 18439202639227709891n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint64, uint64) => ebool test 4 (18439202639227709891, 18439202639227709887)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18439202639227709891n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_euint64_uint64( + encryptedAmount.handles[0], + 18439202639227709887n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (uint64, euint64) => ebool test 1 (18446036239783062811, 18441896300683339311)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18441896300683339311n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_uint64_euint64( + 18446036239783062811n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (uint64, euint64) => ebool test 2 (18439202639227709887, 18439202639227709891)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18439202639227709891n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_uint64_euint64( + 18439202639227709887n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (uint64, euint64) => ebool test 3 (18439202639227709891, 18439202639227709891)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18439202639227709891n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_uint64_euint64( + 18439202639227709891n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (uint64, euint64) => ebool test 4 (18439202639227709891, 18439202639227709887)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18439202639227709887n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_uint64_euint64( + 18439202639227709891n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint64, uint64) => ebool test 1 (18444440306484271225, 18439407989880255169)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18444440306484271225n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_euint64_uint64( + encryptedAmount.handles[0], + 18439407989880255169n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint64, uint64) => ebool test 2 (18438467574976745925, 18438467574976745929)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18438467574976745925n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_euint64_uint64( + encryptedAmount.handles[0], + 18438467574976745929n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint64, uint64) => ebool test 3 (18438467574976745929, 18438467574976745929)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18438467574976745929n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_euint64_uint64( + encryptedAmount.handles[0], + 18438467574976745929n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint64, uint64) => ebool test 4 (18438467574976745929, 18438467574976745925)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18438467574976745929n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_euint64_uint64( + encryptedAmount.handles[0], + 18438467574976745925n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (uint64, euint64) => ebool test 1 (18440413666079381107, 18439407989880255169)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18439407989880255169n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_uint64_euint64( + 18440413666079381107n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (uint64, euint64) => ebool test 2 (18438467574976745925, 18438467574976745929)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18438467574976745929n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_uint64_euint64( + 18438467574976745925n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (uint64, euint64) => ebool test 3 (18438467574976745929, 18438467574976745929)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18438467574976745929n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_uint64_euint64( + 18438467574976745929n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (uint64, euint64) => ebool test 4 (18438467574976745929, 18438467574976745925)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18438467574976745925n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_uint64_euint64( + 18438467574976745929n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint64, uint64) => ebool test 1 (18439401248473769181, 18443099400523097701)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18439401248473769181n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_euint64_uint64( + encryptedAmount.handles[0], + 18443099400523097701n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint64, uint64) => ebool test 2 (18438959113889726283, 18438959113889726287)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18438959113889726283n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_euint64_uint64( + encryptedAmount.handles[0], + 18438959113889726287n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint64, uint64) => ebool test 3 (18438959113889726287, 18438959113889726287)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18438959113889726287n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_euint64_uint64( + encryptedAmount.handles[0], + 18438959113889726287n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint64, uint64) => ebool test 4 (18438959113889726287, 18438959113889726283)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18438959113889726287n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_euint64_uint64( + encryptedAmount.handles[0], + 18438959113889726283n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (uint64, euint64) => ebool test 1 (18442508478151013665, 18443099400523097701)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18443099400523097701n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_uint64_euint64( + 18442508478151013665n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (uint64, euint64) => ebool test 2 (18438959113889726283, 18438959113889726287)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18438959113889726287n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_uint64_euint64( + 18438959113889726283n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (uint64, euint64) => ebool test 3 (18438959113889726287, 18438959113889726287)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18438959113889726287n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_uint64_euint64( + 18438959113889726287n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (uint64, euint64) => ebool test 4 (18438959113889726287, 18438959113889726283)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18438959113889726283n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_uint64_euint64( + 18438959113889726287n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint64, uint64) => ebool test 1 (18443073799205688447, 18443928778893228171)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18443073799205688447n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_euint64_uint64( + encryptedAmount.handles[0], + 18443928778893228171n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint64, uint64) => ebool test 2 (18440918956056860449, 18440918956056860453)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18440918956056860449n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_euint64_uint64( + encryptedAmount.handles[0], + 18440918956056860453n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint64, uint64) => ebool test 3 (18440918956056860453, 18440918956056860453)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18440918956056860453n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_euint64_uint64( + encryptedAmount.handles[0], + 18440918956056860453n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint64, uint64) => ebool test 4 (18440918956056860453, 18440918956056860449)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18440918956056860453n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_euint64_uint64( + encryptedAmount.handles[0], + 18440918956056860449n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (uint64, euint64) => ebool test 1 (18437984170025345869, 18443928778893228171)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18443928778893228171n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_uint64_euint64( + 18437984170025345869n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (uint64, euint64) => ebool test 2 (18440918956056860449, 18440918956056860453)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18440918956056860453n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_uint64_euint64( + 18440918956056860449n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (uint64, euint64) => ebool test 3 (18440918956056860453, 18440918956056860453)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18440918956056860453n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_uint64_euint64( + 18440918956056860453n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (uint64, euint64) => ebool test 4 (18440918956056860453, 18440918956056860449)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18440918956056860449n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_uint64_euint64( + 18440918956056860453n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint64, uint64) => ebool test 1 (18446462451942684113, 18446002414693122585)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18446462451942684113n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_euint64_uint64( + encryptedAmount.handles[0], + 18446002414693122585n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint64, uint64) => ebool test 2 (18439221928363347269, 18439221928363347273)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18439221928363347269n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_euint64_uint64( + encryptedAmount.handles[0], + 18439221928363347273n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint64, uint64) => ebool test 3 (18439221928363347273, 18439221928363347273)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18439221928363347273n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_euint64_uint64( + encryptedAmount.handles[0], + 18439221928363347273n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint64, uint64) => ebool test 4 (18439221928363347273, 18439221928363347269)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18439221928363347273n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_euint64_uint64( + encryptedAmount.handles[0], + 18439221928363347269n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); +}); diff --git a/contracts/test/httpzOperations/httpzOperations11.ts b/contracts/test/httpzOperations/httpzOperations11.ts new file mode 100644 index 00000000..1b8bcacb --- /dev/null +++ b/contracts/test/httpzOperations/httpzOperations11.ts @@ -0,0 +1,3148 @@ +import { expect } from 'chai'; +import { ethers } from 'hardhat'; + +import type { HTTPZTestSuite1 } from '../../types/contracts/tests/HTTPZTestSuite1'; +import type { HTTPZTestSuite2 } from '../../types/contracts/tests/HTTPZTestSuite2'; +import type { HTTPZTestSuite3 } from '../../types/contracts/tests/HTTPZTestSuite3'; +import type { HTTPZTestSuite4 } from '../../types/contracts/tests/HTTPZTestSuite4'; +import type { HTTPZTestSuite5 } from '../../types/contracts/tests/HTTPZTestSuite5'; +import type { HTTPZTestSuite6 } from '../../types/contracts/tests/HTTPZTestSuite6'; +import type { HTTPZTestSuite7 } from '../../types/contracts/tests/HTTPZTestSuite7'; +import { + createInstances, + decrypt8, + decrypt16, + decrypt32, + decrypt64, + decrypt128, + decrypt256, + decryptBool, +} from '../instance'; +import { getSigners, initSigners } from '../signers'; + +async function deployHTTPZTestFixture1(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite1'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture2(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite2'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture3(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite3'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture4(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite4'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture5(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite5'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture6(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite6'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture7(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite7'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +describe('HTTPZ operations 11', function () { + before(async function () { + await initSigners(1); + this.signers = await getSigners(); + + const contract1 = await deployHTTPZTestFixture1(); + this.contract1Address = await contract1.getAddress(); + this.contract1 = contract1; + + const contract2 = await deployHTTPZTestFixture2(); + this.contract2Address = await contract2.getAddress(); + this.contract2 = contract2; + + const contract3 = await deployHTTPZTestFixture3(); + this.contract3Address = await contract3.getAddress(); + this.contract3 = contract3; + + const contract4 = await deployHTTPZTestFixture4(); + this.contract4Address = await contract4.getAddress(); + this.contract4 = contract4; + + const contract5 = await deployHTTPZTestFixture5(); + this.contract5Address = await contract5.getAddress(); + this.contract5 = contract5; + + const contract6 = await deployHTTPZTestFixture6(); + this.contract6Address = await contract6.getAddress(); + this.contract6 = contract6; + + const contract7 = await deployHTTPZTestFixture7(); + this.contract7Address = await contract7.getAddress(); + this.contract7 = contract7; + + const instances = await createInstances(this.signers); + this.instances = instances; + }); + + it('test operator "lt" overload (uint64, euint64) => ebool test 1 (18445663836962076047, 18446002414693122585)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18446002414693122585n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_uint64_euint64( + 18445663836962076047n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (uint64, euint64) => ebool test 2 (18439221928363347269, 18439221928363347273)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18439221928363347273n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_uint64_euint64( + 18439221928363347269n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (uint64, euint64) => ebool test 3 (18439221928363347273, 18439221928363347273)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18439221928363347273n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_uint64_euint64( + 18439221928363347273n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (uint64, euint64) => ebool test 4 (18439221928363347273, 18439221928363347269)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18439221928363347269n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_uint64_euint64( + 18439221928363347273n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint64, uint64) => euint64 test 1 (18443095861337417043, 18444604916458552205)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18443095861337417043n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_euint64_uint64( + encryptedAmount.handles[0], + 18444604916458552205n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18443095861337417043n); + }); + + it('test operator "min" overload (euint64, uint64) => euint64 test 2 (18443095861337417039, 18443095861337417043)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18443095861337417039n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_euint64_uint64( + encryptedAmount.handles[0], + 18443095861337417043n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18443095861337417039n); + }); + + it('test operator "min" overload (euint64, uint64) => euint64 test 3 (18443095861337417043, 18443095861337417043)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18443095861337417043n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_euint64_uint64( + encryptedAmount.handles[0], + 18443095861337417043n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18443095861337417043n); + }); + + it('test operator "min" overload (euint64, uint64) => euint64 test 4 (18443095861337417043, 18443095861337417039)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18443095861337417043n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_euint64_uint64( + encryptedAmount.handles[0], + 18443095861337417039n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18443095861337417039n); + }); + + it('test operator "min" overload (uint64, euint64) => euint64 test 1 (18440294307762500083, 18444604916458552205)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18444604916458552205n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_uint64_euint64( + 18440294307762500083n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18440294307762500083n); + }); + + it('test operator "min" overload (uint64, euint64) => euint64 test 2 (18443095861337417039, 18443095861337417043)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18443095861337417043n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_uint64_euint64( + 18443095861337417039n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18443095861337417039n); + }); + + it('test operator "min" overload (uint64, euint64) => euint64 test 3 (18443095861337417043, 18443095861337417043)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18443095861337417043n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_uint64_euint64( + 18443095861337417043n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18443095861337417043n); + }); + + it('test operator "min" overload (uint64, euint64) => euint64 test 4 (18443095861337417043, 18443095861337417039)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18443095861337417039n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_uint64_euint64( + 18443095861337417043n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18443095861337417039n); + }); + + it('test operator "max" overload (euint64, uint64) => euint64 test 1 (18443571695527824031, 18442822381329295859)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18443571695527824031n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_euint64_uint64( + encryptedAmount.handles[0], + 18442822381329295859n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18443571695527824031n); + }); + + it('test operator "max" overload (euint64, uint64) => euint64 test 2 (18441619631043183187, 18441619631043183191)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18441619631043183187n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_euint64_uint64( + encryptedAmount.handles[0], + 18441619631043183191n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18441619631043183191n); + }); + + it('test operator "max" overload (euint64, uint64) => euint64 test 3 (18441619631043183191, 18441619631043183191)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18441619631043183191n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_euint64_uint64( + encryptedAmount.handles[0], + 18441619631043183191n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18441619631043183191n); + }); + + it('test operator "max" overload (euint64, uint64) => euint64 test 4 (18441619631043183191, 18441619631043183187)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add64(18441619631043183191n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_euint64_uint64( + encryptedAmount.handles[0], + 18441619631043183187n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18441619631043183191n); + }); + + it('test operator "max" overload (uint64, euint64) => euint64 test 1 (18445599701289579281, 18442822381329295859)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18442822381329295859n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_uint64_euint64( + 18445599701289579281n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18445599701289579281n); + }); + + it('test operator "max" overload (uint64, euint64) => euint64 test 2 (18441619631043183187, 18441619631043183191)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18441619631043183191n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_uint64_euint64( + 18441619631043183187n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18441619631043183191n); + }); + + it('test operator "max" overload (uint64, euint64) => euint64 test 3 (18441619631043183191, 18441619631043183191)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18441619631043183191n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_uint64_euint64( + 18441619631043183191n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18441619631043183191n); + }); + + it('test operator "max" overload (uint64, euint64) => euint64 test 4 (18441619631043183191, 18441619631043183187)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add64(18441619631043183187n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_uint64_euint64( + 18441619631043183191n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract6.resEuint64()); + expect(res).to.equal(18441619631043183191n); + }); + + it('test operator "add" overload (euint128, uint128) => euint128 test 1 (170141183460469231731686328461725635101, 170141183460469231731684231884962767606)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(170141183460469231731686328461725635101n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_euint128_uint128( + encryptedAmount.handles[0], + 170141183460469231731684231884962767606n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463370560346688402707n); + }); + + it('test operator "add" overload (euint128, uint128) => euint128 test 2 (170141183460469231731685352077984908024, 170141183460469231731685352077984908026)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(170141183460469231731685352077984908024n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_euint128_uint128( + encryptedAmount.handles[0], + 170141183460469231731685352077984908026n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463370704155969816050n); + }); + + it('test operator "add" overload (euint128, uint128) => euint128 test 3 (170141183460469231731685352077984908026, 170141183460469231731685352077984908026)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(170141183460469231731685352077984908026n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_euint128_uint128( + encryptedAmount.handles[0], + 170141183460469231731685352077984908026n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463370704155969816052n); + }); + + it('test operator "add" overload (euint128, uint128) => euint128 test 4 (170141183460469231731685352077984908026, 170141183460469231731685352077984908024)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(170141183460469231731685352077984908026n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_euint128_uint128( + encryptedAmount.handles[0], + 170141183460469231731685352077984908024n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463370704155969816050n); + }); + + it('test operator "add" overload (uint128, euint128) => euint128 test 1 (170141183460469231731684934558624983465, 170141183460469231731684231884962767606)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(170141183460469231731684231884962767606n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_uint128_euint128( + 170141183460469231731684934558624983465n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463369166443587751071n); + }); + + it('test operator "add" overload (uint128, euint128) => euint128 test 2 (170141183460469231731685352077984908024, 170141183460469231731685352077984908026)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(170141183460469231731685352077984908026n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_uint128_euint128( + 170141183460469231731685352077984908024n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463370704155969816050n); + }); + + it('test operator "add" overload (uint128, euint128) => euint128 test 3 (170141183460469231731685352077984908026, 170141183460469231731685352077984908026)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(170141183460469231731685352077984908026n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_uint128_euint128( + 170141183460469231731685352077984908026n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463370704155969816052n); + }); + + it('test operator "add" overload (uint128, euint128) => euint128 test 4 (170141183460469231731685352077984908026, 170141183460469231731685352077984908024)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(170141183460469231731685352077984908024n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_uint128_euint128( + 170141183460469231731685352077984908026n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463370704155969816050n); + }); + + it('test operator "sub" overload (euint128, uint128) => euint128 test 1 (340282366920938463463371325512794994309, 340282366920938463463371325512794994309)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463371325512794994309n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.sub_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463371325512794994309n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint128, uint128) => euint128 test 2 (340282366920938463463371325512794994309, 340282366920938463463371325512794994305)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463371325512794994309n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.sub_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463371325512794994305n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(4n); + }); + + it('test operator "sub" overload (uint128, euint128) => euint128 test 1 (340282366920938463463371325512794994309, 340282366920938463463371325512794994309)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(340282366920938463463371325512794994309n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.sub_uint128_euint128( + 340282366920938463463371325512794994309n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (uint128, euint128) => euint128 test 2 (340282366920938463463371325512794994309, 340282366920938463463371325512794994305)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(340282366920938463463371325512794994305n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.sub_uint128_euint128( + 340282366920938463463371325512794994309n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint128, uint128) => euint128 test 1 (9223372036854775809, 9223372036854775809)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(9223372036854775809n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_euint128_uint128( + encryptedAmount.handles[0], + 9223372036854775809n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(85070591730234615884290395931651604481n); + }); + + it('test operator "mul" overload (euint128, uint128) => euint128 test 2 (9223372036854775809, 9223372036854775809)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(9223372036854775809n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_euint128_uint128( + encryptedAmount.handles[0], + 9223372036854775809n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(85070591730234615884290395931651604481n); + }); + + it('test operator "mul" overload (euint128, uint128) => euint128 test 3 (9223372036854775809, 9223372036854775809)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(9223372036854775809n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_euint128_uint128( + encryptedAmount.handles[0], + 9223372036854775809n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(85070591730234615884290395931651604481n); + }); + + it('test operator "mul" overload (euint128, uint128) => euint128 test 4 (9223372036854775809, 9223372036854775809)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(9223372036854775809n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_euint128_uint128( + encryptedAmount.handles[0], + 9223372036854775809n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(85070591730234615884290395931651604481n); + }); + + it('test operator "mul" overload (uint128, euint128) => euint128 test 1 (9223372036854775809, 9223372036854775809)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(9223372036854775809n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_uint128_euint128( + 9223372036854775809n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(85070591730234615884290395931651604481n); + }); + + it('test operator "mul" overload (uint128, euint128) => euint128 test 2 (9223372036854775809, 9223372036854775809)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(9223372036854775809n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_uint128_euint128( + 9223372036854775809n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(85070591730234615884290395931651604481n); + }); + + it('test operator "mul" overload (uint128, euint128) => euint128 test 3 (9223372036854775809, 9223372036854775809)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(9223372036854775809n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_uint128_euint128( + 9223372036854775809n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(85070591730234615884290395931651604481n); + }); + + it('test operator "mul" overload (uint128, euint128) => euint128 test 4 (9223372036854775809, 9223372036854775809)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(9223372036854775809n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.mul_uint128_euint128( + 9223372036854775809n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(85070591730234615884290395931651604481n); + }); + + it('test operator "div" overload (euint128, uint128) => euint128 test 1 (340282366920938463463367036253718229621, 340282366920938463463366749493189619057)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463367036253718229621n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.div_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463366749493189619057n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(1n); + }); + + it('test operator "div" overload (euint128, uint128) => euint128 test 2 (340282366920938463463367036253718229617, 340282366920938463463367036253718229621)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463367036253718229617n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.div_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463367036253718229621n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "div" overload (euint128, uint128) => euint128 test 3 (340282366920938463463367036253718229621, 340282366920938463463367036253718229621)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463367036253718229621n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.div_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463367036253718229621n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(1n); + }); + + it('test operator "div" overload (euint128, uint128) => euint128 test 4 (340282366920938463463367036253718229621, 340282366920938463463367036253718229617)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463367036253718229621n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.div_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463367036253718229617n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(1n); + }); + + it('test operator "rem" overload (euint128, uint128) => euint128 test 1 (340282366920938463463373661336861215715, 340282366920938463463373616572096092505)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463373661336861215715n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.rem_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463373616572096092505n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(44764765123210n); + }); + + it('test operator "rem" overload (euint128, uint128) => euint128 test 2 (340282366920938463463365676215904817441, 340282366920938463463365676215904817445)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463365676215904817441n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.rem_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463365676215904817445n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463365676215904817441n); + }); + + it('test operator "rem" overload (euint128, uint128) => euint128 test 3 (340282366920938463463365676215904817445, 340282366920938463463365676215904817445)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463365676215904817445n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.rem_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463365676215904817445n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "rem" overload (euint128, uint128) => euint128 test 4 (340282366920938463463365676215904817445, 340282366920938463463365676215904817441)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463365676215904817445n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.rem_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463365676215904817441n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(4n); + }); + + it('test operator "and" overload (euint128, uint128) => euint128 test 1 (340282366920938463463369448280898636513, 340282366920938463463372486078949297683)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463369448280898636513n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463372486078949297683n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463367889982725360129n); + }); + + it('test operator "and" overload (euint128, uint128) => euint128 test 2 (340282366920938463463369448280898636509, 340282366920938463463369448280898636513)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463369448280898636509n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463369448280898636513n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463369448280898636481n); + }); + + it('test operator "and" overload (euint128, uint128) => euint128 test 3 (340282366920938463463369448280898636513, 340282366920938463463369448280898636513)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463369448280898636513n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463369448280898636513n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463369448280898636513n); + }); + + it('test operator "and" overload (euint128, uint128) => euint128 test 4 (340282366920938463463369448280898636513, 340282366920938463463369448280898636509)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463369448280898636513n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463369448280898636509n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463369448280898636481n); + }); + + it('test operator "and" overload (uint128, euint128) => euint128 test 1 (340282366920938463463369958984560022263, 340282366920938463463372486078949297683)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(340282366920938463463372486078949297683n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_uint128_euint128( + 340282366920938463463369958984560022263n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463367979575847944723n); + }); + + it('test operator "and" overload (uint128, euint128) => euint128 test 2 (340282366920938463463369448280898636509, 340282366920938463463369448280898636513)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(340282366920938463463369448280898636513n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_uint128_euint128( + 340282366920938463463369448280898636509n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463369448280898636481n); + }); + + it('test operator "and" overload (uint128, euint128) => euint128 test 3 (340282366920938463463369448280898636513, 340282366920938463463369448280898636513)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(340282366920938463463369448280898636513n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_uint128_euint128( + 340282366920938463463369448280898636513n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463369448280898636513n); + }); + + it('test operator "and" overload (uint128, euint128) => euint128 test 4 (340282366920938463463369448280898636513, 340282366920938463463369448280898636509)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(340282366920938463463369448280898636509n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.and_uint128_euint128( + 340282366920938463463369448280898636513n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463369448280898636481n); + }); + + it('test operator "or" overload (euint128, uint128) => euint128 test 1 (340282366920938463463369943867774092587, 340282366920938463463370790418939970679)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463369943867774092587n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463370790418939970679n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463374465540930094463n); + }); + + it('test operator "or" overload (euint128, uint128) => euint128 test 2 (340282366920938463463366792612134320311, 340282366920938463463366792612134320315)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463366792612134320311n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463366792612134320315n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463366792612134320319n); + }); + + it('test operator "or" overload (euint128, uint128) => euint128 test 3 (340282366920938463463366792612134320315, 340282366920938463463366792612134320315)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463366792612134320315n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463366792612134320315n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463366792612134320315n); + }); + + it('test operator "or" overload (euint128, uint128) => euint128 test 4 (340282366920938463463366792612134320315, 340282366920938463463366792612134320311)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463366792612134320315n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463366792612134320311n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463366792612134320319n); + }); + + it('test operator "or" overload (uint128, euint128) => euint128 test 1 (340282366920938463463373447424911206945, 340282366920938463463370790418939970679)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(340282366920938463463370790418939970679n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_uint128_euint128( + 340282366920938463463373447424911206945n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463373465017634385527n); + }); + + it('test operator "or" overload (uint128, euint128) => euint128 test 2 (340282366920938463463366792612134320311, 340282366920938463463366792612134320315)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(340282366920938463463366792612134320315n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_uint128_euint128( + 340282366920938463463366792612134320311n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463366792612134320319n); + }); + + it('test operator "or" overload (uint128, euint128) => euint128 test 3 (340282366920938463463366792612134320315, 340282366920938463463366792612134320315)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(340282366920938463463366792612134320315n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_uint128_euint128( + 340282366920938463463366792612134320315n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463366792612134320315n); + }); + + it('test operator "or" overload (uint128, euint128) => euint128 test 4 (340282366920938463463366792612134320315, 340282366920938463463366792612134320311)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(340282366920938463463366792612134320311n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.or_uint128_euint128( + 340282366920938463463366792612134320315n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(340282366920938463463366792612134320319n); + }); + + it('test operator "xor" overload (euint128, uint128) => euint128 test 1 (340282366920938463463369885853425789025, 340282366920938463463366639758401665137)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463369885853425789025n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463366639758401665137n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(3528120671014928n); + }); + + it('test operator "xor" overload (euint128, uint128) => euint128 test 2 (340282366920938463463369885853425789021, 340282366920938463463369885853425789025)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463369885853425789021n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463369885853425789025n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(60n); + }); + + it('test operator "xor" overload (euint128, uint128) => euint128 test 3 (340282366920938463463369885853425789025, 340282366920938463463369885853425789025)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463369885853425789025n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463369885853425789025n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint128, uint128) => euint128 test 4 (340282366920938463463369885853425789025, 340282366920938463463369885853425789021)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463369885853425789025n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463369885853425789021n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(60n); + }); + + it('test operator "xor" overload (uint128, euint128) => euint128 test 1 (340282366920938463463370489995997603491, 340282366920938463463366639758401665137)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(340282366920938463463366639758401665137n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_uint128_euint128( + 340282366920938463463370489995997603491n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(5328541458439890n); + }); + + it('test operator "xor" overload (uint128, euint128) => euint128 test 2 (340282366920938463463369885853425789021, 340282366920938463463369885853425789025)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(340282366920938463463369885853425789025n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_uint128_euint128( + 340282366920938463463369885853425789021n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(60n); + }); + + it('test operator "xor" overload (uint128, euint128) => euint128 test 3 (340282366920938463463369885853425789025, 340282366920938463463369885853425789025)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(340282366920938463463369885853425789025n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_uint128_euint128( + 340282366920938463463369885853425789025n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (uint128, euint128) => euint128 test 4 (340282366920938463463369885853425789025, 340282366920938463463369885853425789021)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add128(340282366920938463463369885853425789021n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.xor_uint128_euint128( + 340282366920938463463369885853425789025n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract6.resEuint128()); + expect(res).to.equal(60n); + }); + + it('test operator "eq" overload (euint128, uint128) => ebool test 1 (340282366920938463463374345879343197185, 340282366920938463463368052220625217763)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463374345879343197185n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463368052220625217763n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint128, uint128) => ebool test 2 (340282366920938463463368861870870547269, 340282366920938463463368861870870547273)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463368861870870547269n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463368861870870547273n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint128, uint128) => ebool test 3 (340282366920938463463368861870870547273, 340282366920938463463368861870870547273)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463368861870870547273n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463368861870870547273n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint128, uint128) => ebool test 4 (340282366920938463463368861870870547273, 340282366920938463463368861870870547269)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add128(340282366920938463463368861870870547273n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463368861870870547269n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (uint128, euint128) => ebool test 1 (340282366920938463463368973668702551249, 340282366920938463463368052220625217763)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463368052220625217763n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.eq_uint128_euint128( + 340282366920938463463368973668702551249n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (uint128, euint128) => ebool test 2 (340282366920938463463368861870870547269, 340282366920938463463368861870870547273)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463368861870870547273n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.eq_uint128_euint128( + 340282366920938463463368861870870547269n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (uint128, euint128) => ebool test 3 (340282366920938463463368861870870547273, 340282366920938463463368861870870547273)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463368861870870547273n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.eq_uint128_euint128( + 340282366920938463463368861870870547273n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (uint128, euint128) => ebool test 4 (340282366920938463463368861870870547273, 340282366920938463463368861870870547269)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463368861870870547269n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.eq_uint128_euint128( + 340282366920938463463368861870870547273n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint128, uint128) => ebool test 1 (340282366920938463463372337746623862115, 340282366920938463463372405248256998861)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463372337746623862115n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ne_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463372405248256998861n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint128, uint128) => ebool test 2 (340282366920938463463372012747422501417, 340282366920938463463372012747422501421)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463372012747422501417n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ne_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463372012747422501421n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint128, uint128) => ebool test 3 (340282366920938463463372012747422501421, 340282366920938463463372012747422501421)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463372012747422501421n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ne_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463372012747422501421n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint128, uint128) => ebool test 4 (340282366920938463463372012747422501421, 340282366920938463463372012747422501417)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463372012747422501421n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ne_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463372012747422501417n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (uint128, euint128) => ebool test 1 (340282366920938463463369306562858304513, 340282366920938463463372405248256998861)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463372405248256998861n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ne_uint128_euint128( + 340282366920938463463369306562858304513n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (uint128, euint128) => ebool test 2 (340282366920938463463372012747422501417, 340282366920938463463372012747422501421)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463372012747422501421n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ne_uint128_euint128( + 340282366920938463463372012747422501417n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (uint128, euint128) => ebool test 3 (340282366920938463463372012747422501421, 340282366920938463463372012747422501421)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463372012747422501421n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ne_uint128_euint128( + 340282366920938463463372012747422501421n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (uint128, euint128) => ebool test 4 (340282366920938463463372012747422501421, 340282366920938463463372012747422501417)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463372012747422501417n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ne_uint128_euint128( + 340282366920938463463372012747422501421n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint128, uint128) => ebool test 1 (340282366920938463463373393932902694667, 340282366920938463463373438652401916771)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463373393932902694667n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ge_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463373438652401916771n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint128, uint128) => ebool test 2 (340282366920938463463369241617541923951, 340282366920938463463369241617541923955)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463369241617541923951n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ge_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463369241617541923955n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint128, uint128) => ebool test 3 (340282366920938463463369241617541923955, 340282366920938463463369241617541923955)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463369241617541923955n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ge_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463369241617541923955n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint128, uint128) => ebool test 4 (340282366920938463463369241617541923955, 340282366920938463463369241617541923951)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463369241617541923955n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ge_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463369241617541923951n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (uint128, euint128) => ebool test 1 (340282366920938463463373253073290779711, 340282366920938463463373438652401916771)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463373438652401916771n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ge_uint128_euint128( + 340282366920938463463373253073290779711n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (uint128, euint128) => ebool test 2 (340282366920938463463369241617541923951, 340282366920938463463369241617541923955)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463369241617541923955n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ge_uint128_euint128( + 340282366920938463463369241617541923951n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (uint128, euint128) => ebool test 3 (340282366920938463463369241617541923955, 340282366920938463463369241617541923955)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463369241617541923955n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ge_uint128_euint128( + 340282366920938463463369241617541923955n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (uint128, euint128) => ebool test 4 (340282366920938463463369241617541923955, 340282366920938463463369241617541923951)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463369241617541923951n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ge_uint128_euint128( + 340282366920938463463369241617541923955n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint128, uint128) => ebool test 1 (340282366920938463463371792186928109333, 340282366920938463463372789960518309383)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463371792186928109333n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.gt_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463372789960518309383n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint128, uint128) => ebool test 2 (340282366920938463463371112910827200489, 340282366920938463463371112910827200493)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463371112910827200489n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.gt_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463371112910827200493n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint128, uint128) => ebool test 3 (340282366920938463463371112910827200493, 340282366920938463463371112910827200493)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463371112910827200493n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.gt_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463371112910827200493n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint128, uint128) => ebool test 4 (340282366920938463463371112910827200493, 340282366920938463463371112910827200489)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463371112910827200493n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.gt_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463371112910827200489n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (uint128, euint128) => ebool test 1 (340282366920938463463369498952830171167, 340282366920938463463372789960518309383)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463372789960518309383n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.gt_uint128_euint128( + 340282366920938463463369498952830171167n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (uint128, euint128) => ebool test 2 (340282366920938463463371112910827200489, 340282366920938463463371112910827200493)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463371112910827200493n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.gt_uint128_euint128( + 340282366920938463463371112910827200489n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (uint128, euint128) => ebool test 3 (340282366920938463463371112910827200493, 340282366920938463463371112910827200493)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463371112910827200493n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.gt_uint128_euint128( + 340282366920938463463371112910827200493n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (uint128, euint128) => ebool test 4 (340282366920938463463371112910827200493, 340282366920938463463371112910827200489)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463371112910827200489n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.gt_uint128_euint128( + 340282366920938463463371112910827200493n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint128, uint128) => ebool test 1 (340282366920938463463373573120609448359, 340282366920938463463369418018941312037)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463373573120609448359n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.le_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463369418018941312037n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (euint128, uint128) => ebool test 2 (340282366920938463463366775675563348855, 340282366920938463463366775675563348859)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463366775675563348855n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.le_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463366775675563348859n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint128, uint128) => ebool test 3 (340282366920938463463366775675563348859, 340282366920938463463366775675563348859)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463366775675563348859n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.le_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463366775675563348859n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint128, uint128) => ebool test 4 (340282366920938463463366775675563348859, 340282366920938463463366775675563348855)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463366775675563348859n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.le_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463366775675563348855n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (uint128, euint128) => ebool test 1 (340282366920938463463373445986255225723, 340282366920938463463369418018941312037)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463369418018941312037n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.le_uint128_euint128( + 340282366920938463463373445986255225723n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (uint128, euint128) => ebool test 2 (340282366920938463463366775675563348855, 340282366920938463463366775675563348859)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463366775675563348859n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.le_uint128_euint128( + 340282366920938463463366775675563348855n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (uint128, euint128) => ebool test 3 (340282366920938463463366775675563348859, 340282366920938463463366775675563348859)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463366775675563348859n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.le_uint128_euint128( + 340282366920938463463366775675563348859n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (uint128, euint128) => ebool test 4 (340282366920938463463366775675563348859, 340282366920938463463366775675563348855)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463366775675563348855n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.le_uint128_euint128( + 340282366920938463463366775675563348859n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint128, uint128) => ebool test 1 (340282366920938463463370008125171706361, 340282366920938463463367859493002319283)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463370008125171706361n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.lt_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463367859493002319283n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint128, uint128) => ebool test 2 (340282366920938463463369783285988541621, 340282366920938463463369783285988541625)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463369783285988541621n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.lt_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463369783285988541625n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint128, uint128) => ebool test 3 (340282366920938463463369783285988541625, 340282366920938463463369783285988541625)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463369783285988541625n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.lt_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463369783285988541625n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint128, uint128) => ebool test 4 (340282366920938463463369783285988541625, 340282366920938463463369783285988541621)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463369783285988541625n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.lt_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463369783285988541621n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (uint128, euint128) => ebool test 1 (340282366920938463463368160618739935837, 340282366920938463463367859493002319283)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463367859493002319283n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.lt_uint128_euint128( + 340282366920938463463368160618739935837n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (uint128, euint128) => ebool test 2 (340282366920938463463369783285988541621, 340282366920938463463369783285988541625)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463369783285988541625n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.lt_uint128_euint128( + 340282366920938463463369783285988541621n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (uint128, euint128) => ebool test 3 (340282366920938463463369783285988541625, 340282366920938463463369783285988541625)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463369783285988541625n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.lt_uint128_euint128( + 340282366920938463463369783285988541625n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (uint128, euint128) => ebool test 4 (340282366920938463463369783285988541625, 340282366920938463463369783285988541621)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463369783285988541621n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.lt_uint128_euint128( + 340282366920938463463369783285988541625n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint128, uint128) => euint128 test 1 (340282366920938463463366382917457466127, 340282366920938463463368942888048079885)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463366382917457466127n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.min_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463368942888048079885n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(340282366920938463463366382917457466127n); + }); + + it('test operator "min" overload (euint128, uint128) => euint128 test 2 (340282366920938463463366382917457466123, 340282366920938463463366382917457466127)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463366382917457466123n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.min_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463366382917457466127n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(340282366920938463463366382917457466123n); + }); + + it('test operator "min" overload (euint128, uint128) => euint128 test 3 (340282366920938463463366382917457466127, 340282366920938463463366382917457466127)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463366382917457466127n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.min_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463366382917457466127n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(340282366920938463463366382917457466127n); + }); + + it('test operator "min" overload (euint128, uint128) => euint128 test 4 (340282366920938463463366382917457466127, 340282366920938463463366382917457466123)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463366382917457466127n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.min_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463366382917457466123n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(340282366920938463463366382917457466123n); + }); + + it('test operator "min" overload (uint128, euint128) => euint128 test 1 (340282366920938463463369078333512232911, 340282366920938463463368942888048079885)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463368942888048079885n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.min_uint128_euint128( + 340282366920938463463369078333512232911n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(340282366920938463463368942888048079885n); + }); + + it('test operator "min" overload (uint128, euint128) => euint128 test 2 (340282366920938463463366382917457466123, 340282366920938463463366382917457466127)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463366382917457466127n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.min_uint128_euint128( + 340282366920938463463366382917457466123n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(340282366920938463463366382917457466123n); + }); + + it('test operator "min" overload (uint128, euint128) => euint128 test 3 (340282366920938463463366382917457466127, 340282366920938463463366382917457466127)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463366382917457466127n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.min_uint128_euint128( + 340282366920938463463366382917457466127n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(340282366920938463463366382917457466127n); + }); + + it('test operator "min" overload (uint128, euint128) => euint128 test 4 (340282366920938463463366382917457466127, 340282366920938463463366382917457466123)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463366382917457466123n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.min_uint128_euint128( + 340282366920938463463366382917457466127n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(340282366920938463463366382917457466123n); + }); + + it('test operator "max" overload (euint128, uint128) => euint128 test 1 (340282366920938463463371863451323857007, 340282366920938463463366478343807083755)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463371863451323857007n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.max_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463366478343807083755n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(340282366920938463463371863451323857007n); + }); + + it('test operator "max" overload (euint128, uint128) => euint128 test 2 (340282366920938463463369685607056229717, 340282366920938463463369685607056229721)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463369685607056229717n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.max_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463369685607056229721n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(340282366920938463463369685607056229721n); + }); + + it('test operator "max" overload (euint128, uint128) => euint128 test 3 (340282366920938463463369685607056229721, 340282366920938463463369685607056229721)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463369685607056229721n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.max_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463369685607056229721n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(340282366920938463463369685607056229721n); + }); + + it('test operator "max" overload (euint128, uint128) => euint128 test 4 (340282366920938463463369685607056229721, 340282366920938463463369685607056229717)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463369685607056229721n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.max_euint128_uint128( + encryptedAmount.handles[0], + 340282366920938463463369685607056229717n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(340282366920938463463369685607056229721n); + }); + + it('test operator "max" overload (uint128, euint128) => euint128 test 1 (340282366920938463463371109018705487683, 340282366920938463463366478343807083755)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463366478343807083755n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.max_uint128_euint128( + 340282366920938463463371109018705487683n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(340282366920938463463371109018705487683n); + }); + + it('test operator "max" overload (uint128, euint128) => euint128 test 2 (340282366920938463463369685607056229717, 340282366920938463463369685607056229721)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463369685607056229721n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.max_uint128_euint128( + 340282366920938463463369685607056229717n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(340282366920938463463369685607056229721n); + }); + + it('test operator "max" overload (uint128, euint128) => euint128 test 3 (340282366920938463463369685607056229721, 340282366920938463463369685607056229721)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463369685607056229721n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.max_uint128_euint128( + 340282366920938463463369685607056229721n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(340282366920938463463369685607056229721n); + }); + + it('test operator "max" overload (uint128, euint128) => euint128 test 4 (340282366920938463463369685607056229721, 340282366920938463463369685607056229717)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add128(340282366920938463463369685607056229717n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.max_uint128_euint128( + 340282366920938463463369685607056229721n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(340282366920938463463369685607056229721n); + }); + + it('test operator "and" overload (euint256, uint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457577882762752269233, 115792089237316195423570985008687907853269984665640564039457581118705832456047)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457577882762752269233n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.and_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457581118705832456047n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457575066684590263073n); + }); + + it('test operator "and" overload (euint256, uint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457577882762752269229, 115792089237316195423570985008687907853269984665640564039457577882762752269233)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457577882762752269229n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.and_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457577882762752269233n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577882762752269217n); + }); + + it('test operator "and" overload (euint256, uint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457577882762752269233, 115792089237316195423570985008687907853269984665640564039457577882762752269233)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457577882762752269233n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.and_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457577882762752269233n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577882762752269233n); + }); + + it('test operator "and" overload (euint256, uint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457577882762752269233, 115792089237316195423570985008687907853269984665640564039457577882762752269229)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457577882762752269233n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.and_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457577882762752269229n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577882762752269217n); + }); + + it('test operator "and" overload (uint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457575083262436589015, 115792089237316195423570985008687907853269984665640564039457581118705832456047)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add256(115792089237316195423570985008687907853269984665640564039457581118705832456047n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.and_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457575083262436589015n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457575009509985889607n); + }); + + it('test operator "and" overload (uint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457577882762752269229, 115792089237316195423570985008687907853269984665640564039457577882762752269233)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add256(115792089237316195423570985008687907853269984665640564039457577882762752269233n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.and_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457577882762752269229n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577882762752269217n); + }); + + it('test operator "and" overload (uint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457577882762752269233, 115792089237316195423570985008687907853269984665640564039457577882762752269233)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add256(115792089237316195423570985008687907853269984665640564039457577882762752269233n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.and_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457577882762752269233n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577882762752269233n); + }); + + it('test operator "and" overload (uint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457577882762752269233, 115792089237316195423570985008687907853269984665640564039457577882762752269229)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add256(115792089237316195423570985008687907853269984665640564039457577882762752269229n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.and_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457577882762752269233n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577882762752269217n); + }); + + it('test operator "or" overload (euint256, uint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457580756276426861853, 115792089237316195423570985008687907853269984665640564039457576619259028560911)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457580756276426861853n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.or_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457576619259028560911n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457581178526079384863n); + }); + + it('test operator "or" overload (euint256, uint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457576625033575425441, 115792089237316195423570985008687907853269984665640564039457576625033575425445)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457576625033575425441n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.or_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457576625033575425445n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576625033575425445n); + }); + + it('test operator "or" overload (euint256, uint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457576625033575425445, 115792089237316195423570985008687907853269984665640564039457576625033575425445)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457576625033575425445n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.or_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457576625033575425445n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576625033575425445n); + }); + + it('test operator "or" overload (euint256, uint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457576625033575425445, 115792089237316195423570985008687907853269984665640564039457576625033575425441)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457576625033575425445n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.or_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457576625033575425441n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576625033575425445n); + }); + + it('test operator "or" overload (uint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457575056264989216535, 115792089237316195423570985008687907853269984665640564039457576619259028560911)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add256(115792089237316195423570985008687907853269984665640564039457576619259028560911n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.or_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457575056264989216535n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576674784365764383n); + }); + + it('test operator "or" overload (uint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457576625033575425441, 115792089237316195423570985008687907853269984665640564039457576625033575425445)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add256(115792089237316195423570985008687907853269984665640564039457576625033575425445n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.or_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457576625033575425441n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576625033575425445n); + }); + + it('test operator "or" overload (uint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457576625033575425445, 115792089237316195423570985008687907853269984665640564039457576625033575425445)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add256(115792089237316195423570985008687907853269984665640564039457576625033575425445n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.or_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457576625033575425445n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576625033575425445n); + }); + + it('test operator "or" overload (uint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457576625033575425445, 115792089237316195423570985008687907853269984665640564039457576625033575425441)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add256(115792089237316195423570985008687907853269984665640564039457576625033575425441n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.or_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457576625033575425445n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576625033575425445n); + }); + + it('test operator "xor" overload (euint256, uint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457577307594866852405, 115792089237316195423570985008687907853269984665640564039457581658127372028577)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457577307594866852405n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.xor_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457581658127372028577n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(8889522663065748n); + }); + + it('test operator "xor" overload (euint256, uint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457577307594866852401, 115792089237316195423570985008687907853269984665640564039457577307594866852405)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457577307594866852401n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.xor_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457577307594866852405n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint256, uint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457577307594866852405, 115792089237316195423570985008687907853269984665640564039457577307594866852405)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457577307594866852405n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.xor_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457577307594866852405n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint256, uint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457577307594866852405, 115792089237316195423570985008687907853269984665640564039457577307594866852401)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457577307594866852405n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.xor_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457577307594866852401n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (uint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457583302275571832783, 115792089237316195423570985008687907853269984665640564039457581658127372028577)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add256(115792089237316195423570985008687907853269984665640564039457581658127372028577n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.xor_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457583302275571832783n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(3053172706270574n); + }); + + it('test operator "xor" overload (uint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457577307594866852401, 115792089237316195423570985008687907853269984665640564039457577307594866852405)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add256(115792089237316195423570985008687907853269984665640564039457577307594866852405n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.xor_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457577307594866852401n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (uint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457577307594866852405, 115792089237316195423570985008687907853269984665640564039457577307594866852405)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add256(115792089237316195423570985008687907853269984665640564039457577307594866852405n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.xor_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457577307594866852405n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (uint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457577307594866852405, 115792089237316195423570985008687907853269984665640564039457577307594866852401)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add256(115792089237316195423570985008687907853269984665640564039457577307594866852401n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.xor_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457577307594866852405n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(4n); + }); + + it('test operator "eq" overload (euint256, uint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457579171920097840425, 115792089237316195423570985008687907853269984665640564039457580395363415947377)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457579171920097840425n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.eq_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457580395363415947377n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint256, uint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457575336807286229255, 115792089237316195423570985008687907853269984665640564039457575336807286229259)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457575336807286229255n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.eq_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457575336807286229259n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint256, uint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457575336807286229259, 115792089237316195423570985008687907853269984665640564039457575336807286229259)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457575336807286229259n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.eq_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457575336807286229259n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint256, uint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457575336807286229259, 115792089237316195423570985008687907853269984665640564039457575336807286229255)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457575336807286229259n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.eq_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457575336807286229255n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (uint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457575870658999086877, 115792089237316195423570985008687907853269984665640564039457580395363415947377)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add256(115792089237316195423570985008687907853269984665640564039457580395363415947377n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.eq_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457575870658999086877n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (uint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457575336807286229255, 115792089237316195423570985008687907853269984665640564039457575336807286229259)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add256(115792089237316195423570985008687907853269984665640564039457575336807286229259n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.eq_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457575336807286229255n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (uint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457575336807286229259, 115792089237316195423570985008687907853269984665640564039457575336807286229259)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add256(115792089237316195423570985008687907853269984665640564039457575336807286229259n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.eq_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457575336807286229259n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (uint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457575336807286229259, 115792089237316195423570985008687907853269984665640564039457575336807286229255)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add256(115792089237316195423570985008687907853269984665640564039457575336807286229255n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.eq_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457575336807286229259n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint256, uint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457579899968092620165, 115792089237316195423570985008687907853269984665640564039457581335165965211017)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457579899968092620165n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ne_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457581335165965211017n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint256, uint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457575210429165840811, 115792089237316195423570985008687907853269984665640564039457575210429165840815)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457575210429165840811n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ne_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457575210429165840815n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint256, uint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457575210429165840815, 115792089237316195423570985008687907853269984665640564039457575210429165840815)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457575210429165840815n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ne_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457575210429165840815n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint256, uint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457575210429165840815, 115792089237316195423570985008687907853269984665640564039457575210429165840811)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457575210429165840815n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ne_euint256_uint256( + encryptedAmount.handles[0], + 115792089237316195423570985008687907853269984665640564039457575210429165840811n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (uint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457576970071832600241, 115792089237316195423570985008687907853269984665640564039457581335165965211017)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add256(115792089237316195423570985008687907853269984665640564039457581335165965211017n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ne_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457576970071832600241n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (uint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457575210429165840811, 115792089237316195423570985008687907853269984665640564039457575210429165840815)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add256(115792089237316195423570985008687907853269984665640564039457575210429165840815n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ne_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457575210429165840811n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (uint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457575210429165840815, 115792089237316195423570985008687907853269984665640564039457575210429165840815)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add256(115792089237316195423570985008687907853269984665640564039457575210429165840815n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ne_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457575210429165840815n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (uint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457575210429165840815, 115792089237316195423570985008687907853269984665640564039457575210429165840811)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + + input.add256(115792089237316195423570985008687907853269984665640564039457575210429165840811n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.ne_uint256_euint256( + 115792089237316195423570985008687907853269984665640564039457575210429165840815n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract7.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "shl" overload (euint8, euint8) => euint8 test 1 (148, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(148n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(0n); + }); + + it('test operator "shl" overload (euint8, euint8) => euint8 test 2 (2, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(2n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(128n); + }); + + it('test operator "shl" overload (euint8, euint8) => euint8 test 3 (6, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(6n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(128n); + }); + + it('test operator "shl" overload (euint8, euint8) => euint8 test 4 (6, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(6n); + input.add8(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(24n); + }); + + it('test operator "shl" overload (euint8, uint8) => euint8 test 1 (148, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(148n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint8_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(0n); + }); + + it('test operator "shl" overload (euint8, uint8) => euint8 test 2 (2, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(2n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint8_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(128n); + }); + + it('test operator "shl" overload (euint8, uint8) => euint8 test 3 (6, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(6n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint8_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(128n); + }); + + it('test operator "shl" overload (euint8, uint8) => euint8 test 4 (6, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(6n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint8_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(24n); + }); + + it('test operator "shr" overload (euint8, euint8) => euint8 test 1 (208, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(208n); + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(6n); + }); + + it('test operator "shr" overload (euint8, euint8) => euint8 test 2 (1, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(1n); + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint8, euint8) => euint8 test 3 (5, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(5n); + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint8, euint8) => euint8 test 4 (5, 1)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(5n); + input.add8(1n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(2n); + }); + + it('test operator "shr" overload (euint8, uint8) => euint8 test 1 (208, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(208n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint8_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(6n); + }); + + it('test operator "shr" overload (euint8, uint8) => euint8 test 2 (1, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(1n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint8_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint8, uint8) => euint8 test 3 (5, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(5n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint8_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint8, uint8) => euint8 test 4 (5, 1)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(5n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint8_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(2n); + }); + + it('test operator "rotl" overload (euint8, euint8) => euint8 test 1 (120, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(120n); + input.add8(7n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(60n); + }); + + it('test operator "rotl" overload (euint8, euint8) => euint8 test 2 (3, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(3n); + input.add8(7n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(129n); + }); + + it('test operator "rotl" overload (euint8, euint8) => euint8 test 3 (7, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(7n); + input.add8(7n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(131n); + }); + + it('test operator "rotl" overload (euint8, euint8) => euint8 test 4 (7, 3)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(7n); + input.add8(3n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(56n); + }); + + it('test operator "rotl" overload (euint8, uint8) => euint8 test 1 (120, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(120n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint8_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(60n); + }); + + it('test operator "rotl" overload (euint8, uint8) => euint8 test 2 (3, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(3n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint8_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(129n); + }); + + it('test operator "rotl" overload (euint8, uint8) => euint8 test 3 (7, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(7n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint8_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(131n); + }); + + it('test operator "rotl" overload (euint8, uint8) => euint8 test 4 (7, 3)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(7n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint8_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(56n); + }); + + it('test operator "rotr" overload (euint8, euint8) => euint8 test 1 (207, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(207n); + input.add8(10n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(243n); + }); + + it('test operator "rotr" overload (euint8, euint8) => euint8 test 2 (6, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(6n); + input.add8(10n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(129n); + }); + + it('test operator "rotr" overload (euint8, euint8) => euint8 test 3 (10, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(10n); + input.add8(10n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(130n); + }); + + it('test operator "rotr" overload (euint8, euint8) => euint8 test 4 (10, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(10n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint8_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(40n); + }); +}); diff --git a/contracts/test/httpzOperations/httpzOperations12.ts b/contracts/test/httpzOperations/httpzOperations12.ts new file mode 100644 index 00000000..1de919bf --- /dev/null +++ b/contracts/test/httpzOperations/httpzOperations12.ts @@ -0,0 +1,2370 @@ +import { expect } from 'chai'; +import { ethers } from 'hardhat'; + +import type { HTTPZTestSuite1 } from '../../types/contracts/tests/HTTPZTestSuite1'; +import type { HTTPZTestSuite2 } from '../../types/contracts/tests/HTTPZTestSuite2'; +import type { HTTPZTestSuite3 } from '../../types/contracts/tests/HTTPZTestSuite3'; +import type { HTTPZTestSuite4 } from '../../types/contracts/tests/HTTPZTestSuite4'; +import type { HTTPZTestSuite5 } from '../../types/contracts/tests/HTTPZTestSuite5'; +import type { HTTPZTestSuite6 } from '../../types/contracts/tests/HTTPZTestSuite6'; +import type { HTTPZTestSuite7 } from '../../types/contracts/tests/HTTPZTestSuite7'; +import { + createInstances, + decrypt8, + decrypt16, + decrypt32, + decrypt64, + decrypt128, + decrypt256, + decryptBool, +} from '../instance'; +import { getSigners, initSigners } from '../signers'; + +async function deployHTTPZTestFixture1(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite1'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture2(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite2'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture3(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite3'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture4(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite4'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture5(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite5'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture6(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite6'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture7(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite7'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +describe('HTTPZ operations 12', function () { + before(async function () { + await initSigners(1); + this.signers = await getSigners(); + + const contract1 = await deployHTTPZTestFixture1(); + this.contract1Address = await contract1.getAddress(); + this.contract1 = contract1; + + const contract2 = await deployHTTPZTestFixture2(); + this.contract2Address = await contract2.getAddress(); + this.contract2 = contract2; + + const contract3 = await deployHTTPZTestFixture3(); + this.contract3Address = await contract3.getAddress(); + this.contract3 = contract3; + + const contract4 = await deployHTTPZTestFixture4(); + this.contract4Address = await contract4.getAddress(); + this.contract4 = contract4; + + const contract5 = await deployHTTPZTestFixture5(); + this.contract5Address = await contract5.getAddress(); + this.contract5 = contract5; + + const contract6 = await deployHTTPZTestFixture6(); + this.contract6Address = await contract6.getAddress(); + this.contract6 = contract6; + + const contract7 = await deployHTTPZTestFixture7(); + this.contract7Address = await contract7.getAddress(); + this.contract7 = contract7; + + const instances = await createInstances(this.signers); + this.instances = instances; + }); + + it('test operator "rotr" overload (euint8, uint8) => euint8 test 1 (207, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(207n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint8_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(243n); + }); + + it('test operator "rotr" overload (euint8, uint8) => euint8 test 2 (6, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(6n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint8_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(129n); + }); + + it('test operator "rotr" overload (euint8, uint8) => euint8 test 3 (10, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(10n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint8_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(130n); + }); + + it('test operator "rotr" overload (euint8, uint8) => euint8 test 4 (10, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(10n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint8_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(40n); + }); + + it('test operator "shl" overload (euint16, euint8) => euint16 test 1 (22188, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(22188n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(43776n); + }); + + it('test operator "shl" overload (euint16, euint8) => euint16 test 2 (2, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(2n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(128n); + }); + + it('test operator "shl" overload (euint16, euint8) => euint16 test 3 (6, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(6n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(384n); + }); + + it('test operator "shl" overload (euint16, euint8) => euint16 test 4 (6, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(6n); + input.add8(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(24n); + }); + + it('test operator "shl" overload (euint16, uint8) => euint16 test 1 (22188, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(22188n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint16_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(43776n); + }); + + it('test operator "shl" overload (euint16, uint8) => euint16 test 2 (2, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(2n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint16_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(128n); + }); + + it('test operator "shl" overload (euint16, uint8) => euint16 test 3 (6, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(6n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint16_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(384n); + }); + + it('test operator "shl" overload (euint16, uint8) => euint16 test 4 (6, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(6n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint16_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(24n); + }); + + it('test operator "shr" overload (euint16, euint8) => euint16 test 1 (33232, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(33232n); + input.add8(9n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(64n); + }); + + it('test operator "shr" overload (euint16, euint8) => euint16 test 2 (5, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(5n); + input.add8(9n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint16, euint8) => euint16 test 3 (9, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(9n); + input.add8(9n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint16, euint8) => euint16 test 4 (9, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(9n); + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint16, uint8) => euint16 test 1 (33232, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(33232n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint16_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(64n); + }); + + it('test operator "shr" overload (euint16, uint8) => euint16 test 2 (5, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(5n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint16_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint16, uint8) => euint16 test 3 (9, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(9n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint16_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint16, uint8) => euint16 test 4 (9, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(9n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint16_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(0n); + }); + + it('test operator "rotl" overload (euint16, euint8) => euint16 test 1 (578, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(578n); + input.add8(9n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(33796n); + }); + + it('test operator "rotl" overload (euint16, euint8) => euint16 test 2 (5, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(5n); + input.add8(9n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(2560n); + }); + + it('test operator "rotl" overload (euint16, euint8) => euint16 test 3 (9, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(9n); + input.add8(9n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(4608n); + }); + + it('test operator "rotl" overload (euint16, euint8) => euint16 test 4 (9, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(9n); + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(288n); + }); + + it('test operator "rotl" overload (euint16, uint8) => euint16 test 1 (578, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(578n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint16_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(33796n); + }); + + it('test operator "rotl" overload (euint16, uint8) => euint16 test 2 (5, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(5n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint16_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(2560n); + }); + + it('test operator "rotl" overload (euint16, uint8) => euint16 test 3 (9, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(9n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint16_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(4608n); + }); + + it('test operator "rotl" overload (euint16, uint8) => euint16 test 4 (9, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(9n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint16_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(288n); + }); + + it('test operator "rotr" overload (euint16, euint8) => euint16 test 1 (47934, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(47934n); + input.add8(10n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(53166n); + }); + + it('test operator "rotr" overload (euint16, euint8) => euint16 test 2 (6, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(6n); + input.add8(10n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(384n); + }); + + it('test operator "rotr" overload (euint16, euint8) => euint16 test 3 (10, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(10n); + input.add8(10n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(640n); + }); + + it('test operator "rotr" overload (euint16, euint8) => euint16 test 4 (10, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(10n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(10240n); + }); + + it('test operator "rotr" overload (euint16, uint8) => euint16 test 1 (47934, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(47934n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint16_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(53166n); + }); + + it('test operator "rotr" overload (euint16, uint8) => euint16 test 2 (6, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(6n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint16_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(384n); + }); + + it('test operator "rotr" overload (euint16, uint8) => euint16 test 3 (10, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(10n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint16_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(640n); + }); + + it('test operator "rotr" overload (euint16, uint8) => euint16 test 4 (10, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(10n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint16_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(10240n); + }); + + it('test operator "shl" overload (euint32, euint8) => euint32 test 1 (2217572133, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(2217572133n); + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(2242831520n); + }); + + it('test operator "shl" overload (euint32, euint8) => euint32 test 2 (1, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(1n); + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(32n); + }); + + it('test operator "shl" overload (euint32, euint8) => euint32 test 3 (5, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(5n); + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(160n); + }); + + it('test operator "shl" overload (euint32, euint8) => euint32 test 4 (5, 1)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(5n); + input.add8(1n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(10n); + }); + + it('test operator "shl" overload (euint32, uint8) => euint32 test 1 (2217572133, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(2217572133n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint32_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(2242831520n); + }); + + it('test operator "shl" overload (euint32, uint8) => euint32 test 2 (1, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(1n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint32_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(32n); + }); + + it('test operator "shl" overload (euint32, uint8) => euint32 test 3 (5, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(5n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint32_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(160n); + }); + + it('test operator "shl" overload (euint32, uint8) => euint32 test 4 (5, 1)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(5n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint32_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(10n); + }); + + it('test operator "shr" overload (euint32, euint8) => euint32 test 1 (3136631566, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(3136631566n); + input.add8(7n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(24504934n); + }); + + it('test operator "shr" overload (euint32, euint8) => euint32 test 2 (3, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(3n); + input.add8(7n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint32, euint8) => euint32 test 3 (7, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(7n); + input.add8(7n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint32, euint8) => euint32 test 4 (7, 3)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(7n); + input.add8(3n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint32, uint8) => euint32 test 1 (3136631566, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(3136631566n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint32_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(24504934n); + }); + + it('test operator "shr" overload (euint32, uint8) => euint32 test 2 (3, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(3n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint32_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint32, uint8) => euint32 test 3 (7, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(7n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint32_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint32, uint8) => euint32 test 4 (7, 3)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(7n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint32_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "rotl" overload (euint32, euint8) => euint32 test 1 (3400120761, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(3400120761n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(2859363954n); + }); + + it('test operator "rotl" overload (euint32, euint8) => euint32 test 2 (2, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(2n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(128n); + }); + + it('test operator "rotl" overload (euint32, euint8) => euint32 test 3 (6, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(6n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(384n); + }); + + it('test operator "rotl" overload (euint32, euint8) => euint32 test 4 (6, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(6n); + input.add8(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(24n); + }); + + it('test operator "rotl" overload (euint32, uint8) => euint32 test 1 (3400120761, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(3400120761n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint32_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(2859363954n); + }); + + it('test operator "rotl" overload (euint32, uint8) => euint32 test 2 (2, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(2n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint32_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(128n); + }); + + it('test operator "rotl" overload (euint32, uint8) => euint32 test 3 (6, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(6n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint32_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(384n); + }); + + it('test operator "rotl" overload (euint32, uint8) => euint32 test 4 (6, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(6n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint32_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(24n); + }); + + it('test operator "rotr" overload (euint32, euint8) => euint32 test 1 (3180887700, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(3180887700n); + input.add8(7n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(695939325n); + }); + + it('test operator "rotr" overload (euint32, euint8) => euint32 test 2 (3, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(3n); + input.add8(7n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(100663296n); + }); + + it('test operator "rotr" overload (euint32, euint8) => euint32 test 3 (7, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(7n); + input.add8(7n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(234881024n); + }); + + it('test operator "rotr" overload (euint32, euint8) => euint32 test 4 (7, 3)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(7n); + input.add8(3n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(3758096384n); + }); + + it('test operator "rotr" overload (euint32, uint8) => euint32 test 1 (3180887700, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(3180887700n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint32_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(695939325n); + }); + + it('test operator "rotr" overload (euint32, uint8) => euint32 test 2 (3, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(3n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint32_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(100663296n); + }); + + it('test operator "rotr" overload (euint32, uint8) => euint32 test 3 (7, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(7n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint32_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(234881024n); + }); + + it('test operator "rotr" overload (euint32, uint8) => euint32 test 4 (7, 3)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(7n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint32_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(3758096384n); + }); + + it('test operator "shl" overload (euint64, euint8) => euint64 test 1 (18439750008030732885, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(18439750008030732885n); + input.add8(9n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(14865782446154361344n); + }); + + it('test operator "shl" overload (euint64, euint8) => euint64 test 2 (5, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(5n); + input.add8(9n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(2560n); + }); + + it('test operator "shl" overload (euint64, euint8) => euint64 test 3 (9, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(9n); + input.add8(9n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(4608n); + }); + + it('test operator "shl" overload (euint64, euint8) => euint64 test 4 (9, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(9n); + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(288n); + }); + + it('test operator "shl" overload (euint64, uint8) => euint64 test 1 (18439750008030732885, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(18439750008030732885n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint64_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(14865782446154361344n); + }); + + it('test operator "shl" overload (euint64, uint8) => euint64 test 2 (5, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(5n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint64_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(2560n); + }); + + it('test operator "shl" overload (euint64, uint8) => euint64 test 3 (9, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(9n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint64_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(4608n); + }); + + it('test operator "shl" overload (euint64, uint8) => euint64 test 4 (9, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(9n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint64_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(288n); + }); + + it('test operator "shr" overload (euint64, euint8) => euint64 test 1 (18438453478748547175, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(18438453478748547175n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(288100835605446049n); + }); + + it('test operator "shr" overload (euint64, euint8) => euint64 test 2 (2, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(2n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint64, euint8) => euint64 test 3 (6, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(6n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint64, euint8) => euint64 test 4 (6, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(6n); + input.add8(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(1n); + }); + + it('test operator "shr" overload (euint64, uint8) => euint64 test 1 (18438453478748547175, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(18438453478748547175n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint64_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(288100835605446049n); + }); + + it('test operator "shr" overload (euint64, uint8) => euint64 test 2 (2, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(2n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint64_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint64, uint8) => euint64 test 3 (6, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(6n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint64_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint64, uint8) => euint64 test 4 (6, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(6n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint64_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(1n); + }); + + it('test operator "rotl" overload (euint64, euint8) => euint64 test 1 (18446627849061713287, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(18446627849061713287n); + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(18443024884978725119n); + }); + + it('test operator "rotl" overload (euint64, euint8) => euint64 test 2 (1, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(1n); + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(32n); + }); + + it('test operator "rotl" overload (euint64, euint8) => euint64 test 3 (5, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(5n); + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(160n); + }); + + it('test operator "rotl" overload (euint64, euint8) => euint64 test 4 (5, 1)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(5n); + input.add8(1n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(10n); + }); + + it('test operator "rotl" overload (euint64, uint8) => euint64 test 1 (18446627849061713287, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(18446627849061713287n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint64_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(18443024884978725119n); + }); + + it('test operator "rotl" overload (euint64, uint8) => euint64 test 2 (1, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(1n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint64_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(32n); + }); + + it('test operator "rotl" overload (euint64, uint8) => euint64 test 3 (5, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(5n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint64_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(160n); + }); + + it('test operator "rotl" overload (euint64, uint8) => euint64 test 4 (5, 1)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(5n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint64_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(10n); + }); + + it('test operator "rotr" overload (euint64, euint8) => euint64 test 1 (18441280551657855437, 11)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(18441280551657855437n); + input.add8(11n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(4161323387954961499n); + }); + + it('test operator "rotr" overload (euint64, euint8) => euint64 test 2 (7, 11)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(7n); + input.add8(11n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(63050394783186944n); + }); + + it('test operator "rotr" overload (euint64, euint8) => euint64 test 3 (11, 11)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(11n); + input.add8(11n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(99079191802150912n); + }); + + it('test operator "rotr" overload (euint64, euint8) => euint64 test 4 (11, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(11n); + input.add8(7n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(1585267068834414592n); + }); + + it('test operator "rotr" overload (euint64, uint8) => euint64 test 1 (18441280551657855437, 11)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(18441280551657855437n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint64_uint8(encryptedAmount.handles[0], 11n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(4161323387954961499n); + }); + + it('test operator "rotr" overload (euint64, uint8) => euint64 test 2 (7, 11)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(7n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint64_uint8(encryptedAmount.handles[0], 11n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(63050394783186944n); + }); + + it('test operator "rotr" overload (euint64, uint8) => euint64 test 3 (11, 11)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(11n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint64_uint8(encryptedAmount.handles[0], 11n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(99079191802150912n); + }); + + it('test operator "rotr" overload (euint64, uint8) => euint64 test 4 (11, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(11n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint64_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(1585267068834414592n); + }); + + it('test operator "shl" overload (euint128, euint8) => euint128 test 1 (340282366920938463463368350684132797115, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463368350684132797115n); + input.add8(10n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(340282366920938463456967697853103926272n); + }); + + it('test operator "shl" overload (euint128, euint8) => euint128 test 2 (6, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(6n); + input.add8(10n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(6144n); + }); + + it('test operator "shl" overload (euint128, euint8) => euint128 test 3 (10, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(10n); + input.add8(10n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(10240n); + }); + + it('test operator "shl" overload (euint128, euint8) => euint128 test 4 (10, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(10n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(640n); + }); + + it('test operator "shl" overload (euint128, uint8) => euint128 test 1 (340282366920938463463368350684132797115, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463368350684132797115n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint128_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(340282366920938463456967697853103926272n); + }); + + it('test operator "shl" overload (euint128, uint8) => euint128 test 2 (6, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(6n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint128_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(6144n); + }); + + it('test operator "shl" overload (euint128, uint8) => euint128 test 3 (10, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(10n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint128_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(10240n); + }); + + it('test operator "shl" overload (euint128, uint8) => euint128 test 4 (10, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(10n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint128_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(640n); + }); + + it('test operator "shr" overload (euint128, euint8) => euint128 test 1 (340282366920938463463368058593023349135, 8)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463368058593023349135n); + input.add8(8n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(1329227995784915872903781478878997457n); + }); + + it('test operator "shr" overload (euint128, euint8) => euint128 test 2 (4, 8)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(4n); + input.add8(8n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint128, euint8) => euint128 test 3 (8, 8)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(8n); + input.add8(8n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint128, euint8) => euint128 test 4 (8, 4)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(8n); + input.add8(4n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint128, uint8) => euint128 test 1 (340282366920938463463368058593023349135, 8)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463368058593023349135n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(1329227995784915872903781478878997457n); + }); + + it('test operator "shr" overload (euint128, uint8) => euint128 test 2 (4, 8)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(4n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint128, uint8) => euint128 test 3 (8, 8)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(8n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint128, uint8) => euint128 test 4 (8, 4)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(8n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint128_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "rotl" overload (euint128, euint8) => euint128 test 1 (340282366920938463463372855129143239247, 8)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463372855129143239247n); + input.add8(8n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(340282366920938463462926017959775326207n); + }); + + it('test operator "rotl" overload (euint128, euint8) => euint128 test 2 (4, 8)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(4n); + input.add8(8n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(1024n); + }); + + it('test operator "rotl" overload (euint128, euint8) => euint128 test 3 (8, 8)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(8n); + input.add8(8n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(2048n); + }); + + it('test operator "rotl" overload (euint128, euint8) => euint128 test 4 (8, 4)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(8n); + input.add8(4n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(128n); + }); + + it('test operator "rotl" overload (euint128, uint8) => euint128 test 1 (340282366920938463463372855129143239247, 8)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463372855129143239247n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(340282366920938463462926017959775326207n); + }); + + it('test operator "rotl" overload (euint128, uint8) => euint128 test 2 (4, 8)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(4n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(1024n); + }); + + it('test operator "rotl" overload (euint128, uint8) => euint128 test 3 (8, 8)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(8n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(2048n); + }); + + it('test operator "rotl" overload (euint128, uint8) => euint128 test 4 (8, 4)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(8n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint128_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(128n); + }); + + it('test operator "rotr" overload (euint128, euint8) => euint128 test 1 (340282366920938463463370215088382094223, 8)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463370215088382094223n); + input.add8(8n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(191408831393027885698148199522778266923n); + }); + + it('test operator "rotr" overload (euint128, euint8) => euint128 test 2 (4, 8)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(4n); + input.add8(8n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(5316911983139663491615228241121378304n); + }); + + it('test operator "rotr" overload (euint128, euint8) => euint128 test 3 (8, 8)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(8n); + input.add8(8n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(10633823966279326983230456482242756608n); + }); + + it('test operator "rotr" overload (euint128, euint8) => euint128 test 4 (8, 4)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(8n); + input.add8(4n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(170141183460469231731687303715884105728n); + }); + + it('test operator "rotr" overload (euint128, uint8) => euint128 test 1 (340282366920938463463370215088382094223, 8)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463370215088382094223n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(191408831393027885698148199522778266923n); + }); + + it('test operator "rotr" overload (euint128, uint8) => euint128 test 2 (4, 8)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(4n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(5316911983139663491615228241121378304n); + }); + + it('test operator "rotr" overload (euint128, uint8) => euint128 test 3 (8, 8)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(8n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(10633823966279326983230456482242756608n); + }); + + it('test operator "rotr" overload (euint128, uint8) => euint128 test 4 (8, 4)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(8n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint128_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(170141183460469231731687303715884105728n); + }); + + it('test operator "shl" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457575533077292144017, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457575533077292144017n); + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457312813166329770528n); + }); + + it('test operator "shl" overload (euint256, euint8) => euint256 test 2 (1, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(1n); + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(32n); + }); + + it('test operator "shl" overload (euint256, euint8) => euint256 test 3 (5, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(5n); + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(160n); + }); + + it('test operator "shl" overload (euint256, euint8) => euint256 test 4 (5, 1)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(5n); + input.add8(1n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(10n); + }); + + it('test operator "shl" overload (euint256, uint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457575533077292144017, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457575533077292144017n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint256_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457312813166329770528n); + }); + + it('test operator "shl" overload (euint256, uint8) => euint256 test 2 (1, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(1n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint256_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(32n); + }); + + it('test operator "shl" overload (euint256, uint8) => euint256 test 3 (5, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(5n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint256_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(160n); + }); + + it('test operator "shl" overload (euint256, uint8) => euint256 test 4 (5, 1)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(5n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shl_euint256_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(10n); + }); + + it('test operator "shr" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457583424205570957441, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457583424205570957441n); + input.add8(7n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(904625697166532776746648320380374280103671755200316906558262370501606023105n); + }); + + it('test operator "shr" overload (euint256, euint8) => euint256 test 2 (3, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(3n); + input.add8(7n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint256, euint8) => euint256 test 3 (7, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(7n); + input.add8(7n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint256, euint8) => euint256 test 4 (7, 3)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(7n); + input.add8(3n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint256, uint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457583424205570957441, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457583424205570957441n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint256_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(904625697166532776746648320380374280103671755200316906558262370501606023105n); + }); + + it('test operator "shr" overload (euint256, uint8) => euint256 test 2 (3, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(3n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint256_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint256, uint8) => euint256 test 3 (7, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(7n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint256_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(0n); + }); + + it('test operator "shr" overload (euint256, uint8) => euint256 test 4 (7, 3)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(7n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.shr_euint256_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(0n); + }); + + it('test operator "rotl" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457576986201167983539, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457576986201167983539n); + input.add8(7n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039456685228782037621247n); + }); + + it('test operator "rotl" overload (euint256, euint8) => euint256 test 2 (3, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(3n); + input.add8(7n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(384n); + }); + + it('test operator "rotl" overload (euint256, euint8) => euint256 test 3 (7, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(7n); + input.add8(7n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(896n); + }); + + it('test operator "rotl" overload (euint256, euint8) => euint256 test 4 (7, 3)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(7n); + input.add8(3n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(56n); + }); + + it('test operator "rotl" overload (euint256, uint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457576986201167983539, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457576986201167983539n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint256_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039456685228782037621247n); + }); + + it('test operator "rotl" overload (euint256, uint8) => euint256 test 2 (3, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(3n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint256_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(384n); + }); + + it('test operator "rotl" overload (euint256, uint8) => euint256 test 3 (7, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(7n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint256_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(896n); + }); + + it('test operator "rotl" overload (euint256, uint8) => euint256 test 4 (7, 3)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(7n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotl_euint256_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(56n); + }); + + it('test operator "rotr" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582037796693705747, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457582037796693705747n); + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(72370055773322622139731865630429942408293740416025352524660989943379567402016n); + }); + + it('test operator "rotr" overload (euint256, euint8) => euint256 test 2 (1, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(1n); + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(3618502788666131106986593281521497120414687020801267626233049500247285301248n); + }); + + it('test operator "rotr" overload (euint256, euint8) => euint256 test 3 (5, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(5n); + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(18092513943330655534932966407607485602073435104006338131165247501236426506240n); + }); + + it('test operator "rotr" overload (euint256, euint8) => euint256 test 4 (5, 1)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(5n); + input.add8(1n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(57896044618658097711785492504343953926634992332820282019728792003956564819970n); + }); + + it('test operator "rotr" overload (euint256, uint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582037796693705747, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457582037796693705747n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint256_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(72370055773322622139731865630429942408293740416025352524660989943379567402016n); + }); + + it('test operator "rotr" overload (euint256, uint8) => euint256 test 2 (1, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(1n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint256_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(3618502788666131106986593281521497120414687020801267626233049500247285301248n); + }); + + it('test operator "rotr" overload (euint256, uint8) => euint256 test 3 (5, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(5n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint256_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(18092513943330655534932966407607485602073435104006338131165247501236426506240n); + }); + + it('test operator "rotr" overload (euint256, uint8) => euint256 test 4 (5, 1)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(5n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.rotr_euint256_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(57896044618658097711785492504343953926634992332820282019728792003956564819970n); + }); + + it('test operator "neg" overload (euint8) => euint8 test 1 (213)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(213n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.neg_euint8(encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(43n); + }); + + it('test operator "not" overload (euint8) => euint8 test 1 (70)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add8(70n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.not_euint8(encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract7.resEuint8()); + expect(res).to.equal(185n); + }); + + it('test operator "neg" overload (euint16) => euint16 test 1 (43386)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(43386n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.neg_euint16(encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(22150n); + }); + + it('test operator "not" overload (euint16) => euint16 test 1 (24528)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add16(24528n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.not_euint16(encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract7.resEuint16()); + expect(res).to.equal(41007n); + }); + + it('test operator "neg" overload (euint32) => euint32 test 1 (1581481030)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(1581481030n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.neg_euint32(encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(2713486266n); + }); + + it('test operator "not" overload (euint32) => euint32 test 1 (3984966127)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add32(3984966127n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.not_euint32(encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt32(await this.contract7.resEuint32()); + expect(res).to.equal(310001168n); + }); + + it('test operator "neg" overload (euint64) => euint64 test 1 (18439558102475769465)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(18439558102475769465n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.neg_euint64(encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(7185971233782151n); + }); + + it('test operator "not" overload (euint64) => euint64 test 1 (18443964035879508429)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add64(18443964035879508429n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.not_euint64(encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt64(await this.contract7.resEuint64()); + expect(res).to.equal(2780037830043186n); + }); + + it('test operator "neg" overload (euint128) => euint128 test 1 (340282366920938463463372565413896228509)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463372565413896228509n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.neg_euint128(encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(2042017871982947n); + }); + + it('test operator "not" overload (euint128) => euint128 test 1 (340282366920938463463368201446256659293)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add128(340282366920938463463368201446256659293n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.not_euint128(encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt128(await this.contract7.resEuint128()); + expect(res).to.equal(6405985511552162n); + }); + + it('test operator "neg" overload (euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457581745298896656089)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457581745298896656089n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.neg_euint256(encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(2262614232983847n); + }); +}); diff --git a/contracts/test/httpzOperations/httpzOperations13.ts b/contracts/test/httpzOperations/httpzOperations13.ts new file mode 100644 index 00000000..fe915fd2 --- /dev/null +++ b/contracts/test/httpzOperations/httpzOperations13.ts @@ -0,0 +1,146 @@ +import { expect } from 'chai'; +import { ethers } from 'hardhat'; + +import type { HTTPZTestSuite1 } from '../../types/contracts/tests/HTTPZTestSuite1'; +import type { HTTPZTestSuite2 } from '../../types/contracts/tests/HTTPZTestSuite2'; +import type { HTTPZTestSuite3 } from '../../types/contracts/tests/HTTPZTestSuite3'; +import type { HTTPZTestSuite4 } from '../../types/contracts/tests/HTTPZTestSuite4'; +import type { HTTPZTestSuite5 } from '../../types/contracts/tests/HTTPZTestSuite5'; +import type { HTTPZTestSuite6 } from '../../types/contracts/tests/HTTPZTestSuite6'; +import type { HTTPZTestSuite7 } from '../../types/contracts/tests/HTTPZTestSuite7'; +import { + createInstances, + decrypt8, + decrypt16, + decrypt32, + decrypt64, + decrypt128, + decrypt256, + decryptBool, +} from '../instance'; +import { getSigners, initSigners } from '../signers'; + +async function deployHTTPZTestFixture1(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite1'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture2(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite2'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture3(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite3'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture4(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite4'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture5(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite5'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture6(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite6'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture7(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite7'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +describe('HTTPZ operations 13', function () { + before(async function () { + await initSigners(1); + this.signers = await getSigners(); + + const contract1 = await deployHTTPZTestFixture1(); + this.contract1Address = await contract1.getAddress(); + this.contract1 = contract1; + + const contract2 = await deployHTTPZTestFixture2(); + this.contract2Address = await contract2.getAddress(); + this.contract2 = contract2; + + const contract3 = await deployHTTPZTestFixture3(); + this.contract3Address = await contract3.getAddress(); + this.contract3 = contract3; + + const contract4 = await deployHTTPZTestFixture4(); + this.contract4Address = await contract4.getAddress(); + this.contract4 = contract4; + + const contract5 = await deployHTTPZTestFixture5(); + this.contract5Address = await contract5.getAddress(); + this.contract5 = contract5; + + const contract6 = await deployHTTPZTestFixture6(); + this.contract6Address = await contract6.getAddress(); + this.contract6 = contract6; + + const contract7 = await deployHTTPZTestFixture7(); + this.contract7Address = await contract7.getAddress(); + this.contract7 = contract7; + + const instances = await createInstances(this.signers); + this.instances = instances; + }); + + it('test operator "not" overload (euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457581150057291659403)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457581150057291659403n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract7.not_euint256(encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt256(await this.contract7.resEuint256()); + expect(res).to.equal(2857855837980532n); + }); +}); diff --git a/contracts/test/httpzOperations/httpzOperations2.ts b/contracts/test/httpzOperations/httpzOperations2.ts new file mode 100644 index 00000000..db15f79c --- /dev/null +++ b/contracts/test/httpzOperations/httpzOperations2.ts @@ -0,0 +1,3166 @@ +import { expect } from 'chai'; +import { ethers } from 'hardhat'; + +import type { HTTPZTestSuite1 } from '../../types/contracts/tests/HTTPZTestSuite1'; +import type { HTTPZTestSuite2 } from '../../types/contracts/tests/HTTPZTestSuite2'; +import type { HTTPZTestSuite3 } from '../../types/contracts/tests/HTTPZTestSuite3'; +import type { HTTPZTestSuite4 } from '../../types/contracts/tests/HTTPZTestSuite4'; +import type { HTTPZTestSuite5 } from '../../types/contracts/tests/HTTPZTestSuite5'; +import type { HTTPZTestSuite6 } from '../../types/contracts/tests/HTTPZTestSuite6'; +import type { HTTPZTestSuite7 } from '../../types/contracts/tests/HTTPZTestSuite7'; +import { + createInstances, + decrypt8, + decrypt16, + decrypt32, + decrypt64, + decrypt128, + decrypt256, + decryptBool, +} from '../instance'; +import { getSigners, initSigners } from '../signers'; + +async function deployHTTPZTestFixture1(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite1'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture2(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite2'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture3(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite3'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture4(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite4'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture5(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite5'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture6(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite6'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture7(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite7'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +describe('HTTPZ operations 2', function () { + before(async function () { + await initSigners(1); + this.signers = await getSigners(); + + const contract1 = await deployHTTPZTestFixture1(); + this.contract1Address = await contract1.getAddress(); + this.contract1 = contract1; + + const contract2 = await deployHTTPZTestFixture2(); + this.contract2Address = await contract2.getAddress(); + this.contract2 = contract2; + + const contract3 = await deployHTTPZTestFixture3(); + this.contract3Address = await contract3.getAddress(); + this.contract3 = contract3; + + const contract4 = await deployHTTPZTestFixture4(); + this.contract4Address = await contract4.getAddress(); + this.contract4 = contract4; + + const contract5 = await deployHTTPZTestFixture5(); + this.contract5Address = await contract5.getAddress(); + this.contract5 = contract5; + + const contract6 = await deployHTTPZTestFixture6(); + this.contract6Address = await contract6.getAddress(); + this.contract6 = contract6; + + const contract7 = await deployHTTPZTestFixture7(); + this.contract7Address = await contract7.getAddress(); + this.contract7 = contract7; + + const instances = await createInstances(this.signers); + this.instances = instances; + }); + + it('test operator "le" overload (euint8, euint64) => ebool test 1 (90, 18438297963859087279)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(90n); + input.add64(18438297963859087279n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, euint64) => ebool test 2 (86, 90)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(86n); + input.add64(90n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, euint64) => ebool test 3 (90, 90)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(90n); + input.add64(90n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, euint64) => ebool test 4 (90, 86)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(90n); + input.add64(86n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint8, euint64) => ebool test 1 (88, 18446521877933175365)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(88n); + input.add64(18446521877933175365n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint8, euint64) => ebool test 2 (84, 88)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(84n); + input.add64(88n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint8, euint64) => ebool test 3 (88, 88)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(88n); + input.add64(88n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint8, euint64) => ebool test 4 (88, 84)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(88n); + input.add64(84n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint8, euint64) => euint64 test 1 (227, 18441908445987364619)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(227n); + input.add64(18441908445987364619n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(227n); + }); + + it('test operator "min" overload (euint8, euint64) => euint64 test 2 (223, 227)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(223n); + input.add64(227n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(223n); + }); + + it('test operator "min" overload (euint8, euint64) => euint64 test 3 (227, 227)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(227n); + input.add64(227n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(227n); + }); + + it('test operator "min" overload (euint8, euint64) => euint64 test 4 (227, 223)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(227n); + input.add64(223n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(223n); + }); + + it('test operator "max" overload (euint8, euint64) => euint64 test 1 (97, 18438191137930556499)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(97n); + input.add64(18438191137930556499n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(18438191137930556499n); + }); + + it('test operator "max" overload (euint8, euint64) => euint64 test 2 (93, 97)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(93n); + input.add64(97n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(97n); + }); + + it('test operator "max" overload (euint8, euint64) => euint64 test 3 (97, 97)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(97n); + input.add64(97n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(97n); + }); + + it('test operator "max" overload (euint8, euint64) => euint64 test 4 (97, 93)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(97n); + input.add64(93n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint8_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract1.resEuint64()); + expect(res).to.equal(97n); + }); + + it('test operator "add" overload (euint8, euint128) => euint128 test 1 (2, 129)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(2n); + input.add128(129n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(131n); + }); + + it('test operator "add" overload (euint8, euint128) => euint128 test 2 (13, 17)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(13n); + input.add128(17n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(30n); + }); + + it('test operator "add" overload (euint8, euint128) => euint128 test 3 (17, 17)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(17n); + input.add128(17n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(34n); + }); + + it('test operator "add" overload (euint8, euint128) => euint128 test 4 (17, 13)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(17n); + input.add128(13n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(30n); + }); + + it('test operator "sub" overload (euint8, euint128) => euint128 test 1 (217, 217)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(217n); + input.add128(217n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.sub_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint8, euint128) => euint128 test 2 (217, 213)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(217n); + input.add128(213n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.sub_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint8, euint128) => euint128 test 1 (2, 65)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(2n); + input.add128(65n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(130n); + }); + + it('test operator "mul" overload (euint8, euint128) => euint128 test 2 (14, 15)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(14n); + input.add128(15n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(210n); + }); + + it('test operator "mul" overload (euint8, euint128) => euint128 test 3 (15, 15)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(15n); + input.add128(15n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(225n); + }); + + it('test operator "mul" overload (euint8, euint128) => euint128 test 4 (15, 14)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(15n); + input.add128(14n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(210n); + }); + + it('test operator "and" overload (euint8, euint128) => euint128 test 1 (191, 340282366920938463463374040419048401109)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(191n); + input.add128(340282366920938463463374040419048401109n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(149n); + }); + + it('test operator "and" overload (euint8, euint128) => euint128 test 2 (187, 191)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(187n); + input.add128(191n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(187n); + }); + + it('test operator "and" overload (euint8, euint128) => euint128 test 3 (191, 191)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(191n); + input.add128(191n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(191n); + }); + + it('test operator "and" overload (euint8, euint128) => euint128 test 4 (191, 187)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(191n); + input.add128(187n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(187n); + }); + + it('test operator "or" overload (euint8, euint128) => euint128 test 1 (23, 340282366920938463463366038442883400591)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(23n); + input.add128(340282366920938463463366038442883400591n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(340282366920938463463366038442883400607n); + }); + + it('test operator "or" overload (euint8, euint128) => euint128 test 2 (19, 23)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(19n); + input.add128(23n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(23n); + }); + + it('test operator "or" overload (euint8, euint128) => euint128 test 3 (23, 23)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(23n); + input.add128(23n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(23n); + }); + + it('test operator "or" overload (euint8, euint128) => euint128 test 4 (23, 19)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(23n); + input.add128(19n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(23n); + }); + + it('test operator "xor" overload (euint8, euint128) => euint128 test 1 (130, 340282366920938463463373050158110182003)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(130n); + input.add128(340282366920938463463373050158110182003n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(340282366920938463463373050158110182129n); + }); + + it('test operator "xor" overload (euint8, euint128) => euint128 test 2 (126, 130)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(126n); + input.add128(130n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(252n); + }); + + it('test operator "xor" overload (euint8, euint128) => euint128 test 3 (130, 130)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(130n); + input.add128(130n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint8, euint128) => euint128 test 4 (130, 126)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(130n); + input.add128(126n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(252n); + }); + + it('test operator "eq" overload (euint8, euint128) => ebool test 1 (7, 340282366920938463463368411234094177495)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(7n); + input.add128(340282366920938463463368411234094177495n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint8, euint128) => ebool test 2 (3, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(3n); + input.add128(7n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint8, euint128) => ebool test 3 (7, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(7n); + input.add128(7n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint8, euint128) => ebool test 4 (7, 3)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(7n); + input.add128(3n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint8, euint128) => ebool test 1 (72, 340282366920938463463366694269872923525)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(72n); + input.add128(340282366920938463463366694269872923525n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint8, euint128) => ebool test 2 (68, 72)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(68n); + input.add128(72n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint8, euint128) => ebool test 3 (72, 72)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(72n); + input.add128(72n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint8, euint128) => ebool test 4 (72, 68)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(72n); + input.add128(68n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint8, euint128) => ebool test 1 (153, 340282366920938463463367954254866198129)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(153n); + input.add128(340282366920938463463367954254866198129n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint8, euint128) => ebool test 2 (149, 153)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(149n); + input.add128(153n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint8, euint128) => ebool test 3 (153, 153)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(153n); + input.add128(153n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint8, euint128) => ebool test 4 (153, 149)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(153n); + input.add128(149n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint8, euint128) => ebool test 1 (71, 340282366920938463463373764048932092755)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(71n); + input.add128(340282366920938463463373764048932092755n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint8, euint128) => ebool test 2 (67, 71)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(67n); + input.add128(71n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint8, euint128) => ebool test 3 (71, 71)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(71n); + input.add128(71n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint8, euint128) => ebool test 4 (71, 67)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(71n); + input.add128(67n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, euint128) => ebool test 1 (233, 340282366920938463463367040635494130631)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(233n); + input.add128(340282366920938463463367040635494130631n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, euint128) => ebool test 2 (229, 233)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(229n); + input.add128(233n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, euint128) => ebool test 3 (233, 233)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(233n); + input.add128(233n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, euint128) => ebool test 4 (233, 229)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(233n); + input.add128(229n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint8, euint128) => ebool test 1 (213, 340282366920938463463372212154914249333)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(213n); + input.add128(340282366920938463463372212154914249333n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint8, euint128) => ebool test 2 (209, 213)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(209n); + input.add128(213n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint8, euint128) => ebool test 3 (213, 213)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(213n); + input.add128(213n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint8, euint128) => ebool test 4 (213, 209)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(213n); + input.add128(209n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint8, euint128) => euint128 test 1 (43, 340282366920938463463373530192485687653)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(43n); + input.add128(340282366920938463463373530192485687653n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(43n); + }); + + it('test operator "min" overload (euint8, euint128) => euint128 test 2 (39, 43)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(39n); + input.add128(43n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(39n); + }); + + it('test operator "min" overload (euint8, euint128) => euint128 test 3 (43, 43)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(43n); + input.add128(43n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(43n); + }); + + it('test operator "min" overload (euint8, euint128) => euint128 test 4 (43, 39)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(43n); + input.add128(39n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(39n); + }); + + it('test operator "max" overload (euint8, euint128) => euint128 test 1 (76, 340282366920938463463371917671943687915)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(76n); + input.add128(340282366920938463463371917671943687915n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(340282366920938463463371917671943687915n); + }); + + it('test operator "max" overload (euint8, euint128) => euint128 test 2 (72, 76)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(72n); + input.add128(76n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(76n); + }); + + it('test operator "max" overload (euint8, euint128) => euint128 test 3 (76, 76)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(76n); + input.add128(76n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(76n); + }); + + it('test operator "max" overload (euint8, euint128) => euint128 test 4 (76, 72)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(76n); + input.add128(72n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint8_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract1.resEuint128()); + expect(res).to.equal(76n); + }); + + it('test operator "and" overload (euint8, euint256) => euint256 test 1 (108, 115792089237316195423570985008687907853269984665640564039457582972291718020359)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(108n); + input.add256(115792089237316195423570985008687907853269984665640564039457582972291718020359n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract1.resEuint256()); + expect(res).to.equal(4n); + }); + + it('test operator "and" overload (euint8, euint256) => euint256 test 2 (104, 108)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(104n); + input.add256(108n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract1.resEuint256()); + expect(res).to.equal(104n); + }); + + it('test operator "and" overload (euint8, euint256) => euint256 test 3 (108, 108)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(108n); + input.add256(108n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract1.resEuint256()); + expect(res).to.equal(108n); + }); + + it('test operator "and" overload (euint8, euint256) => euint256 test 4 (108, 104)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(108n); + input.add256(104n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint8_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract1.resEuint256()); + expect(res).to.equal(104n); + }); + + it('test operator "or" overload (euint8, euint256) => euint256 test 1 (47, 115792089237316195423570985008687907853269984665640564039457578053330157035649)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(47n); + input.add256(115792089237316195423570985008687907853269984665640564039457578053330157035649n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract1.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457578053330157035695n); + }); + + it('test operator "or" overload (euint8, euint256) => euint256 test 2 (43, 47)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(43n); + input.add256(47n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract1.resEuint256()); + expect(res).to.equal(47n); + }); + + it('test operator "or" overload (euint8, euint256) => euint256 test 3 (47, 47)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(47n); + input.add256(47n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract1.resEuint256()); + expect(res).to.equal(47n); + }); + + it('test operator "or" overload (euint8, euint256) => euint256 test 4 (47, 43)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(47n); + input.add256(43n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint8_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract1.resEuint256()); + expect(res).to.equal(47n); + }); + + it('test operator "xor" overload (euint8, euint256) => euint256 test 1 (195, 115792089237316195423570985008687907853269984665640564039457575883441358637971)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(195n); + input.add256(115792089237316195423570985008687907853269984665640564039457575883441358637971n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract1.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457575883441358637904n); + }); + + it('test operator "xor" overload (euint8, euint256) => euint256 test 2 (191, 195)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(191n); + input.add256(195n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract1.resEuint256()); + expect(res).to.equal(124n); + }); + + it('test operator "xor" overload (euint8, euint256) => euint256 test 3 (195, 195)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(195n); + input.add256(195n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract1.resEuint256()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint8, euint256) => euint256 test 4 (195, 191)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(195n); + input.add256(191n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint8_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract1.resEuint256()); + expect(res).to.equal(124n); + }); + + it('test operator "eq" overload (euint8, euint256) => ebool test 1 (208, 115792089237316195423570985008687907853269984665640564039457580637726648185525)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(208n); + input.add256(115792089237316195423570985008687907853269984665640564039457580637726648185525n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint8, euint256) => ebool test 2 (204, 208)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(204n); + input.add256(208n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint8, euint256) => ebool test 3 (208, 208)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(208n); + input.add256(208n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint8, euint256) => ebool test 4 (208, 204)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(208n); + input.add256(204n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint8_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint8, euint256) => ebool test 1 (119, 115792089237316195423570985008687907853269984665640564039457577119128469149917)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(119n); + input.add256(115792089237316195423570985008687907853269984665640564039457577119128469149917n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint8, euint256) => ebool test 2 (115, 119)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(115n); + input.add256(119n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint8, euint256) => ebool test 3 (119, 119)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(119n); + input.add256(119n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint8, euint256) => ebool test 4 (119, 115)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add8(119n); + input.add256(115n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint8_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "add" overload (euint16, euint8) => euint16 test 1 (245, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(245n); + input.add8(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(247n); + }); + + it('test operator "add" overload (euint16, euint8) => euint16 test 2 (107, 109)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(107n); + input.add8(109n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(216n); + }); + + it('test operator "add" overload (euint16, euint8) => euint16 test 3 (109, 109)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(109n); + input.add8(109n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(218n); + }); + + it('test operator "add" overload (euint16, euint8) => euint16 test 4 (109, 107)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(109n); + input.add8(107n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(216n); + }); + + it('test operator "sub" overload (euint16, euint8) => euint16 test 1 (169, 169)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(169n); + input.add8(169n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.sub_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint16, euint8) => euint16 test 2 (169, 165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(169n); + input.add8(165n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.sub_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint16, euint8) => euint16 test 1 (71, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(71n); + input.add8(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(142n); + }); + + it('test operator "mul" overload (euint16, euint8) => euint16 test 2 (13, 13)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(13n); + input.add8(13n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(169n); + }); + + it('test operator "mul" overload (euint16, euint8) => euint16 test 3 (13, 13)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(13n); + input.add8(13n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(169n); + }); + + it('test operator "mul" overload (euint16, euint8) => euint16 test 4 (13, 13)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(13n); + input.add8(13n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.mul_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(169n); + }); + + it('test operator "and" overload (euint16, euint8) => euint16 test 1 (49995, 158)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(49995n); + input.add8(158n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(10n); + }); + + it('test operator "and" overload (euint16, euint8) => euint16 test 2 (154, 158)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(154n); + input.add8(158n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(154n); + }); + + it('test operator "and" overload (euint16, euint8) => euint16 test 3 (158, 158)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(158n); + input.add8(158n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(158n); + }); + + it('test operator "and" overload (euint16, euint8) => euint16 test 4 (158, 154)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(158n); + input.add8(154n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.and_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(154n); + }); + + it('test operator "or" overload (euint16, euint8) => euint16 test 1 (33806, 59)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(33806n); + input.add8(59n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(33855n); + }); + + it('test operator "or" overload (euint16, euint8) => euint16 test 2 (55, 59)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(55n); + input.add8(59n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(63n); + }); + + it('test operator "or" overload (euint16, euint8) => euint16 test 3 (59, 59)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(59n); + input.add8(59n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(59n); + }); + + it('test operator "or" overload (euint16, euint8) => euint16 test 4 (59, 55)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(59n); + input.add8(55n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.or_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(63n); + }); + + it('test operator "xor" overload (euint16, euint8) => euint16 test 1 (60451, 169)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(60451n); + input.add8(169n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(60554n); + }); + + it('test operator "xor" overload (euint16, euint8) => euint16 test 2 (165, 169)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(165n); + input.add8(169n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(12n); + }); + + it('test operator "xor" overload (euint16, euint8) => euint16 test 3 (169, 169)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(169n); + input.add8(169n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint16, euint8) => euint16 test 4 (169, 165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(169n); + input.add8(165n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.xor_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(12n); + }); + + it('test operator "eq" overload (euint16, euint8) => ebool test 1 (29383, 125)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(29383n); + input.add8(125n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint16, euint8) => ebool test 2 (121, 125)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(121n); + input.add8(125n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint16, euint8) => ebool test 3 (125, 125)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(125n); + input.add8(125n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint16, euint8) => ebool test 4 (125, 121)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(125n); + input.add8(121n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.eq_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint16, euint8) => ebool test 1 (35599, 232)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(35599n); + input.add8(232n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint16, euint8) => ebool test 2 (228, 232)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(228n); + input.add8(232n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint16, euint8) => ebool test 3 (232, 232)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(232n); + input.add8(232n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint16, euint8) => ebool test 4 (232, 228)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(232n); + input.add8(228n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ne_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint16, euint8) => ebool test 1 (43767, 135)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(43767n); + input.add8(135n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint16, euint8) => ebool test 2 (131, 135)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(131n); + input.add8(135n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint16, euint8) => ebool test 3 (135, 135)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(135n); + input.add8(135n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint16, euint8) => ebool test 4 (135, 131)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(135n); + input.add8(131n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.ge_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint16, euint8) => ebool test 1 (30481, 124)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(30481n); + input.add8(124n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint16, euint8) => ebool test 2 (120, 124)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(120n); + input.add8(124n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint16, euint8) => ebool test 3 (124, 124)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(124n); + input.add8(124n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint16, euint8) => ebool test 4 (124, 120)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(124n); + input.add8(120n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.gt_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, euint8) => ebool test 1 (8585, 192)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(8585n); + input.add8(192n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (euint16, euint8) => ebool test 2 (188, 192)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(188n); + input.add8(192n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, euint8) => ebool test 3 (192, 192)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(192n); + input.add8(192n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, euint8) => ebool test 4 (192, 188)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(192n); + input.add8(188n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.le_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint16, euint8) => ebool test 1 (29177, 17)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(29177n); + input.add8(17n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint16, euint8) => ebool test 2 (13, 17)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(13n); + input.add8(17n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint16, euint8) => ebool test 3 (17, 17)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(17n); + input.add8(17n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint16, euint8) => ebool test 4 (17, 13)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(17n); + input.add8(13n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.lt_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract1.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint16, euint8) => euint16 test 1 (13173, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(13173n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(6n); + }); + + it('test operator "min" overload (euint16, euint8) => euint16 test 2 (2, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(2n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(2n); + }); + + it('test operator "min" overload (euint16, euint8) => euint16 test 3 (6, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(6n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(6n); + }); + + it('test operator "min" overload (euint16, euint8) => euint16 test 4 (6, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(6n); + input.add8(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.min_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(2n); + }); + + it('test operator "max" overload (euint16, euint8) => euint16 test 1 (39880, 158)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(39880n); + input.add8(158n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(39880n); + }); + + it('test operator "max" overload (euint16, euint8) => euint16 test 2 (154, 158)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(154n); + input.add8(158n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(158n); + }); + + it('test operator "max" overload (euint16, euint8) => euint16 test 3 (158, 158)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(158n); + input.add8(158n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(158n); + }); + + it('test operator "max" overload (euint16, euint8) => euint16 test 4 (158, 154)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(158n); + input.add8(154n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.max_euint16_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(158n); + }); + + it('test operator "add" overload (euint16, euint16) => euint16 test 1 (20179, 22507)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(20179n); + input.add16(22507n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(42686n); + }); + + it('test operator "add" overload (euint16, euint16) => euint16 test 2 (20177, 20179)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(20177n); + input.add16(20179n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(40356n); + }); + + it('test operator "add" overload (euint16, euint16) => euint16 test 3 (20179, 20179)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(20179n); + input.add16(20179n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(40358n); + }); + + it('test operator "add" overload (euint16, euint16) => euint16 test 4 (20179, 20177)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); + input.add16(20179n); + input.add16(20177n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract1.add_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract1.resEuint16()); + expect(res).to.equal(40356n); + }); + + it('test operator "sub" overload (euint16, euint16) => euint16 test 1 (4425, 4425)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(4425n); + input.add16(4425n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.sub_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint16, euint16) => euint16 test 2 (4425, 4421)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(4425n); + input.add16(4421n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.sub_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint16, euint16) => euint16 test 1 (173, 214)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(173n); + input.add16(214n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(37022n); + }); + + it('test operator "mul" overload (euint16, euint16) => euint16 test 2 (173, 173)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(173n); + input.add16(173n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(29929n); + }); + + it('test operator "mul" overload (euint16, euint16) => euint16 test 3 (173, 173)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(173n); + input.add16(173n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(29929n); + }); + + it('test operator "mul" overload (euint16, euint16) => euint16 test 4 (173, 173)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(173n); + input.add16(173n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(29929n); + }); + + it('test operator "and" overload (euint16, euint16) => euint16 test 1 (51261, 47666)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(51261n); + input.add16(47666n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(34864n); + }); + + it('test operator "and" overload (euint16, euint16) => euint16 test 2 (47662, 47666)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(47662n); + input.add16(47666n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(47650n); + }); + + it('test operator "and" overload (euint16, euint16) => euint16 test 3 (47666, 47666)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(47666n); + input.add16(47666n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(47666n); + }); + + it('test operator "and" overload (euint16, euint16) => euint16 test 4 (47666, 47662)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(47666n); + input.add16(47662n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(47650n); + }); + + it('test operator "or" overload (euint16, euint16) => euint16 test 1 (18593, 20640)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(18593n); + input.add16(20640n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(22689n); + }); + + it('test operator "or" overload (euint16, euint16) => euint16 test 2 (18589, 18593)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(18589n); + input.add16(18593n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(18621n); + }); + + it('test operator "or" overload (euint16, euint16) => euint16 test 3 (18593, 18593)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(18593n); + input.add16(18593n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(18593n); + }); + + it('test operator "or" overload (euint16, euint16) => euint16 test 4 (18593, 18589)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(18593n); + input.add16(18589n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(18621n); + }); + + it('test operator "xor" overload (euint16, euint16) => euint16 test 1 (63570, 2188)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(63570n); + input.add16(2188n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(61662n); + }); + + it('test operator "xor" overload (euint16, euint16) => euint16 test 2 (2184, 2188)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(2184n); + input.add16(2188n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint16, euint16) => euint16 test 3 (2188, 2188)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(2188n); + input.add16(2188n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint16, euint16) => euint16 test 4 (2188, 2184)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(2188n); + input.add16(2184n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(4n); + }); + + it('test operator "eq" overload (euint16, euint16) => ebool test 1 (35071, 54538)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(35071n); + input.add16(54538n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint16, euint16) => ebool test 2 (35067, 35071)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(35067n); + input.add16(35071n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint16, euint16) => ebool test 3 (35071, 35071)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(35071n); + input.add16(35071n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint16, euint16) => ebool test 4 (35071, 35067)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(35071n); + input.add16(35067n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint16, euint16) => ebool test 1 (50940, 20398)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(50940n); + input.add16(20398n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint16, euint16) => ebool test 2 (20394, 20398)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(20394n); + input.add16(20398n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint16, euint16) => ebool test 3 (20398, 20398)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(20398n); + input.add16(20398n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint16, euint16) => ebool test 4 (20398, 20394)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(20398n); + input.add16(20394n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint16, euint16) => ebool test 1 (32680, 33049)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(32680n); + input.add16(33049n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint16, euint16) => ebool test 2 (32676, 32680)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(32676n); + input.add16(32680n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint16, euint16) => ebool test 3 (32680, 32680)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(32680n); + input.add16(32680n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint16, euint16) => ebool test 4 (32680, 32676)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(32680n); + input.add16(32676n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint16, euint16) => ebool test 1 (19447, 1904)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(19447n); + input.add16(1904n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint16, euint16) => ebool test 2 (1900, 1904)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(1900n); + input.add16(1904n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint16, euint16) => ebool test 3 (1904, 1904)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(1904n); + input.add16(1904n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint16, euint16) => ebool test 4 (1904, 1900)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(1904n); + input.add16(1900n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, euint16) => ebool test 1 (31637, 34273)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(31637n); + input.add16(34273n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, euint16) => ebool test 2 (31633, 31637)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(31633n); + input.add16(31637n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, euint16) => ebool test 3 (31637, 31637)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(31637n); + input.add16(31637n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, euint16) => ebool test 4 (31637, 31633)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(31637n); + input.add16(31633n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint16, euint16) => ebool test 1 (14598, 49289)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(14598n); + input.add16(49289n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint16, euint16) => ebool test 2 (14594, 14598)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(14594n); + input.add16(14598n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint16, euint16) => ebool test 3 (14598, 14598)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(14598n); + input.add16(14598n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint16, euint16) => ebool test 4 (14598, 14594)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(14598n); + input.add16(14594n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint16, euint16) => euint16 test 1 (19936, 62626)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(19936n); + input.add16(62626n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(19936n); + }); + + it('test operator "min" overload (euint16, euint16) => euint16 test 2 (19932, 19936)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(19932n); + input.add16(19936n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(19932n); + }); + + it('test operator "min" overload (euint16, euint16) => euint16 test 3 (19936, 19936)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(19936n); + input.add16(19936n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(19936n); + }); + + it('test operator "min" overload (euint16, euint16) => euint16 test 4 (19936, 19932)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(19936n); + input.add16(19932n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(19932n); + }); + + it('test operator "max" overload (euint16, euint16) => euint16 test 1 (17099, 52695)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(17099n); + input.add16(52695n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(52695n); + }); + + it('test operator "max" overload (euint16, euint16) => euint16 test 2 (17095, 17099)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(17095n); + input.add16(17099n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(17099n); + }); + + it('test operator "max" overload (euint16, euint16) => euint16 test 3 (17099, 17099)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(17099n); + input.add16(17099n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(17099n); + }); + + it('test operator "max" overload (euint16, euint16) => euint16 test 4 (17099, 17095)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(17099n); + input.add16(17095n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint16_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt16(await this.contract2.resEuint16()); + expect(res).to.equal(17099n); + }); + + it('test operator "add" overload (euint16, euint32) => euint32 test 1 (6, 43324)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(6n); + input.add32(43324n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(43330n); + }); + + it('test operator "add" overload (euint16, euint32) => euint32 test 2 (17282, 17284)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(17282n); + input.add32(17284n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(34566n); + }); + + it('test operator "add" overload (euint16, euint32) => euint32 test 3 (17284, 17284)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(17284n); + input.add32(17284n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(34568n); + }); + + it('test operator "add" overload (euint16, euint32) => euint32 test 4 (17284, 17282)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(17284n); + input.add32(17282n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(34566n); + }); +}); diff --git a/contracts/test/httpzOperations/httpzOperations3.ts b/contracts/test/httpzOperations/httpzOperations3.ts new file mode 100644 index 00000000..c5837e0a --- /dev/null +++ b/contracts/test/httpzOperations/httpzOperations3.ts @@ -0,0 +1,3136 @@ +import { expect } from 'chai'; +import { ethers } from 'hardhat'; + +import type { HTTPZTestSuite1 } from '../../types/contracts/tests/HTTPZTestSuite1'; +import type { HTTPZTestSuite2 } from '../../types/contracts/tests/HTTPZTestSuite2'; +import type { HTTPZTestSuite3 } from '../../types/contracts/tests/HTTPZTestSuite3'; +import type { HTTPZTestSuite4 } from '../../types/contracts/tests/HTTPZTestSuite4'; +import type { HTTPZTestSuite5 } from '../../types/contracts/tests/HTTPZTestSuite5'; +import type { HTTPZTestSuite6 } from '../../types/contracts/tests/HTTPZTestSuite6'; +import type { HTTPZTestSuite7 } from '../../types/contracts/tests/HTTPZTestSuite7'; +import { + createInstances, + decrypt8, + decrypt16, + decrypt32, + decrypt64, + decrypt128, + decrypt256, + decryptBool, +} from '../instance'; +import { getSigners, initSigners } from '../signers'; + +async function deployHTTPZTestFixture1(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite1'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture2(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite2'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture3(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite3'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture4(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite4'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture5(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite5'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture6(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite6'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture7(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite7'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +describe('HTTPZ operations 3', function () { + before(async function () { + await initSigners(1); + this.signers = await getSigners(); + + const contract1 = await deployHTTPZTestFixture1(); + this.contract1Address = await contract1.getAddress(); + this.contract1 = contract1; + + const contract2 = await deployHTTPZTestFixture2(); + this.contract2Address = await contract2.getAddress(); + this.contract2 = contract2; + + const contract3 = await deployHTTPZTestFixture3(); + this.contract3Address = await contract3.getAddress(); + this.contract3 = contract3; + + const contract4 = await deployHTTPZTestFixture4(); + this.contract4Address = await contract4.getAddress(); + this.contract4 = contract4; + + const contract5 = await deployHTTPZTestFixture5(); + this.contract5Address = await contract5.getAddress(); + this.contract5 = contract5; + + const contract6 = await deployHTTPZTestFixture6(); + this.contract6Address = await contract6.getAddress(); + this.contract6 = contract6; + + const contract7 = await deployHTTPZTestFixture7(); + this.contract7Address = await contract7.getAddress(); + this.contract7 = contract7; + + const instances = await createInstances(this.signers); + this.instances = instances; + }); + + it('test operator "sub" overload (euint16, euint32) => euint32 test 1 (61451, 61451)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(61451n); + input.add32(61451n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.sub_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint16, euint32) => euint32 test 2 (61451, 61447)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(61451n); + input.add32(61447n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.sub_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint16, euint32) => euint32 test 1 (2, 20554)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(2n); + input.add32(20554n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(41108n); + }); + + it('test operator "mul" overload (euint16, euint32) => euint32 test 2 (231, 231)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(231n); + input.add32(231n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(53361n); + }); + + it('test operator "mul" overload (euint16, euint32) => euint32 test 3 (231, 231)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(231n); + input.add32(231n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(53361n); + }); + + it('test operator "mul" overload (euint16, euint32) => euint32 test 4 (231, 231)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(231n); + input.add32(231n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(53361n); + }); + + it('test operator "and" overload (euint16, euint32) => euint32 test 1 (56693, 3458877981)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(56693n); + input.add32(3458877981n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(18453n); + }); + + it('test operator "and" overload (euint16, euint32) => euint32 test 2 (56689, 56693)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(56689n); + input.add32(56693n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(56689n); + }); + + it('test operator "and" overload (euint16, euint32) => euint32 test 3 (56693, 56693)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(56693n); + input.add32(56693n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(56693n); + }); + + it('test operator "and" overload (euint16, euint32) => euint32 test 4 (56693, 56689)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(56693n); + input.add32(56689n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(56689n); + }); + + it('test operator "or" overload (euint16, euint32) => euint32 test 1 (1488, 3070575734)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(1488n); + input.add32(3070575734n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(3070576118n); + }); + + it('test operator "or" overload (euint16, euint32) => euint32 test 2 (1484, 1488)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(1484n); + input.add32(1488n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(1500n); + }); + + it('test operator "or" overload (euint16, euint32) => euint32 test 3 (1488, 1488)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(1488n); + input.add32(1488n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(1488n); + }); + + it('test operator "or" overload (euint16, euint32) => euint32 test 4 (1488, 1484)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(1488n); + input.add32(1484n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(1500n); + }); + + it('test operator "xor" overload (euint16, euint32) => euint32 test 1 (7303, 843795182)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(7303n); + input.add32(843795182n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(843798121n); + }); + + it('test operator "xor" overload (euint16, euint32) => euint32 test 2 (7299, 7303)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(7299n); + input.add32(7303n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint16, euint32) => euint32 test 3 (7303, 7303)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(7303n); + input.add32(7303n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint16, euint32) => euint32 test 4 (7303, 7299)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(7303n); + input.add32(7299n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(4n); + }); + + it('test operator "eq" overload (euint16, euint32) => ebool test 1 (3308, 2977945232)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(3308n); + input.add32(2977945232n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint16, euint32) => ebool test 2 (3304, 3308)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(3304n); + input.add32(3308n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint16, euint32) => ebool test 3 (3308, 3308)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(3308n); + input.add32(3308n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint16, euint32) => ebool test 4 (3308, 3304)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(3308n); + input.add32(3304n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint16, euint32) => ebool test 1 (62120, 3360108364)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(62120n); + input.add32(3360108364n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint16, euint32) => ebool test 2 (62116, 62120)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(62116n); + input.add32(62120n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint16, euint32) => ebool test 3 (62120, 62120)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(62120n); + input.add32(62120n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint16, euint32) => ebool test 4 (62120, 62116)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(62120n); + input.add32(62116n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint16, euint32) => ebool test 1 (55438, 3002922665)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(55438n); + input.add32(3002922665n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint16, euint32) => ebool test 2 (55434, 55438)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(55434n); + input.add32(55438n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint16, euint32) => ebool test 3 (55438, 55438)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(55438n); + input.add32(55438n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint16, euint32) => ebool test 4 (55438, 55434)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(55438n); + input.add32(55434n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint16, euint32) => ebool test 1 (6897, 3622955815)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(6897n); + input.add32(3622955815n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint16, euint32) => ebool test 2 (6893, 6897)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(6893n); + input.add32(6897n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint16, euint32) => ebool test 3 (6897, 6897)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(6897n); + input.add32(6897n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint16, euint32) => ebool test 4 (6897, 6893)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(6897n); + input.add32(6893n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, euint32) => ebool test 1 (59060, 2713852098)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(59060n); + input.add32(2713852098n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, euint32) => ebool test 2 (59056, 59060)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(59056n); + input.add32(59060n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, euint32) => ebool test 3 (59060, 59060)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(59060n); + input.add32(59060n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, euint32) => ebool test 4 (59060, 59056)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(59060n); + input.add32(59056n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint16, euint32) => ebool test 1 (6769, 1670762731)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(6769n); + input.add32(1670762731n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint16, euint32) => ebool test 2 (6765, 6769)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(6765n); + input.add32(6769n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint16, euint32) => ebool test 3 (6769, 6769)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(6769n); + input.add32(6769n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint16, euint32) => ebool test 4 (6769, 6765)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(6769n); + input.add32(6765n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint16, euint32) => euint32 test 1 (56295, 3721281657)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(56295n); + input.add32(3721281657n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(56295n); + }); + + it('test operator "min" overload (euint16, euint32) => euint32 test 2 (56291, 56295)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(56291n); + input.add32(56295n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(56291n); + }); + + it('test operator "min" overload (euint16, euint32) => euint32 test 3 (56295, 56295)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(56295n); + input.add32(56295n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(56295n); + }); + + it('test operator "min" overload (euint16, euint32) => euint32 test 4 (56295, 56291)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(56295n); + input.add32(56291n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(56291n); + }); + + it('test operator "max" overload (euint16, euint32) => euint32 test 1 (6788, 4057743384)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(6788n); + input.add32(4057743384n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(4057743384n); + }); + + it('test operator "max" overload (euint16, euint32) => euint32 test 2 (6784, 6788)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(6784n); + input.add32(6788n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(6788n); + }); + + it('test operator "max" overload (euint16, euint32) => euint32 test 3 (6788, 6788)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(6788n); + input.add32(6788n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(6788n); + }); + + it('test operator "max" overload (euint16, euint32) => euint32 test 4 (6788, 6784)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(6788n); + input.add32(6784n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint16_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(6788n); + }); + + it('test operator "add" overload (euint16, euint64) => euint64 test 1 (2, 32768)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(2n); + input.add64(32768n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(32770n); + }); + + it('test operator "add" overload (euint16, euint64) => euint64 test 2 (25262, 25264)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(25262n); + input.add64(25264n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(50526n); + }); + + it('test operator "add" overload (euint16, euint64) => euint64 test 3 (25264, 25264)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(25264n); + input.add64(25264n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(50528n); + }); + + it('test operator "add" overload (euint16, euint64) => euint64 test 4 (25264, 25262)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(25264n); + input.add64(25262n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(50526n); + }); + + it('test operator "sub" overload (euint16, euint64) => euint64 test 1 (62301, 62301)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(62301n); + input.add64(62301n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.sub_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint16, euint64) => euint64 test 2 (62301, 62297)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(62301n); + input.add64(62297n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.sub_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint16, euint64) => euint64 test 1 (2, 32763)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(2n); + input.add64(32763n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(65526n); + }); + + it('test operator "mul" overload (euint16, euint64) => euint64 test 2 (238, 238)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(238n); + input.add64(238n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(56644n); + }); + + it('test operator "mul" overload (euint16, euint64) => euint64 test 3 (238, 238)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(238n); + input.add64(238n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(56644n); + }); + + it('test operator "mul" overload (euint16, euint64) => euint64 test 4 (238, 238)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(238n); + input.add64(238n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(56644n); + }); + + it('test operator "and" overload (euint16, euint64) => euint64 test 1 (26345, 18441365464488148685)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(26345n); + input.add64(18441365464488148685n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(26313n); + }); + + it('test operator "and" overload (euint16, euint64) => euint64 test 2 (26341, 26345)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(26341n); + input.add64(26345n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(26337n); + }); + + it('test operator "and" overload (euint16, euint64) => euint64 test 3 (26345, 26345)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(26345n); + input.add64(26345n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(26345n); + }); + + it('test operator "and" overload (euint16, euint64) => euint64 test 4 (26345, 26341)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(26345n); + input.add64(26341n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(26337n); + }); + + it('test operator "or" overload (euint16, euint64) => euint64 test 1 (39375, 18439923293126102497)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(39375n); + input.add64(18439923293126102497n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(18439923293126106607n); + }); + + it('test operator "or" overload (euint16, euint64) => euint64 test 2 (39371, 39375)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(39371n); + input.add64(39375n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(39375n); + }); + + it('test operator "or" overload (euint16, euint64) => euint64 test 3 (39375, 39375)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(39375n); + input.add64(39375n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(39375n); + }); + + it('test operator "or" overload (euint16, euint64) => euint64 test 4 (39375, 39371)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(39375n); + input.add64(39371n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(39375n); + }); + + it('test operator "xor" overload (euint16, euint64) => euint64 test 1 (38877, 18440298414346765991)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(38877n); + input.add64(18440298414346765991n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(18440298414346735994n); + }); + + it('test operator "xor" overload (euint16, euint64) => euint64 test 2 (38873, 38877)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(38873n); + input.add64(38877n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint16, euint64) => euint64 test 3 (38877, 38877)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(38877n); + input.add64(38877n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint16, euint64) => euint64 test 4 (38877, 38873)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(38877n); + input.add64(38873n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(4n); + }); + + it('test operator "eq" overload (euint16, euint64) => ebool test 1 (24205, 18445425369723824319)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(24205n); + input.add64(18445425369723824319n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint16, euint64) => ebool test 2 (24201, 24205)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(24201n); + input.add64(24205n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint16, euint64) => ebool test 3 (24205, 24205)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(24205n); + input.add64(24205n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint16, euint64) => ebool test 4 (24205, 24201)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(24205n); + input.add64(24201n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint16, euint64) => ebool test 1 (26632, 18441890157047243027)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(26632n); + input.add64(18441890157047243027n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint16, euint64) => ebool test 2 (26628, 26632)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(26628n); + input.add64(26632n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint16, euint64) => ebool test 3 (26632, 26632)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(26632n); + input.add64(26632n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint16, euint64) => ebool test 4 (26632, 26628)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(26632n); + input.add64(26628n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint16, euint64) => ebool test 1 (16462, 18439549518967829253)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(16462n); + input.add64(18439549518967829253n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint16, euint64) => ebool test 2 (16458, 16462)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(16458n); + input.add64(16462n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint16, euint64) => ebool test 3 (16462, 16462)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(16462n); + input.add64(16462n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint16, euint64) => ebool test 4 (16462, 16458)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(16462n); + input.add64(16458n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint16, euint64) => ebool test 1 (9879, 18439282878914616563)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(9879n); + input.add64(18439282878914616563n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint16, euint64) => ebool test 2 (9875, 9879)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(9875n); + input.add64(9879n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint16, euint64) => ebool test 3 (9879, 9879)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(9879n); + input.add64(9879n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint16, euint64) => ebool test 4 (9879, 9875)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(9879n); + input.add64(9875n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, euint64) => ebool test 1 (31025, 18440514017044150133)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(31025n); + input.add64(18440514017044150133n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, euint64) => ebool test 2 (31021, 31025)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(31021n); + input.add64(31025n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, euint64) => ebool test 3 (31025, 31025)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(31025n); + input.add64(31025n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, euint64) => ebool test 4 (31025, 31021)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(31025n); + input.add64(31021n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint16, euint64) => ebool test 1 (16358, 18441920338135984401)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(16358n); + input.add64(18441920338135984401n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint16, euint64) => ebool test 2 (16354, 16358)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(16354n); + input.add64(16358n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint16, euint64) => ebool test 3 (16358, 16358)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(16358n); + input.add64(16358n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint16, euint64) => ebool test 4 (16358, 16354)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(16358n); + input.add64(16354n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint16, euint64) => euint64 test 1 (56135, 18443662682368804087)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(56135n); + input.add64(18443662682368804087n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(56135n); + }); + + it('test operator "min" overload (euint16, euint64) => euint64 test 2 (56131, 56135)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(56131n); + input.add64(56135n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(56131n); + }); + + it('test operator "min" overload (euint16, euint64) => euint64 test 3 (56135, 56135)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(56135n); + input.add64(56135n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(56135n); + }); + + it('test operator "min" overload (euint16, euint64) => euint64 test 4 (56135, 56131)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(56135n); + input.add64(56131n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(56131n); + }); + + it('test operator "max" overload (euint16, euint64) => euint64 test 1 (3079, 18445812500773983055)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(3079n); + input.add64(18445812500773983055n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(18445812500773983055n); + }); + + it('test operator "max" overload (euint16, euint64) => euint64 test 2 (3075, 3079)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(3075n); + input.add64(3079n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(3079n); + }); + + it('test operator "max" overload (euint16, euint64) => euint64 test 3 (3079, 3079)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(3079n); + input.add64(3079n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(3079n); + }); + + it('test operator "max" overload (euint16, euint64) => euint64 test 4 (3079, 3075)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(3079n); + input.add64(3075n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint16_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract2.resEuint64()); + expect(res).to.equal(3079n); + }); + + it('test operator "add" overload (euint16, euint128) => euint128 test 1 (2, 32769)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(2n); + input.add128(32769n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(32771n); + }); + + it('test operator "add" overload (euint16, euint128) => euint128 test 2 (23856, 23860)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(23856n); + input.add128(23860n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(47716n); + }); + + it('test operator "add" overload (euint16, euint128) => euint128 test 3 (23860, 23860)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(23860n); + input.add128(23860n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(47720n); + }); + + it('test operator "add" overload (euint16, euint128) => euint128 test 4 (23860, 23856)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(23860n); + input.add128(23856n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(47716n); + }); + + it('test operator "sub" overload (euint16, euint128) => euint128 test 1 (21495, 21495)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(21495n); + input.add128(21495n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.sub_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint16, euint128) => euint128 test 2 (21495, 21491)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(21495n); + input.add128(21491n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.sub_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint16, euint128) => euint128 test 1 (2, 16385)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(2n); + input.add128(16385n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(32770n); + }); + + it('test operator "mul" overload (euint16, euint128) => euint128 test 2 (165, 165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(165n); + input.add128(165n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(27225n); + }); + + it('test operator "mul" overload (euint16, euint128) => euint128 test 3 (165, 165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(165n); + input.add128(165n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(27225n); + }); + + it('test operator "mul" overload (euint16, euint128) => euint128 test 4 (165, 165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(165n); + input.add128(165n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(27225n); + }); + + it('test operator "and" overload (euint16, euint128) => euint128 test 1 (10952, 340282366920938463463372111661659699131)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(10952n); + input.add128(340282366920938463463372111661659699131n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(8840n); + }); + + it('test operator "and" overload (euint16, euint128) => euint128 test 2 (10948, 10952)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(10948n); + input.add128(10952n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(10944n); + }); + + it('test operator "and" overload (euint16, euint128) => euint128 test 3 (10952, 10952)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(10952n); + input.add128(10952n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(10952n); + }); + + it('test operator "and" overload (euint16, euint128) => euint128 test 4 (10952, 10948)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(10952n); + input.add128(10948n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(10944n); + }); + + it('test operator "or" overload (euint16, euint128) => euint128 test 1 (39332, 340282366920938463463365862083385906483)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(39332n); + input.add128(340282366920938463463365862083385906483n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(340282366920938463463365862083385941431n); + }); + + it('test operator "or" overload (euint16, euint128) => euint128 test 2 (39328, 39332)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(39328n); + input.add128(39332n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(39332n); + }); + + it('test operator "or" overload (euint16, euint128) => euint128 test 3 (39332, 39332)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(39332n); + input.add128(39332n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(39332n); + }); + + it('test operator "or" overload (euint16, euint128) => euint128 test 4 (39332, 39328)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(39332n); + input.add128(39328n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(39332n); + }); + + it('test operator "xor" overload (euint16, euint128) => euint128 test 1 (23566, 340282366920938463463374210644303597911)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(23566n); + input.add128(340282366920938463463374210644303597911n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(340282366920938463463374210644303580505n); + }); + + it('test operator "xor" overload (euint16, euint128) => euint128 test 2 (23562, 23566)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(23562n); + input.add128(23566n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint16, euint128) => euint128 test 3 (23566, 23566)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(23566n); + input.add128(23566n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint16, euint128) => euint128 test 4 (23566, 23562)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(23566n); + input.add128(23562n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(4n); + }); + + it('test operator "eq" overload (euint16, euint128) => ebool test 1 (24741, 340282366920938463463373097105911241109)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(24741n); + input.add128(340282366920938463463373097105911241109n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint16, euint128) => ebool test 2 (24737, 24741)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(24737n); + input.add128(24741n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint16, euint128) => ebool test 3 (24741, 24741)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(24741n); + input.add128(24741n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint16, euint128) => ebool test 4 (24741, 24737)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(24741n); + input.add128(24737n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint16, euint128) => ebool test 1 (5994, 340282366920938463463366746734581371503)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(5994n); + input.add128(340282366920938463463366746734581371503n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint16, euint128) => ebool test 2 (5990, 5994)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(5990n); + input.add128(5994n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint16, euint128) => ebool test 3 (5994, 5994)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(5994n); + input.add128(5994n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint16, euint128) => ebool test 4 (5994, 5990)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(5994n); + input.add128(5990n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint16, euint128) => ebool test 1 (43914, 340282366920938463463366515577562770635)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(43914n); + input.add128(340282366920938463463366515577562770635n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint16, euint128) => ebool test 2 (43910, 43914)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(43910n); + input.add128(43914n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint16, euint128) => ebool test 3 (43914, 43914)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(43914n); + input.add128(43914n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint16, euint128) => ebool test 4 (43914, 43910)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(43914n); + input.add128(43910n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint16, euint128) => ebool test 1 (51844, 340282366920938463463372009337697808779)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(51844n); + input.add128(340282366920938463463372009337697808779n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint16, euint128) => ebool test 2 (51840, 51844)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(51840n); + input.add128(51844n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint16, euint128) => ebool test 3 (51844, 51844)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(51844n); + input.add128(51844n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint16, euint128) => ebool test 4 (51844, 51840)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(51844n); + input.add128(51840n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, euint128) => ebool test 1 (24640, 340282366920938463463371272981898252279)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(24640n); + input.add128(340282366920938463463371272981898252279n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, euint128) => ebool test 2 (24636, 24640)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(24636n); + input.add128(24640n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, euint128) => ebool test 3 (24640, 24640)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(24640n); + input.add128(24640n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, euint128) => ebool test 4 (24640, 24636)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(24640n); + input.add128(24636n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint16, euint128) => ebool test 1 (21730, 340282366920938463463368089425255735781)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(21730n); + input.add128(340282366920938463463368089425255735781n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint16, euint128) => ebool test 2 (21726, 21730)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(21726n); + input.add128(21730n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint16, euint128) => ebool test 3 (21730, 21730)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(21730n); + input.add128(21730n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint16, euint128) => ebool test 4 (21730, 21726)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(21730n); + input.add128(21726n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint16, euint128) => euint128 test 1 (54059, 340282366920938463463374197067570584749)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(54059n); + input.add128(340282366920938463463374197067570584749n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(54059n); + }); + + it('test operator "min" overload (euint16, euint128) => euint128 test 2 (54055, 54059)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(54055n); + input.add128(54059n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(54055n); + }); + + it('test operator "min" overload (euint16, euint128) => euint128 test 3 (54059, 54059)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(54059n); + input.add128(54059n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(54059n); + }); + + it('test operator "min" overload (euint16, euint128) => euint128 test 4 (54059, 54055)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(54059n); + input.add128(54055n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(54055n); + }); + + it('test operator "max" overload (euint16, euint128) => euint128 test 1 (20316, 340282366920938463463368293195715071287)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(20316n); + input.add128(340282366920938463463368293195715071287n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(340282366920938463463368293195715071287n); + }); + + it('test operator "max" overload (euint16, euint128) => euint128 test 2 (20312, 20316)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(20312n); + input.add128(20316n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(20316n); + }); + + it('test operator "max" overload (euint16, euint128) => euint128 test 3 (20316, 20316)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(20316n); + input.add128(20316n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(20316n); + }); + + it('test operator "max" overload (euint16, euint128) => euint128 test 4 (20316, 20312)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(20316n); + input.add128(20312n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint16_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract2.resEuint128()); + expect(res).to.equal(20316n); + }); + + it('test operator "and" overload (euint16, euint256) => euint256 test 1 (39328, 115792089237316195423570985008687907853269984665640564039457576182784442365803)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(39328n); + input.add256(115792089237316195423570985008687907853269984665640564039457576182784442365803n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint16_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract2.resEuint256()); + expect(res).to.equal(37152n); + }); + + it('test operator "and" overload (euint16, euint256) => euint256 test 2 (39324, 39328)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(39324n); + input.add256(39328n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint16_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract2.resEuint256()); + expect(res).to.equal(39296n); + }); + + it('test operator "and" overload (euint16, euint256) => euint256 test 3 (39328, 39328)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(39328n); + input.add256(39328n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint16_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract2.resEuint256()); + expect(res).to.equal(39328n); + }); + + it('test operator "and" overload (euint16, euint256) => euint256 test 4 (39328, 39324)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(39328n); + input.add256(39324n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint16_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract2.resEuint256()); + expect(res).to.equal(39296n); + }); + + it('test operator "or" overload (euint16, euint256) => euint256 test 1 (24612, 115792089237316195423570985008687907853269984665640564039457579237872115900485)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(24612n); + input.add256(115792089237316195423570985008687907853269984665640564039457579237872115900485n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint16_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract2.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579237872115900517n); + }); + + it('test operator "or" overload (euint16, euint256) => euint256 test 2 (24608, 24612)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(24608n); + input.add256(24612n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint16_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract2.resEuint256()); + expect(res).to.equal(24612n); + }); + + it('test operator "or" overload (euint16, euint256) => euint256 test 3 (24612, 24612)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(24612n); + input.add256(24612n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint16_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract2.resEuint256()); + expect(res).to.equal(24612n); + }); + + it('test operator "or" overload (euint16, euint256) => euint256 test 4 (24612, 24608)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(24612n); + input.add256(24608n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint16_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract2.resEuint256()); + expect(res).to.equal(24612n); + }); + + it('test operator "xor" overload (euint16, euint256) => euint256 test 1 (31908, 115792089237316195423570985008687907853269984665640564039457581200159026084239)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(31908n); + input.add256(115792089237316195423570985008687907853269984665640564039457581200159026084239n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint16_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract2.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457581200159026054443n); + }); + + it('test operator "xor" overload (euint16, euint256) => euint256 test 2 (31904, 31908)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(31904n); + input.add256(31908n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint16_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract2.resEuint256()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint16, euint256) => euint256 test 3 (31908, 31908)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(31908n); + input.add256(31908n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint16_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract2.resEuint256()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint16, euint256) => euint256 test 4 (31908, 31904)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(31908n); + input.add256(31904n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint16_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract2.resEuint256()); + expect(res).to.equal(4n); + }); + + it('test operator "eq" overload (euint16, euint256) => ebool test 1 (32319, 115792089237316195423570985008687907853269984665640564039457582204906695780495)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(32319n); + input.add256(115792089237316195423570985008687907853269984665640564039457582204906695780495n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint16_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint16, euint256) => ebool test 2 (32315, 32319)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(32315n); + input.add256(32319n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint16_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint16, euint256) => ebool test 3 (32319, 32319)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(32319n); + input.add256(32319n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint16_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint16, euint256) => ebool test 4 (32319, 32315)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(32319n); + input.add256(32315n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint16_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint16, euint256) => ebool test 1 (60957, 115792089237316195423570985008687907853269984665640564039457576788314992437787)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(60957n); + input.add256(115792089237316195423570985008687907853269984665640564039457576788314992437787n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint16_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint16, euint256) => ebool test 2 (60953, 60957)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(60953n); + input.add256(60957n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint16_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint16, euint256) => ebool test 3 (60957, 60957)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(60957n); + input.add256(60957n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint16_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint16, euint256) => ebool test 4 (60957, 60953)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add16(60957n); + input.add256(60953n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint16_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "add" overload (euint32, euint8) => euint32 test 1 (175, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(175n); + input.add8(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(177n); + }); + + it('test operator "add" overload (euint32, euint8) => euint32 test 2 (120, 122)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(120n); + input.add8(122n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(242n); + }); + + it('test operator "add" overload (euint32, euint8) => euint32 test 3 (122, 122)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(122n); + input.add8(122n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(244n); + }); + + it('test operator "add" overload (euint32, euint8) => euint32 test 4 (122, 120)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(122n); + input.add8(120n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(242n); + }); + + it('test operator "sub" overload (euint32, euint8) => euint32 test 1 (206, 206)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(206n); + input.add8(206n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.sub_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint32, euint8) => euint32 test 2 (206, 202)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(206n); + input.add8(202n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.sub_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint32, euint8) => euint32 test 1 (80, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(80n); + input.add8(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(160n); + }); + + it('test operator "mul" overload (euint32, euint8) => euint32 test 2 (12, 12)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(12n); + input.add8(12n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(144n); + }); + + it('test operator "mul" overload (euint32, euint8) => euint32 test 3 (12, 12)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(12n); + input.add8(12n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(144n); + }); + + it('test operator "mul" overload (euint32, euint8) => euint32 test 4 (12, 12)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(12n); + input.add8(12n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(144n); + }); + + it('test operator "and" overload (euint32, euint8) => euint32 test 1 (579939126, 60)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(579939126n); + input.add8(60n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(52n); + }); + + it('test operator "and" overload (euint32, euint8) => euint32 test 2 (56, 60)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(56n); + input.add8(60n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(56n); + }); + + it('test operator "and" overload (euint32, euint8) => euint32 test 3 (60, 60)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(60n); + input.add8(60n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(60n); + }); + + it('test operator "and" overload (euint32, euint8) => euint32 test 4 (60, 56)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(60n); + input.add8(56n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(56n); + }); + + it('test operator "or" overload (euint32, euint8) => euint32 test 1 (855863383, 112)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(855863383n); + input.add8(112n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(855863415n); + }); + + it('test operator "or" overload (euint32, euint8) => euint32 test 2 (108, 112)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(108n); + input.add8(112n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(124n); + }); + + it('test operator "or" overload (euint32, euint8) => euint32 test 3 (112, 112)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(112n); + input.add8(112n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(112n); + }); + + it('test operator "or" overload (euint32, euint8) => euint32 test 4 (112, 108)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(112n); + input.add8(108n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(124n); + }); + + it('test operator "xor" overload (euint32, euint8) => euint32 test 1 (2307778186, 220)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(2307778186n); + input.add8(220n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(2307778134n); + }); + + it('test operator "xor" overload (euint32, euint8) => euint32 test 2 (216, 220)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(216n); + input.add8(220n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint32, euint8) => euint32 test 3 (220, 220)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(220n); + input.add8(220n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint32, euint8) => euint32 test 4 (220, 216)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(220n); + input.add8(216n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(4n); + }); +}); diff --git a/contracts/test/httpzOperations/httpzOperations4.ts b/contracts/test/httpzOperations/httpzOperations4.ts new file mode 100644 index 00000000..015e5d48 --- /dev/null +++ b/contracts/test/httpzOperations/httpzOperations4.ts @@ -0,0 +1,3136 @@ +import { expect } from 'chai'; +import { ethers } from 'hardhat'; + +import type { HTTPZTestSuite1 } from '../../types/contracts/tests/HTTPZTestSuite1'; +import type { HTTPZTestSuite2 } from '../../types/contracts/tests/HTTPZTestSuite2'; +import type { HTTPZTestSuite3 } from '../../types/contracts/tests/HTTPZTestSuite3'; +import type { HTTPZTestSuite4 } from '../../types/contracts/tests/HTTPZTestSuite4'; +import type { HTTPZTestSuite5 } from '../../types/contracts/tests/HTTPZTestSuite5'; +import type { HTTPZTestSuite6 } from '../../types/contracts/tests/HTTPZTestSuite6'; +import type { HTTPZTestSuite7 } from '../../types/contracts/tests/HTTPZTestSuite7'; +import { + createInstances, + decrypt8, + decrypt16, + decrypt32, + decrypt64, + decrypt128, + decrypt256, + decryptBool, +} from '../instance'; +import { getSigners, initSigners } from '../signers'; + +async function deployHTTPZTestFixture1(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite1'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture2(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite2'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture3(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite3'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture4(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite4'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture5(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite5'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture6(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite6'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture7(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite7'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +describe('HTTPZ operations 4', function () { + before(async function () { + await initSigners(1); + this.signers = await getSigners(); + + const contract1 = await deployHTTPZTestFixture1(); + this.contract1Address = await contract1.getAddress(); + this.contract1 = contract1; + + const contract2 = await deployHTTPZTestFixture2(); + this.contract2Address = await contract2.getAddress(); + this.contract2 = contract2; + + const contract3 = await deployHTTPZTestFixture3(); + this.contract3Address = await contract3.getAddress(); + this.contract3 = contract3; + + const contract4 = await deployHTTPZTestFixture4(); + this.contract4Address = await contract4.getAddress(); + this.contract4 = contract4; + + const contract5 = await deployHTTPZTestFixture5(); + this.contract5Address = await contract5.getAddress(); + this.contract5 = contract5; + + const contract6 = await deployHTTPZTestFixture6(); + this.contract6Address = await contract6.getAddress(); + this.contract6 = contract6; + + const contract7 = await deployHTTPZTestFixture7(); + this.contract7Address = await contract7.getAddress(); + this.contract7 = contract7; + + const instances = await createInstances(this.signers); + this.instances = instances; + }); + + it('test operator "eq" overload (euint32, euint8) => ebool test 1 (2411999354, 130)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(2411999354n); + input.add8(130n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint32, euint8) => ebool test 2 (126, 130)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(126n); + input.add8(130n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint32, euint8) => ebool test 3 (130, 130)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(130n); + input.add8(130n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint32, euint8) => ebool test 4 (130, 126)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(130n); + input.add8(126n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint32, euint8) => ebool test 1 (3543355935, 201)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(3543355935n); + input.add8(201n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint32, euint8) => ebool test 2 (197, 201)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(197n); + input.add8(201n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint32, euint8) => ebool test 3 (201, 201)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(201n); + input.add8(201n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint32, euint8) => ebool test 4 (201, 197)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(201n); + input.add8(197n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint32, euint8) => ebool test 1 (2988441607, 223)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(2988441607n); + input.add8(223n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint32, euint8) => ebool test 2 (219, 223)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(219n); + input.add8(223n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint32, euint8) => ebool test 3 (223, 223)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(223n); + input.add8(223n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint32, euint8) => ebool test 4 (223, 219)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(223n); + input.add8(219n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint32, euint8) => ebool test 1 (3280202622, 32)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(3280202622n); + input.add8(32n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint32, euint8) => ebool test 2 (28, 32)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(28n); + input.add8(32n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint32, euint8) => ebool test 3 (32, 32)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(32n); + input.add8(32n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint32, euint8) => ebool test 4 (32, 28)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(32n); + input.add8(28n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, euint8) => ebool test 1 (4028456546, 181)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(4028456546n); + input.add8(181n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (euint32, euint8) => ebool test 2 (177, 181)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(177n); + input.add8(181n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, euint8) => ebool test 3 (181, 181)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(181n); + input.add8(181n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, euint8) => ebool test 4 (181, 177)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(181n); + input.add8(177n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint32, euint8) => ebool test 1 (1593566873, 107)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(1593566873n); + input.add8(107n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint32, euint8) => ebool test 2 (103, 107)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(103n); + input.add8(107n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint32, euint8) => ebool test 3 (107, 107)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(107n); + input.add8(107n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint32, euint8) => ebool test 4 (107, 103)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(107n); + input.add8(103n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint32, euint8) => euint32 test 1 (2210267978, 12)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(2210267978n); + input.add8(12n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(12n); + }); + + it('test operator "min" overload (euint32, euint8) => euint32 test 2 (8, 12)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(8n); + input.add8(12n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(8n); + }); + + it('test operator "min" overload (euint32, euint8) => euint32 test 3 (12, 12)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(12n); + input.add8(12n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(12n); + }); + + it('test operator "min" overload (euint32, euint8) => euint32 test 4 (12, 8)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(12n); + input.add8(8n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(8n); + }); + + it('test operator "max" overload (euint32, euint8) => euint32 test 1 (3233243527, 205)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(3233243527n); + input.add8(205n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(3233243527n); + }); + + it('test operator "max" overload (euint32, euint8) => euint32 test 2 (201, 205)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(201n); + input.add8(205n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(205n); + }); + + it('test operator "max" overload (euint32, euint8) => euint32 test 3 (205, 205)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(205n); + input.add8(205n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(205n); + }); + + it('test operator "max" overload (euint32, euint8) => euint32 test 4 (205, 201)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(205n); + input.add8(201n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint32_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(205n); + }); + + it('test operator "add" overload (euint32, euint16) => euint32 test 1 (63266, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(63266n); + input.add16(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(63268n); + }); + + it('test operator "add" overload (euint32, euint16) => euint32 test 2 (9567, 9571)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(9567n); + input.add16(9571n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(19138n); + }); + + it('test operator "add" overload (euint32, euint16) => euint32 test 3 (9571, 9571)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(9571n); + input.add16(9571n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(19142n); + }); + + it('test operator "add" overload (euint32, euint16) => euint32 test 4 (9571, 9567)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(9571n); + input.add16(9567n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(19138n); + }); + + it('test operator "sub" overload (euint32, euint16) => euint32 test 1 (819, 819)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(819n); + input.add16(819n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.sub_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint32, euint16) => euint32 test 2 (819, 815)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(819n); + input.add16(815n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.sub_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint32, euint16) => euint32 test 1 (29662, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(29662n); + input.add16(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(59324n); + }); + + it('test operator "mul" overload (euint32, euint16) => euint32 test 2 (129, 129)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(129n); + input.add16(129n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(16641n); + }); + + it('test operator "mul" overload (euint32, euint16) => euint32 test 3 (129, 129)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(129n); + input.add16(129n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(16641n); + }); + + it('test operator "mul" overload (euint32, euint16) => euint32 test 4 (129, 129)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(129n); + input.add16(129n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.mul_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(16641n); + }); + + it('test operator "and" overload (euint32, euint16) => euint32 test 1 (2570562817, 37089)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(2570562817n); + input.add16(37089n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(32769n); + }); + + it('test operator "and" overload (euint32, euint16) => euint32 test 2 (37085, 37089)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(37085n); + input.add16(37089n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(37057n); + }); + + it('test operator "and" overload (euint32, euint16) => euint32 test 3 (37089, 37089)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(37089n); + input.add16(37089n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(37089n); + }); + + it('test operator "and" overload (euint32, euint16) => euint32 test 4 (37089, 37085)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(37089n); + input.add16(37085n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.and_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(37057n); + }); + + it('test operator "or" overload (euint32, euint16) => euint32 test 1 (2766072023, 63873)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(2766072023n); + input.add16(63873n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(2766076375n); + }); + + it('test operator "or" overload (euint32, euint16) => euint32 test 2 (63869, 63873)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(63869n); + input.add16(63873n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(63997n); + }); + + it('test operator "or" overload (euint32, euint16) => euint32 test 3 (63873, 63873)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(63873n); + input.add16(63873n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(63873n); + }); + + it('test operator "or" overload (euint32, euint16) => euint32 test 4 (63873, 63869)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(63873n); + input.add16(63869n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.or_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(63997n); + }); + + it('test operator "xor" overload (euint32, euint16) => euint32 test 1 (457369245, 2550)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(457369245n); + input.add16(2550n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(457371499n); + }); + + it('test operator "xor" overload (euint32, euint16) => euint32 test 2 (2546, 2550)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(2546n); + input.add16(2550n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint32, euint16) => euint32 test 3 (2550, 2550)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(2550n); + input.add16(2550n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint32, euint16) => euint32 test 4 (2550, 2546)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(2550n); + input.add16(2546n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.xor_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(4n); + }); + + it('test operator "eq" overload (euint32, euint16) => ebool test 1 (3255123358, 35209)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(3255123358n); + input.add16(35209n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint32, euint16) => ebool test 2 (35205, 35209)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(35205n); + input.add16(35209n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint32, euint16) => ebool test 3 (35209, 35209)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(35209n); + input.add16(35209n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint32, euint16) => ebool test 4 (35209, 35205)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(35209n); + input.add16(35205n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.eq_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint32, euint16) => ebool test 1 (438666754, 45637)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(438666754n); + input.add16(45637n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint32, euint16) => ebool test 2 (45633, 45637)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(45633n); + input.add16(45637n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint32, euint16) => ebool test 3 (45637, 45637)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(45637n); + input.add16(45637n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint32, euint16) => ebool test 4 (45637, 45633)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(45637n); + input.add16(45633n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ne_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint32, euint16) => ebool test 1 (3985353473, 45943)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(3985353473n); + input.add16(45943n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint32, euint16) => ebool test 2 (45939, 45943)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(45939n); + input.add16(45943n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint32, euint16) => ebool test 3 (45943, 45943)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(45943n); + input.add16(45943n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint32, euint16) => ebool test 4 (45943, 45939)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(45943n); + input.add16(45939n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.ge_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint32, euint16) => ebool test 1 (3007327967, 6148)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(3007327967n); + input.add16(6148n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint32, euint16) => ebool test 2 (6144, 6148)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(6144n); + input.add16(6148n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint32, euint16) => ebool test 3 (6148, 6148)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(6148n); + input.add16(6148n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint32, euint16) => ebool test 4 (6148, 6144)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(6148n); + input.add16(6144n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.gt_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, euint16) => ebool test 1 (3120903167, 50270)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(3120903167n); + input.add16(50270n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (euint32, euint16) => ebool test 2 (50266, 50270)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(50266n); + input.add16(50270n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, euint16) => ebool test 3 (50270, 50270)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(50270n); + input.add16(50270n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, euint16) => ebool test 4 (50270, 50266)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(50270n); + input.add16(50266n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.le_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint32, euint16) => ebool test 1 (3529119695, 10329)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(3529119695n); + input.add16(10329n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint32, euint16) => ebool test 2 (10325, 10329)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(10325n); + input.add16(10329n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint32, euint16) => ebool test 3 (10329, 10329)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(10329n); + input.add16(10329n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint32, euint16) => ebool test 4 (10329, 10325)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(10329n); + input.add16(10325n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.lt_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract2.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint32, euint16) => euint32 test 1 (865882028, 16519)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(865882028n); + input.add16(16519n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(16519n); + }); + + it('test operator "min" overload (euint32, euint16) => euint32 test 2 (16515, 16519)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(16515n); + input.add16(16519n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(16515n); + }); + + it('test operator "min" overload (euint32, euint16) => euint32 test 3 (16519, 16519)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(16519n); + input.add16(16519n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(16519n); + }); + + it('test operator "min" overload (euint32, euint16) => euint32 test 4 (16519, 16515)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(16519n); + input.add16(16515n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.min_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(16515n); + }); + + it('test operator "max" overload (euint32, euint16) => euint32 test 1 (2509827377, 49263)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(2509827377n); + input.add16(49263n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(2509827377n); + }); + + it('test operator "max" overload (euint32, euint16) => euint32 test 2 (49259, 49263)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(49259n); + input.add16(49263n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(49263n); + }); + + it('test operator "max" overload (euint32, euint16) => euint32 test 3 (49263, 49263)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(49263n); + input.add16(49263n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(49263n); + }); + + it('test operator "max" overload (euint32, euint16) => euint32 test 4 (49263, 49259)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(49263n); + input.add16(49259n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.max_euint32_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(49263n); + }); + + it('test operator "add" overload (euint32, euint32) => euint32 test 1 (506115428, 1847069894)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(506115428n); + input.add32(1847069894n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(2353185322n); + }); + + it('test operator "add" overload (euint32, euint32) => euint32 test 2 (1012230850, 1012230854)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(1012230850n); + input.add32(1012230854n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(2024461704n); + }); + + it('test operator "add" overload (euint32, euint32) => euint32 test 3 (1012230854, 1012230854)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(1012230854n); + input.add32(1012230854n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(2024461708n); + }); + + it('test operator "add" overload (euint32, euint32) => euint32 test 4 (1012230854, 1012230850)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(1012230854n); + input.add32(1012230850n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.add_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(2024461704n); + }); + + it('test operator "sub" overload (euint32, euint32) => euint32 test 1 (198498580, 198498580)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(198498580n); + input.add32(198498580n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.sub_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint32, euint32) => euint32 test 2 (198498580, 198498576)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); + input.add32(198498580n); + input.add32(198498576n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract2.sub_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract2.resEuint32()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint32, euint32) => euint32 test 1 (44032, 37165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(44032n); + input.add32(37165n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(1636449280n); + }); + + it('test operator "mul" overload (euint32, euint32) => euint32 test 2 (37165, 37165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(37165n); + input.add32(37165n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(1381237225n); + }); + + it('test operator "mul" overload (euint32, euint32) => euint32 test 3 (37165, 37165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(37165n); + input.add32(37165n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(1381237225n); + }); + + it('test operator "mul" overload (euint32, euint32) => euint32 test 4 (37165, 37165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(37165n); + input.add32(37165n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(1381237225n); + }); + + it('test operator "and" overload (euint32, euint32) => euint32 test 1 (43000343, 1183457194)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(43000343n); + input.add32(1183457194n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(41943554n); + }); + + it('test operator "and" overload (euint32, euint32) => euint32 test 2 (43000339, 43000343)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(43000339n); + input.add32(43000343n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(43000339n); + }); + + it('test operator "and" overload (euint32, euint32) => euint32 test 3 (43000343, 43000343)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(43000343n); + input.add32(43000343n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(43000343n); + }); + + it('test operator "and" overload (euint32, euint32) => euint32 test 4 (43000343, 43000339)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(43000343n); + input.add32(43000339n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(43000339n); + }); + + it('test operator "or" overload (euint32, euint32) => euint32 test 1 (1256320048, 2862417460)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1256320048n); + input.add32(2862417460n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(3942510132n); + }); + + it('test operator "or" overload (euint32, euint32) => euint32 test 2 (1256320044, 1256320048)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1256320044n); + input.add32(1256320048n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(1256320060n); + }); + + it('test operator "or" overload (euint32, euint32) => euint32 test 3 (1256320048, 1256320048)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1256320048n); + input.add32(1256320048n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(1256320048n); + }); + + it('test operator "or" overload (euint32, euint32) => euint32 test 4 (1256320048, 1256320044)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1256320048n); + input.add32(1256320044n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(1256320060n); + }); + + it('test operator "xor" overload (euint32, euint32) => euint32 test 1 (3964432894, 3636800635)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3964432894n); + input.add32(3636800635n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(881417605n); + }); + + it('test operator "xor" overload (euint32, euint32) => euint32 test 2 (3636800631, 3636800635)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3636800631n); + input.add32(3636800635n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(12n); + }); + + it('test operator "xor" overload (euint32, euint32) => euint32 test 3 (3636800635, 3636800635)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3636800635n); + input.add32(3636800635n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint32, euint32) => euint32 test 4 (3636800635, 3636800631)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3636800635n); + input.add32(3636800631n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(12n); + }); + + it('test operator "eq" overload (euint32, euint32) => ebool test 1 (2005621880, 1262678379)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2005621880n); + input.add32(1262678379n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint32, euint32) => ebool test 2 (1262678375, 1262678379)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1262678375n); + input.add32(1262678379n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint32, euint32) => ebool test 3 (1262678379, 1262678379)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1262678379n); + input.add32(1262678379n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint32, euint32) => ebool test 4 (1262678379, 1262678375)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1262678379n); + input.add32(1262678375n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint32, euint32) => ebool test 1 (284274034, 196977491)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(284274034n); + input.add32(196977491n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint32, euint32) => ebool test 2 (196977487, 196977491)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(196977487n); + input.add32(196977491n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint32, euint32) => ebool test 3 (196977491, 196977491)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(196977491n); + input.add32(196977491n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint32, euint32) => ebool test 4 (196977491, 196977487)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(196977491n); + input.add32(196977487n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint32, euint32) => ebool test 1 (1262541356, 1806139175)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1262541356n); + input.add32(1806139175n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint32, euint32) => ebool test 2 (1262541352, 1262541356)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1262541352n); + input.add32(1262541356n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint32, euint32) => ebool test 3 (1262541356, 1262541356)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1262541356n); + input.add32(1262541356n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint32, euint32) => ebool test 4 (1262541356, 1262541352)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1262541356n); + input.add32(1262541352n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint32, euint32) => ebool test 1 (167939907, 2196650786)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(167939907n); + input.add32(2196650786n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint32, euint32) => ebool test 2 (167939903, 167939907)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(167939903n); + input.add32(167939907n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint32, euint32) => ebool test 3 (167939907, 167939907)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(167939907n); + input.add32(167939907n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint32, euint32) => ebool test 4 (167939907, 167939903)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(167939907n); + input.add32(167939903n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, euint32) => ebool test 1 (2864379306, 4028104509)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2864379306n); + input.add32(4028104509n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, euint32) => ebool test 2 (2864379302, 2864379306)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2864379302n); + input.add32(2864379306n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, euint32) => ebool test 3 (2864379306, 2864379306)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2864379306n); + input.add32(2864379306n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, euint32) => ebool test 4 (2864379306, 2864379302)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2864379306n); + input.add32(2864379302n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint32, euint32) => ebool test 1 (3207735434, 1089455023)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3207735434n); + input.add32(1089455023n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint32, euint32) => ebool test 2 (1089455019, 1089455023)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1089455019n); + input.add32(1089455023n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint32, euint32) => ebool test 3 (1089455023, 1089455023)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1089455023n); + input.add32(1089455023n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint32, euint32) => ebool test 4 (1089455023, 1089455019)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1089455023n); + input.add32(1089455019n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint32, euint32) => euint32 test 1 (3916966196, 643220256)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3916966196n); + input.add32(643220256n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(643220256n); + }); + + it('test operator "min" overload (euint32, euint32) => euint32 test 2 (643220252, 643220256)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(643220252n); + input.add32(643220256n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(643220252n); + }); + + it('test operator "min" overload (euint32, euint32) => euint32 test 3 (643220256, 643220256)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(643220256n); + input.add32(643220256n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(643220256n); + }); + + it('test operator "min" overload (euint32, euint32) => euint32 test 4 (643220256, 643220252)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(643220256n); + input.add32(643220252n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(643220252n); + }); + + it('test operator "max" overload (euint32, euint32) => euint32 test 1 (3465686838, 1853095105)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3465686838n); + input.add32(1853095105n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(3465686838n); + }); + + it('test operator "max" overload (euint32, euint32) => euint32 test 2 (1853095101, 1853095105)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1853095101n); + input.add32(1853095105n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(1853095105n); + }); + + it('test operator "max" overload (euint32, euint32) => euint32 test 3 (1853095105, 1853095105)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1853095105n); + input.add32(1853095105n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(1853095105n); + }); + + it('test operator "max" overload (euint32, euint32) => euint32 test 4 (1853095105, 1853095101)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1853095105n); + input.add32(1853095101n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint32_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract3.resEuint32()); + expect(res).to.equal(1853095105n); + }); + + it('test operator "add" overload (euint32, euint64) => euint64 test 1 (2, 4293444610)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2n); + input.add64(4293444610n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(4293444612n); + }); + + it('test operator "add" overload (euint32, euint64) => euint64 test 2 (717528358, 717528362)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(717528358n); + input.add64(717528362n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(1435056720n); + }); + + it('test operator "add" overload (euint32, euint64) => euint64 test 3 (717528362, 717528362)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(717528362n); + input.add64(717528362n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(1435056724n); + }); + + it('test operator "add" overload (euint32, euint64) => euint64 test 4 (717528362, 717528358)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(717528362n); + input.add64(717528358n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(1435056720n); + }); + + it('test operator "sub" overload (euint32, euint64) => euint64 test 1 (313635140, 313635140)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(313635140n); + input.add64(313635140n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.sub_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint32, euint64) => euint64 test 2 (313635140, 313635136)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(313635140n); + input.add64(313635136n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.sub_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint32, euint64) => euint64 test 1 (2, 2147310947)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2n); + input.add64(2147310947n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(4294621894n); + }); + + it('test operator "mul" overload (euint32, euint64) => euint64 test 2 (61431, 61431)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(61431n); + input.add64(61431n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(3773767761n); + }); + + it('test operator "mul" overload (euint32, euint64) => euint64 test 3 (61431, 61431)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(61431n); + input.add64(61431n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(3773767761n); + }); + + it('test operator "mul" overload (euint32, euint64) => euint64 test 4 (61431, 61431)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(61431n); + input.add64(61431n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(3773767761n); + }); + + it('test operator "and" overload (euint32, euint64) => euint64 test 1 (2494231984, 18441827225175390281)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2494231984n); + input.add64(18441827225175390281n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(2493575168n); + }); + + it('test operator "and" overload (euint32, euint64) => euint64 test 2 (2494231980, 2494231984)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2494231980n); + input.add64(2494231984n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(2494231968n); + }); + + it('test operator "and" overload (euint32, euint64) => euint64 test 3 (2494231984, 2494231984)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2494231984n); + input.add64(2494231984n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(2494231984n); + }); + + it('test operator "and" overload (euint32, euint64) => euint64 test 4 (2494231984, 2494231980)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2494231984n); + input.add64(2494231980n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(2494231968n); + }); + + it('test operator "or" overload (euint32, euint64) => euint64 test 1 (298382834, 18441665569180862695)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(298382834n); + input.add64(18441665569180862695n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18441665569454030327n); + }); + + it('test operator "or" overload (euint32, euint64) => euint64 test 2 (298382830, 298382834)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(298382830n); + input.add64(298382834n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(298382846n); + }); + + it('test operator "or" overload (euint32, euint64) => euint64 test 3 (298382834, 298382834)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(298382834n); + input.add64(298382834n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(298382834n); + }); + + it('test operator "or" overload (euint32, euint64) => euint64 test 4 (298382834, 298382830)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(298382834n); + input.add64(298382830n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(298382846n); + }); + + it('test operator "xor" overload (euint32, euint64) => euint64 test 1 (1609689593, 18439365797864081927)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1609689593n); + input.add64(18439365797864081927n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18439365797019968510n); + }); + + it('test operator "xor" overload (euint32, euint64) => euint64 test 2 (1609689589, 1609689593)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1609689589n); + input.add64(1609689593n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(12n); + }); + + it('test operator "xor" overload (euint32, euint64) => euint64 test 3 (1609689593, 1609689593)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1609689593n); + input.add64(1609689593n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint32, euint64) => euint64 test 4 (1609689593, 1609689589)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1609689593n); + input.add64(1609689589n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(12n); + }); + + it('test operator "eq" overload (euint32, euint64) => ebool test 1 (1662791427, 18444805633266905519)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1662791427n); + input.add64(18444805633266905519n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint32, euint64) => ebool test 2 (1662791423, 1662791427)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1662791423n); + input.add64(1662791427n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint32, euint64) => ebool test 3 (1662791427, 1662791427)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1662791427n); + input.add64(1662791427n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint32, euint64) => ebool test 4 (1662791427, 1662791423)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1662791427n); + input.add64(1662791423n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint32, euint64) => ebool test 1 (3992291604, 18444784183223460553)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3992291604n); + input.add64(18444784183223460553n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint32, euint64) => ebool test 2 (3992291600, 3992291604)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3992291600n); + input.add64(3992291604n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint32, euint64) => ebool test 3 (3992291604, 3992291604)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3992291604n); + input.add64(3992291604n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint32, euint64) => ebool test 4 (3992291604, 3992291600)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3992291604n); + input.add64(3992291600n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint32, euint64) => ebool test 1 (2238177839, 18444532370929089861)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2238177839n); + input.add64(18444532370929089861n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint32, euint64) => ebool test 2 (2238177835, 2238177839)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2238177835n); + input.add64(2238177839n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint32, euint64) => ebool test 3 (2238177839, 2238177839)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2238177839n); + input.add64(2238177839n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint32, euint64) => ebool test 4 (2238177839, 2238177835)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2238177839n); + input.add64(2238177835n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint32, euint64) => ebool test 1 (1789870083, 18443587347343942947)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1789870083n); + input.add64(18443587347343942947n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint32, euint64) => ebool test 2 (1789870079, 1789870083)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1789870079n); + input.add64(1789870083n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint32, euint64) => ebool test 3 (1789870083, 1789870083)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1789870083n); + input.add64(1789870083n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint32, euint64) => ebool test 4 (1789870083, 1789870079)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1789870083n); + input.add64(1789870079n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, euint64) => ebool test 1 (1656567687, 18438821859352254195)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1656567687n); + input.add64(18438821859352254195n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, euint64) => ebool test 2 (1656567683, 1656567687)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1656567683n); + input.add64(1656567687n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, euint64) => ebool test 3 (1656567687, 1656567687)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1656567687n); + input.add64(1656567687n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, euint64) => ebool test 4 (1656567687, 1656567683)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1656567687n); + input.add64(1656567683n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint32, euint64) => ebool test 1 (359772398, 18438634634474113289)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(359772398n); + input.add64(18438634634474113289n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint32, euint64) => ebool test 2 (359772394, 359772398)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(359772394n); + input.add64(359772398n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint32, euint64) => ebool test 3 (359772398, 359772398)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(359772398n); + input.add64(359772398n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint32, euint64) => ebool test 4 (359772398, 359772394)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(359772398n); + input.add64(359772394n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint32, euint64) => euint64 test 1 (437450405, 18442228745281912255)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(437450405n); + input.add64(18442228745281912255n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(437450405n); + }); + + it('test operator "min" overload (euint32, euint64) => euint64 test 2 (437450401, 437450405)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(437450401n); + input.add64(437450405n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(437450401n); + }); + + it('test operator "min" overload (euint32, euint64) => euint64 test 3 (437450405, 437450405)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(437450405n); + input.add64(437450405n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(437450405n); + }); + + it('test operator "min" overload (euint32, euint64) => euint64 test 4 (437450405, 437450401)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(437450405n); + input.add64(437450401n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(437450401n); + }); + + it('test operator "max" overload (euint32, euint64) => euint64 test 1 (725233503, 18439049417945334905)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(725233503n); + input.add64(18439049417945334905n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18439049417945334905n); + }); + + it('test operator "max" overload (euint32, euint64) => euint64 test 2 (725233499, 725233503)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(725233499n); + input.add64(725233503n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(725233503n); + }); + + it('test operator "max" overload (euint32, euint64) => euint64 test 3 (725233503, 725233503)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(725233503n); + input.add64(725233503n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(725233503n); + }); + + it('test operator "max" overload (euint32, euint64) => euint64 test 4 (725233503, 725233499)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(725233503n); + input.add64(725233499n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint32_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(725233503n); + }); + + it('test operator "add" overload (euint32, euint128) => euint128 test 1 (2, 2147483649)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2n); + input.add128(2147483649n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(2147483651n); + }); + + it('test operator "add" overload (euint32, euint128) => euint128 test 2 (1825864700, 1825864704)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1825864700n); + input.add128(1825864704n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(3651729404n); + }); + + it('test operator "add" overload (euint32, euint128) => euint128 test 3 (1825864704, 1825864704)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1825864704n); + input.add128(1825864704n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(3651729408n); + }); + + it('test operator "add" overload (euint32, euint128) => euint128 test 4 (1825864704, 1825864700)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1825864704n); + input.add128(1825864700n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(3651729404n); + }); + + it('test operator "sub" overload (euint32, euint128) => euint128 test 1 (1709856459, 1709856459)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1709856459n); + input.add128(1709856459n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.sub_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint32, euint128) => euint128 test 2 (1709856459, 1709856455)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1709856459n); + input.add128(1709856455n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.sub_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(4n); + }); +}); diff --git a/contracts/test/httpzOperations/httpzOperations5.ts b/contracts/test/httpzOperations/httpzOperations5.ts new file mode 100644 index 00000000..df302311 --- /dev/null +++ b/contracts/test/httpzOperations/httpzOperations5.ts @@ -0,0 +1,3166 @@ +import { expect } from 'chai'; +import { ethers } from 'hardhat'; + +import type { HTTPZTestSuite1 } from '../../types/contracts/tests/HTTPZTestSuite1'; +import type { HTTPZTestSuite2 } from '../../types/contracts/tests/HTTPZTestSuite2'; +import type { HTTPZTestSuite3 } from '../../types/contracts/tests/HTTPZTestSuite3'; +import type { HTTPZTestSuite4 } from '../../types/contracts/tests/HTTPZTestSuite4'; +import type { HTTPZTestSuite5 } from '../../types/contracts/tests/HTTPZTestSuite5'; +import type { HTTPZTestSuite6 } from '../../types/contracts/tests/HTTPZTestSuite6'; +import type { HTTPZTestSuite7 } from '../../types/contracts/tests/HTTPZTestSuite7'; +import { + createInstances, + decrypt8, + decrypt16, + decrypt32, + decrypt64, + decrypt128, + decrypt256, + decryptBool, +} from '../instance'; +import { getSigners, initSigners } from '../signers'; + +async function deployHTTPZTestFixture1(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite1'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture2(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite2'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture3(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite3'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture4(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite4'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture5(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite5'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture6(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite6'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture7(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite7'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +describe('HTTPZ operations 5', function () { + before(async function () { + await initSigners(1); + this.signers = await getSigners(); + + const contract1 = await deployHTTPZTestFixture1(); + this.contract1Address = await contract1.getAddress(); + this.contract1 = contract1; + + const contract2 = await deployHTTPZTestFixture2(); + this.contract2Address = await contract2.getAddress(); + this.contract2 = contract2; + + const contract3 = await deployHTTPZTestFixture3(); + this.contract3Address = await contract3.getAddress(); + this.contract3 = contract3; + + const contract4 = await deployHTTPZTestFixture4(); + this.contract4Address = await contract4.getAddress(); + this.contract4 = contract4; + + const contract5 = await deployHTTPZTestFixture5(); + this.contract5Address = await contract5.getAddress(); + this.contract5 = contract5; + + const contract6 = await deployHTTPZTestFixture6(); + this.contract6Address = await contract6.getAddress(); + this.contract6 = contract6; + + const contract7 = await deployHTTPZTestFixture7(); + this.contract7Address = await contract7.getAddress(); + this.contract7 = contract7; + + const instances = await createInstances(this.signers); + this.instances = instances; + }); + + it('test operator "mul" overload (euint32, euint128) => euint128 test 1 (2, 1073741825)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2n); + input.add128(1073741825n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(2147483650n); + }); + + it('test operator "mul" overload (euint32, euint128) => euint128 test 2 (39395, 39395)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(39395n); + input.add128(39395n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(1551966025n); + }); + + it('test operator "mul" overload (euint32, euint128) => euint128 test 3 (39395, 39395)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(39395n); + input.add128(39395n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(1551966025n); + }); + + it('test operator "mul" overload (euint32, euint128) => euint128 test 4 (39395, 39395)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(39395n); + input.add128(39395n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(1551966025n); + }); + + it('test operator "and" overload (euint32, euint128) => euint128 test 1 (3210085055, 340282366920938463463369835647619430637)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3210085055n); + input.add128(340282366920938463463369835647619430637n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(743702701n); + }); + + it('test operator "and" overload (euint32, euint128) => euint128 test 2 (3210085051, 3210085055)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3210085051n); + input.add128(3210085055n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(3210085051n); + }); + + it('test operator "and" overload (euint32, euint128) => euint128 test 3 (3210085055, 3210085055)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3210085055n); + input.add128(3210085055n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(3210085055n); + }); + + it('test operator "and" overload (euint32, euint128) => euint128 test 4 (3210085055, 3210085051)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3210085055n); + input.add128(3210085051n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(3210085051n); + }); + + it('test operator "or" overload (euint32, euint128) => euint128 test 1 (642809521, 340282366920938463463372191851910546031)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(642809521n); + input.add128(340282366920938463463372191851910546031n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(340282366920938463463372191851949358847n); + }); + + it('test operator "or" overload (euint32, euint128) => euint128 test 2 (642809517, 642809521)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(642809517n); + input.add128(642809521n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(642809533n); + }); + + it('test operator "or" overload (euint32, euint128) => euint128 test 3 (642809521, 642809521)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(642809521n); + input.add128(642809521n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(642809521n); + }); + + it('test operator "or" overload (euint32, euint128) => euint128 test 4 (642809521, 642809517)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(642809521n); + input.add128(642809517n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(642809533n); + }); + + it('test operator "xor" overload (euint32, euint128) => euint128 test 1 (3743976797, 340282366920938463463368101137974418739)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3743976797n); + input.add128(340282366920938463463368101137974418739n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(340282366920938463463368101139133583470n); + }); + + it('test operator "xor" overload (euint32, euint128) => euint128 test 2 (3743976793, 3743976797)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3743976793n); + input.add128(3743976797n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint32, euint128) => euint128 test 3 (3743976797, 3743976797)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3743976797n); + input.add128(3743976797n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint32, euint128) => euint128 test 4 (3743976797, 3743976793)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3743976797n); + input.add128(3743976793n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(4n); + }); + + it('test operator "eq" overload (euint32, euint128) => ebool test 1 (662241561, 340282366920938463463373020046473245431)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(662241561n); + input.add128(340282366920938463463373020046473245431n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint32, euint128) => ebool test 2 (662241557, 662241561)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(662241557n); + input.add128(662241561n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint32, euint128) => ebool test 3 (662241561, 662241561)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(662241561n); + input.add128(662241561n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint32, euint128) => ebool test 4 (662241561, 662241557)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(662241561n); + input.add128(662241557n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint32, euint128) => ebool test 1 (2901752082, 340282366920938463463368897193530530583)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2901752082n); + input.add128(340282366920938463463368897193530530583n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint32, euint128) => ebool test 2 (2901752078, 2901752082)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2901752078n); + input.add128(2901752082n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint32, euint128) => ebool test 3 (2901752082, 2901752082)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2901752082n); + input.add128(2901752082n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint32, euint128) => ebool test 4 (2901752082, 2901752078)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2901752082n); + input.add128(2901752078n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint32, euint128) => ebool test 1 (2933020117, 340282366920938463463366467045461118489)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2933020117n); + input.add128(340282366920938463463366467045461118489n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint32, euint128) => ebool test 2 (2933020113, 2933020117)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2933020113n); + input.add128(2933020117n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint32, euint128) => ebool test 3 (2933020117, 2933020117)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2933020117n); + input.add128(2933020117n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint32, euint128) => ebool test 4 (2933020117, 2933020113)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2933020117n); + input.add128(2933020113n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint32, euint128) => ebool test 1 (1742855510, 340282366920938463463367066533174096547)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1742855510n); + input.add128(340282366920938463463367066533174096547n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint32, euint128) => ebool test 2 (1742855506, 1742855510)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1742855506n); + input.add128(1742855510n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint32, euint128) => ebool test 3 (1742855510, 1742855510)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1742855510n); + input.add128(1742855510n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint32, euint128) => ebool test 4 (1742855510, 1742855506)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1742855510n); + input.add128(1742855506n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, euint128) => ebool test 1 (1675279424, 340282366920938463463369437688149539163)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1675279424n); + input.add128(340282366920938463463369437688149539163n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, euint128) => ebool test 2 (1675279420, 1675279424)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1675279420n); + input.add128(1675279424n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, euint128) => ebool test 3 (1675279424, 1675279424)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1675279424n); + input.add128(1675279424n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint32, euint128) => ebool test 4 (1675279424, 1675279420)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1675279424n); + input.add128(1675279420n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint32, euint128) => ebool test 1 (3941414869, 340282366920938463463371559875446410275)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3941414869n); + input.add128(340282366920938463463371559875446410275n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint32, euint128) => ebool test 2 (3941414865, 3941414869)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3941414865n); + input.add128(3941414869n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint32, euint128) => ebool test 3 (3941414869, 3941414869)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3941414869n); + input.add128(3941414869n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint32, euint128) => ebool test 4 (3941414869, 3941414865)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3941414869n); + input.add128(3941414865n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint32, euint128) => euint128 test 1 (2058095166, 340282366920938463463366748988246604657)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2058095166n); + input.add128(340282366920938463463366748988246604657n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(2058095166n); + }); + + it('test operator "min" overload (euint32, euint128) => euint128 test 2 (2058095162, 2058095166)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2058095162n); + input.add128(2058095166n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(2058095162n); + }); + + it('test operator "min" overload (euint32, euint128) => euint128 test 3 (2058095166, 2058095166)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2058095166n); + input.add128(2058095166n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(2058095166n); + }); + + it('test operator "min" overload (euint32, euint128) => euint128 test 4 (2058095166, 2058095162)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2058095166n); + input.add128(2058095162n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(2058095162n); + }); + + it('test operator "max" overload (euint32, euint128) => euint128 test 1 (1090929823, 340282366920938463463372472845534177481)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1090929823n); + input.add128(340282366920938463463372472845534177481n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(340282366920938463463372472845534177481n); + }); + + it('test operator "max" overload (euint32, euint128) => euint128 test 2 (1090929819, 1090929823)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1090929819n); + input.add128(1090929823n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(1090929823n); + }); + + it('test operator "max" overload (euint32, euint128) => euint128 test 3 (1090929823, 1090929823)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1090929823n); + input.add128(1090929823n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(1090929823n); + }); + + it('test operator "max" overload (euint32, euint128) => euint128 test 4 (1090929823, 1090929819)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1090929823n); + input.add128(1090929819n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint32_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract3.resEuint128()); + expect(res).to.equal(1090929823n); + }); + + it('test operator "and" overload (euint32, euint256) => euint256 test 1 (781258708, 115792089237316195423570985008687907853269984665640564039457579457132382013549)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(781258708n); + input.add256(115792089237316195423570985008687907853269984665640564039457579457132382013549n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract3.resEuint256()); + expect(res).to.equal(168822852n); + }); + + it('test operator "and" overload (euint32, euint256) => euint256 test 2 (781258704, 781258708)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(781258704n); + input.add256(781258708n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract3.resEuint256()); + expect(res).to.equal(781258704n); + }); + + it('test operator "and" overload (euint32, euint256) => euint256 test 3 (781258708, 781258708)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(781258708n); + input.add256(781258708n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract3.resEuint256()); + expect(res).to.equal(781258708n); + }); + + it('test operator "and" overload (euint32, euint256) => euint256 test 4 (781258708, 781258704)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(781258708n); + input.add256(781258704n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract3.resEuint256()); + expect(res).to.equal(781258704n); + }); + + it('test operator "or" overload (euint32, euint256) => euint256 test 1 (3779126520, 115792089237316195423570985008687907853269984665640564039457580528447141233897)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3779126520n); + input.add256(115792089237316195423570985008687907853269984665640564039457580528447141233897n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract3.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457580528448214983929n); + }); + + it('test operator "or" overload (euint32, euint256) => euint256 test 2 (3779126516, 3779126520)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3779126516n); + input.add256(3779126520n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract3.resEuint256()); + expect(res).to.equal(3779126524n); + }); + + it('test operator "or" overload (euint32, euint256) => euint256 test 3 (3779126520, 3779126520)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3779126520n); + input.add256(3779126520n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract3.resEuint256()); + expect(res).to.equal(3779126520n); + }); + + it('test operator "or" overload (euint32, euint256) => euint256 test 4 (3779126520, 3779126516)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(3779126520n); + input.add256(3779126516n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract3.resEuint256()); + expect(res).to.equal(3779126524n); + }); + + it('test operator "xor" overload (euint32, euint256) => euint256 test 1 (2045355972, 115792089237316195423570985008687907853269984665640564039457577227689858541695)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2045355972n); + input.add256(115792089237316195423570985008687907853269984665640564039457577227689858541695n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract3.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577227689742569403n); + }); + + it('test operator "xor" overload (euint32, euint256) => euint256 test 2 (2045355968, 2045355972)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2045355968n); + input.add256(2045355972n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract3.resEuint256()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint32, euint256) => euint256 test 3 (2045355972, 2045355972)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2045355972n); + input.add256(2045355972n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract3.resEuint256()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint32, euint256) => euint256 test 4 (2045355972, 2045355968)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(2045355972n); + input.add256(2045355968n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract3.resEuint256()); + expect(res).to.equal(4n); + }); + + it('test operator "eq" overload (euint32, euint256) => ebool test 1 (1008703379, 115792089237316195423570985008687907853269984665640564039457582269531694993211)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1008703379n); + input.add256(115792089237316195423570985008687907853269984665640564039457582269531694993211n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint32, euint256) => ebool test 2 (1008703375, 1008703379)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1008703375n); + input.add256(1008703379n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint32, euint256) => ebool test 3 (1008703379, 1008703379)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1008703379n); + input.add256(1008703379n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint32, euint256) => ebool test 4 (1008703379, 1008703375)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(1008703379n); + input.add256(1008703375n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint32, euint256) => ebool test 1 (546816932, 115792089237316195423570985008687907853269984665640564039457575302456222155241)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(546816932n); + input.add256(115792089237316195423570985008687907853269984665640564039457575302456222155241n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint32, euint256) => ebool test 2 (546816928, 546816932)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(546816928n); + input.add256(546816932n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint32, euint256) => ebool test 3 (546816932, 546816932)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(546816932n); + input.add256(546816932n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint32, euint256) => ebool test 4 (546816932, 546816928)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add32(546816932n); + input.add256(546816928n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint32_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "add" overload (euint64, euint8) => euint64 test 1 (129, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(129n); + input.add8(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(131n); + }); + + it('test operator "add" overload (euint64, euint8) => euint64 test 2 (65, 67)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(65n); + input.add8(67n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(132n); + }); + + it('test operator "add" overload (euint64, euint8) => euint64 test 3 (67, 67)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(67n); + input.add8(67n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(134n); + }); + + it('test operator "add" overload (euint64, euint8) => euint64 test 4 (67, 65)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(67n); + input.add8(65n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(132n); + }); + + it('test operator "sub" overload (euint64, euint8) => euint64 test 1 (11, 11)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(11n); + input.add8(11n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.sub_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint64, euint8) => euint64 test 2 (11, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(11n); + input.add8(7n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.sub_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint64, euint8) => euint64 test 1 (65, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(65n); + input.add8(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(130n); + }); + + it('test operator "mul" overload (euint64, euint8) => euint64 test 2 (13, 13)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(13n); + input.add8(13n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(169n); + }); + + it('test operator "mul" overload (euint64, euint8) => euint64 test 3 (13, 13)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(13n); + input.add8(13n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(169n); + }); + + it('test operator "mul" overload (euint64, euint8) => euint64 test 4 (13, 13)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(13n); + input.add8(13n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(169n); + }); + + it('test operator "and" overload (euint64, euint8) => euint64 test 1 (18438105153246822725, 237)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18438105153246822725n); + input.add8(237n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(69n); + }); + + it('test operator "and" overload (euint64, euint8) => euint64 test 2 (233, 237)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(233n); + input.add8(237n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(233n); + }); + + it('test operator "and" overload (euint64, euint8) => euint64 test 3 (237, 237)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(237n); + input.add8(237n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(237n); + }); + + it('test operator "and" overload (euint64, euint8) => euint64 test 4 (237, 233)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(237n); + input.add8(233n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(233n); + }); + + it('test operator "or" overload (euint64, euint8) => euint64 test 1 (18439057065100426367, 198)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18439057065100426367n); + input.add8(198n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18439057065100426495n); + }); + + it('test operator "or" overload (euint64, euint8) => euint64 test 2 (194, 198)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(194n); + input.add8(198n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(198n); + }); + + it('test operator "or" overload (euint64, euint8) => euint64 test 3 (198, 198)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(198n); + input.add8(198n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(198n); + }); + + it('test operator "or" overload (euint64, euint8) => euint64 test 4 (198, 194)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(198n); + input.add8(194n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(198n); + }); + + it('test operator "xor" overload (euint64, euint8) => euint64 test 1 (18438787543024508423, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18438787543024508423n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18438787543024508417n); + }); + + it('test operator "xor" overload (euint64, euint8) => euint64 test 2 (2, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(2n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint64, euint8) => euint64 test 3 (6, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(6n); + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint64, euint8) => euint64 test 4 (6, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(6n); + input.add8(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(4n); + }); + + it('test operator "eq" overload (euint64, euint8) => ebool test 1 (18441256062840684911, 61)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18441256062840684911n); + input.add8(61n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint64, euint8) => ebool test 2 (57, 61)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(57n); + input.add8(61n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint64, euint8) => ebool test 3 (61, 61)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(61n); + input.add8(61n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint64, euint8) => ebool test 4 (61, 57)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(61n); + input.add8(57n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint64, euint8) => ebool test 1 (18446675918845193913, 60)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18446675918845193913n); + input.add8(60n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint64, euint8) => ebool test 2 (56, 60)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(56n); + input.add8(60n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint64, euint8) => ebool test 3 (60, 60)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(60n); + input.add8(60n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint64, euint8) => ebool test 4 (60, 56)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(60n); + input.add8(56n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint64, euint8) => ebool test 1 (18438868913574318151, 174)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18438868913574318151n); + input.add8(174n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint64, euint8) => ebool test 2 (170, 174)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(170n); + input.add8(174n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint64, euint8) => ebool test 3 (174, 174)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(174n); + input.add8(174n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint64, euint8) => ebool test 4 (174, 170)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(174n); + input.add8(170n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint64, euint8) => ebool test 1 (18441016416000680559, 153)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18441016416000680559n); + input.add8(153n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint64, euint8) => ebool test 2 (149, 153)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(149n); + input.add8(153n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint64, euint8) => ebool test 3 (153, 153)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(153n); + input.add8(153n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint64, euint8) => ebool test 4 (153, 149)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(153n); + input.add8(149n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint64, euint8) => ebool test 1 (18440124257045609459, 122)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18440124257045609459n); + input.add8(122n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (euint64, euint8) => ebool test 2 (118, 122)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(118n); + input.add8(122n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint64, euint8) => ebool test 3 (122, 122)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(122n); + input.add8(122n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint64, euint8) => ebool test 4 (122, 118)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(122n); + input.add8(118n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint64, euint8) => ebool test 1 (18442758712139278825, 11)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18442758712139278825n); + input.add8(11n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint64, euint8) => ebool test 2 (7, 11)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(7n); + input.add8(11n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint64, euint8) => ebool test 3 (11, 11)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(11n); + input.add8(11n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint64, euint8) => ebool test 4 (11, 7)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(11n); + input.add8(7n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint64, euint8) => euint64 test 1 (18442946735073801401, 175)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18442946735073801401n); + input.add8(175n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(175n); + }); + + it('test operator "min" overload (euint64, euint8) => euint64 test 2 (171, 175)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(171n); + input.add8(175n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(171n); + }); + + it('test operator "min" overload (euint64, euint8) => euint64 test 3 (175, 175)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(175n); + input.add8(175n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(175n); + }); + + it('test operator "min" overload (euint64, euint8) => euint64 test 4 (175, 171)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(175n); + input.add8(171n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(171n); + }); + + it('test operator "max" overload (euint64, euint8) => euint64 test 1 (18445251345308977817, 125)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18445251345308977817n); + input.add8(125n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18445251345308977817n); + }); + + it('test operator "max" overload (euint64, euint8) => euint64 test 2 (121, 125)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(121n); + input.add8(125n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(125n); + }); + + it('test operator "max" overload (euint64, euint8) => euint64 test 3 (125, 125)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(125n); + input.add8(125n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(125n); + }); + + it('test operator "max" overload (euint64, euint8) => euint64 test 4 (125, 121)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(125n); + input.add8(121n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint64_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(125n); + }); + + it('test operator "add" overload (euint64, euint16) => euint64 test 1 (65533, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(65533n); + input.add16(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(65535n); + }); + + it('test operator "add" overload (euint64, euint16) => euint64 test 2 (5292, 5296)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(5292n); + input.add16(5296n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(10588n); + }); + + it('test operator "add" overload (euint64, euint16) => euint64 test 3 (5296, 5296)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(5296n); + input.add16(5296n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(10592n); + }); + + it('test operator "add" overload (euint64, euint16) => euint64 test 4 (5296, 5292)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(5296n); + input.add16(5292n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(10588n); + }); + + it('test operator "sub" overload (euint64, euint16) => euint64 test 1 (5977, 5977)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(5977n); + input.add16(5977n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.sub_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint64, euint16) => euint64 test 2 (5977, 5973)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(5977n); + input.add16(5973n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.sub_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint64, euint16) => euint64 test 1 (32755, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(32755n); + input.add16(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(65510n); + }); + + it('test operator "mul" overload (euint64, euint16) => euint64 test 2 (136, 136)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(136n); + input.add16(136n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18496n); + }); + + it('test operator "mul" overload (euint64, euint16) => euint64 test 3 (136, 136)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(136n); + input.add16(136n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18496n); + }); + + it('test operator "mul" overload (euint64, euint16) => euint64 test 4 (136, 136)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(136n); + input.add16(136n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18496n); + }); + + it('test operator "and" overload (euint64, euint16) => euint64 test 1 (18438239725912162149, 26165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18438239725912162149n); + input.add16(26165n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(26149n); + }); + + it('test operator "and" overload (euint64, euint16) => euint64 test 2 (26161, 26165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(26161n); + input.add16(26165n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(26161n); + }); + + it('test operator "and" overload (euint64, euint16) => euint64 test 3 (26165, 26165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(26165n); + input.add16(26165n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(26165n); + }); + + it('test operator "and" overload (euint64, euint16) => euint64 test 4 (26165, 26161)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(26165n); + input.add16(26161n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(26161n); + }); + + it('test operator "or" overload (euint64, euint16) => euint64 test 1 (18441522489266276269, 29011)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18441522489266276269n); + input.add16(29011n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18441522489266305023n); + }); + + it('test operator "or" overload (euint64, euint16) => euint64 test 2 (29007, 29011)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(29007n); + input.add16(29011n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(29023n); + }); + + it('test operator "or" overload (euint64, euint16) => euint64 test 3 (29011, 29011)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(29011n); + input.add16(29011n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(29011n); + }); + + it('test operator "or" overload (euint64, euint16) => euint64 test 4 (29011, 29007)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(29011n); + input.add16(29007n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(29023n); + }); + + it('test operator "xor" overload (euint64, euint16) => euint64 test 1 (18441572174443433887, 57261)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18441572174443433887n); + input.add16(57261n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18441572174443384882n); + }); + + it('test operator "xor" overload (euint64, euint16) => euint64 test 2 (57257, 57261)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(57257n); + input.add16(57261n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint64, euint16) => euint64 test 3 (57261, 57261)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(57261n); + input.add16(57261n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint64, euint16) => euint64 test 4 (57261, 57257)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(57261n); + input.add16(57257n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(4n); + }); + + it('test operator "eq" overload (euint64, euint16) => ebool test 1 (18442052725102182425, 53909)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18442052725102182425n); + input.add16(53909n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint64, euint16) => ebool test 2 (53905, 53909)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(53905n); + input.add16(53909n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint64, euint16) => ebool test 3 (53909, 53909)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(53909n); + input.add16(53909n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint64, euint16) => ebool test 4 (53909, 53905)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(53909n); + input.add16(53905n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint64, euint16) => ebool test 1 (18438061614570366687, 23662)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18438061614570366687n); + input.add16(23662n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint64, euint16) => ebool test 2 (23658, 23662)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(23658n); + input.add16(23662n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint64, euint16) => ebool test 3 (23662, 23662)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(23662n); + input.add16(23662n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint64, euint16) => ebool test 4 (23662, 23658)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(23662n); + input.add16(23658n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint64, euint16) => ebool test 1 (18441230832277149245, 58216)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18441230832277149245n); + input.add16(58216n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint64, euint16) => ebool test 2 (58212, 58216)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(58212n); + input.add16(58216n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint64, euint16) => ebool test 3 (58216, 58216)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(58216n); + input.add16(58216n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint64, euint16) => ebool test 4 (58216, 58212)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(58216n); + input.add16(58212n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint64, euint16) => ebool test 1 (18438202546389242793, 62165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18438202546389242793n); + input.add16(62165n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint64, euint16) => ebool test 2 (62161, 62165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(62161n); + input.add16(62165n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint64, euint16) => ebool test 3 (62165, 62165)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(62165n); + input.add16(62165n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint64, euint16) => ebool test 4 (62165, 62161)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(62165n); + input.add16(62161n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint64, euint16) => ebool test 1 (18439864391898925259, 42804)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18439864391898925259n); + input.add16(42804n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (euint64, euint16) => ebool test 2 (42800, 42804)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(42800n); + input.add16(42804n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint64, euint16) => ebool test 3 (42804, 42804)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(42804n); + input.add16(42804n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint64, euint16) => ebool test 4 (42804, 42800)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(42804n); + input.add16(42800n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint64, euint16) => ebool test 1 (18440638077443953811, 32530)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18440638077443953811n); + input.add16(32530n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint64, euint16) => ebool test 2 (32526, 32530)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(32526n); + input.add16(32530n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint64, euint16) => ebool test 3 (32530, 32530)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(32530n); + input.add16(32530n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint64, euint16) => ebool test 4 (32530, 32526)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(32530n); + input.add16(32526n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint64, euint16) => euint64 test 1 (18439484005992858121, 58328)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18439484005992858121n); + input.add16(58328n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(58328n); + }); + + it('test operator "min" overload (euint64, euint16) => euint64 test 2 (58324, 58328)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(58324n); + input.add16(58328n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(58324n); + }); + + it('test operator "min" overload (euint64, euint16) => euint64 test 3 (58328, 58328)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(58328n); + input.add16(58328n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(58328n); + }); + + it('test operator "min" overload (euint64, euint16) => euint64 test 4 (58328, 58324)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(58328n); + input.add16(58324n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(58324n); + }); + + it('test operator "max" overload (euint64, euint16) => euint64 test 1 (18444066541820294667, 31790)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18444066541820294667n); + input.add16(31790n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18444066541820294667n); + }); + + it('test operator "max" overload (euint64, euint16) => euint64 test 2 (31786, 31790)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(31786n); + input.add16(31790n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(31790n); + }); + + it('test operator "max" overload (euint64, euint16) => euint64 test 3 (31790, 31790)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(31790n); + input.add16(31790n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(31790n); + }); + + it('test operator "max" overload (euint64, euint16) => euint64 test 4 (31790, 31786)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(31790n); + input.add16(31786n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint64_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(31790n); + }); + + it('test operator "add" overload (euint64, euint32) => euint64 test 1 (4293920638, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(4293920638n); + input.add32(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(4293920640n); + }); + + it('test operator "add" overload (euint64, euint32) => euint64 test 2 (1306920206, 1306920208)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(1306920206n); + input.add32(1306920208n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(2613840414n); + }); + + it('test operator "add" overload (euint64, euint32) => euint64 test 3 (1306920208, 1306920208)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(1306920208n); + input.add32(1306920208n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(2613840416n); + }); + + it('test operator "add" overload (euint64, euint32) => euint64 test 4 (1306920208, 1306920206)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(1306920208n); + input.add32(1306920206n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(2613840414n); + }); + + it('test operator "sub" overload (euint64, euint32) => euint64 test 1 (3804601232, 3804601232)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(3804601232n); + input.add32(3804601232n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.sub_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint64, euint32) => euint64 test 2 (3804601232, 3804601228)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(3804601232n); + input.add32(3804601228n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.sub_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint64, euint32) => euint64 test 1 (2146784317, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(2146784317n); + input.add32(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(4293568634n); + }); + + it('test operator "mul" overload (euint64, euint32) => euint64 test 2 (48911, 48911)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(48911n); + input.add32(48911n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(2392285921n); + }); + + it('test operator "mul" overload (euint64, euint32) => euint64 test 3 (48911, 48911)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(48911n); + input.add32(48911n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(2392285921n); + }); + + it('test operator "mul" overload (euint64, euint32) => euint64 test 4 (48911, 48911)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(48911n); + input.add32(48911n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(2392285921n); + }); + + it('test operator "and" overload (euint64, euint32) => euint64 test 1 (18439192797774332691, 1653972572)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18439192797774332691n); + input.add32(1653972572n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(360976n); + }); + + it('test operator "and" overload (euint64, euint32) => euint64 test 2 (1653972568, 1653972572)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(1653972568n); + input.add32(1653972572n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(1653972568n); + }); + + it('test operator "and" overload (euint64, euint32) => euint64 test 3 (1653972572, 1653972572)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(1653972572n); + input.add32(1653972572n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(1653972572n); + }); + + it('test operator "and" overload (euint64, euint32) => euint64 test 4 (1653972572, 1653972568)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(1653972572n); + input.add32(1653972568n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.and_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(1653972568n); + }); + + it('test operator "or" overload (euint64, euint32) => euint64 test 1 (18442728438835358387, 2184699133)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18442728438835358387n); + input.add32(2184699133n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18442728441019629311n); + }); + + it('test operator "or" overload (euint64, euint32) => euint64 test 2 (2184699129, 2184699133)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(2184699129n); + input.add32(2184699133n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(2184699133n); + }); + + it('test operator "or" overload (euint64, euint32) => euint64 test 3 (2184699133, 2184699133)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(2184699133n); + input.add32(2184699133n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(2184699133n); + }); + + it('test operator "or" overload (euint64, euint32) => euint64 test 4 (2184699133, 2184699129)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(2184699133n); + input.add32(2184699129n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.or_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(2184699133n); + }); + + it('test operator "xor" overload (euint64, euint32) => euint64 test 1 (18443747183072091965, 2776873890)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18443747183072091965n); + input.add32(2776873890n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18443747185714275487n); + }); + + it('test operator "xor" overload (euint64, euint32) => euint64 test 2 (2776873886, 2776873890)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(2776873886n); + input.add32(2776873890n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(60n); + }); + + it('test operator "xor" overload (euint64, euint32) => euint64 test 3 (2776873890, 2776873890)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(2776873890n); + input.add32(2776873890n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint64, euint32) => euint64 test 4 (2776873890, 2776873886)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(2776873890n); + input.add32(2776873886n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.xor_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(60n); + }); + + it('test operator "eq" overload (euint64, euint32) => ebool test 1 (18440385947430038559, 3107236081)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18440385947430038559n); + input.add32(3107236081n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint64, euint32) => ebool test 2 (3107236077, 3107236081)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(3107236077n); + input.add32(3107236081n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint64, euint32) => ebool test 3 (3107236081, 3107236081)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(3107236081n); + input.add32(3107236081n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint64, euint32) => ebool test 4 (3107236081, 3107236077)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(3107236081n); + input.add32(3107236077n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.eq_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); +}); diff --git a/contracts/test/httpzOperations/httpzOperations6.ts b/contracts/test/httpzOperations/httpzOperations6.ts new file mode 100644 index 00000000..0d422744 --- /dev/null +++ b/contracts/test/httpzOperations/httpzOperations6.ts @@ -0,0 +1,3166 @@ +import { expect } from 'chai'; +import { ethers } from 'hardhat'; + +import type { HTTPZTestSuite1 } from '../../types/contracts/tests/HTTPZTestSuite1'; +import type { HTTPZTestSuite2 } from '../../types/contracts/tests/HTTPZTestSuite2'; +import type { HTTPZTestSuite3 } from '../../types/contracts/tests/HTTPZTestSuite3'; +import type { HTTPZTestSuite4 } from '../../types/contracts/tests/HTTPZTestSuite4'; +import type { HTTPZTestSuite5 } from '../../types/contracts/tests/HTTPZTestSuite5'; +import type { HTTPZTestSuite6 } from '../../types/contracts/tests/HTTPZTestSuite6'; +import type { HTTPZTestSuite7 } from '../../types/contracts/tests/HTTPZTestSuite7'; +import { + createInstances, + decrypt8, + decrypt16, + decrypt32, + decrypt64, + decrypt128, + decrypt256, + decryptBool, +} from '../instance'; +import { getSigners, initSigners } from '../signers'; + +async function deployHTTPZTestFixture1(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite1'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture2(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite2'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture3(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite3'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture4(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite4'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture5(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite5'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture6(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite6'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture7(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite7'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +describe('HTTPZ operations 6', function () { + before(async function () { + await initSigners(1); + this.signers = await getSigners(); + + const contract1 = await deployHTTPZTestFixture1(); + this.contract1Address = await contract1.getAddress(); + this.contract1 = contract1; + + const contract2 = await deployHTTPZTestFixture2(); + this.contract2Address = await contract2.getAddress(); + this.contract2 = contract2; + + const contract3 = await deployHTTPZTestFixture3(); + this.contract3Address = await contract3.getAddress(); + this.contract3 = contract3; + + const contract4 = await deployHTTPZTestFixture4(); + this.contract4Address = await contract4.getAddress(); + this.contract4 = contract4; + + const contract5 = await deployHTTPZTestFixture5(); + this.contract5Address = await contract5.getAddress(); + this.contract5 = contract5; + + const contract6 = await deployHTTPZTestFixture6(); + this.contract6Address = await contract6.getAddress(); + this.contract6 = contract6; + + const contract7 = await deployHTTPZTestFixture7(); + this.contract7Address = await contract7.getAddress(); + this.contract7 = contract7; + + const instances = await createInstances(this.signers); + this.instances = instances; + }); + + it('test operator "ne" overload (euint64, euint32) => ebool test 1 (18441104443466866551, 2758625103)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18441104443466866551n); + input.add32(2758625103n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint64, euint32) => ebool test 2 (2758625099, 2758625103)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(2758625099n); + input.add32(2758625103n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint64, euint32) => ebool test 3 (2758625103, 2758625103)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(2758625103n); + input.add32(2758625103n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint64, euint32) => ebool test 4 (2758625103, 2758625099)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(2758625103n); + input.add32(2758625099n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ne_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint64, euint32) => ebool test 1 (18441234113732032187, 1316050845)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18441234113732032187n); + input.add32(1316050845n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint64, euint32) => ebool test 2 (1316050841, 1316050845)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(1316050841n); + input.add32(1316050845n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint64, euint32) => ebool test 3 (1316050845, 1316050845)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(1316050845n); + input.add32(1316050845n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint64, euint32) => ebool test 4 (1316050845, 1316050841)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(1316050845n); + input.add32(1316050841n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.ge_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint64, euint32) => ebool test 1 (18440125209920020471, 1133072358)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18440125209920020471n); + input.add32(1133072358n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint64, euint32) => ebool test 2 (1133072354, 1133072358)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(1133072354n); + input.add32(1133072358n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint64, euint32) => ebool test 3 (1133072358, 1133072358)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(1133072358n); + input.add32(1133072358n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint64, euint32) => ebool test 4 (1133072358, 1133072354)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(1133072358n); + input.add32(1133072354n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.gt_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint64, euint32) => ebool test 1 (18440400692431322489, 2751122079)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18440400692431322489n); + input.add32(2751122079n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (euint64, euint32) => ebool test 2 (2751122075, 2751122079)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(2751122075n); + input.add32(2751122079n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint64, euint32) => ebool test 3 (2751122079, 2751122079)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(2751122079n); + input.add32(2751122079n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint64, euint32) => ebool test 4 (2751122079, 2751122075)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(2751122079n); + input.add32(2751122075n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.le_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint64, euint32) => ebool test 1 (18440922368449425769, 3876119429)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18440922368449425769n); + input.add32(3876119429n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint64, euint32) => ebool test 2 (3876119425, 3876119429)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(3876119425n); + input.add32(3876119429n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint64, euint32) => ebool test 3 (3876119429, 3876119429)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(3876119429n); + input.add32(3876119429n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint64, euint32) => ebool test 4 (3876119429, 3876119425)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(3876119429n); + input.add32(3876119425n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.lt_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract3.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint64, euint32) => euint64 test 1 (18441449164727163435, 2218022429)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18441449164727163435n); + input.add32(2218022429n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(2218022429n); + }); + + it('test operator "min" overload (euint64, euint32) => euint64 test 2 (2218022425, 2218022429)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(2218022425n); + input.add32(2218022429n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(2218022425n); + }); + + it('test operator "min" overload (euint64, euint32) => euint64 test 3 (2218022429, 2218022429)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(2218022429n); + input.add32(2218022429n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(2218022429n); + }); + + it('test operator "min" overload (euint64, euint32) => euint64 test 4 (2218022429, 2218022425)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(2218022429n); + input.add32(2218022425n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.min_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(2218022425n); + }); + + it('test operator "max" overload (euint64, euint32) => euint64 test 1 (18439113003354111443, 390298777)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18439113003354111443n); + input.add32(390298777n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18439113003354111443n); + }); + + it('test operator "max" overload (euint64, euint32) => euint64 test 2 (390298773, 390298777)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(390298773n); + input.add32(390298777n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(390298777n); + }); + + it('test operator "max" overload (euint64, euint32) => euint64 test 3 (390298777, 390298777)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(390298777n); + input.add32(390298777n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(390298777n); + }); + + it('test operator "max" overload (euint64, euint32) => euint64 test 4 (390298777, 390298773)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(390298777n); + input.add32(390298773n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.max_euint64_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(390298777n); + }); + + it('test operator "add" overload (euint64, euint64) => euint64 test 1 (9222708121753265310, 9223259241735982726)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(9222708121753265310n); + input.add64(9223259241735982726n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18445967363489248036n); + }); + + it('test operator "add" overload (euint64, euint64) => euint64 test 2 (9222708121753265308, 9222708121753265310)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(9222708121753265308n); + input.add64(9222708121753265310n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18445416243506530618n); + }); + + it('test operator "add" overload (euint64, euint64) => euint64 test 3 (9222708121753265310, 9222708121753265310)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(9222708121753265310n); + input.add64(9222708121753265310n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18445416243506530620n); + }); + + it('test operator "add" overload (euint64, euint64) => euint64 test 4 (9222708121753265310, 9222708121753265308)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(9222708121753265310n); + input.add64(9222708121753265308n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.add_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18445416243506530618n); + }); + + it('test operator "sub" overload (euint64, euint64) => euint64 test 1 (18437847236872160075, 18437847236872160075)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18437847236872160075n); + input.add64(18437847236872160075n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.sub_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint64, euint64) => euint64 test 2 (18437847236872160075, 18437847236872160071)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(18437847236872160075n); + input.add64(18437847236872160071n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.sub_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint64, euint64) => euint64 test 1 (4293860721, 4294575494)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(4293860721n); + input.add64(4294575494n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18440309027055771174n); + }); + + it('test operator "mul" overload (euint64, euint64) => euint64 test 2 (4293860721, 4293860721)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(4293860721n); + input.add64(4293860721n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18437239891346639841n); + }); + + it('test operator "mul" overload (euint64, euint64) => euint64 test 3 (4293860721, 4293860721)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(4293860721n); + input.add64(4293860721n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18437239891346639841n); + }); + + it('test operator "mul" overload (euint64, euint64) => euint64 test 4 (4293860721, 4293860721)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); + input.add64(4293860721n); + input.add64(4293860721n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract3.mul_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract3.resEuint64()); + expect(res).to.equal(18437239891346639841n); + }); + + it('test operator "and" overload (euint64, euint64) => euint64 test 1 (18444485059375251901, 18442680276926096237)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18444485059375251901n); + input.add64(18442680276926096237n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract4.resEuint64()); + expect(res).to.equal(18442673063524319533n); + }); + + it('test operator "and" overload (euint64, euint64) => euint64 test 2 (18442680276926096233, 18442680276926096237)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18442680276926096233n); + input.add64(18442680276926096237n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract4.resEuint64()); + expect(res).to.equal(18442680276926096233n); + }); + + it('test operator "and" overload (euint64, euint64) => euint64 test 3 (18442680276926096237, 18442680276926096237)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18442680276926096237n); + input.add64(18442680276926096237n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract4.resEuint64()); + expect(res).to.equal(18442680276926096237n); + }); + + it('test operator "and" overload (euint64, euint64) => euint64 test 4 (18442680276926096237, 18442680276926096233)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18442680276926096237n); + input.add64(18442680276926096233n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract4.resEuint64()); + expect(res).to.equal(18442680276926096233n); + }); + + it('test operator "or" overload (euint64, euint64) => euint64 test 1 (18444283307319986391, 18439402373749904111)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18444283307319986391n); + input.add64(18439402373749904111n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract4.resEuint64()); + expect(res).to.equal(18444470229673941759n); + }); + + it('test operator "or" overload (euint64, euint64) => euint64 test 2 (18439402373749904107, 18439402373749904111)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439402373749904107n); + input.add64(18439402373749904111n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract4.resEuint64()); + expect(res).to.equal(18439402373749904111n); + }); + + it('test operator "or" overload (euint64, euint64) => euint64 test 3 (18439402373749904111, 18439402373749904111)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439402373749904111n); + input.add64(18439402373749904111n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract4.resEuint64()); + expect(res).to.equal(18439402373749904111n); + }); + + it('test operator "or" overload (euint64, euint64) => euint64 test 4 (18439402373749904111, 18439402373749904107)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439402373749904111n); + input.add64(18439402373749904107n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract4.resEuint64()); + expect(res).to.equal(18439402373749904111n); + }); + + it('test operator "xor" overload (euint64, euint64) => euint64 test 1 (18438626225909262211, 18442297948518337133)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438626225909262211n); + input.add64(18442297948518337133n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract4.resEuint64()); + expect(res).to.equal(5379470342761966n); + }); + + it('test operator "xor" overload (euint64, euint64) => euint64 test 2 (18438626225909262207, 18438626225909262211)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438626225909262207n); + input.add64(18438626225909262211n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract4.resEuint64()); + expect(res).to.equal(252n); + }); + + it('test operator "xor" overload (euint64, euint64) => euint64 test 3 (18438626225909262211, 18438626225909262211)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438626225909262211n); + input.add64(18438626225909262211n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract4.resEuint64()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint64, euint64) => euint64 test 4 (18438626225909262211, 18438626225909262207)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438626225909262211n); + input.add64(18438626225909262207n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract4.resEuint64()); + expect(res).to.equal(252n); + }); + + it('test operator "eq" overload (euint64, euint64) => ebool test 1 (18443919210761555045, 18439054868065671393)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18443919210761555045n); + input.add64(18439054868065671393n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint64, euint64) => ebool test 2 (18439054868065671389, 18439054868065671393)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439054868065671389n); + input.add64(18439054868065671393n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint64, euint64) => ebool test 3 (18439054868065671393, 18439054868065671393)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439054868065671393n); + input.add64(18439054868065671393n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint64, euint64) => ebool test 4 (18439054868065671393, 18439054868065671389)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439054868065671393n); + input.add64(18439054868065671389n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint64, euint64) => ebool test 1 (18439202639227709891, 18445225647451441701)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439202639227709891n); + input.add64(18445225647451441701n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint64, euint64) => ebool test 2 (18439202639227709887, 18439202639227709891)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439202639227709887n); + input.add64(18439202639227709891n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint64, euint64) => ebool test 3 (18439202639227709891, 18439202639227709891)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439202639227709891n); + input.add64(18439202639227709891n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint64, euint64) => ebool test 4 (18439202639227709891, 18439202639227709887)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439202639227709891n); + input.add64(18439202639227709887n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint64, euint64) => ebool test 1 (18444440306484271225, 18438467574976745929)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18444440306484271225n); + input.add64(18438467574976745929n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint64, euint64) => ebool test 2 (18438467574976745925, 18438467574976745929)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438467574976745925n); + input.add64(18438467574976745929n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint64, euint64) => ebool test 3 (18438467574976745929, 18438467574976745929)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438467574976745929n); + input.add64(18438467574976745929n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint64, euint64) => ebool test 4 (18438467574976745929, 18438467574976745925)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438467574976745929n); + input.add64(18438467574976745925n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint64, euint64) => ebool test 1 (18439401248473769181, 18438959113889726287)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439401248473769181n); + input.add64(18438959113889726287n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint64, euint64) => ebool test 2 (18438959113889726283, 18438959113889726287)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438959113889726283n); + input.add64(18438959113889726287n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint64, euint64) => ebool test 3 (18438959113889726287, 18438959113889726287)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438959113889726287n); + input.add64(18438959113889726287n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint64, euint64) => ebool test 4 (18438959113889726287, 18438959113889726283)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438959113889726287n); + input.add64(18438959113889726283n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint64, euint64) => ebool test 1 (18443073799205688447, 18440918956056860453)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18443073799205688447n); + input.add64(18440918956056860453n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (euint64, euint64) => ebool test 2 (18440918956056860449, 18440918956056860453)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18440918956056860449n); + input.add64(18440918956056860453n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint64, euint64) => ebool test 3 (18440918956056860453, 18440918956056860453)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18440918956056860453n); + input.add64(18440918956056860453n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint64, euint64) => ebool test 4 (18440918956056860453, 18440918956056860449)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18440918956056860453n); + input.add64(18440918956056860449n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint64, euint64) => ebool test 1 (18446462451942684113, 18439221928363347273)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18446462451942684113n); + input.add64(18439221928363347273n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint64, euint64) => ebool test 2 (18439221928363347269, 18439221928363347273)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439221928363347269n); + input.add64(18439221928363347273n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint64, euint64) => ebool test 3 (18439221928363347273, 18439221928363347273)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439221928363347273n); + input.add64(18439221928363347273n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint64, euint64) => ebool test 4 (18439221928363347273, 18439221928363347269)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439221928363347273n); + input.add64(18439221928363347269n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint64, euint64) => euint64 test 1 (18443095861337417043, 18445222572723175763)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18443095861337417043n); + input.add64(18445222572723175763n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract4.resEuint64()); + expect(res).to.equal(18443095861337417043n); + }); + + it('test operator "min" overload (euint64, euint64) => euint64 test 2 (18443095861337417039, 18443095861337417043)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18443095861337417039n); + input.add64(18443095861337417043n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract4.resEuint64()); + expect(res).to.equal(18443095861337417039n); + }); + + it('test operator "min" overload (euint64, euint64) => euint64 test 3 (18443095861337417043, 18443095861337417043)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18443095861337417043n); + input.add64(18443095861337417043n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract4.resEuint64()); + expect(res).to.equal(18443095861337417043n); + }); + + it('test operator "min" overload (euint64, euint64) => euint64 test 4 (18443095861337417043, 18443095861337417039)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18443095861337417043n); + input.add64(18443095861337417039n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract4.resEuint64()); + expect(res).to.equal(18443095861337417039n); + }); + + it('test operator "max" overload (euint64, euint64) => euint64 test 1 (18443571695527824031, 18441619631043183191)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18443571695527824031n); + input.add64(18441619631043183191n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract4.resEuint64()); + expect(res).to.equal(18443571695527824031n); + }); + + it('test operator "max" overload (euint64, euint64) => euint64 test 2 (18441619631043183187, 18441619631043183191)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18441619631043183187n); + input.add64(18441619631043183191n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract4.resEuint64()); + expect(res).to.equal(18441619631043183191n); + }); + + it('test operator "max" overload (euint64, euint64) => euint64 test 3 (18441619631043183191, 18441619631043183191)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18441619631043183191n); + input.add64(18441619631043183191n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract4.resEuint64()); + expect(res).to.equal(18441619631043183191n); + }); + + it('test operator "max" overload (euint64, euint64) => euint64 test 4 (18441619631043183191, 18441619631043183187)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18441619631043183191n); + input.add64(18441619631043183187n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint64_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt64(await this.contract4.resEuint64()); + expect(res).to.equal(18441619631043183191n); + }); + + it('test operator "add" overload (euint64, euint128) => euint128 test 1 (2, 9223372036854775809)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(2n); + input.add128(9223372036854775809n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(9223372036854775811n); + }); + + it('test operator "add" overload (euint64, euint128) => euint128 test 2 (9220009495742218711, 9220009495742218713)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(9220009495742218711n); + input.add128(9220009495742218713n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18440018991484437424n); + }); + + it('test operator "add" overload (euint64, euint128) => euint128 test 3 (9220009495742218713, 9220009495742218713)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(9220009495742218713n); + input.add128(9220009495742218713n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18440018991484437426n); + }); + + it('test operator "add" overload (euint64, euint128) => euint128 test 4 (9220009495742218713, 9220009495742218711)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(9220009495742218713n); + input.add128(9220009495742218711n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18440018991484437424n); + }); + + it('test operator "sub" overload (euint64, euint128) => euint128 test 1 (18444377563099366651, 18444377563099366651)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18444377563099366651n); + input.add128(18444377563099366651n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.sub_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint64, euint128) => euint128 test 2 (18444377563099366651, 18444377563099366647)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18444377563099366651n); + input.add128(18444377563099366647n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.sub_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint64, euint128) => euint128 test 1 (2, 4611686018427387905)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(2n); + input.add128(4611686018427387905n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(9223372036854775810n); + }); + + it('test operator "mul" overload (euint64, euint128) => euint128 test 2 (4293746416, 4293746416)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(4293746416n); + input.add128(4293746416n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18436258284912845056n); + }); + + it('test operator "mul" overload (euint64, euint128) => euint128 test 3 (4293746416, 4293746416)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(4293746416n); + input.add128(4293746416n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18436258284912845056n); + }); + + it('test operator "mul" overload (euint64, euint128) => euint128 test 4 (4293746416, 4293746416)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(4293746416n); + input.add128(4293746416n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18436258284912845056n); + }); + + it('test operator "and" overload (euint64, euint128) => euint128 test 1 (18442405897975149047, 340282366920938463463370110697656910041)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18442405897975149047n); + input.add128(340282366920938463463370110697656910041n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18442247288049926353n); + }); + + it('test operator "and" overload (euint64, euint128) => euint128 test 2 (18442405897975149043, 18442405897975149047)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18442405897975149043n); + input.add128(18442405897975149047n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18442405897975149043n); + }); + + it('test operator "and" overload (euint64, euint128) => euint128 test 3 (18442405897975149047, 18442405897975149047)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18442405897975149047n); + input.add128(18442405897975149047n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18442405897975149047n); + }); + + it('test operator "and" overload (euint64, euint128) => euint128 test 4 (18442405897975149047, 18442405897975149043)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18442405897975149047n); + input.add128(18442405897975149043n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18442405897975149043n); + }); + + it('test operator "or" overload (euint64, euint128) => euint128 test 1 (18444678521824923075, 340282366920938463463367788204590335461)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18444678521824923075n); + input.add128(340282366920938463463367788204590335461n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463374587601836035559n); + }); + + it('test operator "or" overload (euint64, euint128) => euint128 test 2 (18444678521824923071, 18444678521824923075)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18444678521824923071n); + input.add128(18444678521824923075n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18444678521824923135n); + }); + + it('test operator "or" overload (euint64, euint128) => euint128 test 3 (18444678521824923075, 18444678521824923075)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18444678521824923075n); + input.add128(18444678521824923075n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18444678521824923075n); + }); + + it('test operator "or" overload (euint64, euint128) => euint128 test 4 (18444678521824923075, 18444678521824923071)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18444678521824923075n); + input.add128(18444678521824923071n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18444678521824923135n); + }); + + it('test operator "xor" overload (euint64, euint128) => euint128 test 1 (18438440369864966035, 340282366920938463463366214003652737475)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438440369864966035n); + input.add128(340282366920938463463366214003652737475n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463444927953431856891472n); + }); + + it('test operator "xor" overload (euint64, euint128) => euint128 test 2 (18438440369864966031, 18438440369864966035)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438440369864966031n); + input.add128(18438440369864966035n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(28n); + }); + + it('test operator "xor" overload (euint64, euint128) => euint128 test 3 (18438440369864966035, 18438440369864966035)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438440369864966035n); + input.add128(18438440369864966035n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint64, euint128) => euint128 test 4 (18438440369864966035, 18438440369864966031)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438440369864966035n); + input.add128(18438440369864966031n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(28n); + }); + + it('test operator "eq" overload (euint64, euint128) => ebool test 1 (18439214659500085673, 340282366920938463463366883210399568823)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439214659500085673n); + input.add128(340282366920938463463366883210399568823n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint64, euint128) => ebool test 2 (18439214659500085669, 18439214659500085673)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439214659500085669n); + input.add128(18439214659500085673n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint64, euint128) => ebool test 3 (18439214659500085673, 18439214659500085673)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439214659500085673n); + input.add128(18439214659500085673n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint64, euint128) => ebool test 4 (18439214659500085673, 18439214659500085669)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439214659500085673n); + input.add128(18439214659500085669n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint64, euint128) => ebool test 1 (18441067137081287485, 340282366920938463463368029785925255457)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18441067137081287485n); + input.add128(340282366920938463463368029785925255457n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint64, euint128) => ebool test 2 (18441067137081287481, 18441067137081287485)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18441067137081287481n); + input.add128(18441067137081287485n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint64, euint128) => ebool test 3 (18441067137081287485, 18441067137081287485)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18441067137081287485n); + input.add128(18441067137081287485n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint64, euint128) => ebool test 4 (18441067137081287485, 18441067137081287481)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18441067137081287485n); + input.add128(18441067137081287481n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint64, euint128) => ebool test 1 (18445426612598551237, 340282366920938463463373095966488148121)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18445426612598551237n); + input.add128(340282366920938463463373095966488148121n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint64, euint128) => ebool test 2 (18445426612598551233, 18445426612598551237)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18445426612598551233n); + input.add128(18445426612598551237n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint64, euint128) => ebool test 3 (18445426612598551237, 18445426612598551237)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18445426612598551237n); + input.add128(18445426612598551237n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint64, euint128) => ebool test 4 (18445426612598551237, 18445426612598551233)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18445426612598551237n); + input.add128(18445426612598551233n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint64, euint128) => ebool test 1 (18444816930300991433, 340282366920938463463369263234189036339)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18444816930300991433n); + input.add128(340282366920938463463369263234189036339n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint64, euint128) => ebool test 2 (18444816930300991429, 18444816930300991433)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18444816930300991429n); + input.add128(18444816930300991433n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint64, euint128) => ebool test 3 (18444816930300991433, 18444816930300991433)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18444816930300991433n); + input.add128(18444816930300991433n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint64, euint128) => ebool test 4 (18444816930300991433, 18444816930300991429)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18444816930300991433n); + input.add128(18444816930300991429n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint64, euint128) => ebool test 1 (18439852582411614101, 340282366920938463463366144446965238851)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439852582411614101n); + input.add128(340282366920938463463366144446965238851n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint64, euint128) => ebool test 2 (18439852582411614097, 18439852582411614101)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439852582411614097n); + input.add128(18439852582411614101n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint64, euint128) => ebool test 3 (18439852582411614101, 18439852582411614101)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439852582411614101n); + input.add128(18439852582411614101n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint64, euint128) => ebool test 4 (18439852582411614101, 18439852582411614097)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439852582411614101n); + input.add128(18439852582411614097n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint64, euint128) => ebool test 1 (18437900617998416379, 340282366920938463463372675048861060661)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18437900617998416379n); + input.add128(340282366920938463463372675048861060661n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint64, euint128) => ebool test 2 (18437900617998416375, 18437900617998416379)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18437900617998416375n); + input.add128(18437900617998416379n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint64, euint128) => ebool test 3 (18437900617998416379, 18437900617998416379)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18437900617998416379n); + input.add128(18437900617998416379n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint64, euint128) => ebool test 4 (18437900617998416379, 18437900617998416375)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18437900617998416379n); + input.add128(18437900617998416375n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint64, euint128) => euint128 test 1 (18441882458486194289, 340282366920938463463368167848207795407)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18441882458486194289n); + input.add128(340282366920938463463368167848207795407n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18441882458486194289n); + }); + + it('test operator "min" overload (euint64, euint128) => euint128 test 2 (18441882458486194285, 18441882458486194289)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18441882458486194285n); + input.add128(18441882458486194289n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18441882458486194285n); + }); + + it('test operator "min" overload (euint64, euint128) => euint128 test 3 (18441882458486194289, 18441882458486194289)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18441882458486194289n); + input.add128(18441882458486194289n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18441882458486194289n); + }); + + it('test operator "min" overload (euint64, euint128) => euint128 test 4 (18441882458486194289, 18441882458486194285)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18441882458486194289n); + input.add128(18441882458486194285n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18441882458486194285n); + }); + + it('test operator "max" overload (euint64, euint128) => euint128 test 1 (18438850890524161643, 340282366920938463463371508179505406497)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438850890524161643n); + input.add128(340282366920938463463371508179505406497n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463371508179505406497n); + }); + + it('test operator "max" overload (euint64, euint128) => euint128 test 2 (18438850890524161639, 18438850890524161643)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438850890524161639n); + input.add128(18438850890524161643n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18438850890524161643n); + }); + + it('test operator "max" overload (euint64, euint128) => euint128 test 3 (18438850890524161643, 18438850890524161643)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438850890524161643n); + input.add128(18438850890524161643n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18438850890524161643n); + }); + + it('test operator "max" overload (euint64, euint128) => euint128 test 4 (18438850890524161643, 18438850890524161639)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438850890524161643n); + input.add128(18438850890524161639n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint64_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18438850890524161643n); + }); + + it('test operator "and" overload (euint64, euint256) => euint256 test 1 (18439517432831167247, 115792089237316195423570985008687907853269984665640564039457576238582042005773)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439517432831167247n); + input.add256(115792089237316195423570985008687907853269984665640564039457576238582042005773n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint64_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract4.resEuint256()); + expect(res).to.equal(18438934519709958413n); + }); + + it('test operator "and" overload (euint64, euint256) => euint256 test 2 (18439517432831167243, 18439517432831167247)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439517432831167243n); + input.add256(18439517432831167247n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint64_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract4.resEuint256()); + expect(res).to.equal(18439517432831167243n); + }); + + it('test operator "and" overload (euint64, euint256) => euint256 test 3 (18439517432831167247, 18439517432831167247)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439517432831167247n); + input.add256(18439517432831167247n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint64_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract4.resEuint256()); + expect(res).to.equal(18439517432831167247n); + }); + + it('test operator "and" overload (euint64, euint256) => euint256 test 4 (18439517432831167247, 18439517432831167243)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18439517432831167247n); + input.add256(18439517432831167243n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint64_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract4.resEuint256()); + expect(res).to.equal(18439517432831167243n); + }); + + it('test operator "or" overload (euint64, euint256) => euint256 test 1 (18443520708668655963, 115792089237316195423570985008687907853269984665640564039457581162495372655135)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18443520708668655963n); + input.add256(115792089237316195423570985008687907853269984665640564039457581162495372655135n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint64_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract4.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457581171584907606879n); + }); + + it('test operator "or" overload (euint64, euint256) => euint256 test 2 (18443520708668655959, 18443520708668655963)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18443520708668655959n); + input.add256(18443520708668655963n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint64_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract4.resEuint256()); + expect(res).to.equal(18443520708668655967n); + }); + + it('test operator "or" overload (euint64, euint256) => euint256 test 3 (18443520708668655963, 18443520708668655963)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18443520708668655963n); + input.add256(18443520708668655963n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint64_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract4.resEuint256()); + expect(res).to.equal(18443520708668655963n); + }); + + it('test operator "or" overload (euint64, euint256) => euint256 test 4 (18443520708668655963, 18443520708668655959)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18443520708668655963n); + input.add256(18443520708668655959n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint64_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract4.resEuint256()); + expect(res).to.equal(18443520708668655967n); + }); + + it('test operator "xor" overload (euint64, euint256) => euint256 test 1 (18437827491008012055, 115792089237316195423570985008687907853269984665640564039457581268890489235235)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18437827491008012055n); + input.add256(115792089237316195423570985008687907853269984665640564039457581268890489235235n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint64_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract4.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039439143481259160401972n); + }); + + it('test operator "xor" overload (euint64, euint256) => euint256 test 2 (18437827491008012051, 18437827491008012055)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18437827491008012051n); + input.add256(18437827491008012055n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint64_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract4.resEuint256()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint64, euint256) => euint256 test 3 (18437827491008012055, 18437827491008012055)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18437827491008012055n); + input.add256(18437827491008012055n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint64_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract4.resEuint256()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint64, euint256) => euint256 test 4 (18437827491008012055, 18437827491008012051)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18437827491008012055n); + input.add256(18437827491008012051n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint64_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract4.resEuint256()); + expect(res).to.equal(4n); + }); + + it('test operator "eq" overload (euint64, euint256) => ebool test 1 (18438194280970170155, 115792089237316195423570985008687907853269984665640564039457576902740273953935)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438194280970170155n); + input.add256(115792089237316195423570985008687907853269984665640564039457576902740273953935n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint64_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint64, euint256) => ebool test 2 (18438194280970170151, 18438194280970170155)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438194280970170151n); + input.add256(18438194280970170155n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint64_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint64, euint256) => ebool test 3 (18438194280970170155, 18438194280970170155)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438194280970170155n); + input.add256(18438194280970170155n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint64_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint64, euint256) => ebool test 4 (18438194280970170155, 18438194280970170151)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18438194280970170155n); + input.add256(18438194280970170151n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint64_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint64, euint256) => ebool test 1 (18437860501968519533, 115792089237316195423570985008687907853269984665640564039457582212845013923569)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18437860501968519533n); + input.add256(115792089237316195423570985008687907853269984665640564039457582212845013923569n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint64_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint64, euint256) => ebool test 2 (18437860501968519529, 18437860501968519533)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18437860501968519529n); + input.add256(18437860501968519533n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint64_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint64, euint256) => ebool test 3 (18437860501968519533, 18437860501968519533)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18437860501968519533n); + input.add256(18437860501968519533n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint64_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint64, euint256) => ebool test 4 (18437860501968519533, 18437860501968519529)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add64(18437860501968519533n); + input.add256(18437860501968519529n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint64_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "add" overload (euint128, euint8) => euint128 test 1 (129, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(129n); + input.add8(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(131n); + }); + + it('test operator "add" overload (euint128, euint8) => euint128 test 2 (122, 124)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(122n); + input.add8(124n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(246n); + }); + + it('test operator "add" overload (euint128, euint8) => euint128 test 3 (124, 124)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(124n); + input.add8(124n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(248n); + }); + + it('test operator "add" overload (euint128, euint8) => euint128 test 4 (124, 122)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(124n); + input.add8(122n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(246n); + }); + + it('test operator "sub" overload (euint128, euint8) => euint128 test 1 (162, 162)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(162n); + input.add8(162n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.sub_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint128, euint8) => euint128 test 2 (162, 158)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(162n); + input.add8(158n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.sub_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint128, euint8) => euint128 test 1 (65, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(65n); + input.add8(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(130n); + }); + + it('test operator "mul" overload (euint128, euint8) => euint128 test 2 (9, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(9n); + input.add8(9n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(81n); + }); + + it('test operator "mul" overload (euint128, euint8) => euint128 test 3 (9, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(9n); + input.add8(9n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(81n); + }); + + it('test operator "mul" overload (euint128, euint8) => euint128 test 4 (9, 9)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(9n); + input.add8(9n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(81n); + }); + + it('test operator "and" overload (euint128, euint8) => euint128 test 1 (340282366920938463463367896487725737283, 134)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463367896487725737283n); + input.add8(134n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(2n); + }); + + it('test operator "and" overload (euint128, euint8) => euint128 test 2 (130, 134)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(130n); + input.add8(134n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(130n); + }); + + it('test operator "and" overload (euint128, euint8) => euint128 test 3 (134, 134)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(134n); + input.add8(134n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(134n); + }); + + it('test operator "and" overload (euint128, euint8) => euint128 test 4 (134, 130)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(134n); + input.add8(130n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(130n); + }); + + it('test operator "or" overload (euint128, euint8) => euint128 test 1 (340282366920938463463372661120915153851, 91)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463372661120915153851n); + input.add8(91n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463372661120915153915n); + }); + + it('test operator "or" overload (euint128, euint8) => euint128 test 2 (87, 91)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(87n); + input.add8(91n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(95n); + }); + + it('test operator "or" overload (euint128, euint8) => euint128 test 3 (91, 91)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(91n); + input.add8(91n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(91n); + }); + + it('test operator "or" overload (euint128, euint8) => euint128 test 4 (91, 87)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(91n); + input.add8(87n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(95n); + }); + + it('test operator "xor" overload (euint128, euint8) => euint128 test 1 (340282366920938463463368592994606166225, 224)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463368592994606166225n); + input.add8(224n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463368592994606166065n); + }); + + it('test operator "xor" overload (euint128, euint8) => euint128 test 2 (220, 224)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(220n); + input.add8(224n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(60n); + }); + + it('test operator "xor" overload (euint128, euint8) => euint128 test 3 (224, 224)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(224n); + input.add8(224n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint128, euint8) => euint128 test 4 (224, 220)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(224n); + input.add8(220n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(60n); + }); + + it('test operator "eq" overload (euint128, euint8) => ebool test 1 (340282366920938463463365997268082750461, 161)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463365997268082750461n); + input.add8(161n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint128, euint8) => ebool test 2 (157, 161)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(157n); + input.add8(161n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint128, euint8) => ebool test 3 (161, 161)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(161n); + input.add8(161n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint128, euint8) => ebool test 4 (161, 157)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(161n); + input.add8(157n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint128, euint8) => ebool test 1 (340282366920938463463371200261392717711, 58)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463371200261392717711n); + input.add8(58n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint128, euint8) => ebool test 2 (54, 58)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(54n); + input.add8(58n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint128, euint8) => ebool test 3 (58, 58)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(58n); + input.add8(58n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint128, euint8) => ebool test 4 (58, 54)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(58n); + input.add8(54n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint128, euint8) => ebool test 1 (340282366920938463463369625633157745843, 133)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463369625633157745843n); + input.add8(133n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint128, euint8) => ebool test 2 (129, 133)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(129n); + input.add8(133n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint128, euint8) => ebool test 3 (133, 133)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(133n); + input.add8(133n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint128, euint8) => ebool test 4 (133, 129)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(133n); + input.add8(129n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint128, euint8) => ebool test 1 (340282366920938463463373227679404414827, 27)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463373227679404414827n); + input.add8(27n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint128, euint8) => ebool test 2 (23, 27)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(23n); + input.add8(27n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint128, euint8) => ebool test 3 (27, 27)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(27n); + input.add8(27n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint128, euint8) => ebool test 4 (27, 23)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(27n); + input.add8(23n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint128, euint8) => ebool test 1 (340282366920938463463373260679185947587, 145)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463373260679185947587n); + input.add8(145n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (euint128, euint8) => ebool test 2 (141, 145)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(141n); + input.add8(145n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint128, euint8) => ebool test 3 (145, 145)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(145n); + input.add8(145n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint128, euint8) => ebool test 4 (145, 141)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(145n); + input.add8(141n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint128, euint8) => ebool test 1 (340282366920938463463369400683321900663, 242)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463369400683321900663n); + input.add8(242n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint128, euint8) => ebool test 2 (238, 242)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(238n); + input.add8(242n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint128, euint8) => ebool test 3 (242, 242)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(242n); + input.add8(242n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint128, euint8) => ebool test 4 (242, 238)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(242n); + input.add8(238n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); +}); diff --git a/contracts/test/httpzOperations/httpzOperations7.ts b/contracts/test/httpzOperations/httpzOperations7.ts new file mode 100644 index 00000000..c185b757 --- /dev/null +++ b/contracts/test/httpzOperations/httpzOperations7.ts @@ -0,0 +1,3136 @@ +import { expect } from 'chai'; +import { ethers } from 'hardhat'; + +import type { HTTPZTestSuite1 } from '../../types/contracts/tests/HTTPZTestSuite1'; +import type { HTTPZTestSuite2 } from '../../types/contracts/tests/HTTPZTestSuite2'; +import type { HTTPZTestSuite3 } from '../../types/contracts/tests/HTTPZTestSuite3'; +import type { HTTPZTestSuite4 } from '../../types/contracts/tests/HTTPZTestSuite4'; +import type { HTTPZTestSuite5 } from '../../types/contracts/tests/HTTPZTestSuite5'; +import type { HTTPZTestSuite6 } from '../../types/contracts/tests/HTTPZTestSuite6'; +import type { HTTPZTestSuite7 } from '../../types/contracts/tests/HTTPZTestSuite7'; +import { + createInstances, + decrypt8, + decrypt16, + decrypt32, + decrypt64, + decrypt128, + decrypt256, + decryptBool, +} from '../instance'; +import { getSigners, initSigners } from '../signers'; + +async function deployHTTPZTestFixture1(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite1'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture2(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite2'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture3(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite3'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture4(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite4'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture5(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite5'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture6(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite6'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture7(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite7'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +describe('HTTPZ operations 7', function () { + before(async function () { + await initSigners(1); + this.signers = await getSigners(); + + const contract1 = await deployHTTPZTestFixture1(); + this.contract1Address = await contract1.getAddress(); + this.contract1 = contract1; + + const contract2 = await deployHTTPZTestFixture2(); + this.contract2Address = await contract2.getAddress(); + this.contract2 = contract2; + + const contract3 = await deployHTTPZTestFixture3(); + this.contract3Address = await contract3.getAddress(); + this.contract3 = contract3; + + const contract4 = await deployHTTPZTestFixture4(); + this.contract4Address = await contract4.getAddress(); + this.contract4 = contract4; + + const contract5 = await deployHTTPZTestFixture5(); + this.contract5Address = await contract5.getAddress(); + this.contract5 = contract5; + + const contract6 = await deployHTTPZTestFixture6(); + this.contract6Address = await contract6.getAddress(); + this.contract6 = contract6; + + const contract7 = await deployHTTPZTestFixture7(); + this.contract7Address = await contract7.getAddress(); + this.contract7 = contract7; + + const instances = await createInstances(this.signers); + this.instances = instances; + }); + + it('test operator "min" overload (euint128, euint8) => euint128 test 1 (340282366920938463463370325327611449529, 117)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463370325327611449529n); + input.add8(117n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(117n); + }); + + it('test operator "min" overload (euint128, euint8) => euint128 test 2 (113, 117)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(113n); + input.add8(117n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(113n); + }); + + it('test operator "min" overload (euint128, euint8) => euint128 test 3 (117, 117)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(117n); + input.add8(117n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(117n); + }); + + it('test operator "min" overload (euint128, euint8) => euint128 test 4 (117, 113)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(117n); + input.add8(113n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(113n); + }); + + it('test operator "max" overload (euint128, euint8) => euint128 test 1 (340282366920938463463373991991235874367, 104)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463373991991235874367n); + input.add8(104n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463373991991235874367n); + }); + + it('test operator "max" overload (euint128, euint8) => euint128 test 2 (100, 104)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(100n); + input.add8(104n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(104n); + }); + + it('test operator "max" overload (euint128, euint8) => euint128 test 3 (104, 104)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(104n); + input.add8(104n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(104n); + }); + + it('test operator "max" overload (euint128, euint8) => euint128 test 4 (104, 100)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(104n); + input.add8(100n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint128_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(104n); + }); + + it('test operator "add" overload (euint128, euint16) => euint128 test 1 (32769, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(32769n); + input.add16(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(32771n); + }); + + it('test operator "add" overload (euint128, euint16) => euint128 test 2 (13163, 13167)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(13163n); + input.add16(13167n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(26330n); + }); + + it('test operator "add" overload (euint128, euint16) => euint128 test 3 (13167, 13167)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(13167n); + input.add16(13167n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(26334n); + }); + + it('test operator "add" overload (euint128, euint16) => euint128 test 4 (13167, 13163)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(13167n); + input.add16(13163n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(26330n); + }); + + it('test operator "sub" overload (euint128, euint16) => euint128 test 1 (21276, 21276)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(21276n); + input.add16(21276n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.sub_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint128, euint16) => euint128 test 2 (21276, 21272)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(21276n); + input.add16(21272n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.sub_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint128, euint16) => euint128 test 1 (16385, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(16385n); + input.add16(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(32770n); + }); + + it('test operator "mul" overload (euint128, euint16) => euint128 test 2 (204, 204)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(204n); + input.add16(204n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(41616n); + }); + + it('test operator "mul" overload (euint128, euint16) => euint128 test 3 (204, 204)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(204n); + input.add16(204n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(41616n); + }); + + it('test operator "mul" overload (euint128, euint16) => euint128 test 4 (204, 204)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(204n); + input.add16(204n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(41616n); + }); + + it('test operator "and" overload (euint128, euint16) => euint128 test 1 (340282366920938463463367963132962188941, 5475)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463367963132962188941n); + input.add16(5475n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(1025n); + }); + + it('test operator "and" overload (euint128, euint16) => euint128 test 2 (5471, 5475)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(5471n); + input.add16(5475n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(5443n); + }); + + it('test operator "and" overload (euint128, euint16) => euint128 test 3 (5475, 5475)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(5475n); + input.add16(5475n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(5475n); + }); + + it('test operator "and" overload (euint128, euint16) => euint128 test 4 (5475, 5471)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(5475n); + input.add16(5471n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(5443n); + }); + + it('test operator "or" overload (euint128, euint16) => euint128 test 1 (340282366920938463463368567436203477099, 39291)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463368567436203477099n); + input.add16(39291n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463368567436203514235n); + }); + + it('test operator "or" overload (euint128, euint16) => euint128 test 2 (39287, 39291)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(39287n); + input.add16(39291n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(39295n); + }); + + it('test operator "or" overload (euint128, euint16) => euint128 test 3 (39291, 39291)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(39291n); + input.add16(39291n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(39291n); + }); + + it('test operator "or" overload (euint128, euint16) => euint128 test 4 (39291, 39287)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(39291n); + input.add16(39287n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(39295n); + }); + + it('test operator "xor" overload (euint128, euint16) => euint128 test 1 (340282366920938463463367189396823456785, 15649)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463367189396823456785n); + input.add16(15649n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463367189396823441712n); + }); + + it('test operator "xor" overload (euint128, euint16) => euint128 test 2 (15645, 15649)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(15645n); + input.add16(15649n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(60n); + }); + + it('test operator "xor" overload (euint128, euint16) => euint128 test 3 (15649, 15649)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(15649n); + input.add16(15649n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint128, euint16) => euint128 test 4 (15649, 15645)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(15649n); + input.add16(15645n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(60n); + }); + + it('test operator "eq" overload (euint128, euint16) => ebool test 1 (340282366920938463463372277054552679059, 29134)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463372277054552679059n); + input.add16(29134n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint128, euint16) => ebool test 2 (29130, 29134)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(29130n); + input.add16(29134n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint128, euint16) => ebool test 3 (29134, 29134)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(29134n); + input.add16(29134n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint128, euint16) => ebool test 4 (29134, 29130)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(29134n); + input.add16(29130n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint128, euint16) => ebool test 1 (340282366920938463463373548253403468009, 6549)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463373548253403468009n); + input.add16(6549n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint128, euint16) => ebool test 2 (6545, 6549)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(6545n); + input.add16(6549n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint128, euint16) => ebool test 3 (6549, 6549)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(6549n); + input.add16(6549n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint128, euint16) => ebool test 4 (6549, 6545)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(6549n); + input.add16(6545n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint128, euint16) => ebool test 1 (340282366920938463463370451621944126719, 54441)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463370451621944126719n); + input.add16(54441n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint128, euint16) => ebool test 2 (54437, 54441)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(54437n); + input.add16(54441n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint128, euint16) => ebool test 3 (54441, 54441)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(54441n); + input.add16(54441n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint128, euint16) => ebool test 4 (54441, 54437)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(54441n); + input.add16(54437n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint128, euint16) => ebool test 1 (340282366920938463463368150024181171555, 34736)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463368150024181171555n); + input.add16(34736n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint128, euint16) => ebool test 2 (34732, 34736)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(34732n); + input.add16(34736n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint128, euint16) => ebool test 3 (34736, 34736)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(34736n); + input.add16(34736n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint128, euint16) => ebool test 4 (34736, 34732)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(34736n); + input.add16(34732n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint128, euint16) => ebool test 1 (340282366920938463463374168977594842789, 25330)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463374168977594842789n); + input.add16(25330n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (euint128, euint16) => ebool test 2 (25326, 25330)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(25326n); + input.add16(25330n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint128, euint16) => ebool test 3 (25330, 25330)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(25330n); + input.add16(25330n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint128, euint16) => ebool test 4 (25330, 25326)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(25330n); + input.add16(25326n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint128, euint16) => ebool test 1 (340282366920938463463368514598461203523, 35806)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463368514598461203523n); + input.add16(35806n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint128, euint16) => ebool test 2 (35802, 35806)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(35802n); + input.add16(35806n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint128, euint16) => ebool test 3 (35806, 35806)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(35806n); + input.add16(35806n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint128, euint16) => ebool test 4 (35806, 35802)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(35806n); + input.add16(35802n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint128, euint16) => euint128 test 1 (340282366920938463463373974024081482581, 43998)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463373974024081482581n); + input.add16(43998n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(43998n); + }); + + it('test operator "min" overload (euint128, euint16) => euint128 test 2 (43994, 43998)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(43994n); + input.add16(43998n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(43994n); + }); + + it('test operator "min" overload (euint128, euint16) => euint128 test 3 (43998, 43998)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(43998n); + input.add16(43998n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(43998n); + }); + + it('test operator "min" overload (euint128, euint16) => euint128 test 4 (43998, 43994)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(43998n); + input.add16(43994n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(43994n); + }); + + it('test operator "max" overload (euint128, euint16) => euint128 test 1 (340282366920938463463368481903072128487, 16205)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463368481903072128487n); + input.add16(16205n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463368481903072128487n); + }); + + it('test operator "max" overload (euint128, euint16) => euint128 test 2 (16201, 16205)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(16201n); + input.add16(16205n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(16205n); + }); + + it('test operator "max" overload (euint128, euint16) => euint128 test 3 (16205, 16205)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(16205n); + input.add16(16205n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(16205n); + }); + + it('test operator "max" overload (euint128, euint16) => euint128 test 4 (16205, 16201)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(16205n); + input.add16(16201n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint128_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(16205n); + }); + + it('test operator "add" overload (euint128, euint32) => euint128 test 1 (2147483649, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(2147483649n); + input.add32(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(2147483651n); + }); + + it('test operator "add" overload (euint128, euint32) => euint128 test 2 (1854957565, 1854957567)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(1854957565n); + input.add32(1854957567n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(3709915132n); + }); + + it('test operator "add" overload (euint128, euint32) => euint128 test 3 (1854957567, 1854957567)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(1854957567n); + input.add32(1854957567n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(3709915134n); + }); + + it('test operator "add" overload (euint128, euint32) => euint128 test 4 (1854957567, 1854957565)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(1854957567n); + input.add32(1854957565n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(3709915132n); + }); + + it('test operator "sub" overload (euint128, euint32) => euint128 test 1 (3908355536, 3908355536)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(3908355536n); + input.add32(3908355536n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.sub_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint128, euint32) => euint128 test 2 (3908355536, 3908355532)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(3908355536n); + input.add32(3908355532n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.sub_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint128, euint32) => euint128 test 1 (1073741825, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(1073741825n); + input.add32(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(2147483650n); + }); + + it('test operator "mul" overload (euint128, euint32) => euint128 test 2 (43656, 43656)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(43656n); + input.add32(43656n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(1905846336n); + }); + + it('test operator "mul" overload (euint128, euint32) => euint128 test 3 (43656, 43656)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(43656n); + input.add32(43656n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(1905846336n); + }); + + it('test operator "mul" overload (euint128, euint32) => euint128 test 4 (43656, 43656)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(43656n); + input.add32(43656n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(1905846336n); + }); + + it('test operator "and" overload (euint128, euint32) => euint128 test 1 (340282366920938463463367750713425096539, 694136323)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463367750713425096539n); + input.add32(694136323n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(139800067n); + }); + + it('test operator "and" overload (euint128, euint32) => euint128 test 2 (694136319, 694136323)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(694136319n); + input.add32(694136323n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(694135811n); + }); + + it('test operator "and" overload (euint128, euint32) => euint128 test 3 (694136323, 694136323)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(694136323n); + input.add32(694136323n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(694136323n); + }); + + it('test operator "and" overload (euint128, euint32) => euint128 test 4 (694136323, 694136319)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(694136323n); + input.add32(694136319n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(694135811n); + }); + + it('test operator "or" overload (euint128, euint32) => euint128 test 1 (340282366920938463463373509987285879583, 3522791248)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463373509987285879583n); + input.add32(3522791248n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463373509989710286687n); + }); + + it('test operator "or" overload (euint128, euint32) => euint128 test 2 (3522791244, 3522791248)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(3522791244n); + input.add32(3522791248n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(3522791260n); + }); + + it('test operator "or" overload (euint128, euint32) => euint128 test 3 (3522791248, 3522791248)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(3522791248n); + input.add32(3522791248n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(3522791248n); + }); + + it('test operator "or" overload (euint128, euint32) => euint128 test 4 (3522791248, 3522791244)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(3522791248n); + input.add32(3522791244n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(3522791260n); + }); + + it('test operator "xor" overload (euint128, euint32) => euint128 test 1 (340282366920938463463366740128848143395, 993709645)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463366740128848143395n); + input.add32(993709645n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463366740129569909358n); + }); + + it('test operator "xor" overload (euint128, euint32) => euint128 test 2 (993709641, 993709645)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(993709641n); + input.add32(993709645n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint128, euint32) => euint128 test 3 (993709645, 993709645)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(993709645n); + input.add32(993709645n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint128, euint32) => euint128 test 4 (993709645, 993709641)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(993709645n); + input.add32(993709641n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(4n); + }); + + it('test operator "eq" overload (euint128, euint32) => ebool test 1 (340282366920938463463373321607778886337, 2679889002)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463373321607778886337n); + input.add32(2679889002n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint128, euint32) => ebool test 2 (2679888998, 2679889002)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(2679888998n); + input.add32(2679889002n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint128, euint32) => ebool test 3 (2679889002, 2679889002)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(2679889002n); + input.add32(2679889002n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint128, euint32) => ebool test 4 (2679889002, 2679888998)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(2679889002n); + input.add32(2679888998n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint128, euint32) => ebool test 1 (340282366920938463463367449531400554407, 3538700800)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463367449531400554407n); + input.add32(3538700800n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint128, euint32) => ebool test 2 (3538700796, 3538700800)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(3538700796n); + input.add32(3538700800n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint128, euint32) => ebool test 3 (3538700800, 3538700800)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(3538700800n); + input.add32(3538700800n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint128, euint32) => ebool test 4 (3538700800, 3538700796)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(3538700800n); + input.add32(3538700796n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint128, euint32) => ebool test 1 (340282366920938463463373688501741191975, 4023270845)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463373688501741191975n); + input.add32(4023270845n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint128, euint32) => ebool test 2 (4023270841, 4023270845)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(4023270841n); + input.add32(4023270845n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint128, euint32) => ebool test 3 (4023270845, 4023270845)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(4023270845n); + input.add32(4023270845n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint128, euint32) => ebool test 4 (4023270845, 4023270841)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(4023270845n); + input.add32(4023270841n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint128, euint32) => ebool test 1 (340282366920938463463371212946578640253, 1009990216)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463371212946578640253n); + input.add32(1009990216n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint128, euint32) => ebool test 2 (1009990212, 1009990216)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(1009990212n); + input.add32(1009990216n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint128, euint32) => ebool test 3 (1009990216, 1009990216)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(1009990216n); + input.add32(1009990216n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint128, euint32) => ebool test 4 (1009990216, 1009990212)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(1009990216n); + input.add32(1009990212n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint128, euint32) => ebool test 1 (340282366920938463463374362728592104657, 2656121355)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463374362728592104657n); + input.add32(2656121355n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (euint128, euint32) => ebool test 2 (2656121351, 2656121355)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(2656121351n); + input.add32(2656121355n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint128, euint32) => ebool test 3 (2656121355, 2656121355)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(2656121355n); + input.add32(2656121355n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint128, euint32) => ebool test 4 (2656121355, 2656121351)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(2656121355n); + input.add32(2656121351n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint128, euint32) => ebool test 1 (340282366920938463463369249794799973517, 3991355395)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463369249794799973517n); + input.add32(3991355395n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint128, euint32) => ebool test 2 (3991355391, 3991355395)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(3991355391n); + input.add32(3991355395n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint128, euint32) => ebool test 3 (3991355395, 3991355395)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(3991355395n); + input.add32(3991355395n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint128, euint32) => ebool test 4 (3991355395, 3991355391)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(3991355395n); + input.add32(3991355391n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint128, euint32) => euint128 test 1 (340282366920938463463371991582957988145, 1996142801)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463371991582957988145n); + input.add32(1996142801n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(1996142801n); + }); + + it('test operator "min" overload (euint128, euint32) => euint128 test 2 (1996142797, 1996142801)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(1996142797n); + input.add32(1996142801n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(1996142797n); + }); + + it('test operator "min" overload (euint128, euint32) => euint128 test 3 (1996142801, 1996142801)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(1996142801n); + input.add32(1996142801n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(1996142801n); + }); + + it('test operator "min" overload (euint128, euint32) => euint128 test 4 (1996142801, 1996142797)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(1996142801n); + input.add32(1996142797n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(1996142797n); + }); + + it('test operator "max" overload (euint128, euint32) => euint128 test 1 (340282366920938463463368024828702403367, 4292520200)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463368024828702403367n); + input.add32(4292520200n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463368024828702403367n); + }); + + it('test operator "max" overload (euint128, euint32) => euint128 test 2 (4292520196, 4292520200)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(4292520196n); + input.add32(4292520200n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(4292520200n); + }); + + it('test operator "max" overload (euint128, euint32) => euint128 test 3 (4292520200, 4292520200)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(4292520200n); + input.add32(4292520200n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(4292520200n); + }); + + it('test operator "max" overload (euint128, euint32) => euint128 test 4 (4292520200, 4292520196)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(4292520200n); + input.add32(4292520196n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint128_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(4292520200n); + }); + + it('test operator "add" overload (euint128, euint64) => euint128 test 1 (9223372036854775809, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(9223372036854775809n); + input.add64(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(9223372036854775811n); + }); + + it('test operator "add" overload (euint128, euint64) => euint128 test 2 (9221046676882949229, 9221046676882949231)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(9221046676882949229n); + input.add64(9221046676882949231n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18442093353765898460n); + }); + + it('test operator "add" overload (euint128, euint64) => euint128 test 3 (9221046676882949231, 9221046676882949231)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(9221046676882949231n); + input.add64(9221046676882949231n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18442093353765898462n); + }); + + it('test operator "add" overload (euint128, euint64) => euint128 test 4 (9221046676882949231, 9221046676882949229)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(9221046676882949231n); + input.add64(9221046676882949229n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18442093353765898460n); + }); + + it('test operator "sub" overload (euint128, euint64) => euint128 test 1 (18440000751246273417, 18440000751246273417)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18440000751246273417n); + input.add64(18440000751246273417n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.sub_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint128, euint64) => euint128 test 2 (18440000751246273417, 18440000751246273413)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18440000751246273417n); + input.add64(18440000751246273413n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.sub_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint128, euint64) => euint128 test 1 (4611686018427387905, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(4611686018427387905n); + input.add64(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(9223372036854775810n); + }); + + it('test operator "mul" overload (euint128, euint64) => euint128 test 2 (4293053834, 4293053834)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(4293053834n); + input.add64(4293053834n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18430311221622099556n); + }); + + it('test operator "mul" overload (euint128, euint64) => euint128 test 3 (4293053834, 4293053834)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(4293053834n); + input.add64(4293053834n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18430311221622099556n); + }); + + it('test operator "mul" overload (euint128, euint64) => euint128 test 4 (4293053834, 4293053834)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(4293053834n); + input.add64(4293053834n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18430311221622099556n); + }); + + it('test operator "and" overload (euint128, euint64) => euint128 test 1 (340282366920938463463371398732235092587, 18443291285144205545)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463371398732235092587n); + input.add64(18443291285144205545n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18442409472522661993n); + }); + + it('test operator "and" overload (euint128, euint64) => euint128 test 2 (18443291285144205541, 18443291285144205545)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18443291285144205541n); + input.add64(18443291285144205545n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18443291285144205537n); + }); + + it('test operator "and" overload (euint128, euint64) => euint128 test 3 (18443291285144205545, 18443291285144205545)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18443291285144205545n); + input.add64(18443291285144205545n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18443291285144205545n); + }); + + it('test operator "and" overload (euint128, euint64) => euint128 test 4 (18443291285144205545, 18443291285144205541)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18443291285144205545n); + input.add64(18443291285144205541n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18443291285144205537n); + }); + + it('test operator "or" overload (euint128, euint64) => euint128 test 1 (340282366920938463463372282119885155619, 18440706154160796299)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463372282119885155619n); + input.add64(18440706154160796299n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463374534517974892459n); + }); + + it('test operator "or" overload (euint128, euint64) => euint128 test 2 (18440706154160796295, 18440706154160796299)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18440706154160796295n); + input.add64(18440706154160796299n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18440706154160796303n); + }); + + it('test operator "or" overload (euint128, euint64) => euint128 test 3 (18440706154160796299, 18440706154160796299)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18440706154160796299n); + input.add64(18440706154160796299n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18440706154160796299n); + }); + + it('test operator "or" overload (euint128, euint64) => euint128 test 4 (18440706154160796299, 18440706154160796295)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18440706154160796299n); + input.add64(18440706154160796295n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.or_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18440706154160796303n); + }); + + it('test operator "xor" overload (euint128, euint64) => euint128 test 1 (340282366920938463463371053857970311983, 18441210023123300149)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463371053857970311983n); + input.add64(18441210023123300149n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463444936649299132218394n); + }); + + it('test operator "xor" overload (euint128, euint64) => euint128 test 2 (18441210023123300145, 18441210023123300149)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18441210023123300145n); + input.add64(18441210023123300149n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint128, euint64) => euint128 test 3 (18441210023123300149, 18441210023123300149)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18441210023123300149n); + input.add64(18441210023123300149n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint128, euint64) => euint128 test 4 (18441210023123300149, 18441210023123300145)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18441210023123300149n); + input.add64(18441210023123300145n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.xor_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(4n); + }); + + it('test operator "eq" overload (euint128, euint64) => ebool test 1 (340282366920938463463368992125107189535, 18444861749755063139)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463368992125107189535n); + input.add64(18444861749755063139n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint128, euint64) => ebool test 2 (18444861749755063135, 18444861749755063139)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18444861749755063135n); + input.add64(18444861749755063139n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint128, euint64) => ebool test 3 (18444861749755063139, 18444861749755063139)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18444861749755063139n); + input.add64(18444861749755063139n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint128, euint64) => ebool test 4 (18444861749755063139, 18444861749755063135)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18444861749755063139n); + input.add64(18444861749755063135n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.eq_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint128, euint64) => ebool test 1 (340282366920938463463371782422707667701, 18446046014358714303)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463371782422707667701n); + input.add64(18446046014358714303n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint128, euint64) => ebool test 2 (18446046014358714299, 18446046014358714303)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18446046014358714299n); + input.add64(18446046014358714303n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint128, euint64) => ebool test 3 (18446046014358714303, 18446046014358714303)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18446046014358714303n); + input.add64(18446046014358714303n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint128, euint64) => ebool test 4 (18446046014358714303, 18446046014358714299)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18446046014358714303n); + input.add64(18446046014358714299n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ne_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint128, euint64) => ebool test 1 (340282366920938463463369530044263677639, 18443878485685194959)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463369530044263677639n); + input.add64(18443878485685194959n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint128, euint64) => ebool test 2 (18443878485685194955, 18443878485685194959)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18443878485685194955n); + input.add64(18443878485685194959n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint128, euint64) => ebool test 3 (18443878485685194959, 18443878485685194959)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18443878485685194959n); + input.add64(18443878485685194959n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint128, euint64) => ebool test 4 (18443878485685194959, 18443878485685194955)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18443878485685194959n); + input.add64(18443878485685194955n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.ge_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint128, euint64) => ebool test 1 (340282366920938463463371909529878472395, 18446243825441200463)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463371909529878472395n); + input.add64(18446243825441200463n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint128, euint64) => ebool test 2 (18446243825441200459, 18446243825441200463)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18446243825441200459n); + input.add64(18446243825441200463n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint128, euint64) => ebool test 3 (18446243825441200463, 18446243825441200463)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18446243825441200463n); + input.add64(18446243825441200463n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint128, euint64) => ebool test 4 (18446243825441200463, 18446243825441200459)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18446243825441200463n); + input.add64(18446243825441200459n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.gt_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint128, euint64) => ebool test 1 (340282366920938463463367271707389118081, 18441333112680594301)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463367271707389118081n); + input.add64(18441333112680594301n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (euint128, euint64) => ebool test 2 (18441333112680594297, 18441333112680594301)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18441333112680594297n); + input.add64(18441333112680594301n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint128, euint64) => ebool test 3 (18441333112680594301, 18441333112680594301)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18441333112680594301n); + input.add64(18441333112680594301n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint128, euint64) => ebool test 4 (18441333112680594301, 18441333112680594297)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18441333112680594301n); + input.add64(18441333112680594297n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.le_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint128, euint64) => ebool test 1 (340282366920938463463371488993642338949, 18439230167343827447)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463371488993642338949n); + input.add64(18439230167343827447n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint128, euint64) => ebool test 2 (18439230167343827443, 18439230167343827447)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18439230167343827443n); + input.add64(18439230167343827447n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint128, euint64) => ebool test 3 (18439230167343827447, 18439230167343827447)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18439230167343827447n); + input.add64(18439230167343827447n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint128, euint64) => ebool test 4 (18439230167343827447, 18439230167343827443)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18439230167343827447n); + input.add64(18439230167343827443n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.lt_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract4.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint128, euint64) => euint128 test 1 (340282366920938463463366964846591823327, 18438609511183794923)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463366964846591823327n); + input.add64(18438609511183794923n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18438609511183794923n); + }); + + it('test operator "min" overload (euint128, euint64) => euint128 test 2 (18438609511183794919, 18438609511183794923)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18438609511183794919n); + input.add64(18438609511183794923n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18438609511183794919n); + }); + + it('test operator "min" overload (euint128, euint64) => euint128 test 3 (18438609511183794923, 18438609511183794923)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18438609511183794923n); + input.add64(18438609511183794923n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18438609511183794923n); + }); + + it('test operator "min" overload (euint128, euint64) => euint128 test 4 (18438609511183794923, 18438609511183794919)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18438609511183794923n); + input.add64(18438609511183794919n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.min_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18438609511183794919n); + }); + + it('test operator "max" overload (euint128, euint64) => euint128 test 1 (340282366920938463463373933410034195357, 18440535476606729897)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463373933410034195357n); + input.add64(18440535476606729897n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463373933410034195357n); + }); + + it('test operator "max" overload (euint128, euint64) => euint128 test 2 (18440535476606729893, 18440535476606729897)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18440535476606729893n); + input.add64(18440535476606729897n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18440535476606729897n); + }); + + it('test operator "max" overload (euint128, euint64) => euint128 test 3 (18440535476606729897, 18440535476606729897)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18440535476606729897n); + input.add64(18440535476606729897n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18440535476606729897n); + }); + + it('test operator "max" overload (euint128, euint64) => euint128 test 4 (18440535476606729897, 18440535476606729893)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(18440535476606729897n); + input.add64(18440535476606729893n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.max_euint128_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(18440535476606729897n); + }); + + it('test operator "add" overload (euint128, euint128) => euint128 test 1 (170141183460469231731686328461725635101, 170141183460469231731685352077984908026)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(170141183460469231731686328461725635101n); + input.add128(170141183460469231731685352077984908026n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463371680539710543127n); + }); + + it('test operator "add" overload (euint128, euint128) => euint128 test 2 (170141183460469231731685352077984908024, 170141183460469231731685352077984908026)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(170141183460469231731685352077984908024n); + input.add128(170141183460469231731685352077984908026n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463370704155969816050n); + }); + + it('test operator "add" overload (euint128, euint128) => euint128 test 3 (170141183460469231731685352077984908026, 170141183460469231731685352077984908026)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(170141183460469231731685352077984908026n); + input.add128(170141183460469231731685352077984908026n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463370704155969816052n); + }); + + it('test operator "add" overload (euint128, euint128) => euint128 test 4 (170141183460469231731685352077984908026, 170141183460469231731685352077984908024)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(170141183460469231731685352077984908026n); + input.add128(170141183460469231731685352077984908024n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.add_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463370704155969816050n); + }); + + it('test operator "sub" overload (euint128, euint128) => euint128 test 1 (340282366920938463463371325512794994309, 340282366920938463463371325512794994309)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463371325512794994309n); + input.add128(340282366920938463463371325512794994309n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.sub_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint128, euint128) => euint128 test 2 (340282366920938463463371325512794994309, 340282366920938463463371325512794994305)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463371325512794994309n); + input.add128(340282366920938463463371325512794994305n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.sub_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint128, euint128) => euint128 test 1 (9223372036854775809, 9223372036854775809)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(9223372036854775809n); + input.add128(9223372036854775809n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(85070591730234615884290395931651604481n); + }); + + it('test operator "mul" overload (euint128, euint128) => euint128 test 2 (9223372036854775809, 9223372036854775809)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(9223372036854775809n); + input.add128(9223372036854775809n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(85070591730234615884290395931651604481n); + }); + + it('test operator "mul" overload (euint128, euint128) => euint128 test 3 (9223372036854775809, 9223372036854775809)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(9223372036854775809n); + input.add128(9223372036854775809n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(85070591730234615884290395931651604481n); + }); + + it('test operator "mul" overload (euint128, euint128) => euint128 test 4 (9223372036854775809, 9223372036854775809)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(9223372036854775809n); + input.add128(9223372036854775809n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.mul_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(85070591730234615884290395931651604481n); + }); + + it('test operator "and" overload (euint128, euint128) => euint128 test 1 (340282366920938463463369448280898636513, 340282366920938463463370871201487596811)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463369448280898636513n); + input.add128(340282366920938463463370871201487596811n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463365786887783647233n); + }); + + it('test operator "and" overload (euint128, euint128) => euint128 test 2 (340282366920938463463369448280898636509, 340282366920938463463369448280898636513)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463369448280898636509n); + input.add128(340282366920938463463369448280898636513n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463369448280898636481n); + }); + + it('test operator "and" overload (euint128, euint128) => euint128 test 3 (340282366920938463463369448280898636513, 340282366920938463463369448280898636513)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463369448280898636513n); + input.add128(340282366920938463463369448280898636513n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463369448280898636513n); + }); + + it('test operator "and" overload (euint128, euint128) => euint128 test 4 (340282366920938463463369448280898636513, 340282366920938463463369448280898636509)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); + input.add128(340282366920938463463369448280898636513n); + input.add128(340282366920938463463369448280898636509n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract4.and_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract4.resEuint128()); + expect(res).to.equal(340282366920938463463369448280898636481n); + }); + + it('test operator "or" overload (euint128, euint128) => euint128 test 1 (340282366920938463463369943867774092587, 340282366920938463463366792612134320315)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463369943867774092587n); + input.add128(340282366920938463463366792612134320315n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract5.resEuint128()); + expect(res).to.equal(340282366920938463463369961960374205883n); + }); + + it('test operator "or" overload (euint128, euint128) => euint128 test 2 (340282366920938463463366792612134320311, 340282366920938463463366792612134320315)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463366792612134320311n); + input.add128(340282366920938463463366792612134320315n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract5.resEuint128()); + expect(res).to.equal(340282366920938463463366792612134320319n); + }); + + it('test operator "or" overload (euint128, euint128) => euint128 test 3 (340282366920938463463366792612134320315, 340282366920938463463366792612134320315)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463366792612134320315n); + input.add128(340282366920938463463366792612134320315n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract5.resEuint128()); + expect(res).to.equal(340282366920938463463366792612134320315n); + }); + + it('test operator "or" overload (euint128, euint128) => euint128 test 4 (340282366920938463463366792612134320315, 340282366920938463463366792612134320311)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463366792612134320315n); + input.add128(340282366920938463463366792612134320311n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract5.resEuint128()); + expect(res).to.equal(340282366920938463463366792612134320319n); + }); + + it('test operator "xor" overload (euint128, euint128) => euint128 test 1 (340282366920938463463369885853425789025, 340282366920938463463370436699161336081)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463369885853425789025n); + input.add128(340282366920938463463370436699161336081n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract5.resEuint128()); + expect(res).to.equal(8469547809862000n); + }); + + it('test operator "xor" overload (euint128, euint128) => euint128 test 2 (340282366920938463463369885853425789021, 340282366920938463463369885853425789025)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463369885853425789021n); + input.add128(340282366920938463463369885853425789025n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract5.resEuint128()); + expect(res).to.equal(60n); + }); + + it('test operator "xor" overload (euint128, euint128) => euint128 test 3 (340282366920938463463369885853425789025, 340282366920938463463369885853425789025)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463369885853425789025n); + input.add128(340282366920938463463369885853425789025n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract5.resEuint128()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint128, euint128) => euint128 test 4 (340282366920938463463369885853425789025, 340282366920938463463369885853425789021)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463369885853425789025n); + input.add128(340282366920938463463369885853425789021n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract5.resEuint128()); + expect(res).to.equal(60n); + }); + + it('test operator "eq" overload (euint128, euint128) => ebool test 1 (340282366920938463463374345879343197185, 340282366920938463463368861870870547273)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463374345879343197185n); + input.add128(340282366920938463463368861870870547273n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint128, euint128) => ebool test 2 (340282366920938463463368861870870547269, 340282366920938463463368861870870547273)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463368861870870547269n); + input.add128(340282366920938463463368861870870547273n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint128, euint128) => ebool test 3 (340282366920938463463368861870870547273, 340282366920938463463368861870870547273)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463368861870870547273n); + input.add128(340282366920938463463368861870870547273n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint128, euint128) => ebool test 4 (340282366920938463463368861870870547273, 340282366920938463463368861870870547269)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463368861870870547273n); + input.add128(340282366920938463463368861870870547269n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint128, euint128) => ebool test 1 (340282366920938463463372337746623862115, 340282366920938463463372012747422501421)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463372337746623862115n); + input.add128(340282366920938463463372012747422501421n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint128, euint128) => ebool test 2 (340282366920938463463372012747422501417, 340282366920938463463372012747422501421)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463372012747422501417n); + input.add128(340282366920938463463372012747422501421n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint128, euint128) => ebool test 3 (340282366920938463463372012747422501421, 340282366920938463463372012747422501421)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463372012747422501421n); + input.add128(340282366920938463463372012747422501421n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint128, euint128) => ebool test 4 (340282366920938463463372012747422501421, 340282366920938463463372012747422501417)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463372012747422501421n); + input.add128(340282366920938463463372012747422501417n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); +}); diff --git a/contracts/test/httpzOperations/httpzOperations8.ts b/contracts/test/httpzOperations/httpzOperations8.ts new file mode 100644 index 00000000..314ed3f3 --- /dev/null +++ b/contracts/test/httpzOperations/httpzOperations8.ts @@ -0,0 +1,3036 @@ +import { expect } from 'chai'; +import { ethers } from 'hardhat'; + +import type { HTTPZTestSuite1 } from '../../types/contracts/tests/HTTPZTestSuite1'; +import type { HTTPZTestSuite2 } from '../../types/contracts/tests/HTTPZTestSuite2'; +import type { HTTPZTestSuite3 } from '../../types/contracts/tests/HTTPZTestSuite3'; +import type { HTTPZTestSuite4 } from '../../types/contracts/tests/HTTPZTestSuite4'; +import type { HTTPZTestSuite5 } from '../../types/contracts/tests/HTTPZTestSuite5'; +import type { HTTPZTestSuite6 } from '../../types/contracts/tests/HTTPZTestSuite6'; +import type { HTTPZTestSuite7 } from '../../types/contracts/tests/HTTPZTestSuite7'; +import { + createInstances, + decrypt8, + decrypt16, + decrypt32, + decrypt64, + decrypt128, + decrypt256, + decryptBool, +} from '../instance'; +import { getSigners, initSigners } from '../signers'; + +async function deployHTTPZTestFixture1(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite1'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture2(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite2'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture3(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite3'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture4(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite4'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture5(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite5'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture6(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite6'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture7(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite7'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +describe('HTTPZ operations 8', function () { + before(async function () { + await initSigners(1); + this.signers = await getSigners(); + + const contract1 = await deployHTTPZTestFixture1(); + this.contract1Address = await contract1.getAddress(); + this.contract1 = contract1; + + const contract2 = await deployHTTPZTestFixture2(); + this.contract2Address = await contract2.getAddress(); + this.contract2 = contract2; + + const contract3 = await deployHTTPZTestFixture3(); + this.contract3Address = await contract3.getAddress(); + this.contract3 = contract3; + + const contract4 = await deployHTTPZTestFixture4(); + this.contract4Address = await contract4.getAddress(); + this.contract4 = contract4; + + const contract5 = await deployHTTPZTestFixture5(); + this.contract5Address = await contract5.getAddress(); + this.contract5 = contract5; + + const contract6 = await deployHTTPZTestFixture6(); + this.contract6Address = await contract6.getAddress(); + this.contract6 = contract6; + + const contract7 = await deployHTTPZTestFixture7(); + this.contract7Address = await contract7.getAddress(); + this.contract7 = contract7; + + const instances = await createInstances(this.signers); + this.instances = instances; + }); + + it('test operator "ge" overload (euint128, euint128) => ebool test 1 (340282366920938463463373393932902694667, 340282366920938463463369241617541923955)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463373393932902694667n); + input.add128(340282366920938463463369241617541923955n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ge_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint128, euint128) => ebool test 2 (340282366920938463463369241617541923951, 340282366920938463463369241617541923955)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463369241617541923951n); + input.add128(340282366920938463463369241617541923955n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ge_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint128, euint128) => ebool test 3 (340282366920938463463369241617541923955, 340282366920938463463369241617541923955)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463369241617541923955n); + input.add128(340282366920938463463369241617541923955n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ge_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint128, euint128) => ebool test 4 (340282366920938463463369241617541923955, 340282366920938463463369241617541923951)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463369241617541923955n); + input.add128(340282366920938463463369241617541923951n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ge_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint128, euint128) => ebool test 1 (340282366920938463463371792186928109333, 340282366920938463463371112910827200493)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463371792186928109333n); + input.add128(340282366920938463463371112910827200493n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.gt_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint128, euint128) => ebool test 2 (340282366920938463463371112910827200489, 340282366920938463463371112910827200493)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463371112910827200489n); + input.add128(340282366920938463463371112910827200493n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.gt_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint128, euint128) => ebool test 3 (340282366920938463463371112910827200493, 340282366920938463463371112910827200493)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463371112910827200493n); + input.add128(340282366920938463463371112910827200493n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.gt_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint128, euint128) => ebool test 4 (340282366920938463463371112910827200493, 340282366920938463463371112910827200489)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463371112910827200493n); + input.add128(340282366920938463463371112910827200489n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.gt_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint128, euint128) => ebool test 1 (340282366920938463463373573120609448359, 340282366920938463463366775675563348859)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463373573120609448359n); + input.add128(340282366920938463463366775675563348859n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.le_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (euint128, euint128) => ebool test 2 (340282366920938463463366775675563348855, 340282366920938463463366775675563348859)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463366775675563348855n); + input.add128(340282366920938463463366775675563348859n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.le_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint128, euint128) => ebool test 3 (340282366920938463463366775675563348859, 340282366920938463463366775675563348859)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463366775675563348859n); + input.add128(340282366920938463463366775675563348859n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.le_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint128, euint128) => ebool test 4 (340282366920938463463366775675563348859, 340282366920938463463366775675563348855)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463366775675563348859n); + input.add128(340282366920938463463366775675563348855n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.le_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint128, euint128) => ebool test 1 (340282366920938463463370008125171706361, 340282366920938463463369783285988541625)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463370008125171706361n); + input.add128(340282366920938463463369783285988541625n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.lt_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint128, euint128) => ebool test 2 (340282366920938463463369783285988541621, 340282366920938463463369783285988541625)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463369783285988541621n); + input.add128(340282366920938463463369783285988541625n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.lt_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint128, euint128) => ebool test 3 (340282366920938463463369783285988541625, 340282366920938463463369783285988541625)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463369783285988541625n); + input.add128(340282366920938463463369783285988541625n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.lt_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint128, euint128) => ebool test 4 (340282366920938463463369783285988541625, 340282366920938463463369783285988541621)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463369783285988541625n); + input.add128(340282366920938463463369783285988541621n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.lt_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint128, euint128) => euint128 test 1 (340282366920938463463366382917457466127, 340282366920938463463372628786275958663)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463366382917457466127n); + input.add128(340282366920938463463372628786275958663n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.min_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract5.resEuint128()); + expect(res).to.equal(340282366920938463463366382917457466127n); + }); + + it('test operator "min" overload (euint128, euint128) => euint128 test 2 (340282366920938463463366382917457466123, 340282366920938463463366382917457466127)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463366382917457466123n); + input.add128(340282366920938463463366382917457466127n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.min_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract5.resEuint128()); + expect(res).to.equal(340282366920938463463366382917457466123n); + }); + + it('test operator "min" overload (euint128, euint128) => euint128 test 3 (340282366920938463463366382917457466127, 340282366920938463463366382917457466127)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463366382917457466127n); + input.add128(340282366920938463463366382917457466127n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.min_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract5.resEuint128()); + expect(res).to.equal(340282366920938463463366382917457466127n); + }); + + it('test operator "min" overload (euint128, euint128) => euint128 test 4 (340282366920938463463366382917457466127, 340282366920938463463366382917457466123)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463366382917457466127n); + input.add128(340282366920938463463366382917457466123n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.min_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract5.resEuint128()); + expect(res).to.equal(340282366920938463463366382917457466123n); + }); + + it('test operator "max" overload (euint128, euint128) => euint128 test 1 (340282366920938463463371863451323857007, 340282366920938463463369685607056229721)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463371863451323857007n); + input.add128(340282366920938463463369685607056229721n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.max_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract5.resEuint128()); + expect(res).to.equal(340282366920938463463371863451323857007n); + }); + + it('test operator "max" overload (euint128, euint128) => euint128 test 2 (340282366920938463463369685607056229717, 340282366920938463463369685607056229721)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463369685607056229717n); + input.add128(340282366920938463463369685607056229721n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.max_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract5.resEuint128()); + expect(res).to.equal(340282366920938463463369685607056229721n); + }); + + it('test operator "max" overload (euint128, euint128) => euint128 test 3 (340282366920938463463369685607056229721, 340282366920938463463369685607056229721)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463369685607056229721n); + input.add128(340282366920938463463369685607056229721n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.max_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract5.resEuint128()); + expect(res).to.equal(340282366920938463463369685607056229721n); + }); + + it('test operator "max" overload (euint128, euint128) => euint128 test 4 (340282366920938463463369685607056229721, 340282366920938463463369685607056229717)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463369685607056229721n); + input.add128(340282366920938463463369685607056229717n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.max_euint128_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt128(await this.contract5.resEuint128()); + expect(res).to.equal(340282366920938463463369685607056229721n); + }); + + it('test operator "and" overload (euint128, euint256) => euint256 test 1 (340282366920938463463366672375159189085, 115792089237316195423570985008687907853269984665640564039457577885062732981349)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463366672375159189085n); + input.add256(115792089237316195423570985008687907853269984665640564039457577885062732981349n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint128_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(340282366920938463463366179711800058949n); + }); + + it('test operator "and" overload (euint128, euint256) => euint256 test 2 (340282366920938463463366672375159189081, 340282366920938463463366672375159189085)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463366672375159189081n); + input.add256(340282366920938463463366672375159189085n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint128_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(340282366920938463463366672375159189081n); + }); + + it('test operator "and" overload (euint128, euint256) => euint256 test 3 (340282366920938463463366672375159189085, 340282366920938463463366672375159189085)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463366672375159189085n); + input.add256(340282366920938463463366672375159189085n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint128_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(340282366920938463463366672375159189085n); + }); + + it('test operator "and" overload (euint128, euint256) => euint256 test 4 (340282366920938463463366672375159189085, 340282366920938463463366672375159189081)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463366672375159189085n); + input.add256(340282366920938463463366672375159189081n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint128_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(340282366920938463463366672375159189081n); + }); + + it('test operator "or" overload (euint128, euint256) => euint256 test 1 (340282366920938463463367057962021060853, 115792089237316195423570985008687907853269984665640564039457580709575094053105)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463367057962021060853n); + input.add256(115792089237316195423570985008687907853269984665640564039457580709575094053105n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint128_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457581032556776302837n); + }); + + it('test operator "or" overload (euint128, euint256) => euint256 test 2 (340282366920938463463367057962021060849, 340282366920938463463367057962021060853)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463367057962021060849n); + input.add256(340282366920938463463367057962021060853n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint128_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(340282366920938463463367057962021060853n); + }); + + it('test operator "or" overload (euint128, euint256) => euint256 test 3 (340282366920938463463367057962021060853, 340282366920938463463367057962021060853)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463367057962021060853n); + input.add256(340282366920938463463367057962021060853n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint128_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(340282366920938463463367057962021060853n); + }); + + it('test operator "or" overload (euint128, euint256) => euint256 test 4 (340282366920938463463367057962021060853, 340282366920938463463367057962021060849)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463367057962021060853n); + input.add256(340282366920938463463367057962021060849n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint128_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(340282366920938463463367057962021060853n); + }); + + it('test operator "xor" overload (euint128, euint256) => euint256 test 1 (340282366920938463463365969863430162273, 115792089237316195423570985008687907853269984665640564039457580128074898389707)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463365969863430162273n); + input.add256(115792089237316195423570985008687907853269984665640564039457580128074898389707n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint128_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907852929702298719625575994214862183553858986n); + }); + + it('test operator "xor" overload (euint128, euint256) => euint256 test 2 (340282366920938463463365969863430162269, 340282366920938463463365969863430162273)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463365969863430162269n); + input.add256(340282366920938463463365969863430162273n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint128_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(60n); + }); + + it('test operator "xor" overload (euint128, euint256) => euint256 test 3 (340282366920938463463365969863430162273, 340282366920938463463365969863430162273)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463365969863430162273n); + input.add256(340282366920938463463365969863430162273n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint128_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint128, euint256) => euint256 test 4 (340282366920938463463365969863430162273, 340282366920938463463365969863430162269)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463365969863430162273n); + input.add256(340282366920938463463365969863430162269n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint128_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(60n); + }); + + it('test operator "eq" overload (euint128, euint256) => ebool test 1 (340282366920938463463366205533039695641, 115792089237316195423570985008687907853269984665640564039457575022755976128087)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463366205533039695641n); + input.add256(115792089237316195423570985008687907853269984665640564039457575022755976128087n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint128_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint128, euint256) => ebool test 2 (340282366920938463463366205533039695637, 340282366920938463463366205533039695641)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463366205533039695637n); + input.add256(340282366920938463463366205533039695641n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint128_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint128, euint256) => ebool test 3 (340282366920938463463366205533039695641, 340282366920938463463366205533039695641)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463366205533039695641n); + input.add256(340282366920938463463366205533039695641n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint128_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint128, euint256) => ebool test 4 (340282366920938463463366205533039695641, 340282366920938463463366205533039695637)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463366205533039695641n); + input.add256(340282366920938463463366205533039695637n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint128_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint128, euint256) => ebool test 1 (340282366920938463463369641960865812363, 115792089237316195423570985008687907853269984665640564039457575580896361005345)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463369641960865812363n); + input.add256(115792089237316195423570985008687907853269984665640564039457575580896361005345n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint128_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint128, euint256) => ebool test 2 (340282366920938463463369641960865812359, 340282366920938463463369641960865812363)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463369641960865812359n); + input.add256(340282366920938463463369641960865812363n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint128_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint128, euint256) => ebool test 3 (340282366920938463463369641960865812363, 340282366920938463463369641960865812363)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463369641960865812363n); + input.add256(340282366920938463463369641960865812363n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint128_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint128, euint256) => ebool test 4 (340282366920938463463369641960865812363, 340282366920938463463369641960865812359)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add128(340282366920938463463369641960865812363n); + input.add256(340282366920938463463369641960865812359n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint128_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "and" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457583607559611704817, 12)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457583607559611704817n); + input.add8(12n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(0n); + }); + + it('test operator "and" overload (euint256, euint8) => euint256 test 2 (8, 12)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(8n); + input.add8(12n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(8n); + }); + + it('test operator "and" overload (euint256, euint8) => euint256 test 3 (12, 12)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(12n); + input.add8(12n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(12n); + }); + + it('test operator "and" overload (euint256, euint8) => euint256 test 4 (12, 8)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(12n); + input.add8(8n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(8n); + }); + + it('test operator "or" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457581807446003191135, 20)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457581807446003191135n); + input.add8(20n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457581807446003191135n); + }); + + it('test operator "or" overload (euint256, euint8) => euint256 test 2 (16, 20)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(16n); + input.add8(20n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(20n); + }); + + it('test operator "or" overload (euint256, euint8) => euint256 test 3 (20, 20)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(20n); + input.add8(20n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(20n); + }); + + it('test operator "or" overload (euint256, euint8) => euint256 test 4 (20, 16)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(20n); + input.add8(16n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(20n); + }); + + it('test operator "xor" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457577927965780637637, 221)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457577927965780637637n); + input.add8(221n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577927965780637464n); + }); + + it('test operator "xor" overload (euint256, euint8) => euint256 test 2 (217, 221)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(217n); + input.add8(221n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint256, euint8) => euint256 test 3 (221, 221)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(221n); + input.add8(221n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint256, euint8) => euint256 test 4 (221, 217)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(221n); + input.add8(217n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(4n); + }); + + it('test operator "eq" overload (euint256, euint8) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457578190033423975869, 151)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457578190033423975869n); + input.add8(151n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint256, euint8) => ebool test 2 (147, 151)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(147n); + input.add8(151n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint256, euint8) => ebool test 3 (151, 151)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(151n); + input.add8(151n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint256, euint8) => ebool test 4 (151, 147)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(151n); + input.add8(147n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint256, euint8) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457575629225914779917, 29)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457575629225914779917n); + input.add8(29n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint256, euint8) => ebool test 2 (25, 29)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(25n); + input.add8(29n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint256, euint8) => ebool test 3 (29, 29)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(29n); + input.add8(29n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint256, euint8) => ebool test 4 (29, 25)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(29n); + input.add8(25n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint8( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "and" overload (euint256, euint16) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457576904933565980805, 63846)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457576904933565980805n); + input.add16(63846n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(57348n); + }); + + it('test operator "and" overload (euint256, euint16) => euint256 test 2 (63842, 63846)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(63842n); + input.add16(63846n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(63842n); + }); + + it('test operator "and" overload (euint256, euint16) => euint256 test 3 (63846, 63846)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(63846n); + input.add16(63846n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(63846n); + }); + + it('test operator "and" overload (euint256, euint16) => euint256 test 4 (63846, 63842)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(63846n); + input.add16(63842n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(63842n); + }); + + it('test operator "or" overload (euint256, euint16) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457580119146944964967, 12940)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457580119146944964967n); + input.add16(12940n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457580119146944969711n); + }); + + it('test operator "or" overload (euint256, euint16) => euint256 test 2 (12936, 12940)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(12936n); + input.add16(12940n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(12940n); + }); + + it('test operator "or" overload (euint256, euint16) => euint256 test 3 (12940, 12940)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(12940n); + input.add16(12940n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(12940n); + }); + + it('test operator "or" overload (euint256, euint16) => euint256 test 4 (12940, 12936)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(12940n); + input.add16(12936n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(12940n); + }); + + it('test operator "xor" overload (euint256, euint16) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457580554918419806897, 49243)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457580554918419806897n); + input.add16(49243n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457580554918419790570n); + }); + + it('test operator "xor" overload (euint256, euint16) => euint256 test 2 (49239, 49243)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(49239n); + input.add16(49243n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(12n); + }); + + it('test operator "xor" overload (euint256, euint16) => euint256 test 3 (49243, 49243)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(49243n); + input.add16(49243n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint256, euint16) => euint256 test 4 (49243, 49239)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(49243n); + input.add16(49239n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(12n); + }); + + it('test operator "eq" overload (euint256, euint16) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457576912427416310583, 37533)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457576912427416310583n); + input.add16(37533n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint256, euint16) => ebool test 2 (37529, 37533)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(37529n); + input.add16(37533n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint256, euint16) => ebool test 3 (37533, 37533)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(37533n); + input.add16(37533n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint256, euint16) => ebool test 4 (37533, 37529)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(37533n); + input.add16(37529n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint256, euint16) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457578905482736239397, 32809)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457578905482736239397n); + input.add16(32809n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint256, euint16) => ebool test 2 (32805, 32809)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(32805n); + input.add16(32809n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint256, euint16) => ebool test 3 (32809, 32809)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(32809n); + input.add16(32809n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint256, euint16) => ebool test 4 (32809, 32805)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(32809n); + input.add16(32805n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint16( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "and" overload (euint256, euint32) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457575846029773914391, 220313953)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457575846029773914391n); + input.add32(220313953n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(18874625n); + }); + + it('test operator "and" overload (euint256, euint32) => euint256 test 2 (220313949, 220313953)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(220313949n); + input.add32(220313953n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(220313921n); + }); + + it('test operator "and" overload (euint256, euint32) => euint256 test 3 (220313953, 220313953)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(220313953n); + input.add32(220313953n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(220313953n); + }); + + it('test operator "and" overload (euint256, euint32) => euint256 test 4 (220313953, 220313949)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(220313953n); + input.add32(220313949n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(220313921n); + }); + + it('test operator "or" overload (euint256, euint32) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457576722159932797381, 1690151630)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457576722159932797381n); + input.add32(1690151630n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576722159936469967n); + }); + + it('test operator "or" overload (euint256, euint32) => euint256 test 2 (1690151626, 1690151630)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(1690151626n); + input.add32(1690151630n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(1690151630n); + }); + + it('test operator "or" overload (euint256, euint32) => euint256 test 3 (1690151630, 1690151630)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(1690151630n); + input.add32(1690151630n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(1690151630n); + }); + + it('test operator "or" overload (euint256, euint32) => euint256 test 4 (1690151630, 1690151626)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(1690151630n); + input.add32(1690151626n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(1690151630n); + }); + + it('test operator "xor" overload (euint256, euint32) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582821111139193533, 1728363250)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457582821111139193533n); + input.add32(1728363250n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457582821111793739855n); + }); + + it('test operator "xor" overload (euint256, euint32) => euint256 test 2 (1728363246, 1728363250)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(1728363246n); + input.add32(1728363250n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(28n); + }); + + it('test operator "xor" overload (euint256, euint32) => euint256 test 3 (1728363250, 1728363250)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(1728363250n); + input.add32(1728363250n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint256, euint32) => euint256 test 4 (1728363250, 1728363246)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(1728363250n); + input.add32(1728363246n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(28n); + }); + + it('test operator "eq" overload (euint256, euint32) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457581049282021581695, 1014661130)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457581049282021581695n); + input.add32(1014661130n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint256, euint32) => ebool test 2 (1014661126, 1014661130)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(1014661126n); + input.add32(1014661130n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint256, euint32) => ebool test 3 (1014661130, 1014661130)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(1014661130n); + input.add32(1014661130n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint256, euint32) => ebool test 4 (1014661130, 1014661126)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(1014661130n); + input.add32(1014661126n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint256, euint32) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457580470671973636913, 3491508630)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457580470671973636913n); + input.add32(3491508630n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint256, euint32) => ebool test 2 (3491508626, 3491508630)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(3491508626n); + input.add32(3491508630n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint256, euint32) => ebool test 3 (3491508630, 3491508630)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(3491508630n); + input.add32(3491508630n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint256, euint32) => ebool test 4 (3491508630, 3491508626)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(3491508630n); + input.add32(3491508626n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint32( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "and" overload (euint256, euint64) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457583191672839911025, 18441891104883193557)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457583191672839911025n); + input.add64(18441891104883193557n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(18441114574787360337n); + }); + + it('test operator "and" overload (euint256, euint64) => euint256 test 2 (18441891104883193553, 18441891104883193557)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(18441891104883193553n); + input.add64(18441891104883193557n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(18441891104883193553n); + }); + + it('test operator "and" overload (euint256, euint64) => euint256 test 3 (18441891104883193557, 18441891104883193557)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(18441891104883193557n); + input.add64(18441891104883193557n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(18441891104883193557n); + }); + + it('test operator "and" overload (euint256, euint64) => euint256 test 4 (18441891104883193557, 18441891104883193553)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(18441891104883193557n); + input.add64(18441891104883193553n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(18441891104883193553n); + }); + + it('test operator "or" overload (euint256, euint64) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457583299328081083817, 18439865211889844315)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457583299328081083817n); + input.add64(18439865211889844315n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457584007636907933179n); + }); + + it('test operator "or" overload (euint256, euint64) => euint256 test 2 (18439865211889844311, 18439865211889844315)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(18439865211889844311n); + input.add64(18439865211889844315n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(18439865211889844319n); + }); + + it('test operator "or" overload (euint256, euint64) => euint256 test 3 (18439865211889844315, 18439865211889844315)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(18439865211889844315n); + input.add64(18439865211889844315n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(18439865211889844315n); + }); + + it('test operator "or" overload (euint256, euint64) => euint256 test 4 (18439865211889844315, 18439865211889844311)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(18439865211889844315n); + input.add64(18439865211889844311n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(18439865211889844319n); + }); + + it('test operator "xor" overload (euint256, euint64) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457577864460528852523, 18440321568052981811)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457577864460528852523n); + input.add64(18440321568052981811n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039439138110790425161240n); + }); + + it('test operator "xor" overload (euint256, euint64) => euint256 test 2 (18440321568052981807, 18440321568052981811)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(18440321568052981807n); + input.add64(18440321568052981811n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(28n); + }); + + it('test operator "xor" overload (euint256, euint64) => euint256 test 3 (18440321568052981811, 18440321568052981811)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(18440321568052981811n); + input.add64(18440321568052981811n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint256, euint64) => euint256 test 4 (18440321568052981811, 18440321568052981807)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(18440321568052981811n); + input.add64(18440321568052981807n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(28n); + }); + + it('test operator "eq" overload (euint256, euint64) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457578377729388723105, 18438302770166838951)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457578377729388723105n); + input.add64(18438302770166838951n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint256, euint64) => ebool test 2 (18438302770166838947, 18438302770166838951)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(18438302770166838947n); + input.add64(18438302770166838951n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint256, euint64) => ebool test 3 (18438302770166838951, 18438302770166838951)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(18438302770166838951n); + input.add64(18438302770166838951n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint256, euint64) => ebool test 4 (18438302770166838951, 18438302770166838947)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(18438302770166838951n); + input.add64(18438302770166838947n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint256, euint64) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457580003307925103829, 18441015582708417097)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457580003307925103829n); + input.add64(18441015582708417097n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint256, euint64) => ebool test 2 (18441015582708417093, 18441015582708417097)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(18441015582708417093n); + input.add64(18441015582708417097n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint256, euint64) => ebool test 3 (18441015582708417097, 18441015582708417097)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(18441015582708417097n); + input.add64(18441015582708417097n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint256, euint64) => ebool test 4 (18441015582708417097, 18441015582708417093)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(18441015582708417097n); + input.add64(18441015582708417093n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint64( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "and" overload (euint256, euint128) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457575063176251591085, 340282366920938463463370035869693079673)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457575063176251591085n); + input.add128(340282366920938463463370035869693079673n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(340282366920938463463365600232551235625n); + }); + + it('test operator "and" overload (euint256, euint128) => euint256 test 2 (340282366920938463463370035869693079669, 340282366920938463463370035869693079673)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(340282366920938463463370035869693079669n); + input.add128(340282366920938463463370035869693079673n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(340282366920938463463370035869693079665n); + }); + + it('test operator "and" overload (euint256, euint128) => euint256 test 3 (340282366920938463463370035869693079673, 340282366920938463463370035869693079673)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(340282366920938463463370035869693079673n); + input.add128(340282366920938463463370035869693079673n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(340282366920938463463370035869693079673n); + }); + + it('test operator "and" overload (euint256, euint128) => euint256 test 4 (340282366920938463463370035869693079673, 340282366920938463463370035869693079669)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(340282366920938463463370035869693079673n); + input.add128(340282366920938463463370035869693079669n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(340282366920938463463370035869693079665n); + }); + + it('test operator "or" overload (euint256, euint128) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582907641523797991, 340282366920938463463366400478111746753)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457582907641523797991n); + input.add128(340282366920938463463366400478111746753n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457583682319172960231n); + }); + + it('test operator "or" overload (euint256, euint128) => euint256 test 2 (340282366920938463463366400478111746749, 340282366920938463463366400478111746753)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(340282366920938463463366400478111746749n); + input.add128(340282366920938463463366400478111746753n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(340282366920938463463366400478111746813n); + }); + + it('test operator "or" overload (euint256, euint128) => euint256 test 3 (340282366920938463463366400478111746753, 340282366920938463463366400478111746753)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(340282366920938463463366400478111746753n); + input.add128(340282366920938463463366400478111746753n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(340282366920938463463366400478111746753n); + }); + + it('test operator "or" overload (euint256, euint128) => euint256 test 4 (340282366920938463463366400478111746753, 340282366920938463463366400478111746749)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(340282366920938463463366400478111746753n); + input.add128(340282366920938463463366400478111746749n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(340282366920938463463366400478111746813n); + }); + + it('test operator "xor" overload (euint256, euint128) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457576076871645339203, 340282366920938463463365855983121808745)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457576076871645339203n); + input.add128(340282366920938463463365855983121808745n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907852929702298719625575994210309056284336938n); + }); + + it('test operator "xor" overload (euint256, euint128) => euint256 test 2 (340282366920938463463365855983121808741, 340282366920938463463365855983121808745)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(340282366920938463463365855983121808741n); + input.add128(340282366920938463463365855983121808745n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(12n); + }); + + it('test operator "xor" overload (euint256, euint128) => euint256 test 3 (340282366920938463463365855983121808745, 340282366920938463463365855983121808745)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(340282366920938463463365855983121808745n); + input.add128(340282366920938463463365855983121808745n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint256, euint128) => euint256 test 4 (340282366920938463463365855983121808745, 340282366920938463463365855983121808741)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(340282366920938463463365855983121808745n); + input.add128(340282366920938463463365855983121808741n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(12n); + }); + + it('test operator "eq" overload (euint256, euint128) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457583332569934994945, 340282366920938463463366676098074162693)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457583332569934994945n); + input.add128(340282366920938463463366676098074162693n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint256, euint128) => ebool test 2 (340282366920938463463366676098074162689, 340282366920938463463366676098074162693)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(340282366920938463463366676098074162689n); + input.add128(340282366920938463463366676098074162693n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint256, euint128) => ebool test 3 (340282366920938463463366676098074162693, 340282366920938463463366676098074162693)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(340282366920938463463366676098074162693n); + input.add128(340282366920938463463366676098074162693n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint256, euint128) => ebool test 4 (340282366920938463463366676098074162693, 340282366920938463463366676098074162689)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(340282366920938463463366676098074162693n); + input.add128(340282366920938463463366676098074162689n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint256, euint128) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457580538452835387697, 340282366920938463463366564201261405127)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457580538452835387697n); + input.add128(340282366920938463463366564201261405127n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint256, euint128) => ebool test 2 (340282366920938463463366564201261405123, 340282366920938463463366564201261405127)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(340282366920938463463366564201261405123n); + input.add128(340282366920938463463366564201261405127n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint256, euint128) => ebool test 3 (340282366920938463463366564201261405127, 340282366920938463463366564201261405127)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(340282366920938463463366564201261405127n); + input.add128(340282366920938463463366564201261405127n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint256, euint128) => ebool test 4 (340282366920938463463366564201261405127, 340282366920938463463366564201261405123)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(340282366920938463463366564201261405127n); + input.add128(340282366920938463463366564201261405123n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint128( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "and" overload (euint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457577882762752269233, 115792089237316195423570985008687907853269984665640564039457583777292539301647)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457577882762752269233n); + input.add256(115792089237316195423570985008687907853269984665640564039457583777292539301647n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577863843252701953n); + }); + + it('test operator "and" overload (euint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457577882762752269229, 115792089237316195423570985008687907853269984665640564039457577882762752269233)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457577882762752269229n); + input.add256(115792089237316195423570985008687907853269984665640564039457577882762752269233n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577882762752269217n); + }); + + it('test operator "and" overload (euint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457577882762752269233, 115792089237316195423570985008687907853269984665640564039457577882762752269233)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457577882762752269233n); + input.add256(115792089237316195423570985008687907853269984665640564039457577882762752269233n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577882762752269233n); + }); + + it('test operator "and" overload (euint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457577882762752269233, 115792089237316195423570985008687907853269984665640564039457577882762752269229)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457577882762752269233n); + input.add256(115792089237316195423570985008687907853269984665640564039457577882762752269229n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint256_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577882762752269217n); + }); + + it('test operator "or" overload (euint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457580756276426861853, 115792089237316195423570985008687907853269984665640564039457576625033575425445)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457580756276426861853n); + input.add256(115792089237316195423570985008687907853269984665640564039457576625033575425445n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457581184296266526141n); + }); + + it('test operator "or" overload (euint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457576625033575425441, 115792089237316195423570985008687907853269984665640564039457576625033575425445)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457576625033575425441n); + input.add256(115792089237316195423570985008687907853269984665640564039457576625033575425445n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576625033575425445n); + }); + + it('test operator "or" overload (euint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457576625033575425445, 115792089237316195423570985008687907853269984665640564039457576625033575425445)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457576625033575425445n); + input.add256(115792089237316195423570985008687907853269984665640564039457576625033575425445n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576625033575425445n); + }); + + it('test operator "or" overload (euint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457576625033575425445, 115792089237316195423570985008687907853269984665640564039457576625033575425441)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457576625033575425445n); + input.add256(115792089237316195423570985008687907853269984665640564039457576625033575425441n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint256_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576625033575425445n); + }); + + it('test operator "xor" overload (euint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457577307594866852405, 115792089237316195423570985008687907853269984665640564039457579745864342203447)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457577307594866852405n); + input.add256(115792089237316195423570985008687907853269984665640564039457579745864342203447n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(7012311064833538n); + }); + + it('test operator "xor" overload (euint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457577307594866852401, 115792089237316195423570985008687907853269984665640564039457577307594866852405)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457577307594866852401n); + input.add256(115792089237316195423570985008687907853269984665640564039457577307594866852405n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457577307594866852405, 115792089237316195423570985008687907853269984665640564039457577307594866852405)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457577307594866852405n); + input.add256(115792089237316195423570985008687907853269984665640564039457577307594866852405n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457577307594866852405, 115792089237316195423570985008687907853269984665640564039457577307594866852401)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457577307594866852405n); + input.add256(115792089237316195423570985008687907853269984665640564039457577307594866852401n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint256_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt256(await this.contract5.resEuint256()); + expect(res).to.equal(4n); + }); + + it('test operator "eq" overload (euint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457579171920097840425, 115792089237316195423570985008687907853269984665640564039457575336807286229259)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457579171920097840425n); + input.add256(115792089237316195423570985008687907853269984665640564039457575336807286229259n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457575336807286229255, 115792089237316195423570985008687907853269984665640564039457575336807286229259)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457575336807286229255n); + input.add256(115792089237316195423570985008687907853269984665640564039457575336807286229259n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457575336807286229259, 115792089237316195423570985008687907853269984665640564039457575336807286229259)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457575336807286229259n); + input.add256(115792089237316195423570985008687907853269984665640564039457575336807286229259n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457575336807286229259, 115792089237316195423570985008687907853269984665640564039457575336807286229255)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457575336807286229259n); + input.add256(115792089237316195423570985008687907853269984665640564039457575336807286229255n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint256_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457579899968092620165, 115792089237316195423570985008687907853269984665640564039457575210429165840815)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457579899968092620165n); + input.add256(115792089237316195423570985008687907853269984665640564039457575210429165840815n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457575210429165840811, 115792089237316195423570985008687907853269984665640564039457575210429165840815)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457575210429165840811n); + input.add256(115792089237316195423570985008687907853269984665640564039457575210429165840815n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457575210429165840815, 115792089237316195423570985008687907853269984665640564039457575210429165840815)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457575210429165840815n); + input.add256(115792089237316195423570985008687907853269984665640564039457575210429165840815n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457575210429165840815, 115792089237316195423570985008687907853269984665640564039457575210429165840811)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add256(115792089237316195423570985008687907853269984665640564039457575210429165840815n); + input.add256(115792089237316195423570985008687907853269984665640564039457575210429165840811n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint256_euint256( + encryptedAmount.handles[0], + encryptedAmount.handles[1], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "add" overload (euint8, uint8) => euint8 test 1 (80, 122)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(80n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.add_euint8_uint8(encryptedAmount.handles[0], 122n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(202n); + }); + + it('test operator "add" overload (euint8, uint8) => euint8 test 2 (117, 121)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(117n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.add_euint8_uint8(encryptedAmount.handles[0], 121n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(238n); + }); + + it('test operator "add" overload (euint8, uint8) => euint8 test 3 (121, 121)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(121n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.add_euint8_uint8(encryptedAmount.handles[0], 121n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(242n); + }); + + it('test operator "add" overload (euint8, uint8) => euint8 test 4 (121, 117)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(121n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.add_euint8_uint8(encryptedAmount.handles[0], 117n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(238n); + }); + + it('test operator "add" overload (uint8, euint8) => euint8 test 1 (77, 122)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(122n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.add_uint8_euint8(77n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(199n); + }); + + it('test operator "add" overload (uint8, euint8) => euint8 test 2 (117, 121)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(121n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.add_uint8_euint8(117n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(238n); + }); + + it('test operator "add" overload (uint8, euint8) => euint8 test 3 (121, 121)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(121n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.add_uint8_euint8(121n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(242n); + }); + + it('test operator "add" overload (uint8, euint8) => euint8 test 4 (121, 117)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(117n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.add_uint8_euint8(121n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(238n); + }); + + it('test operator "sub" overload (euint8, uint8) => euint8 test 1 (58, 58)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(58n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.sub_euint8_uint8(encryptedAmount.handles[0], 58n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint8, uint8) => euint8 test 2 (58, 54)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(58n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.sub_euint8_uint8(encryptedAmount.handles[0], 54n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(4n); + }); + + it('test operator "sub" overload (uint8, euint8) => euint8 test 1 (58, 58)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(58n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.sub_uint8_euint8(58n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (uint8, euint8) => euint8 test 2 (58, 54)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(54n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.sub_uint8_euint8(58n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint8, uint8) => euint8 test 1 (11, 17)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(11n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.mul_euint8_uint8(encryptedAmount.handles[0], 17n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(187n); + }); + + it('test operator "mul" overload (euint8, uint8) => euint8 test 2 (10, 11)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(10n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.mul_euint8_uint8(encryptedAmount.handles[0], 11n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(110n); + }); + + it('test operator "mul" overload (euint8, uint8) => euint8 test 3 (11, 11)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(11n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.mul_euint8_uint8(encryptedAmount.handles[0], 11n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(121n); + }); + + it('test operator "mul" overload (euint8, uint8) => euint8 test 4 (11, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(11n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.mul_euint8_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(110n); + }); + + it('test operator "mul" overload (uint8, euint8) => euint8 test 1 (5, 17)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(17n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.mul_uint8_euint8(5n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(85n); + }); + + it('test operator "mul" overload (uint8, euint8) => euint8 test 2 (10, 11)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(11n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.mul_uint8_euint8(10n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(110n); + }); + + it('test operator "mul" overload (uint8, euint8) => euint8 test 3 (11, 11)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(11n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.mul_uint8_euint8(11n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(121n); + }); + + it('test operator "mul" overload (uint8, euint8) => euint8 test 4 (11, 10)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(10n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.mul_uint8_euint8(11n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(110n); + }); + + it('test operator "div" overload (euint8, uint8) => euint8 test 1 (149, 116)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(149n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.div_euint8_uint8(encryptedAmount.handles[0], 116n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(1n); + }); + + it('test operator "div" overload (euint8, uint8) => euint8 test 2 (1, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(1n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.div_euint8_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(0n); + }); + + it('test operator "div" overload (euint8, uint8) => euint8 test 3 (5, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(5n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.div_euint8_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(1n); + }); + + it('test operator "div" overload (euint8, uint8) => euint8 test 4 (5, 1)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(5n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.div_euint8_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(5n); + }); + + it('test operator "rem" overload (euint8, uint8) => euint8 test 1 (82, 154)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(82n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.rem_euint8_uint8(encryptedAmount.handles[0], 154n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(82n); + }); + + it('test operator "rem" overload (euint8, uint8) => euint8 test 2 (78, 82)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(78n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.rem_euint8_uint8(encryptedAmount.handles[0], 82n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(78n); + }); + + it('test operator "rem" overload (euint8, uint8) => euint8 test 3 (82, 82)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(82n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.rem_euint8_uint8(encryptedAmount.handles[0], 82n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(0n); + }); + + it('test operator "rem" overload (euint8, uint8) => euint8 test 4 (82, 78)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(82n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.rem_euint8_uint8(encryptedAmount.handles[0], 78n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(4n); + }); + + it('test operator "and" overload (euint8, uint8) => euint8 test 1 (112, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(112n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint8_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(0n); + }); + + it('test operator "and" overload (euint8, uint8) => euint8 test 2 (108, 112)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(108n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint8_uint8(encryptedAmount.handles[0], 112n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(96n); + }); + + it('test operator "and" overload (euint8, uint8) => euint8 test 3 (112, 112)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(112n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint8_uint8(encryptedAmount.handles[0], 112n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(112n); + }); + + it('test operator "and" overload (euint8, uint8) => euint8 test 4 (112, 108)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(112n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint8_uint8(encryptedAmount.handles[0], 108n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(96n); + }); + + it('test operator "and" overload (uint8, euint8) => euint8 test 1 (112, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_uint8_euint8(112n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(0n); + }); + + it('test operator "and" overload (uint8, euint8) => euint8 test 2 (108, 112)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(112n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_uint8_euint8(108n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(96n); + }); + + it('test operator "and" overload (uint8, euint8) => euint8 test 3 (112, 112)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(112n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_uint8_euint8(112n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(112n); + }); + + it('test operator "and" overload (uint8, euint8) => euint8 test 4 (112, 108)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(108n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_uint8_euint8(112n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(96n); + }); + + it('test operator "or" overload (euint8, uint8) => euint8 test 1 (244, 85)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(244n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint8_uint8(encryptedAmount.handles[0], 85n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(245n); + }); + + it('test operator "or" overload (euint8, uint8) => euint8 test 2 (110, 114)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(110n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint8_uint8(encryptedAmount.handles[0], 114n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(126n); + }); + + it('test operator "or" overload (euint8, uint8) => euint8 test 3 (114, 114)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(114n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint8_uint8(encryptedAmount.handles[0], 114n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(114n); + }); + + it('test operator "or" overload (euint8, uint8) => euint8 test 4 (114, 110)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(114n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint8_uint8(encryptedAmount.handles[0], 110n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(126n); + }); +}); diff --git a/contracts/test/httpzOperations/httpzOperations9.ts b/contracts/test/httpzOperations/httpzOperations9.ts new file mode 100644 index 00000000..ce88cd39 --- /dev/null +++ b/contracts/test/httpzOperations/httpzOperations9.ts @@ -0,0 +1,2398 @@ +import { expect } from 'chai'; +import { ethers } from 'hardhat'; + +import type { HTTPZTestSuite1 } from '../../types/contracts/tests/HTTPZTestSuite1'; +import type { HTTPZTestSuite2 } from '../../types/contracts/tests/HTTPZTestSuite2'; +import type { HTTPZTestSuite3 } from '../../types/contracts/tests/HTTPZTestSuite3'; +import type { HTTPZTestSuite4 } from '../../types/contracts/tests/HTTPZTestSuite4'; +import type { HTTPZTestSuite5 } from '../../types/contracts/tests/HTTPZTestSuite5'; +import type { HTTPZTestSuite6 } from '../../types/contracts/tests/HTTPZTestSuite6'; +import type { HTTPZTestSuite7 } from '../../types/contracts/tests/HTTPZTestSuite7'; +import { + createInstances, + decrypt8, + decrypt16, + decrypt32, + decrypt64, + decrypt128, + decrypt256, + decryptBool, +} from '../instance'; +import { getSigners, initSigners } from '../signers'; + +async function deployHTTPZTestFixture1(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite1'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture2(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite2'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture3(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite3'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture4(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite4'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture5(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite5'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture6(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite6'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +async function deployHTTPZTestFixture7(): Promise { + const signers = await getSigners(); + const admin = signers.alice; + + const contractFactory = await ethers.getContractFactory('HTTPZTestSuite7'); + const contract = await contractFactory.connect(admin).deploy(); + await contract.waitForDeployment(); + + return contract; +} + +describe('HTTPZ operations 9', function () { + before(async function () { + await initSigners(1); + this.signers = await getSigners(); + + const contract1 = await deployHTTPZTestFixture1(); + this.contract1Address = await contract1.getAddress(); + this.contract1 = contract1; + + const contract2 = await deployHTTPZTestFixture2(); + this.contract2Address = await contract2.getAddress(); + this.contract2 = contract2; + + const contract3 = await deployHTTPZTestFixture3(); + this.contract3Address = await contract3.getAddress(); + this.contract3 = contract3; + + const contract4 = await deployHTTPZTestFixture4(); + this.contract4Address = await contract4.getAddress(); + this.contract4 = contract4; + + const contract5 = await deployHTTPZTestFixture5(); + this.contract5Address = await contract5.getAddress(); + this.contract5 = contract5; + + const contract6 = await deployHTTPZTestFixture6(); + this.contract6Address = await contract6.getAddress(); + this.contract6 = contract6; + + const contract7 = await deployHTTPZTestFixture7(); + this.contract7Address = await contract7.getAddress(); + this.contract7 = contract7; + + const instances = await createInstances(this.signers); + this.instances = instances; + }); + + it('test operator "or" overload (uint8, euint8) => euint8 test 1 (208, 85)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(85n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_uint8_euint8(208n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(213n); + }); + + it('test operator "or" overload (uint8, euint8) => euint8 test 2 (110, 114)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(114n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_uint8_euint8(110n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(126n); + }); + + it('test operator "or" overload (uint8, euint8) => euint8 test 3 (114, 114)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(114n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_uint8_euint8(114n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(114n); + }); + + it('test operator "or" overload (uint8, euint8) => euint8 test 4 (114, 110)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(110n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_uint8_euint8(114n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(126n); + }); + + it('test operator "xor" overload (euint8, uint8) => euint8 test 1 (63, 53)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(63n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint8_uint8(encryptedAmount.handles[0], 53n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(10n); + }); + + it('test operator "xor" overload (euint8, uint8) => euint8 test 2 (59, 63)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(59n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint8_uint8(encryptedAmount.handles[0], 63n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint8, uint8) => euint8 test 3 (63, 63)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(63n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint8_uint8(encryptedAmount.handles[0], 63n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint8, uint8) => euint8 test 4 (63, 59)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(63n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint8_uint8(encryptedAmount.handles[0], 59n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (uint8, euint8) => euint8 test 1 (185, 53)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(53n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_uint8_euint8(185n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(140n); + }); + + it('test operator "xor" overload (uint8, euint8) => euint8 test 2 (59, 63)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(63n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_uint8_euint8(59n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (uint8, euint8) => euint8 test 3 (63, 63)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(63n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_uint8_euint8(63n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (uint8, euint8) => euint8 test 4 (63, 59)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(59n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_uint8_euint8(63n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(4n); + }); + + it('test operator "eq" overload (euint8, uint8) => ebool test 1 (143, 174)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(143n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint8_uint8(encryptedAmount.handles[0], 174n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint8, uint8) => ebool test 2 (86, 90)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(86n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint8_uint8(encryptedAmount.handles[0], 90n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint8, uint8) => ebool test 3 (90, 90)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(90n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint8_uint8(encryptedAmount.handles[0], 90n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint8, uint8) => ebool test 4 (90, 86)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(90n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint8_uint8(encryptedAmount.handles[0], 86n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (uint8, euint8) => ebool test 1 (95, 174)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(174n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_uint8_euint8(95n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (uint8, euint8) => ebool test 2 (86, 90)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(90n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_uint8_euint8(86n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (uint8, euint8) => ebool test 3 (90, 90)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(90n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_uint8_euint8(90n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (uint8, euint8) => ebool test 4 (90, 86)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(86n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_uint8_euint8(90n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint8, uint8) => ebool test 1 (140, 152)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(140n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint8_uint8(encryptedAmount.handles[0], 152n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint8, uint8) => ebool test 2 (136, 140)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(136n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint8_uint8(encryptedAmount.handles[0], 140n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint8, uint8) => ebool test 3 (140, 140)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(140n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint8_uint8(encryptedAmount.handles[0], 140n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint8, uint8) => ebool test 4 (140, 136)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(140n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_euint8_uint8(encryptedAmount.handles[0], 136n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (uint8, euint8) => ebool test 1 (190, 152)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(152n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_uint8_euint8(190n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (uint8, euint8) => ebool test 2 (136, 140)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(140n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_uint8_euint8(136n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (uint8, euint8) => ebool test 3 (140, 140)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(140n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_uint8_euint8(140n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (uint8, euint8) => ebool test 4 (140, 136)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(136n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ne_uint8_euint8(140n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint8, uint8) => ebool test 1 (6, 166)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(6n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ge_euint8_uint8(encryptedAmount.handles[0], 166n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint8, uint8) => ebool test 2 (2, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(2n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ge_euint8_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint8, uint8) => ebool test 3 (6, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(6n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ge_euint8_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint8, uint8) => ebool test 4 (6, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(6n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ge_euint8_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (uint8, euint8) => ebool test 1 (53, 166)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(166n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ge_uint8_euint8(53n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (uint8, euint8) => ebool test 2 (2, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ge_uint8_euint8(2n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (uint8, euint8) => ebool test 3 (6, 6)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(6n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ge_uint8_euint8(6n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (uint8, euint8) => ebool test 4 (6, 2)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(2n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.ge_uint8_euint8(6n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint8, uint8) => ebool test 1 (41, 178)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(41n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.gt_euint8_uint8(encryptedAmount.handles[0], 178n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint8, uint8) => ebool test 2 (37, 41)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(37n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.gt_euint8_uint8(encryptedAmount.handles[0], 41n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint8, uint8) => ebool test 3 (41, 41)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(41n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.gt_euint8_uint8(encryptedAmount.handles[0], 41n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint8, uint8) => ebool test 4 (41, 37)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(41n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.gt_euint8_uint8(encryptedAmount.handles[0], 37n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (uint8, euint8) => ebool test 1 (102, 178)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(178n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.gt_uint8_euint8(102n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (uint8, euint8) => ebool test 2 (37, 41)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(41n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.gt_uint8_euint8(37n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (uint8, euint8) => ebool test 3 (41, 41)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(41n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.gt_uint8_euint8(41n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (uint8, euint8) => ebool test 4 (41, 37)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(37n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.gt_uint8_euint8(41n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, uint8) => ebool test 1 (136, 214)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(136n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.le_euint8_uint8(encryptedAmount.handles[0], 214n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, uint8) => ebool test 2 (132, 136)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(132n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.le_euint8_uint8(encryptedAmount.handles[0], 136n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, uint8) => ebool test 3 (136, 136)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(136n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.le_euint8_uint8(encryptedAmount.handles[0], 136n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint8, uint8) => ebool test 4 (136, 132)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(136n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.le_euint8_uint8(encryptedAmount.handles[0], 132n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (uint8, euint8) => ebool test 1 (212, 214)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(214n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.le_uint8_euint8(212n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (uint8, euint8) => ebool test 2 (132, 136)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(136n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.le_uint8_euint8(132n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (uint8, euint8) => ebool test 3 (136, 136)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(136n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.le_uint8_euint8(136n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (uint8, euint8) => ebool test 4 (136, 132)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(132n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.le_uint8_euint8(136n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint8, uint8) => ebool test 1 (177, 55)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(177n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.lt_euint8_uint8(encryptedAmount.handles[0], 55n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint8, uint8) => ebool test 2 (164, 168)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(164n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.lt_euint8_uint8(encryptedAmount.handles[0], 168n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint8, uint8) => ebool test 3 (168, 168)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(168n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.lt_euint8_uint8(encryptedAmount.handles[0], 168n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint8, uint8) => ebool test 4 (168, 164)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(168n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.lt_euint8_uint8(encryptedAmount.handles[0], 164n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (uint8, euint8) => ebool test 1 (239, 55)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(55n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.lt_uint8_euint8(239n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (uint8, euint8) => ebool test 2 (164, 168)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(168n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.lt_uint8_euint8(164n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (uint8, euint8) => ebool test 3 (168, 168)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(168n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.lt_uint8_euint8(168n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (uint8, euint8) => ebool test 4 (168, 164)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(164n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.lt_uint8_euint8(168n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint8, uint8) => euint8 test 1 (5, 117)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(5n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.min_euint8_uint8(encryptedAmount.handles[0], 117n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(5n); + }); + + it('test operator "min" overload (euint8, uint8) => euint8 test 2 (1, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(1n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.min_euint8_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(1n); + }); + + it('test operator "min" overload (euint8, uint8) => euint8 test 3 (5, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(5n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.min_euint8_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(5n); + }); + + it('test operator "min" overload (euint8, uint8) => euint8 test 4 (5, 1)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(5n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.min_euint8_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(1n); + }); + + it('test operator "min" overload (uint8, euint8) => euint8 test 1 (171, 117)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(117n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.min_uint8_euint8(171n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(117n); + }); + + it('test operator "min" overload (uint8, euint8) => euint8 test 2 (1, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.min_uint8_euint8(1n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(1n); + }); + + it('test operator "min" overload (uint8, euint8) => euint8 test 3 (5, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.min_uint8_euint8(5n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(5n); + }); + + it('test operator "min" overload (uint8, euint8) => euint8 test 4 (5, 1)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(1n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.min_uint8_euint8(5n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(1n); + }); + + it('test operator "max" overload (euint8, uint8) => euint8 test 1 (249, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(249n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.max_euint8_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(249n); + }); + + it('test operator "max" overload (euint8, uint8) => euint8 test 2 (178, 182)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(178n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.max_euint8_uint8(encryptedAmount.handles[0], 182n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(182n); + }); + + it('test operator "max" overload (euint8, uint8) => euint8 test 3 (182, 182)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(182n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.max_euint8_uint8(encryptedAmount.handles[0], 182n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(182n); + }); + + it('test operator "max" overload (euint8, uint8) => euint8 test 4 (182, 178)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add8(182n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.max_euint8_uint8(encryptedAmount.handles[0], 178n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(182n); + }); + + it('test operator "max" overload (uint8, euint8) => euint8 test 1 (136, 5)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(5n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.max_uint8_euint8(136n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(136n); + }); + + it('test operator "max" overload (uint8, euint8) => euint8 test 2 (178, 182)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(182n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.max_uint8_euint8(178n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(182n); + }); + + it('test operator "max" overload (uint8, euint8) => euint8 test 3 (182, 182)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(182n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.max_uint8_euint8(182n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(182n); + }); + + it('test operator "max" overload (uint8, euint8) => euint8 test 4 (182, 178)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add8(178n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.max_uint8_euint8(182n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt8(await this.contract5.resEuint8()); + expect(res).to.equal(182n); + }); + + it('test operator "add" overload (euint16, uint16) => euint16 test 1 (20179, 23122)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(20179n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.add_euint16_uint16(encryptedAmount.handles[0], 23122n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(43301n); + }); + + it('test operator "add" overload (euint16, uint16) => euint16 test 2 (20177, 20179)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(20177n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.add_euint16_uint16(encryptedAmount.handles[0], 20179n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(40356n); + }); + + it('test operator "add" overload (euint16, uint16) => euint16 test 3 (20179, 20179)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(20179n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.add_euint16_uint16(encryptedAmount.handles[0], 20179n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(40358n); + }); + + it('test operator "add" overload (euint16, uint16) => euint16 test 4 (20179, 20177)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(20179n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.add_euint16_uint16(encryptedAmount.handles[0], 20177n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(40356n); + }); + + it('test operator "add" overload (uint16, euint16) => euint16 test 1 (12021, 23122)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(23122n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.add_uint16_euint16(12021n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(35143n); + }); + + it('test operator "add" overload (uint16, euint16) => euint16 test 2 (20177, 20179)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(20179n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.add_uint16_euint16(20177n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(40356n); + }); + + it('test operator "add" overload (uint16, euint16) => euint16 test 3 (20179, 20179)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(20179n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.add_uint16_euint16(20179n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(40358n); + }); + + it('test operator "add" overload (uint16, euint16) => euint16 test 4 (20179, 20177)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(20177n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.add_uint16_euint16(20179n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(40356n); + }); + + it('test operator "sub" overload (euint16, uint16) => euint16 test 1 (4425, 4425)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(4425n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.sub_euint16_uint16(encryptedAmount.handles[0], 4425n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint16, uint16) => euint16 test 2 (4425, 4421)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(4425n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.sub_euint16_uint16(encryptedAmount.handles[0], 4421n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(4n); + }); + + it('test operator "sub" overload (uint16, euint16) => euint16 test 1 (4425, 4425)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(4425n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.sub_uint16_euint16(4425n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (uint16, euint16) => euint16 test 2 (4425, 4421)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(4421n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.sub_uint16_euint16(4425n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(4n); + }); + + it('test operator "mul" overload (euint16, uint16) => euint16 test 1 (344, 74)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(344n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.mul_euint16_uint16(encryptedAmount.handles[0], 74n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(25456n); + }); + + it('test operator "mul" overload (euint16, uint16) => euint16 test 2 (173, 173)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(173n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.mul_euint16_uint16(encryptedAmount.handles[0], 173n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(29929n); + }); + + it('test operator "mul" overload (euint16, uint16) => euint16 test 3 (173, 173)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(173n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.mul_euint16_uint16(encryptedAmount.handles[0], 173n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(29929n); + }); + + it('test operator "mul" overload (euint16, uint16) => euint16 test 4 (173, 173)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(173n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.mul_euint16_uint16(encryptedAmount.handles[0], 173n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(29929n); + }); + + it('test operator "mul" overload (uint16, euint16) => euint16 test 1 (252, 74)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(74n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.mul_uint16_euint16(252n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(18648n); + }); + + it('test operator "mul" overload (uint16, euint16) => euint16 test 2 (173, 173)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(173n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.mul_uint16_euint16(173n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(29929n); + }); + + it('test operator "mul" overload (uint16, euint16) => euint16 test 3 (173, 173)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(173n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.mul_uint16_euint16(173n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(29929n); + }); + + it('test operator "mul" overload (uint16, euint16) => euint16 test 4 (173, 173)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(173n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.mul_uint16_euint16(173n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(29929n); + }); + + it('test operator "div" overload (euint16, uint16) => euint16 test 1 (60426, 20491)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(60426n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.div_euint16_uint16(encryptedAmount.handles[0], 20491n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(2n); + }); + + it('test operator "div" overload (euint16, uint16) => euint16 test 2 (9975, 9979)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(9975n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.div_euint16_uint16(encryptedAmount.handles[0], 9979n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(0n); + }); + + it('test operator "div" overload (euint16, uint16) => euint16 test 3 (9979, 9979)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(9979n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.div_euint16_uint16(encryptedAmount.handles[0], 9979n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(1n); + }); + + it('test operator "div" overload (euint16, uint16) => euint16 test 4 (9979, 9975)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(9979n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.div_euint16_uint16(encryptedAmount.handles[0], 9975n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(1n); + }); + + it('test operator "rem" overload (euint16, uint16) => euint16 test 1 (18350, 18144)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(18350n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.rem_euint16_uint16(encryptedAmount.handles[0], 18144n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(206n); + }); + + it('test operator "rem" overload (euint16, uint16) => euint16 test 2 (18346, 18350)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(18346n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.rem_euint16_uint16(encryptedAmount.handles[0], 18350n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(18346n); + }); + + it('test operator "rem" overload (euint16, uint16) => euint16 test 3 (18350, 18350)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(18350n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.rem_euint16_uint16(encryptedAmount.handles[0], 18350n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(0n); + }); + + it('test operator "rem" overload (euint16, uint16) => euint16 test 4 (18350, 18346)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(18350n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.rem_euint16_uint16(encryptedAmount.handles[0], 18346n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(4n); + }); + + it('test operator "and" overload (euint16, uint16) => euint16 test 1 (51261, 47381)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(51261n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint16_uint16(encryptedAmount.handles[0], 47381n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(34837n); + }); + + it('test operator "and" overload (euint16, uint16) => euint16 test 2 (47662, 47666)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(47662n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint16_uint16(encryptedAmount.handles[0], 47666n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(47650n); + }); + + it('test operator "and" overload (euint16, uint16) => euint16 test 3 (47666, 47666)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(47666n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint16_uint16(encryptedAmount.handles[0], 47666n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(47666n); + }); + + it('test operator "and" overload (euint16, uint16) => euint16 test 4 (47666, 47662)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(47666n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_euint16_uint16(encryptedAmount.handles[0], 47662n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(47650n); + }); + + it('test operator "and" overload (uint16, euint16) => euint16 test 1 (7561, 47381)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(47381n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_uint16_euint16(7561n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(6401n); + }); + + it('test operator "and" overload (uint16, euint16) => euint16 test 2 (47662, 47666)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(47666n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_uint16_euint16(47662n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(47650n); + }); + + it('test operator "and" overload (uint16, euint16) => euint16 test 3 (47666, 47666)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(47666n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_uint16_euint16(47666n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(47666n); + }); + + it('test operator "and" overload (uint16, euint16) => euint16 test 4 (47666, 47662)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(47662n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.and_uint16_euint16(47666n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(47650n); + }); + + it('test operator "or" overload (euint16, uint16) => euint16 test 1 (18593, 39699)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(18593n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint16_uint16(encryptedAmount.handles[0], 39699n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(56243n); + }); + + it('test operator "or" overload (euint16, uint16) => euint16 test 2 (18589, 18593)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(18589n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint16_uint16(encryptedAmount.handles[0], 18593n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(18621n); + }); + + it('test operator "or" overload (euint16, uint16) => euint16 test 3 (18593, 18593)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(18593n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint16_uint16(encryptedAmount.handles[0], 18593n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(18593n); + }); + + it('test operator "or" overload (euint16, uint16) => euint16 test 4 (18593, 18589)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(18593n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_euint16_uint16(encryptedAmount.handles[0], 18589n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(18621n); + }); + + it('test operator "or" overload (uint16, euint16) => euint16 test 1 (35290, 39699)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(39699n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_uint16_euint16(35290n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(39899n); + }); + + it('test operator "or" overload (uint16, euint16) => euint16 test 2 (18589, 18593)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(18593n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_uint16_euint16(18589n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(18621n); + }); + + it('test operator "or" overload (uint16, euint16) => euint16 test 3 (18593, 18593)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(18593n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_uint16_euint16(18593n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(18593n); + }); + + it('test operator "or" overload (uint16, euint16) => euint16 test 4 (18593, 18589)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(18589n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.or_uint16_euint16(18593n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(18621n); + }); + + it('test operator "xor" overload (euint16, uint16) => euint16 test 1 (63570, 44601)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(63570n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint16_uint16(encryptedAmount.handles[0], 44601n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(22123n); + }); + + it('test operator "xor" overload (euint16, uint16) => euint16 test 2 (2184, 2188)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(2184n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint16_uint16(encryptedAmount.handles[0], 2188n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (euint16, uint16) => euint16 test 3 (2188, 2188)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(2188n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint16_uint16(encryptedAmount.handles[0], 2188n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (euint16, uint16) => euint16 test 4 (2188, 2184)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(2188n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_euint16_uint16(encryptedAmount.handles[0], 2184n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (uint16, euint16) => euint16 test 1 (22552, 44601)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(44601n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_uint16_euint16(22552n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(63009n); + }); + + it('test operator "xor" overload (uint16, euint16) => euint16 test 2 (2184, 2188)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(2188n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_uint16_euint16(2184n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(4n); + }); + + it('test operator "xor" overload (uint16, euint16) => euint16 test 3 (2188, 2188)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(2188n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_uint16_euint16(2188n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(0n); + }); + + it('test operator "xor" overload (uint16, euint16) => euint16 test 4 (2188, 2184)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + + input.add16(2184n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.xor_uint16_euint16(2188n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract5.resEuint16()); + expect(res).to.equal(4n); + }); + + it('test operator "eq" overload (euint16, uint16) => ebool test 1 (35071, 57620)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(35071n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint16_uint16(encryptedAmount.handles[0], 57620n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint16, uint16) => ebool test 2 (35067, 35071)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(35067n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint16_uint16(encryptedAmount.handles[0], 35071n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (euint16, uint16) => ebool test 3 (35071, 35071)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(35071n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint16_uint16(encryptedAmount.handles[0], 35071n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (euint16, uint16) => ebool test 4 (35071, 35067)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); + input.add16(35071n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract5.eq_euint16_uint16(encryptedAmount.handles[0], 35067n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract5.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (uint16, euint16) => ebool test 1 (64105, 57620)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(57620n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_uint16_euint16(64105n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (uint16, euint16) => ebool test 2 (35067, 35071)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(35071n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_uint16_euint16(35067n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "eq" overload (uint16, euint16) => ebool test 3 (35071, 35071)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(35071n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_uint16_euint16(35071n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "eq" overload (uint16, euint16) => ebool test 4 (35071, 35067)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(35067n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.eq_uint16_euint16(35071n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint16, uint16) => ebool test 1 (50940, 2781)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(50940n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_euint16_uint16(encryptedAmount.handles[0], 2781n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint16, uint16) => ebool test 2 (20394, 20398)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(20394n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_euint16_uint16(encryptedAmount.handles[0], 20398n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (euint16, uint16) => ebool test 3 (20398, 20398)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(20398n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_euint16_uint16(encryptedAmount.handles[0], 20398n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (euint16, uint16) => ebool test 4 (20398, 20394)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(20398n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_euint16_uint16(encryptedAmount.handles[0], 20394n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (uint16, euint16) => ebool test 1 (40161, 2781)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(2781n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_uint16_euint16(40161n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (uint16, euint16) => ebool test 2 (20394, 20398)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(20398n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_uint16_euint16(20394n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ne" overload (uint16, euint16) => ebool test 3 (20398, 20398)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(20398n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_uint16_euint16(20398n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ne" overload (uint16, euint16) => ebool test 4 (20398, 20394)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(20394n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ne_uint16_euint16(20398n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint16, uint16) => ebool test 1 (32680, 32632)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(32680n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_euint16_uint16(encryptedAmount.handles[0], 32632n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint16, uint16) => ebool test 2 (32676, 32680)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(32676n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_euint16_uint16(encryptedAmount.handles[0], 32680n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (euint16, uint16) => ebool test 3 (32680, 32680)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(32680n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_euint16_uint16(encryptedAmount.handles[0], 32680n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (euint16, uint16) => ebool test 4 (32680, 32676)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(32680n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_euint16_uint16(encryptedAmount.handles[0], 32676n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (uint16, euint16) => ebool test 1 (15887, 32632)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(32632n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_uint16_euint16(15887n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (uint16, euint16) => ebool test 2 (32676, 32680)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(32680n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_uint16_euint16(32676n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "ge" overload (uint16, euint16) => ebool test 3 (32680, 32680)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(32680n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_uint16_euint16(32680n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "ge" overload (uint16, euint16) => ebool test 4 (32680, 32676)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(32676n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.ge_uint16_euint16(32680n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint16, uint16) => ebool test 1 (19447, 14835)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(19447n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_euint16_uint16(encryptedAmount.handles[0], 14835n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (euint16, uint16) => ebool test 2 (1900, 1904)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(1900n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_euint16_uint16(encryptedAmount.handles[0], 1904n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint16, uint16) => ebool test 3 (1904, 1904)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(1904n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_euint16_uint16(encryptedAmount.handles[0], 1904n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (euint16, uint16) => ebool test 4 (1904, 1900)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(1904n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_euint16_uint16(encryptedAmount.handles[0], 1900n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (uint16, euint16) => ebool test 1 (24221, 14835)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(14835n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_uint16_euint16(24221n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "gt" overload (uint16, euint16) => ebool test 2 (1900, 1904)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(1904n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_uint16_euint16(1900n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (uint16, euint16) => ebool test 3 (1904, 1904)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(1904n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_uint16_euint16(1904n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "gt" overload (uint16, euint16) => ebool test 4 (1904, 1900)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(1900n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.gt_uint16_euint16(1904n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, uint16) => ebool test 1 (31637, 13624)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(31637n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_euint16_uint16(encryptedAmount.handles[0], 13624n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (euint16, uint16) => ebool test 2 (31633, 31637)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(31633n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_euint16_uint16(encryptedAmount.handles[0], 31637n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, uint16) => ebool test 3 (31637, 31637)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(31637n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_euint16_uint16(encryptedAmount.handles[0], 31637n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (euint16, uint16) => ebool test 4 (31637, 31633)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(31637n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_euint16_uint16(encryptedAmount.handles[0], 31633n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "le" overload (uint16, euint16) => ebool test 1 (9847, 13624)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(13624n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_uint16_euint16(9847n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (uint16, euint16) => ebool test 2 (31633, 31637)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(31637n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_uint16_euint16(31633n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (uint16, euint16) => ebool test 3 (31637, 31637)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(31637n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_uint16_euint16(31637n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "le" overload (uint16, euint16) => ebool test 4 (31637, 31633)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(31633n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.le_uint16_euint16(31637n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint16, uint16) => ebool test 1 (14598, 28121)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(14598n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_euint16_uint16(encryptedAmount.handles[0], 28121n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint16, uint16) => ebool test 2 (14594, 14598)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(14594n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_euint16_uint16(encryptedAmount.handles[0], 14598n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (euint16, uint16) => ebool test 3 (14598, 14598)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(14598n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_euint16_uint16(encryptedAmount.handles[0], 14598n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (euint16, uint16) => ebool test 4 (14598, 14594)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(14598n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_euint16_uint16(encryptedAmount.handles[0], 14594n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (uint16, euint16) => ebool test 1 (3217, 28121)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(28121n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_uint16_euint16(3217n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (uint16, euint16) => ebool test 2 (14594, 14598)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(14598n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_uint16_euint16(14594n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(true); + }); + + it('test operator "lt" overload (uint16, euint16) => ebool test 3 (14598, 14598)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(14598n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_uint16_euint16(14598n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "lt" overload (uint16, euint16) => ebool test 4 (14598, 14594)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(14594n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.lt_uint16_euint16(14598n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decryptBool(await this.contract6.resEbool()); + expect(res).to.equal(false); + }); + + it('test operator "min" overload (euint16, uint16) => euint16 test 1 (19936, 14782)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(19936n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_euint16_uint16(encryptedAmount.handles[0], 14782n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract6.resEuint16()); + expect(res).to.equal(14782n); + }); + + it('test operator "min" overload (euint16, uint16) => euint16 test 2 (19932, 19936)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(19932n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_euint16_uint16(encryptedAmount.handles[0], 19936n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract6.resEuint16()); + expect(res).to.equal(19932n); + }); + + it('test operator "min" overload (euint16, uint16) => euint16 test 3 (19936, 19936)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(19936n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_euint16_uint16(encryptedAmount.handles[0], 19936n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract6.resEuint16()); + expect(res).to.equal(19936n); + }); + + it('test operator "min" overload (euint16, uint16) => euint16 test 4 (19936, 19932)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(19936n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_euint16_uint16(encryptedAmount.handles[0], 19932n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract6.resEuint16()); + expect(res).to.equal(19932n); + }); + + it('test operator "min" overload (uint16, euint16) => euint16 test 1 (15092, 14782)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(14782n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_uint16_euint16(15092n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract6.resEuint16()); + expect(res).to.equal(14782n); + }); + + it('test operator "min" overload (uint16, euint16) => euint16 test 2 (19932, 19936)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(19936n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_uint16_euint16(19932n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract6.resEuint16()); + expect(res).to.equal(19932n); + }); + + it('test operator "min" overload (uint16, euint16) => euint16 test 3 (19936, 19936)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(19936n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_uint16_euint16(19936n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract6.resEuint16()); + expect(res).to.equal(19936n); + }); + + it('test operator "min" overload (uint16, euint16) => euint16 test 4 (19936, 19932)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(19932n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.min_uint16_euint16(19936n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract6.resEuint16()); + expect(res).to.equal(19932n); + }); + + it('test operator "max" overload (euint16, uint16) => euint16 test 1 (17099, 38028)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(17099n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_euint16_uint16(encryptedAmount.handles[0], 38028n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract6.resEuint16()); + expect(res).to.equal(38028n); + }); + + it('test operator "max" overload (euint16, uint16) => euint16 test 2 (17095, 17099)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(17095n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_euint16_uint16(encryptedAmount.handles[0], 17099n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract6.resEuint16()); + expect(res).to.equal(17099n); + }); + + it('test operator "max" overload (euint16, uint16) => euint16 test 3 (17099, 17099)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(17099n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_euint16_uint16(encryptedAmount.handles[0], 17099n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract6.resEuint16()); + expect(res).to.equal(17099n); + }); + + it('test operator "max" overload (euint16, uint16) => euint16 test 4 (17099, 17095)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add16(17099n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_euint16_uint16(encryptedAmount.handles[0], 17095n, encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract6.resEuint16()); + expect(res).to.equal(17099n); + }); + + it('test operator "max" overload (uint16, euint16) => euint16 test 1 (59182, 38028)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(38028n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_uint16_euint16(59182n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract6.resEuint16()); + expect(res).to.equal(59182n); + }); + + it('test operator "max" overload (uint16, euint16) => euint16 test 2 (17095, 17099)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(17099n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_uint16_euint16(17095n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract6.resEuint16()); + expect(res).to.equal(17099n); + }); + + it('test operator "max" overload (uint16, euint16) => euint16 test 3 (17099, 17099)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(17099n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_uint16_euint16(17099n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract6.resEuint16()); + expect(res).to.equal(17099n); + }); + + it('test operator "max" overload (uint16, euint16) => euint16 test 4 (17099, 17095)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add16(17095n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.max_uint16_euint16(17099n, encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx.wait(); + const res = await decrypt16(await this.contract6.resEuint16()); + expect(res).to.equal(17099n); + }); + + it('test operator "add" overload (euint32, uint32) => euint32 test 1 (506115428, 1738513200)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(506115428n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_euint32_uint32( + encryptedAmount.handles[0], + 1738513200n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(2244628628n); + }); + + it('test operator "add" overload (euint32, uint32) => euint32 test 2 (1012230850, 1012230854)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1012230850n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_euint32_uint32( + encryptedAmount.handles[0], + 1012230854n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(2024461704n); + }); + + it('test operator "add" overload (euint32, uint32) => euint32 test 3 (1012230854, 1012230854)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1012230854n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_euint32_uint32( + encryptedAmount.handles[0], + 1012230854n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(2024461708n); + }); + + it('test operator "add" overload (euint32, uint32) => euint32 test 4 (1012230854, 1012230850)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(1012230854n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_euint32_uint32( + encryptedAmount.handles[0], + 1012230850n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(2024461704n); + }); + + it('test operator "add" overload (uint32, euint32) => euint32 test 1 (948190819, 1738513200)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1738513200n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_uint32_euint32( + 948190819n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(2686704019n); + }); + + it('test operator "add" overload (uint32, euint32) => euint32 test 2 (1012230850, 1012230854)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1012230854n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_uint32_euint32( + 1012230850n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(2024461704n); + }); + + it('test operator "add" overload (uint32, euint32) => euint32 test 3 (1012230854, 1012230854)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1012230854n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_uint32_euint32( + 1012230854n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(2024461708n); + }); + + it('test operator "add" overload (uint32, euint32) => euint32 test 4 (1012230854, 1012230850)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + + input.add32(1012230850n); + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.add_uint32_euint32( + 1012230854n, + encryptedAmount.handles[0], + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(2024461704n); + }); + + it('test operator "sub" overload (euint32, uint32) => euint32 test 1 (198498580, 198498580)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(198498580n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.sub_euint32_uint32( + encryptedAmount.handles[0], + 198498580n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(0n); + }); + + it('test operator "sub" overload (euint32, uint32) => euint32 test 2 (198498580, 198498576)', async function () { + const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); + input.add32(198498580n); + + const encryptedAmount = await input.encrypt(); + const tx = await this.contract6.sub_euint32_uint32( + encryptedAmount.handles[0], + 198498576n, + encryptedAmount.inputProof, + ); + await tx.wait(); + const res = await decrypt32(await this.contract6.resEuint32()); + expect(res).to.equal(4n); + }); +}); diff --git a/contracts/test/tfheOperations/manual.ts b/contracts/test/httpzOperations/manual.ts similarity index 78% rename from contracts/test/tfheOperations/manual.ts rename to contracts/test/httpzOperations/manual.ts index d4a56b8e..d9cbbf2e 100644 --- a/contracts/test/tfheOperations/manual.ts +++ b/contracts/test/httpzOperations/manual.ts @@ -1,10 +1,9 @@ import { expect } from 'chai'; import { ethers } from 'hardhat'; -import type { TFHEManualTestSuite } from '../../types/contracts/tests/TFHEManualTestSuite'; +import type { HTTPZManualTestSuite } from '../../types/contracts/tests/HTTPZManualTestSuite'; import { createInstances, - decrypt4, decrypt8, decrypt16, decrypt32, @@ -20,7 +19,7 @@ import { import { getSigners, initSigners } from '../signers'; import { bigIntToBytes256 } from '../utils'; -async function deployTfheManualTestFixture(): Promise { +async function deployHTTPZManualTestFixture(): Promise { const signers = await getSigners(); const admin = signers.alice; @@ -32,11 +31,11 @@ async function deployTfheManualTestFixture(): Promise { } describe('TFHE manual operations', function () { - before(async function () { + beforeEach(async function () { await initSigners(1); this.signers = await getSigners(); - const contract = await deployTfheManualTestFixture(); + const contract = await deployHTTPZManualTestFixture(); this.contractAddress = await contract.getAddress(); this.contract = contract; const instances = await createInstances(this.signers); @@ -56,7 +55,7 @@ describe('TFHE manual operations', function () { encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract.res32()); + const res = await decrypt32(await this.contract.resEuint32()); expect(res).to.equal(4); }); @@ -73,18 +72,18 @@ describe('TFHE manual operations', function () { encryptedAmount.inputProof, ); await tx.wait(); - const res = await decrypt32(await this.contract.res32()); + const res = await decrypt32(await this.contract.resEuint32()); expect(res).to.equal(3); }); it('Select ebool', async function () { const tx = await this.contract.test_select_ebool(true, false, true); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.test_select_ebool(false, false, true); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(true); }); @@ -95,13 +94,13 @@ describe('TFHE manual operations', function () { '0x11', ); await tx.wait(); - const res = await decryptEbytes64(await this.contract.resB64()); + const res = await decryptEbytes64(await this.contract.resEbytes64()); expect(res).to.equal( ethers.toBeHex(BigInt('0x6798aa6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb'), 64), ); const tx2 = await this.contract.test_select_ebytes64(false, '0x42', '0xaaaaaaaa'); await tx2.wait(); - const res2 = await decryptEbytes64(await this.contract.resB64()); + const res2 = await decryptEbytes64(await this.contract.resEbytes64()); expect(res2).to.equal(ethers.toBeHex(BigInt('0xaaaaaaaa'), 64)); }); @@ -112,13 +111,13 @@ describe('TFHE manual operations', function () { '0x11', ); await tx.wait(); - const res = await decryptEbytes128(await this.contract.resB128()); + const res = await decryptEbytes128(await this.contract.resEbytes128()); expect(res).to.equal( ethers.toBeHex(BigInt('0x6798aa6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb'), 128), ); const tx2 = await this.contract.test_select_ebytes128(false, '0x42', '0xaaaaaaaa'); await tx2.wait(); - const res2 = await decryptEbytes128(await this.contract.resB128()); + const res2 = await decryptEbytes128(await this.contract.resEbytes128()); expect(res2).to.equal(ethers.toBeHex(BigInt('0xaaaaaaaa'), 128)); }); @@ -129,13 +128,13 @@ describe('TFHE manual operations', function () { '0x11', ); await tx.wait(); - const res = await decryptEbytes256(await this.contract.resB256()); + const res = await decryptEbytes256(await this.contract.resEbytes256()); expect(res).to.equal( ethers.toBeHex(BigInt('0x6798aa6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb'), 256), ); const tx2 = await this.contract.test_select_ebytes256(false, '0x428899', '0xaaaaaabb'); await tx2.wait(); - const res2 = await decryptEbytes256(await this.contract.resB256()); + const res2 = await decryptEbytes256(await this.contract.resEbytes256()); expect(res2).to.equal(ethers.toBeHex(BigInt('0xaaaaaabb'), 256)); }); @@ -176,114 +175,114 @@ describe('TFHE manual operations', function () { it('ebool eq ebool', async function () { const tx = await this.contract.eqEbool(true, true); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(true); const tx2 = await this.contract.eqEbool(false, false); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(true); const tx3 = await this.contract.eqEbool(false, true); await tx3.wait(); - const res3 = await decryptBool(await this.contract.resb()); + const res3 = await decryptBool(await this.contract.resEbool()); expect(res3).to.equal(false); const tx4 = await this.contract.eqEbool(true, false); await tx4.wait(); - const res4 = await decryptBool(await this.contract.resb()); + const res4 = await decryptBool(await this.contract.resEbool()); expect(res4).to.equal(false); }); it('ebool eq ebool - ScalarL', async function () { const tx = await this.contract.eqEboolScalarL(true, true); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(true); const tx2 = await this.contract.eqEboolScalarL(false, true); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(false); const tx3 = await this.contract.eqEboolScalarL(false, false); await tx3.wait(); - const res3 = await decryptBool(await this.contract.resb()); + const res3 = await decryptBool(await this.contract.resEbool()); expect(res3).to.equal(true); const tx4 = await this.contract.eqEboolScalarL(true, false); await tx4.wait(); - const res4 = await decryptBool(await this.contract.resb()); + const res4 = await decryptBool(await this.contract.resEbool()); expect(res4).to.equal(false); }); it('ebool eq ebool - ScalarR', async function () { const tx = await this.contract.eqEboolScalarL(false, false); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(true); const tx2 = await this.contract.eqEboolScalarL(false, true); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(false); const tx3 = await this.contract.eqEboolScalarL(true, true); await tx3.wait(); - const res3 = await decryptBool(await this.contract.resb()); + const res3 = await decryptBool(await this.contract.resEbool()); expect(res3).to.equal(true); const tx4 = await this.contract.eqEboolScalarL(true, false); await tx4.wait(); - const res4 = await decryptBool(await this.contract.resb()); + const res4 = await decryptBool(await this.contract.resEbool()); expect(res4).to.equal(false); }); it('ebool ne ebool', async function () { const tx = await this.contract.neEbool(true, true); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.neEbool(false, false); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(false); const tx3 = await this.contract.neEbool(false, true); await tx3.wait(); - const res3 = await decryptBool(await this.contract.resb()); + const res3 = await decryptBool(await this.contract.resEbool()); expect(res3).to.equal(true); const tx4 = await this.contract.neEbool(true, false); await tx4.wait(); - const res4 = await decryptBool(await this.contract.resb()); + const res4 = await decryptBool(await this.contract.resEbool()); expect(res4).to.equal(true); }); it('ebool ne ebool - ScalarL', async function () { const tx = await this.contract.neEboolScalarL(true, true); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.neEboolScalarL(false, true); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(true); const tx3 = await this.contract.neEboolScalarL(false, false); await tx3.wait(); - const res3 = await decryptBool(await this.contract.resb()); + const res3 = await decryptBool(await this.contract.resEbool()); expect(res3).to.equal(false); const tx4 = await this.contract.neEboolScalarL(true, false); await tx4.wait(); - const res4 = await decryptBool(await this.contract.resb()); + const res4 = await decryptBool(await this.contract.resEbool()); expect(res4).to.equal(true); }); it('ebool ne ebool - ScalarR', async function () { const tx = await this.contract.neEboolScalarL(false, false); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.neEboolScalarL(false, true); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(true); const tx3 = await this.contract.neEboolScalarL(true, true); await tx3.wait(); - const res3 = await decryptBool(await this.contract.resb()); + const res3 = await decryptBool(await this.contract.resEbool()); expect(res3).to.equal(false); const tx4 = await this.contract.neEboolScalarL(true, false); await tx4.wait(); - const res4 = await decryptBool(await this.contract.resb()); + const res4 = await decryptBool(await this.contract.resEbool()); expect(res4).to.equal(true); }); @@ -298,7 +297,7 @@ describe('TFHE manual operations', function () { encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(true); }); @@ -313,7 +312,7 @@ describe('TFHE manual operations', function () { encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); }); @@ -324,7 +323,7 @@ describe('TFHE manual operations', function () { const encryptedAmount = await input.encrypt(); const tx = await this.contract.test_eq_eaddress_address(encryptedAmount.handles[0], b, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(true); }); @@ -335,7 +334,7 @@ describe('TFHE manual operations', function () { const encryptedAmount = await input.encrypt(); const tx = await this.contract.test_eq_eaddress_address(encryptedAmount.handles[0], b, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); }); @@ -346,7 +345,7 @@ describe('TFHE manual operations', function () { const encryptedAmount = await input.encrypt(); const tx = await this.contract.test_eq_address_eaddress(encryptedAmount.handles[0], b, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(true); }); @@ -357,7 +356,7 @@ describe('TFHE manual operations', function () { const encryptedAmount = await input.encrypt(); const tx = await this.contract.test_eq_address_eaddress(encryptedAmount.handles[0], b, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); }); @@ -372,7 +371,7 @@ describe('TFHE manual operations', function () { encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); }); @@ -387,7 +386,7 @@ describe('TFHE manual operations', function () { encryptedAmount.inputProof, ); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(true); }); @@ -398,7 +397,7 @@ describe('TFHE manual operations', function () { const encryptedAmount = await input.encrypt(); const tx = await this.contract.test_ne_eaddress_address(encryptedAmount.handles[0], b, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); }); @@ -409,7 +408,7 @@ describe('TFHE manual operations', function () { const encryptedAmount = await input.encrypt(); const tx = await this.contract.test_ne_eaddress_address(encryptedAmount.handles[0], b, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(true); }); @@ -420,7 +419,7 @@ describe('TFHE manual operations', function () { const encryptedAmount = await input.encrypt(); const tx = await this.contract.test_ne_address_eaddress(encryptedAmount.handles[0], b, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); }); @@ -431,331 +430,310 @@ describe('TFHE manual operations', function () { const encryptedAmount = await input.encrypt(); const tx = await this.contract.test_ne_address_eaddress(encryptedAmount.handles[0], b, encryptedAmount.inputProof); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(true); }); - it('ebool to euint4 casting works with true', async function () { - const tx = await this.contract.test_ebool_to_euint4_cast(true); - await tx.wait(); - const res = await decrypt4(await this.contract.res4()); - expect(res).to.equal(1); - }); - - it('ebool to euint4 casting works with false', async function () { - const tx = await this.contract.test_ebool_to_euint4_cast(false); - await tx.wait(); - const res = await decrypt4(await this.contract.res4()); - expect(res).to.equal(0); - }); - it('ebool to euint8 casting works with true', async function () { const tx = await this.contract.test_ebool_to_euint8_cast(true); await tx.wait(); - const res = await decrypt8(await this.contract.res8()); + const res = await decrypt8(await this.contract.resEuint8()); expect(res).to.equal(1); }); it('ebool to euint8 casting works with false', async function () { const tx = await this.contract.test_ebool_to_euint8_cast(false); await tx.wait(); - const res = await decrypt8(await this.contract.res8()); + const res = await decrypt8(await this.contract.resEuint8()); expect(res).to.equal(0); }); it('ebool to euint16 casting works with true', async function () { const tx = await this.contract.test_ebool_to_euint16_cast(true); await tx.wait(); - const res = await decrypt16(await this.contract.res16()); + const res = await decrypt16(await this.contract.resEuint16()); expect(res).to.equal(1); }); it('ebool to euint16 casting works with false', async function () { const tx = await this.contract.test_ebool_to_euint16_cast(false); await tx.wait(); - const res = await decrypt16(await this.contract.res16()); + const res = await decrypt16(await this.contract.resEuint16()); expect(res).to.equal(0); }); it('ebool to euint32 casting works with true', async function () { const tx = await this.contract.test_ebool_to_euint32_cast(true); await tx.wait(); - const res = await decrypt32(await this.contract.res32()); + const res = await decrypt32(await this.contract.resEuint32()); expect(res).to.equal(1); }); it('ebool to euint32 casting works with false', async function () { const tx = await this.contract.test_ebool_to_euint32_cast(false); await tx.wait(); - const res = await decrypt32(await this.contract.res32()); + const res = await decrypt32(await this.contract.resEuint32()); expect(res).to.equal(0); }); it('ebool to euint64 casting works with true', async function () { const tx = await this.contract.test_ebool_to_euint64_cast(true); await tx.wait(); - const res = await decrypt64(await this.contract.res64()); + const res = await decrypt64(await this.contract.resEuint64()); expect(res).to.equal(1); }); it('ebool to euint64 casting works with false', async function () { const tx = await this.contract.test_ebool_to_euint64_cast(false); await tx.wait(); - const res = await decrypt64(await this.contract.res64()); + const res = await decrypt64(await this.contract.resEuint64()); expect(res).to.equal(0); }); it('ebool to euint128 casting works with true', async function () { const tx = await this.contract.test_ebool_to_euint128_cast(true); await tx.wait(); - const res = await decrypt128(await this.contract.res128()); + const res = await decrypt128(await this.contract.resEuint128()); expect(res).to.equal(1); }); it('ebool to euint128 casting works with false', async function () { const tx = await this.contract.test_ebool_to_euint128_cast(false); await tx.wait(); - const res = await decrypt128(await this.contract.res128()); + const res = await decrypt128(await this.contract.resEuint128()); expect(res).to.equal(0); }); it('ebool to euint256 casting works with true', async function () { const tx = await this.contract.test_ebool_to_euint256_cast(true); await tx.wait(); - const res = await decrypt256(await this.contract.res256()); + const res = await decrypt256(await this.contract.resEuint256()); expect(res).to.equal(1); }); it('ebool to euint256 casting works with false', async function () { const tx = await this.contract.test_ebool_to_euint256_cast(false); await tx.wait(); - const res = await decrypt256(await this.contract.res256()); + const res = await decrypt256(await this.contract.resEuint256()); expect(res).to.equal(0); }); - it('euint4 to euint256 casting works', async function () { - const tx = await this.contract.test_euint4_to_euint256_cast(12); - await tx.wait(); - const res = await decrypt256(await this.contract.res256()); - expect(res).to.equal(12); - }); - it('euint128 to euint8 casting works', async function () { const tx = await this.contract.test_euint128_to_euint8_cast(7668756464674969496544n); await tx.wait(); - const res = await decrypt8(await this.contract.res8()); + const res = await decrypt8(await this.contract.resEuint8()); expect(res).to.equal(224n); }); it('ebool not for false is true', async function () { const tx = await this.contract.test_ebool_not(false); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(true); }); it('ebool not for true is false', async function () { const tx = await this.contract.test_ebool_not(true); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); }); it('ebool and', async function () { const tx = await this.contract.test_ebool_and(false, false); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.test_ebool_and(false, true); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(false); const tx3 = await this.contract.test_ebool_and(true, false); await tx3.wait(); - const res3 = await decryptBool(await this.contract.resb()); + const res3 = await decryptBool(await this.contract.resEbool()); expect(res3).to.equal(false); const tx4 = await this.contract.test_ebool_and(true, true); await tx4.wait(); - const res4 = await decryptBool(await this.contract.resb()); + const res4 = await decryptBool(await this.contract.resEbool()); expect(res4).to.equal(true); }); it('ebool or', async function () { const tx = await this.contract.test_ebool_or(false, false); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.test_ebool_or(false, true); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(true); const tx3 = await this.contract.test_ebool_or(true, false); await tx3.wait(); - const res3 = await decryptBool(await this.contract.resb()); + const res3 = await decryptBool(await this.contract.resEbool()); expect(res3).to.equal(true); const tx4 = await this.contract.test_ebool_or(true, true); await tx4.wait(); - const res4 = await decryptBool(await this.contract.resb()); + const res4 = await decryptBool(await this.contract.resEbool()); expect(res4).to.equal(true); }); it('ebool xor', async function () { const tx = await this.contract.test_ebool_xor(false, false); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.test_ebool_xor(false, true); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(true); const tx3 = await this.contract.test_ebool_xor(true, false); await tx3.wait(); - const res3 = await decryptBool(await this.contract.resb()); + const res3 = await decryptBool(await this.contract.resEbool()); expect(res3).to.equal(true); const tx4 = await this.contract.test_ebool_xor(true, true); await tx4.wait(); - const res4 = await decryptBool(await this.contract.resb()); + const res4 = await decryptBool(await this.contract.resEbool()); expect(res4).to.equal(false); }); it('ebool xor scalarL', async function () { const tx = await this.contract.test_ebool_xor_scalarL(false, false); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.test_ebool_xor_scalarL(false, true); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(true); const tx3 = await this.contract.test_ebool_xor_scalarL(true, false); await tx3.wait(); - const res3 = await decryptBool(await this.contract.resb()); + const res3 = await decryptBool(await this.contract.resEbool()); expect(res3).to.equal(true); const tx4 = await this.contract.test_ebool_xor_scalarL(true, true); await tx4.wait(); - const res4 = await decryptBool(await this.contract.resb()); + const res4 = await decryptBool(await this.contract.resEbool()); expect(res4).to.equal(false); }); it('ebool xor scalarR', async function () { const tx = await this.contract.test_ebool_xor_scalarR(false, false); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.test_ebool_xor_scalarR(false, true); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(true); const tx3 = await this.contract.test_ebool_xor_scalarR(true, false); await tx3.wait(); - const res3 = await decryptBool(await this.contract.resb()); + const res3 = await decryptBool(await this.contract.resEbool()); expect(res3).to.equal(true); const tx4 = await this.contract.test_ebool_xor_scalarR(true, true); await tx4.wait(); - const res4 = await decryptBool(await this.contract.resb()); + const res4 = await decryptBool(await this.contract.resEbool()); expect(res4).to.equal(false); }); it('ebool or scalarL', async function () { const tx = await this.contract.test_ebool_or_scalarL(false, false); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.test_ebool_or_scalarL(false, true); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(true); const tx3 = await this.contract.test_ebool_or_scalarL(true, false); await tx3.wait(); - const res3 = await decryptBool(await this.contract.resb()); + const res3 = await decryptBool(await this.contract.resEbool()); expect(res3).to.equal(true); const tx4 = await this.contract.test_ebool_or_scalarL(true, true); await tx4.wait(); - const res4 = await decryptBool(await this.contract.resb()); + const res4 = await decryptBool(await this.contract.resEbool()); expect(res4).to.equal(true); }); it('ebool or scalarR', async function () { const tx = await this.contract.test_ebool_or_scalarR(false, false); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.test_ebool_or_scalarR(false, true); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(true); const tx3 = await this.contract.test_ebool_or_scalarR(true, false); await tx3.wait(); - const res3 = await decryptBool(await this.contract.resb()); + const res3 = await decryptBool(await this.contract.resEbool()); expect(res3).to.equal(true); const tx4 = await this.contract.test_ebool_or_scalarR(true, true); await tx4.wait(); - const res4 = await decryptBool(await this.contract.resb()); + const res4 = await decryptBool(await this.contract.resEbool()); expect(res4).to.equal(true); }); it('ebool and scalarL', async function () { const tx = await this.contract.test_ebool_and_scalarL(false, false); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.test_ebool_and_scalarL(false, true); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(false); const tx3 = await this.contract.test_ebool_and_scalarL(true, false); await tx3.wait(); - const res3 = await decryptBool(await this.contract.resb()); + const res3 = await decryptBool(await this.contract.resEbool()); expect(res3).to.equal(false); const tx4 = await this.contract.test_ebool_and_scalarL(true, true); await tx4.wait(); - const res4 = await decryptBool(await this.contract.resb()); + const res4 = await decryptBool(await this.contract.resEbool()); expect(res4).to.equal(true); }); it('ebool and scalarR', async function () { const tx = await this.contract.test_ebool_and_scalarR(false, false); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.test_ebool_and_scalarR(false, true); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(false); const tx3 = await this.contract.test_ebool_and_scalarR(true, false); await tx3.wait(); - const res3 = await decryptBool(await this.contract.resb()); + const res3 = await decryptBool(await this.contract.resEbool()); expect(res3).to.equal(false); const tx4 = await this.contract.test_ebool_and_scalarR(true, true); await tx4.wait(); - const res4 = await decryptBool(await this.contract.resb()); + const res4 = await decryptBool(await this.contract.resEbool()); expect(res4).to.equal(true); }); @@ -776,7 +754,7 @@ describe('TFHE manual operations', function () { ); await tx.wait(); - const res = await this.contract.resb(); + const res = await this.contract.resEbool(); const decRes = await decryptBool(res); expect(decRes).to.equal(true); }); @@ -798,7 +776,7 @@ describe('TFHE manual operations', function () { ); await tx.wait(); - const res = await this.contract.resb(); + const res = await this.contract.resEbool(); const decRes = await decryptBool(res); expect(decRes).to.equal(false); }); @@ -820,7 +798,7 @@ describe('TFHE manual operations', function () { ); await tx.wait(); - const res = await this.contract.resb(); + const res = await this.contract.resEbool(); const decRes = await decryptBool(res); expect(decRes).to.equal(true); }); @@ -842,7 +820,7 @@ describe('TFHE manual operations', function () { ); await tx.wait(); - const res = await this.contract.resb(); + const res = await this.contract.resEbool(); const decRes = await decryptBool(res); expect(decRes).to.equal(false); }); @@ -853,11 +831,11 @@ describe('TFHE manual operations', function () { '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb', ); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(true); const tx2 = await this.contract.eqEbytes64('0x1100', '0x0011'); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(false); }); @@ -867,11 +845,11 @@ describe('TFHE manual operations', function () { '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa', ); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.eqEbytes64ScalarL('0x1100', '0x1100'); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(true); }); @@ -881,11 +859,11 @@ describe('TFHE manual operations', function () { '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa', ); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.eqEbytes64ScalarR('0x1100', '0x1100'); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(true); }); @@ -895,11 +873,11 @@ describe('TFHE manual operations', function () { '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabb', ); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.neEbytes64('0x1100', '0x0011'); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(true); }); @@ -909,11 +887,11 @@ describe('TFHE manual operations', function () { '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa', ); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(true); const tx2 = await this.contract.neEbytes64ScalarL('0x1100', '0x1100'); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(false); }); @@ -923,11 +901,11 @@ describe('TFHE manual operations', function () { '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa', ); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(true); const tx2 = await this.contract.neEbytes64ScalarR('0x1100', '0x1100'); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(false); }); @@ -937,14 +915,14 @@ describe('TFHE manual operations', function () { '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb73', ); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(true); const tx2 = await this.contract.eqEbytes128( '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb73', '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb71', ); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(false); }); @@ -954,11 +932,11 @@ describe('TFHE manual operations', function () { '0x6d4b2086ba8e3d2104fbf4a8dfe9679d6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa', ); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.eqEbytes128ScalarL('0x1100', '0x1100'); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(true); }); @@ -968,11 +946,11 @@ describe('TFHE manual operations', function () { '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa', ); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.eqEbytes128ScalarR('0x1100', '0x1100'); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(true); }); @@ -982,14 +960,14 @@ describe('TFHE manual operations', function () { '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb73', ); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.neEbytes128( '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb73', '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbabbd4fdd06bd752b24ffb9f307805c4e698bf10aed0a47a103e5c1ade64bd31eb71', ); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(true); }); @@ -999,11 +977,11 @@ describe('TFHE manual operations', function () { '0x6d4b2086ba8e3d2104fbf4a8dfe9679d6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa', ); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(true); const tx2 = await this.contract.neEbytes128ScalarL('0x1100', '0x1100'); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(false); }); @@ -1013,11 +991,11 @@ describe('TFHE manual operations', function () { '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa', ); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(true); const tx2 = await this.contract.neEbytes128ScalarR('0x1100', '0x1100'); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(false); }); @@ -1027,11 +1005,11 @@ describe('TFHE manual operations', function () { '0x6d4b2086ba8e3d2104fbf4a8dfe9679d6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa', ); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.eqEbytes256ScalarL('0x1100', '0x1100'); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(true); }); @@ -1041,11 +1019,11 @@ describe('TFHE manual operations', function () { '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaaaa', ); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.eqEbytes256ScalarR('0x1100', '0x1100'); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(true); }); @@ -1055,11 +1033,11 @@ describe('TFHE manual operations', function () { '0x6d4b2086ba8e3d2104fbf4a8dfe9679d6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaa', ); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(true); const tx2 = await this.contract.neEbytes256ScalarL('0x1100', '0x1100'); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(false); }); @@ -1069,68 +1047,68 @@ describe('TFHE manual operations', function () { '0x6bb8166128b0e7a16f60dc255c953288d03107895b0904ea18f7a242bf335fbaaaaa', ); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(true); const tx2 = await this.contract.neEbytes256ScalarR('0x1100', '0x1100'); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(false); }); it('ebool ne ebool', async function () { const tx = await this.contract.neEbool(true, true); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.neEbool(false, false); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(false); const tx3 = await this.contract.neEbool(false, true); await tx3.wait(); - const res3 = await decryptBool(await this.contract.resb()); + const res3 = await decryptBool(await this.contract.resEbool()); expect(res3).to.equal(true); const tx4 = await this.contract.neEbool(true, false); await tx4.wait(); - const res4 = await decryptBool(await this.contract.resb()); + const res4 = await decryptBool(await this.contract.resEbool()); expect(res4).to.equal(true); }); it('ebool ne ebool - ScalarL', async function () { const tx = await this.contract.neEboolScalarL(true, true); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.neEboolScalarL(false, true); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(true); const tx3 = await this.contract.neEboolScalarL(false, false); await tx3.wait(); - const res3 = await decryptBool(await this.contract.resb()); + const res3 = await decryptBool(await this.contract.resEbool()); expect(res3).to.equal(false); const tx4 = await this.contract.neEboolScalarL(true, false); await tx4.wait(); - const res4 = await decryptBool(await this.contract.resb()); + const res4 = await decryptBool(await this.contract.resEbool()); expect(res4).to.equal(true); }); it('ebool ne ebool - ScalarR', async function () { const tx = await this.contract.neEboolScalarL(false, false); await tx.wait(); - const res = await decryptBool(await this.contract.resb()); + const res = await decryptBool(await this.contract.resEbool()); expect(res).to.equal(false); const tx2 = await this.contract.neEboolScalarL(false, true); await tx2.wait(); - const res2 = await decryptBool(await this.contract.resb()); + const res2 = await decryptBool(await this.contract.resEbool()); expect(res2).to.equal(true); const tx3 = await this.contract.neEboolScalarL(true, true); await tx3.wait(); - const res3 = await decryptBool(await this.contract.resb()); + const res3 = await decryptBool(await this.contract.resEbool()); expect(res3).to.equal(false); const tx4 = await this.contract.neEboolScalarL(true, false); await tx4.wait(); - const res4 = await decryptBool(await this.contract.resb()); + const res4 = await decryptBool(await this.contract.resEbool()); expect(res4).to.equal(true); }); }); diff --git a/contracts/test/inputVerifier/inputVerifier.ts b/contracts/test/inputVerifier/inputVerifier.ts index 181aef16..21a2deac 100644 --- a/contracts/test/inputVerifier/inputVerifier.ts +++ b/contracts/test/inputVerifier/inputVerifier.ts @@ -29,7 +29,7 @@ describe('InputVerifier', function () { const tx = await inputVerifier.connect(deployer).addSigner(addressSigner); await tx.wait(); - expect((await inputVerifier.getSigners()).length).to.equal(2); // one signer has been added + expect((await inputVerifier.getCoprocessorSigners()).length).to.equal(2); // one signer has been added const contractFactory = await ethers.getContractFactory('TestInput'); const contract = await contractFactory.connect(this.signers.alice).deploy(); @@ -59,7 +59,7 @@ describe('InputVerifier', function () { const addressSigner2 = process.env['COPROCESSOR_SIGNER_ADDRESS_2']!; const tx3 = await inputVerifier.connect(deployer).addSigner(addressSigner2); await tx3.wait(); - expect((await inputVerifier.getSigners()).length).to.equal(3); + expect((await inputVerifier.getCoprocessorSigners()).length).to.equal(3); const inputAlice2 = this.instances.alice.createEncryptedInput(contractAddress, this.signers.alice.address); inputAlice2.add64(42); @@ -74,7 +74,7 @@ describe('InputVerifier', function () { const addressSigner3 = process.env['COPROCESSOR_SIGNER_ADDRESS_3']!; const tx5 = await inputVerifier.connect(deployer).addSigner(addressSigner3); await tx5.wait(); - expect((await inputVerifier.getSigners()).length).to.equal(4); + expect((await inputVerifier.getCoprocessorSigners()).length).to.equal(4); const inputAlice3 = this.instances.alice.createEncryptedInput(contractAddress, this.signers.alice.address); inputAlice3.add64(19); @@ -105,13 +105,13 @@ describe('InputVerifier', function () { const tx8 = await inputVerifier.connect(deployer).removeSigner(addressSigner3); await tx8.wait(); - expect((await inputVerifier.getSigners()).length).to.equal(3); + expect((await inputVerifier.getCoprocessorSigners()).length).to.equal(3); const tx9 = await inputVerifier.connect(deployer).removeSigner(addressSigner2); await tx9.wait(); - expect((await inputVerifier.getSigners()).length).to.equal(2); + expect((await inputVerifier.getCoprocessorSigners()).length).to.equal(2); const tx10 = await inputVerifier.connect(deployer).removeSigner(addressSigner); await tx10.wait(); - expect((await inputVerifier.getSigners()).length).to.equal(1); + expect((await inputVerifier.getCoprocessorSigners()).length).to.equal(1); process.env.NUM_COPROCESSORS = '1'; } }); @@ -123,13 +123,13 @@ describe('InputVerifier', function () { const origIVAdd = dotenv.parse(fs.readFileSync('addresses/.env.inputverifier')).INPUT_VERIFIER_CONTRACT_ADDRESS; const deployer = new ethers.Wallet(process.env.DEPLOYER_PRIVATE_KEY!).connect(ethers.provider); const inputVerifier = await this.inputVerifierFactory.attach(origIVAdd); - expect((await inputVerifier.getSigners()).length).to.equal(1); + expect((await inputVerifier.getCoprocessorSigners()).length).to.equal(1); const addressSigner = process.env['COPROCESSOR_SIGNER_ADDRESS_1']!; const tx = await inputVerifier.connect(deployer).addSigner(addressSigner); await tx.wait(); - expect((await inputVerifier.getSigners()).length).to.equal(2); // one signer has been added + expect((await inputVerifier.getCoprocessorSigners()).length).to.equal(2); // one signer has been added const contractFactory = await ethers.getContractFactory('TestInput'); const contract = await contractFactory.connect(this.signers.alice).deploy(); @@ -174,10 +174,10 @@ describe('InputVerifier', function () { expect(y_8).to.equal(42); expect(y_Add).to.equal('0x1E69D5aa8750Ff56c556C164fE6feaE71BBA9a09'); - expect((await inputVerifier.getSigners()).length).to.equal(2); + expect((await inputVerifier.getCoprocessorSigners()).length).to.equal(2); const tx10 = await inputVerifier.connect(deployer).removeSigner(addressSigner); await tx10.wait(); - expect((await inputVerifier.getSigners()).length).to.equal(1); + expect((await inputVerifier.getCoprocessorSigners()).length).to.equal(1); process.env.NUM_COPROCESSORS = '1'; } }); diff --git a/contracts/test/instance.ts b/contracts/test/instance.ts index 8cf83639..e41d0056 100644 --- a/contracts/test/instance.ts +++ b/contracts/test/instance.ts @@ -100,24 +100,6 @@ export const decryptBool = async (handle: string): Promise => { } }; -/** - * @debug - * This function is intended for debugging purposes only. - * It cannot be used in production code, since it requires the FHE private key for decryption. - * In production, decryption is only possible via an asyncronous on-chain call to the Decryption Oracle. - * - * @param {bigint} a handle to decrypt - * @returns {bigint} - */ -export const decrypt4 = async (handle: string): Promise => { - if (network.name === 'hardhat') { - await awaitCoprocessor(); - return BigInt(await getClearText(handle)); - } else { - return getDecryptor().decrypt4(await getCiphertext(handle, ethers)); - } -}; - /** * @debug * This function is intended for debugging purposes only. diff --git a/contracts/test/kmsVerifier/kmsVerifier.t.sol b/contracts/test/kmsVerifier/kmsVerifier.t.sol index 30965196..e45d7416 100644 --- a/contracts/test/kmsVerifier/kmsVerifier.t.sol +++ b/contracts/test/kmsVerifier/kmsVerifier.t.sol @@ -8,7 +8,7 @@ import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/Messa import {KMSVerifier} from "../../contracts/KMSVerifier.sol"; import {EmptyUUPSProxy} from "../../contracts/emptyProxy/EmptyUUPSProxy.sol"; -import {tfheExecutorAdd} from "../../addresses/TFHEExecutorAddress.sol"; +import {httpzExecutorAdd} from "../../addresses/HTTPZExecutorAddress.sol"; contract KMSVerifierTest is Test { KMSVerifier internal kmsVerifier; @@ -144,7 +144,7 @@ contract KMSVerifierTest is Test { /// @dev Tests that the initial threshold, owner, and signers list are correctly set after deployment function test_postDeployment() public view { assertEq(kmsVerifier.getThreshold(), 0); - assertEq(kmsVerifier.getSigners().length, 0); + assertEq(kmsVerifier.getKmsSigners().length, 0); assertEq(kmsVerifier.owner(), owner); } @@ -185,7 +185,7 @@ contract KMSVerifierTest is Test { vm.expectEmit(); emit KMSVerifier.NewContextSet(newSigners, 1); kmsVerifier.defineNewContext(newSigners, 1); - assertEq(kmsVerifier.getSigners()[0], randomSigner); + assertEq(kmsVerifier.getKmsSigners()[0], randomSigner); assertTrue(kmsVerifier.isSigner(randomSigner)); } @@ -194,7 +194,7 @@ contract KMSVerifierTest is Test { */ function test_OwnerCannotAddSameSignerTwice() public { test_OwnerCanAddNewSigner(); - address randomSigner = kmsVerifier.getSigners()[0]; + address randomSigner = kmsVerifier.getKmsSigners()[0]; address[] memory newSigners = new address[](2); newSigners[0] = randomSigner; newSigners[1] = randomSigner; @@ -217,13 +217,13 @@ contract KMSVerifierTest is Test { newSigners[0] = address(42); newSigners[1] = randomSigner; kmsVerifier.defineNewContext(newSigners, 2); - assertEq(kmsVerifier.getSigners().length, 2); + assertEq(kmsVerifier.getKmsSigners().length, 2); address[] memory newSigners2 = new address[](1); newSigners2[0] = address(42); kmsVerifier.defineNewContext(newSigners2, 1); assertFalse(kmsVerifier.isSigner(randomSigner)); - assertEq(kmsVerifier.getSigners().length, 1); + assertEq(kmsVerifier.getKmsSigners().length, 1); } /** diff --git a/contracts/test/kmsVerifier/kmsVerifier.ts b/contracts/test/kmsVerifier/kmsVerifier.ts index 1efeea0b..9b8d5e1c 100644 --- a/contracts/test/kmsVerifier/kmsVerifier.ts +++ b/contracts/test/kmsVerifier/kmsVerifier.ts @@ -3,6 +3,7 @@ import dotenv from 'dotenv'; import fs from 'fs'; import { ethers } from 'hardhat'; +import { TestAsyncDecrypt } from '../../types'; import { awaitAllDecryptionResults, initDecryptionOracle } from '../asyncDecrypt'; import { createInstances } from '../instance'; import { getSigners, initSigners } from '../signers'; @@ -27,62 +28,52 @@ describe('KMSVerifier', function () { expect(await kmsVerifier.getVersion()).to.equal('KMSVerifier v0.1.0'); const addressSigner = process.env['KMS_SIGNER_ADDRESS_1']!; - let setSigners = await kmsVerifier.getSigners(); + let setSigners = await kmsVerifier.getKmsSigners(); setSigners = [...setSigners, addressSigner]; - const tx = await kmsVerifier.connect(deployer).defineNewContext(setSigners, 1); - await tx.wait(); + const tx1 = await kmsVerifier.connect(deployer).defineNewContext(setSigners, 1); + await tx1.wait(); - expect((await kmsVerifier.getSigners()).length).to.equal(2); // one signer has been added + expect((await kmsVerifier.getKmsSigners()).length).to.equal(2); // one signer has been added const contractFactory = await ethers.getContractFactory('TestAsyncDecrypt'); - const contract = await contractFactory.connect(this.signers.alice).deploy(); + const contract = (await contractFactory.connect(this.signers.alice).deploy()) as TestAsyncDecrypt; const tx2 = await contract.requestBool(); await tx2.wait(); await awaitAllDecryptionResults(); - const y = await contract.yBool(); - expect(y).to.equal(true); // in this case, one signature still suffices to pass the decrypt (threshold is still 1) + expect(await contract.yBool()).to.equal(true); // in this case, one signature still suffices to pass the decrypt (threshold is still 1) setSigners = [...setSigners, addressSigner]; await expect(kmsVerifier.connect(deployer).defineNewContext(setSigners, 1)).to.revertedWithCustomError( kmsVerifier, 'KMSAlreadySigner', ); // cannot add duplicated signer - expect((await kmsVerifier.getSigners()).length).to.equal(2); + expect((await kmsVerifier.getKmsSigners()).length).to.equal(2); const kmsSigner2Address = process.env['KMS_SIGNER_ADDRESS_2']!; const kmsSigner3Address = process.env['KMS_SIGNER_ADDRESS_3']!; - let setSigners2 = await kmsVerifier.getSigners(); + let setSigners2 = await kmsVerifier.getKmsSigners(); setSigners2 = [...setSigners2, kmsSigner2Address, kmsSigner3Address]; - const tx4 = await kmsVerifier.connect(deployer).defineNewContext(setSigners2, 1); - await tx4.wait(); - expect((await kmsVerifier.getSigners()).length).to.equal(4); // 3rd and 4th signer has been added successfully + const tx3 = await kmsVerifier.connect(deployer).defineNewContext(setSigners2, 1); + await tx3.wait(); + expect((await kmsVerifier.getKmsSigners()).length).to.equal(4); // 3rd and 4th signer has been added successfully - const txSetTh = await kmsVerifier.connect(deployer).setThreshold(2n); - await txSetTh.wait(); + const tx4 = await kmsVerifier.connect(deployer).setThreshold(2n); + await tx4.wait(); expect(await kmsVerifier.getThreshold()).to.equal(2); - const tx5 = await contract.requestUint4(); + const tx5 = await contract.requestUint16(); await tx5.wait(); + await expect(awaitAllDecryptionResults()) .to.revertedWithCustomError(kmsVerifier, 'KMSSignatureThresholdNotReached') .withArgs(1n); // should revert because now we are below the threshold! (we receive only 1 signature but threshold is 2) - const y2 = await contract.yUint4(); - expect(y2).to.equal(0); - - process.env.NUM_KMS_NODES = '2'; - const tx5Bis = await contract.requestUint4(); - await tx5Bis.wait(); - - await awaitAllDecryptionResults(); - const y3 = await contract.yUint4(); - expect(y3).to.equal(4); // with 2 signatures decryption should now succeed process.env.NUM_KMS_NODES = '4'; + const tx6 = await contract.requestUint8(); await tx6.wait(); await awaitAllDecryptionResults(); - const y4 = await contract.yUint8(); - expect(y4).to.equal(42); // even with more than 2 signatures decryption should still succeed + expect(await contract.yUint8()).to.equal(42); // even with more than 2 signatures decryption should still succeed const contract2 = await contractFactory.connect(this.signers.alice).deploy(); const inputAlice = this.instances.alice.createEncryptedInput( @@ -92,42 +83,40 @@ describe('KMSVerifier', function () { inputAlice.addBytes256(bigIntToBytes256(18446744073709550032n)); const encryptedAmount = await inputAlice.encrypt(); - const tx6bis = await contract2.requestMixedBytes256(encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx6bis.wait(); + const tx7 = await contract2.requestMixedBytes256(encryptedAmount.handles[0], encryptedAmount.inputProof); + await tx7.wait(); await awaitAllDecryptionResults(); - const ybis = await contract2.yBytes256(); - expect(ybis).to.equal(ethers.toBeHex(18446744073709550032n, 256)); - const yb = await contract2.yBool(); - expect(yb).to.equal(true); - const yAdd = await contract2.yAddress(); - expect(yAdd).to.equal('0x8ba1f109551bD432803012645Ac136ddd64DBA72'); // testing trustless mixed with ebytes256, in case of several signatures + + expect(await contract2.yBytes256()).to.equal(ethers.toBeHex(18446744073709550032n, 256)); + expect(await contract2.yBool()).to.equal(true); + expect(await contract2.yAddress()).to.equal('0x8ba1f109551bD432803012645Ac136ddd64DBA72'); // testing trustless mixed with ebytes256, in case of several signatures process.env.NUM_KMS_NODES = '2'; process.env.KMS_SIGNER_ADDRESS_1 = process.env.KMS_SIGNER_ADDRESS_0; - const tx7 = await contract.requestUint16(); - await tx7.wait(); + const tx8 = await contract.requestUint16(); + await tx8.wait(); await expect(awaitAllDecryptionResults()).to.revertedWithCustomError(contract, 'InvalidKMSSignatures'); // cannot use duplicated signatures if threshold is 2 - const y5 = await contract.yUint16(); - expect(y5).to.equal(0); + expect(await contract.yUint16()).to.equal(0); process.env.NUM_KMS_NODES = '1'; - let setSigners3 = [...(await kmsVerifier.getSigners())]; + let setSigners3 = [...(await kmsVerifier.getKmsSigners())]; setSigners3.pop(); - const tx8 = await kmsVerifier.connect(deployer).defineNewContext(setSigners3, 1); - await tx8.wait(); + + const tx9 = await kmsVerifier.connect(deployer).defineNewContext(setSigners3, 1); + await tx9.wait(); expect(await kmsVerifier.getThreshold()).to.equal(1); - const tx7Bis = await contract.requestUint16(); - await tx7Bis.wait(); + + const tx10 = await contract.requestUint16(); + await tx10.wait(); await awaitAllDecryptionResults(); - const y6 = await contract.yUint16(); - expect(y6).to.equal(16); // after removing one of the 4 signers, one signature is enough for decryption + expect(await contract.yUint16()).to.equal(16); // after removing one of the 4 signers, one signature is enough for decryption } }); it('cannot add/remove signers if not the owner', async function () { const origKMSAdd = dotenv.parse(fs.readFileSync('addresses/.env.kmsverifier')).KMS_VERIFIER_CONTRACT_ADDRESS; const kmsVerifier = await this.kmsFactory.attach(origKMSAdd); - let setSigners = await kmsVerifier.getSigners(); + let setSigners = await kmsVerifier.getKmsSigners(); const randomAccount = this.signers.carol; setSigners = [...setSigners, randomAccount]; await expect(kmsVerifier.connect(randomAccount).defineNewContext(setSigners, 2)).to.be.revertedWithCustomError( diff --git a/contracts/test/rand/Rand.ts b/contracts/test/rand/Rand.ts index e45886f6..4f987409 100644 --- a/contracts/test/rand/Rand.ts +++ b/contracts/test/rand/Rand.ts @@ -3,7 +3,6 @@ import { ethers, network } from 'hardhat'; import { createInstances, - decrypt4, decrypt8, decrypt16, decrypt32, @@ -45,36 +44,6 @@ describe('Rand', function () { expect(unique.size).to.be.greaterThanOrEqual(2); }); - it('4 bits generate and decrypt', async function () { - const values: number[] = []; - for (let i = 0; i < 5; i++) { - const txn = await this.rand.generate4(); - await txn.wait(); - const valueHandle = await this.rand.value4(); - const value = await decrypt4(valueHandle); - expect(value).to.be.lessThanOrEqual(0xf); - values.push(value); - } - // Expect at least two different generated values. - const unique = new Set(values); - expect(unique.size).to.be.greaterThanOrEqual(2); - }); - - it('4 bits generate with upper bound and decrypt', async function () { - const values: number[] = []; - for (let i = 0; i < 7; i++) { - const txn = await this.rand.generate4UpperBound(8); - await txn.wait(); - const valueHandle = await this.rand.value4(); - const value = await decrypt4(valueHandle); - expect(value).to.be.lessThanOrEqual(7); - values.push(value); - } - // Expect at least two different generated values. - const unique = new Set(values); - expect(unique.size).to.be.greaterThanOrEqual(2); - }); - it('8 bits generate and decrypt', async function () { const values: number[] = []; for (let i = 0; i < 5; i++) { diff --git a/contracts/test/reencryption/reencryption.ts b/contracts/test/reencryption/reencryption.ts index c1cea8af..290b76c3 100644 --- a/contracts/test/reencryption/reencryption.ts +++ b/contracts/test/reencryption/reencryption.ts @@ -83,26 +83,6 @@ describe('Reencryption', function () { } }); - it('test reencrypt euint4', async function () { - const handle = await this.contract.xUint4(); - const { publicKey, privateKey } = this.instances.alice.generateKeypair(); - const eip712 = this.instances.alice.createEIP712(publicKey, this.contractAddress); - const signature = await this.signers.alice.signTypedData( - eip712.domain, - { Reencrypt: eip712.types.Reencrypt }, - eip712.message, - ); - const decryptedValue = await this.instances.alice.reencrypt( - handle, - privateKey, - publicKey, - signature.replace('0x', ''), - this.contractAddress, - this.signers.alice.address, - ); - expect(decryptedValue).to.equal(4); - }); - it('test reencrypt euint8', async function () { const handle = await this.contract.xUint8(); const { publicKey, privateKey } = this.instances.alice.generateKeypair(); diff --git a/contracts/test/tfheOperations/tfheOperations1.ts b/contracts/test/tfheOperations/tfheOperations1.ts deleted file mode 100644 index 82012291..00000000 --- a/contracts/test/tfheOperations/tfheOperations1.ts +++ /dev/null @@ -1,4821 +0,0 @@ -import { expect } from 'chai'; -import { ethers } from 'hardhat'; - -import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1'; -import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2'; -import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'; -import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4'; -import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5'; -import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6'; -import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7'; -import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8'; -import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9'; -import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10'; -import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11'; -import { - createInstances, - decrypt4, - decrypt8, - decrypt16, - decrypt32, - decrypt64, - decrypt128, - decrypt256, - decryptBool, -} from '../instance'; -import { getSigners, initSigners } from '../signers'; - -async function deployTfheTestFixture1(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture2(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture3(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture4(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture5(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture6(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture7(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite7'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture8(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite8'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture9(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite9'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture10(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite10'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture11(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite11'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -describe('TFHE operations 1', function () { - before(async function () { - await initSigners(1); - this.signers = await getSigners(); - - const contract1 = await deployTfheTestFixture1(); - this.contract1Address = await contract1.getAddress(); - this.contract1 = contract1; - - const contract2 = await deployTfheTestFixture2(); - this.contract2Address = await contract2.getAddress(); - this.contract2 = contract2; - - const contract3 = await deployTfheTestFixture3(); - this.contract3Address = await contract3.getAddress(); - this.contract3 = contract3; - - const contract4 = await deployTfheTestFixture4(); - this.contract4Address = await contract4.getAddress(); - this.contract4 = contract4; - - const contract5 = await deployTfheTestFixture5(); - this.contract5Address = await contract5.getAddress(); - this.contract5 = contract5; - - const contract6 = await deployTfheTestFixture6(); - this.contract6Address = await contract6.getAddress(); - this.contract6 = contract6; - - const contract7 = await deployTfheTestFixture7(); - this.contract7Address = await contract7.getAddress(); - this.contract7 = contract7; - - const contract8 = await deployTfheTestFixture8(); - this.contract8Address = await contract8.getAddress(); - this.contract8 = contract8; - - const contract9 = await deployTfheTestFixture9(); - this.contract9Address = await contract9.getAddress(); - this.contract9 = contract9; - - const contract10 = await deployTfheTestFixture10(); - this.contract10Address = await contract10.getAddress(); - this.contract10 = contract10; - - const contract11 = await deployTfheTestFixture11(); - this.contract11Address = await contract11.getAddress(); - this.contract11 = contract11; - - const instances = await createInstances(this.signers); - this.instances = instances; - }); - - it('test operator "add" overload (euint4, euint4) => euint4 test 1 (2, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(2n); - input.add4(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(9n); - }); - - it('test operator "add" overload (euint4, euint4) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(12n); - }); - - it('test operator "add" overload (euint4, euint4) => euint4 test 3 (5, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(10n); - }); - - it('test operator "add" overload (euint4, euint4) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(12n); - }); - - it('test operator "sub" overload (euint4, euint4) => euint4 test 1 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.sub_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint4, euint4) => euint4 test 2 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.sub_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint4, euint4) => euint4 test 1 (1, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(1n); - input.add4(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(7n); - }); - - it('test operator "mul" overload (euint4, euint4) => euint4 test 2 (3, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(15n); - }); - - it('test operator "mul" overload (euint4, euint4) => euint4 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(9n); - }); - - it('test operator "mul" overload (euint4, euint4) => euint4 test 4 (5, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(15n); - }); - - it('test operator "and" overload (euint4, euint4) => euint4 test 1 (14, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add4(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(6n); - }); - - it('test operator "and" overload (euint4, euint4) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(0n); - }); - - it('test operator "and" overload (euint4, euint4) => euint4 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(8n); - }); - - it('test operator "and" overload (euint4, euint4) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(0n); - }); - - it('test operator "or" overload (euint4, euint4) => euint4 test 1 (10, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add4(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(14n); - }); - - it('test operator "or" overload (euint4, euint4) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(12n); - }); - - it('test operator "or" overload (euint4, euint4) => euint4 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(8n); - }); - - it('test operator "or" overload (euint4, euint4) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint4, euint4) => euint4 test 1 (9, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(13n); - }); - - it('test operator "xor" overload (euint4, euint4) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint4, euint4) => euint4 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint4, euint4) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(12n); - }); - - it('test operator "eq" overload (euint4, euint4) => ebool test 1 (2, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(2n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint4, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint4, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint4, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint4, euint4) => ebool test 1 (1, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(1n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint4, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint4, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint4, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint4, euint4) => ebool test 1 (6, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(6n); - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint4, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint4, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint4, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint4, euint4) => ebool test 1 (12, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(12n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint4) => ebool test 2 (8, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint4) => ebool test 3 (12, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(12n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint4) => ebool test 4 (12, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(12n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint4) => ebool test 1 (6, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(6n); - input.add4(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint4, euint4) => ebool test 1 (2, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(2n); - input.add4(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint4, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint4, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint4, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint4, euint4) => euint4 test 1 (14, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(13n); - }); - - it('test operator "min" overload (euint4, euint4) => euint4 test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(9n); - }); - - it('test operator "min" overload (euint4, euint4) => euint4 test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(13n); - }); - - it('test operator "min" overload (euint4, euint4) => euint4 test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(9n); - }); - - it('test operator "max" overload (euint4, euint4) => euint4 test 1 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(13n); - }); - - it('test operator "max" overload (euint4, euint4) => euint4 test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(9n); - }); - - it('test operator "max" overload (euint4, euint4) => euint4 test 3 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(9n); - }); - - it('test operator "max" overload (euint4, euint4) => euint4 test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt4(await this.contract1.res4()); - expect(res).to.equal(9n); - }); - - it('test operator "add" overload (euint4, euint8) => euint8 test 1 (2, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(2n); - input.add8(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(12n); - }); - - it('test operator "add" overload (euint4, euint8) => euint8 test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add8(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(14n); - }); - - it('test operator "add" overload (euint4, euint8) => euint8 test 3 (5, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add8(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(10n); - }); - - it('test operator "add" overload (euint4, euint8) => euint8 test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add8(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(14n); - }); - - it('test operator "sub" overload (euint4, euint8) => euint8 test 1 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.sub_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint4, euint8) => euint8 test 2 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.sub_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint4, euint8) => euint8 test 1 (2, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(2n); - input.add8(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(10n); - }); - - it('test operator "mul" overload (euint4, euint8) => euint8 test 2 (3, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); - input.add8(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(15n); - }); - - it('test operator "mul" overload (euint4, euint8) => euint8 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); - input.add8(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(9n); - }); - - it('test operator "mul" overload (euint4, euint8) => euint8 test 4 (5, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add8(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(15n); - }); - - it('test operator "and" overload (euint4, euint8) => euint8 test 1 (10, 116)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add8(116n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(0n); - }); - - it('test operator "and" overload (euint4, euint8) => euint8 test 2 (6, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(6n); - input.add8(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(2n); - }); - - it('test operator "and" overload (euint4, euint8) => euint8 test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add8(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(10n); - }); - - it('test operator "and" overload (euint4, euint8) => euint8 test 4 (10, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add8(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(2n); - }); - - it('test operator "or" overload (euint4, euint8) => euint8 test 1 (8, 185)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add8(185n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(185n); - }); - - it('test operator "or" overload (euint4, euint8) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(12n); - }); - - it('test operator "or" overload (euint4, euint8) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(8n); - }); - - it('test operator "or" overload (euint4, euint8) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint4, euint8) => euint8 test 1 (10, 103)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add8(103n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(109n); - }); - - it('test operator "xor" overload (euint4, euint8) => euint8 test 2 (6, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(6n); - input.add8(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint4, euint8) => euint8 test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add8(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint4, euint8) => euint8 test 4 (10, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add8(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(12n); - }); - - it('test operator "eq" overload (euint4, euint8) => ebool test 1 (14, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add8(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint4, euint8) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint4, euint8) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint4, euint8) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint4, euint8) => ebool test 1 (8, 128)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add8(128n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint4, euint8) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint4, euint8) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint4, euint8) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint4, euint8) => ebool test 1 (3, 79)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); - input.add8(79n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint4, euint8) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint4, euint8) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint4, euint8) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint4, euint8) => ebool test 1 (1, 59)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(1n); - input.add8(59n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint8) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint8) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint8) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint8) => ebool test 1 (1, 98)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(1n); - input.add8(98n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint8) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint8) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint8) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint4, euint8) => ebool test 1 (12, 31)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(12n); - input.add8(31n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint4, euint8) => ebool test 2 (8, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add8(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint4, euint8) => ebool test 3 (12, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(12n); - input.add8(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint4, euint8) => ebool test 4 (12, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(12n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint4, euint8) => euint8 test 1 (5, 254)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add8(254n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(5n); - }); - - it('test operator "min" overload (euint4, euint8) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "min" overload (euint4, euint8) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(8n); - }); - - it('test operator "min" overload (euint4, euint8) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "max" overload (euint4, euint8) => euint8 test 1 (14, 226)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add8(226n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(226n); - }); - - it('test operator "max" overload (euint4, euint8) => euint8 test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add8(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(14n); - }); - - it('test operator "max" overload (euint4, euint8) => euint8 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add8(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(14n); - }); - - it('test operator "max" overload (euint4, euint8) => euint8 test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add8(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract1.res8()); - expect(res).to.equal(14n); - }); - - it('test operator "add" overload (euint4, euint16) => euint16 test 1 (2, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(2n); - input.add16(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(11n); - }); - - it('test operator "add" overload (euint4, euint16) => euint16 test 2 (6, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(6n); - input.add16(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(14n); - }); - - it('test operator "add" overload (euint4, euint16) => euint16 test 3 (5, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add16(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(10n); - }); - - it('test operator "add" overload (euint4, euint16) => euint16 test 4 (8, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add16(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(14n); - }); - - it('test operator "sub" overload (euint4, euint16) => euint16 test 1 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add16(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.sub_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint4, euint16) => euint16 test 2 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add16(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.sub_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint4, euint16) => euint16 test 1 (2, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(2n); - input.add16(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(12n); - }); - - it('test operator "mul" overload (euint4, euint16) => euint16 test 2 (3, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); - input.add16(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(15n); - }); - - it('test operator "mul" overload (euint4, euint16) => euint16 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); - input.add16(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(9n); - }); - - it('test operator "mul" overload (euint4, euint16) => euint16 test 4 (5, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add16(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(15n); - }); - - it('test operator "and" overload (euint4, euint16) => euint16 test 1 (3, 65312)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); - input.add16(65312n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "and" overload (euint4, euint16) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add16(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "and" overload (euint4, euint16) => euint16 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add16(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(8n); - }); - - it('test operator "and" overload (euint4, euint16) => euint16 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add16(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "or" overload (euint4, euint16) => euint16 test 1 (9, 28733)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add16(28733n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(28733n); - }); - - it('test operator "or" overload (euint4, euint16) => euint16 test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add16(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(13n); - }); - - it('test operator "or" overload (euint4, euint16) => euint16 test 3 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add16(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(9n); - }); - - it('test operator "or" overload (euint4, euint16) => euint16 test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add16(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(13n); - }); - - it('test operator "xor" overload (euint4, euint16) => euint16 test 1 (14, 11463)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add16(11463n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(11465n); - }); - - it('test operator "xor" overload (euint4, euint16) => euint16 test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add16(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint4, euint16) => euint16 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add16(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint4, euint16) => euint16 test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add16(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint4, euint16) => ebool test 1 (11, 40901)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(11n); - input.add16(40901n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint4, euint16) => ebool test 2 (7, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(7n); - input.add16(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint4, euint16) => ebool test 3 (11, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(11n); - input.add16(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint4, euint16) => ebool test 4 (11, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(11n); - input.add16(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint4, euint16) => ebool test 1 (14, 35568)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add16(35568n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint4, euint16) => ebool test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add16(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint4, euint16) => ebool test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add16(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint4, euint16) => ebool test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add16(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint4, euint16) => ebool test 1 (1, 53247)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(1n); - input.add16(53247n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint4, euint16) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add16(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint4, euint16) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add16(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint4, euint16) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add16(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint4, euint16) => ebool test 1 (13, 43765)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add16(43765n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint16) => ebool test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add16(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint16) => ebool test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add16(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint16) => ebool test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add16(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint16) => ebool test 1 (14, 62468)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add16(62468n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint16) => ebool test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add16(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint16) => ebool test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add16(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint16) => ebool test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add16(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint4, euint16) => ebool test 1 (10, 24653)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add16(24653n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint4, euint16) => ebool test 2 (6, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(6n); - input.add16(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint4, euint16) => ebool test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add16(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint4, euint16) => ebool test 4 (10, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add16(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint4, euint16) => euint16 test 1 (1, 50108)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(1n); - input.add16(50108n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(1n); - }); - - it('test operator "min" overload (euint4, euint16) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add16(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(4n); - }); - - it('test operator "min" overload (euint4, euint16) => euint16 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add16(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(8n); - }); - - it('test operator "min" overload (euint4, euint16) => euint16 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add16(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(4n); - }); - - it('test operator "max" overload (euint4, euint16) => euint16 test 1 (14, 33411)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add16(33411n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(33411n); - }); - - it('test operator "max" overload (euint4, euint16) => euint16 test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add16(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(14n); - }); - - it('test operator "max" overload (euint4, euint16) => euint16 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add16(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(14n); - }); - - it('test operator "max" overload (euint4, euint16) => euint16 test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add16(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract1.res16()); - expect(res).to.equal(14n); - }); - - it('test operator "add" overload (euint4, euint32) => euint32 test 1 (2, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(2n); - input.add32(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(11n); - }); - - it('test operator "add" overload (euint4, euint32) => euint32 test 2 (4, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add32(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(10n); - }); - - it('test operator "add" overload (euint4, euint32) => euint32 test 3 (6, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(6n); - input.add32(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(12n); - }); - - it('test operator "add" overload (euint4, euint32) => euint32 test 4 (6, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(6n); - input.add32(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(10n); - }); - - it('test operator "sub" overload (euint4, euint32) => euint32 test 1 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add32(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.sub_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint4, euint32) => euint32 test 2 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add32(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.sub_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint4, euint32) => euint32 test 1 (2, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(2n); - input.add32(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(10n); - }); - - it('test operator "mul" overload (euint4, euint32) => euint32 test 2 (3, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); - input.add32(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(12n); - }); - - it('test operator "mul" overload (euint4, euint32) => euint32 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); - input.add32(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(9n); - }); - - it('test operator "mul" overload (euint4, euint32) => euint32 test 4 (4, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add32(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(12n); - }); - - it('test operator "and" overload (euint4, euint32) => euint32 test 1 (6, 3666388192)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(6n); - input.add32(3666388192n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "and" overload (euint4, euint32) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add32(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "and" overload (euint4, euint32) => euint32 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add32(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(8n); - }); - - it('test operator "and" overload (euint4, euint32) => euint32 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add32(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "or" overload (euint4, euint32) => euint32 test 1 (13, 371092847)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add32(371092847n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(371092847n); - }); - - it('test operator "or" overload (euint4, euint32) => euint32 test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add32(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(13n); - }); - - it('test operator "or" overload (euint4, euint32) => euint32 test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add32(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(13n); - }); - - it('test operator "or" overload (euint4, euint32) => euint32 test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add32(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(13n); - }); - - it('test operator "xor" overload (euint4, euint32) => euint32 test 1 (1, 1939413163)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(1n); - input.add32(1939413163n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(1939413162n); - }); - - it('test operator "xor" overload (euint4, euint32) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add32(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint4, euint32) => euint32 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add32(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint4, euint32) => euint32 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add32(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(12n); - }); - - it('test operator "eq" overload (euint4, euint32) => ebool test 1 (9, 1089894566)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add32(1089894566n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint4, euint32) => ebool test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add32(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint4, euint32) => ebool test 3 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add32(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint4, euint32) => ebool test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add32(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint4, euint32) => ebool test 1 (5, 2818677977)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add32(2818677977n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint4, euint32) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add32(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint4, euint32) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add32(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint4, euint32) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add32(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint4, euint32) => ebool test 1 (1, 2262617776)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(1n); - input.add32(2262617776n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint4, euint32) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add32(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint4, euint32) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add32(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint4, euint32) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add32(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint4, euint32) => ebool test 1 (8, 1791761269)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add32(1791761269n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint32) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add32(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint32) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add32(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint32) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add32(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint32) => ebool test 1 (4, 1782114748)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add32(1782114748n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint32) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add32(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint32) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add32(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint32) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add32(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint4, euint32) => ebool test 1 (1, 3154883490)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(1n); - input.add32(3154883490n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint4, euint32) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add32(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint4, euint32) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add32(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint4, euint32) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add32(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint4, euint32) => euint32 test 1 (9, 2831156674)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add32(2831156674n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(9n); - }); - - it('test operator "min" overload (euint4, euint32) => euint32 test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add32(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(5n); - }); - - it('test operator "min" overload (euint4, euint32) => euint32 test 3 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add32(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(9n); - }); - - it('test operator "min" overload (euint4, euint32) => euint32 test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add32(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(5n); - }); - - it('test operator "max" overload (euint4, euint32) => euint32 test 1 (12, 623453237)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(12n); - input.add32(623453237n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(623453237n); - }); - - it('test operator "max" overload (euint4, euint32) => euint32 test 2 (8, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add32(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(12n); - }); - - it('test operator "max" overload (euint4, euint32) => euint32 test 3 (12, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(12n); - input.add32(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(12n); - }); - - it('test operator "max" overload (euint4, euint32) => euint32 test 4 (12, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(12n); - input.add32(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract1.res32()); - expect(res).to.equal(12n); - }); - - it('test operator "add" overload (euint4, euint64) => euint64 test 1 (1, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(1n); - input.add64(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(10n); - }); - - it('test operator "add" overload (euint4, euint64) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add64(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(12n); - }); - - it('test operator "add" overload (euint4, euint64) => euint64 test 3 (5, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add64(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(10n); - }); - - it('test operator "add" overload (euint4, euint64) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add64(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(12n); - }); - - it('test operator "sub" overload (euint4, euint64) => euint64 test 1 (12, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(12n); - input.add64(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.sub_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint4, euint64) => euint64 test 2 (12, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(12n); - input.add64(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.sub_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint4, euint64) => euint64 test 1 (2, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(2n); - input.add64(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(10n); - }); - - it('test operator "mul" overload (euint4, euint64) => euint64 test 2 (3, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); - input.add64(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(15n); - }); - - it('test operator "mul" overload (euint4, euint64) => euint64 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); - input.add64(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(9n); - }); - - it('test operator "mul" overload (euint4, euint64) => euint64 test 4 (5, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add64(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(15n); - }); - - it('test operator "and" overload (euint4, euint64) => euint64 test 1 (6, 18438764365497303935)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(6n); - input.add64(18438764365497303935n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(6n); - }); - - it('test operator "and" overload (euint4, euint64) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add64(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "and" overload (euint4, euint64) => euint64 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add64(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(8n); - }); - - it('test operator "and" overload (euint4, euint64) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add64(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "or" overload (euint4, euint64) => euint64 test 1 (14, 18440698678220010551)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add64(18440698678220010551n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(18440698678220010559n); - }); - - it('test operator "or" overload (euint4, euint64) => euint64 test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add64(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(14n); - }); - - it('test operator "or" overload (euint4, euint64) => euint64 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add64(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(14n); - }); - - it('test operator "or" overload (euint4, euint64) => euint64 test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add64(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(14n); - }); - - it('test operator "xor" overload (euint4, euint64) => euint64 test 1 (2, 18438078325844207475)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(2n); - input.add64(18438078325844207475n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(18438078325844207473n); - }); - - it('test operator "xor" overload (euint4, euint64) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add64(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint4, euint64) => euint64 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add64(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint4, euint64) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add64(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(12n); - }); - - it('test operator "eq" overload (euint4, euint64) => ebool test 1 (3, 18443050121569259433)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); - input.add64(18443050121569259433n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint4, euint64) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add64(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint4, euint64) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add64(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint4, euint64) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add64(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint4, euint64) => ebool test 1 (7, 18446555094221865045)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(7n); - input.add64(18446555094221865045n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint4, euint64) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add64(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint4, euint64) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add64(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint4, euint64) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add64(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint4, euint64) => ebool test 1 (12, 18446558548033148537)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(12n); - input.add64(18446558548033148537n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint4, euint64) => ebool test 2 (8, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add64(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint4, euint64) => ebool test 3 (12, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(12n); - input.add64(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint4, euint64) => ebool test 4 (12, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(12n); - input.add64(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint4, euint64) => ebool test 1 (11, 18445624350177245281)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(11n); - input.add64(18445624350177245281n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint64) => ebool test 2 (7, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(7n); - input.add64(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint64) => ebool test 3 (11, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(11n); - input.add64(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint64) => ebool test 4 (11, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(11n); - input.add64(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint64) => ebool test 1 (14, 18446414069240547725)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add64(18446414069240547725n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint64) => ebool test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add64(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint64) => ebool test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add64(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint64) => ebool test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add64(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint4, euint64) => ebool test 1 (13, 18441885120383916401)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add64(18441885120383916401n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint4, euint64) => ebool test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add64(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint4, euint64) => ebool test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add64(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint4, euint64) => ebool test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add64(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint4, euint64) => euint64 test 1 (12, 18440035039683442233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(12n); - input.add64(18440035039683442233n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(12n); - }); - - it('test operator "min" overload (euint4, euint64) => euint64 test 2 (8, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add64(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(8n); - }); - - it('test operator "min" overload (euint4, euint64) => euint64 test 3 (12, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(12n); - input.add64(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(12n); - }); - - it('test operator "min" overload (euint4, euint64) => euint64 test 4 (12, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(12n); - input.add64(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(8n); - }); - - it('test operator "max" overload (euint4, euint64) => euint64 test 1 (9, 18439762941056895609)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add64(18439762941056895609n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(18439762941056895609n); - }); - - it('test operator "max" overload (euint4, euint64) => euint64 test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add64(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(9n); - }); - - it('test operator "max" overload (euint4, euint64) => euint64 test 3 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add64(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(9n); - }); - - it('test operator "max" overload (euint4, euint64) => euint64 test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add64(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract1.res64()); - expect(res).to.equal(9n); - }); - - it('test operator "add" overload (euint4, euint128) => euint128 test 1 (2, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(2n); - input.add128(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(11n); - }); - - it('test operator "add" overload (euint4, euint128) => euint128 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add128(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(12n); - }); - - it('test operator "add" overload (euint4, euint128) => euint128 test 3 (5, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add128(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(10n); - }); - - it('test operator "add" overload (euint4, euint128) => euint128 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add128(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(12n); - }); - - it('test operator "sub" overload (euint4, euint128) => euint128 test 1 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add128(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.sub_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint4, euint128) => euint128 test 2 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add128(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.sub_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint4, euint128) => euint128 test 1 (2, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(2n); - input.add128(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(10n); - }); - - it('test operator "mul" overload (euint4, euint128) => euint128 test 2 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); - input.add128(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(9n); - }); - - it('test operator "mul" overload (euint4, euint128) => euint128 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); - input.add128(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(9n); - }); - - it('test operator "mul" overload (euint4, euint128) => euint128 test 4 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); - input.add128(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(9n); - }); - - it('test operator "and" overload (euint4, euint128) => euint128 test 1 (8, 340282366920938463463367802109078157213)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add128(340282366920938463463367802109078157213n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(8n); - }); - - it('test operator "and" overload (euint4, euint128) => euint128 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add128(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "and" overload (euint4, euint128) => euint128 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add128(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(8n); - }); - - it('test operator "and" overload (euint4, euint128) => euint128 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add128(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "or" overload (euint4, euint128) => euint128 test 1 (4, 340282366920938463463366343089484611447)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add128(340282366920938463463366343089484611447n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(340282366920938463463366343089484611447n); - }); - - it('test operator "or" overload (euint4, euint128) => euint128 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add128(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(12n); - }); - - it('test operator "or" overload (euint4, euint128) => euint128 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add128(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(8n); - }); - - it('test operator "or" overload (euint4, euint128) => euint128 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add128(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint4, euint128) => euint128 test 1 (13, 340282366920938463463366123999290070707)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add128(340282366920938463463366123999290070707n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(340282366920938463463366123999290070718n); - }); - - it('test operator "xor" overload (euint4, euint128) => euint128 test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add128(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint4, euint128) => euint128 test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add128(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint4, euint128) => euint128 test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add128(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint4, euint128) => ebool test 1 (10, 340282366920938463463370073243865312497)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add128(340282366920938463463370073243865312497n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint4, euint128) => ebool test 2 (6, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(6n); - input.add128(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint4, euint128) => ebool test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add128(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint4, euint128) => ebool test 4 (10, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add128(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.eq_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint4, euint128) => ebool test 1 (13, 340282366920938463463368725666766226609)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add128(340282366920938463463368725666766226609n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint4, euint128) => ebool test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(9n); - input.add128(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint4, euint128) => ebool test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add128(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint4, euint128) => ebool test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(13n); - input.add128(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ne_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint4, euint128) => ebool test 1 (3, 340282366920938463463374467311851431135)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); - input.add128(340282366920938463463374467311851431135n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint4, euint128) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add128(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint4, euint128) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add128(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint4, euint128) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add128(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.ge_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint4, euint128) => ebool test 1 (14, 340282366920938463463369565306924367885)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add128(340282366920938463463369565306924367885n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint128) => ebool test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add128(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint128) => ebool test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add128(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint128) => ebool test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add128(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.gt_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); -}); diff --git a/contracts/test/tfheOperations/tfheOperations10.ts b/contracts/test/tfheOperations/tfheOperations10.ts deleted file mode 100644 index fa223d0d..00000000 --- a/contracts/test/tfheOperations/tfheOperations10.ts +++ /dev/null @@ -1,4821 +0,0 @@ -import { expect } from 'chai'; -import { ethers } from 'hardhat'; - -import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1'; -import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2'; -import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'; -import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4'; -import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5'; -import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6'; -import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7'; -import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8'; -import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9'; -import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10'; -import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11'; -import { - createInstances, - decrypt4, - decrypt8, - decrypt16, - decrypt32, - decrypt64, - decrypt128, - decrypt256, - decryptBool, -} from '../instance'; -import { getSigners, initSigners } from '../signers'; - -async function deployTfheTestFixture1(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture2(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture3(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture4(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture5(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture6(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture7(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite7'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture8(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite8'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture9(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite9'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture10(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite10'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture11(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite11'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -describe('TFHE operations 10', function () { - before(async function () { - await initSigners(1); - this.signers = await getSigners(); - - const contract1 = await deployTfheTestFixture1(); - this.contract1Address = await contract1.getAddress(); - this.contract1 = contract1; - - const contract2 = await deployTfheTestFixture2(); - this.contract2Address = await contract2.getAddress(); - this.contract2 = contract2; - - const contract3 = await deployTfheTestFixture3(); - this.contract3Address = await contract3.getAddress(); - this.contract3 = contract3; - - const contract4 = await deployTfheTestFixture4(); - this.contract4Address = await contract4.getAddress(); - this.contract4 = contract4; - - const contract5 = await deployTfheTestFixture5(); - this.contract5Address = await contract5.getAddress(); - this.contract5 = contract5; - - const contract6 = await deployTfheTestFixture6(); - this.contract6Address = await contract6.getAddress(); - this.contract6 = contract6; - - const contract7 = await deployTfheTestFixture7(); - this.contract7Address = await contract7.getAddress(); - this.contract7 = contract7; - - const contract8 = await deployTfheTestFixture8(); - this.contract8Address = await contract8.getAddress(); - this.contract8 = contract8; - - const contract9 = await deployTfheTestFixture9(); - this.contract9Address = await contract9.getAddress(); - this.contract9 = contract9; - - const contract10 = await deployTfheTestFixture10(); - this.contract10Address = await contract10.getAddress(); - this.contract10 = contract10; - - const contract11 = await deployTfheTestFixture11(); - this.contract11Address = await contract11.getAddress(); - this.contract11 = contract11; - - const instances = await createInstances(this.signers); - this.instances = instances; - }); - - it('test operator "le" overload (euint128, euint128) => ebool test 1 (340282366920938463463373992528465349581, 340282366920938463463372840104721436799)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463373992528465349581n); - input.add128(340282366920938463463372840104721436799n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint128, euint128) => ebool test 2 (340282366920938463463372840104721436795, 340282366920938463463372840104721436799)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463372840104721436795n); - input.add128(340282366920938463463372840104721436799n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint128) => ebool test 3 (340282366920938463463372840104721436799, 340282366920938463463372840104721436799)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463372840104721436799n); - input.add128(340282366920938463463372840104721436799n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint128) => ebool test 4 (340282366920938463463372840104721436799, 340282366920938463463372840104721436795)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463372840104721436799n); - input.add128(340282366920938463463372840104721436795n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, euint128) => ebool test 1 (340282366920938463463368309276517872429, 340282366920938463463372024309642476529)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463368309276517872429n); - input.add128(340282366920938463463372024309642476529n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint128, euint128) => ebool test 2 (340282366920938463463368309276517872425, 340282366920938463463368309276517872429)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463368309276517872425n); - input.add128(340282366920938463463368309276517872429n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint128, euint128) => ebool test 3 (340282366920938463463368309276517872429, 340282366920938463463368309276517872429)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463368309276517872429n); - input.add128(340282366920938463463368309276517872429n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, euint128) => ebool test 4 (340282366920938463463368309276517872429, 340282366920938463463368309276517872425)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463368309276517872429n); - input.add128(340282366920938463463368309276517872425n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint128, euint128) => euint128 test 1 (340282366920938463463369507025632955721, 340282366920938463463371759125181075731)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463369507025632955721n); - input.add128(340282366920938463463371759125181075731n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463369507025632955721n); - }); - - it('test operator "min" overload (euint128, euint128) => euint128 test 2 (340282366920938463463369507025632955717, 340282366920938463463369507025632955721)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463369507025632955717n); - input.add128(340282366920938463463369507025632955721n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463369507025632955717n); - }); - - it('test operator "min" overload (euint128, euint128) => euint128 test 3 (340282366920938463463369507025632955721, 340282366920938463463369507025632955721)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463369507025632955721n); - input.add128(340282366920938463463369507025632955721n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463369507025632955721n); - }); - - it('test operator "min" overload (euint128, euint128) => euint128 test 4 (340282366920938463463369507025632955721, 340282366920938463463369507025632955717)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463369507025632955721n); - input.add128(340282366920938463463369507025632955717n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463369507025632955717n); - }); - - it('test operator "max" overload (euint128, euint128) => euint128 test 1 (340282366920938463463374311959896511759, 340282366920938463463367499312160836031)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463374311959896511759n); - input.add128(340282366920938463463367499312160836031n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463374311959896511759n); - }); - - it('test operator "max" overload (euint128, euint128) => euint128 test 2 (340282366920938463463367499312160836027, 340282366920938463463367499312160836031)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367499312160836027n); - input.add128(340282366920938463463367499312160836031n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463367499312160836031n); - }); - - it('test operator "max" overload (euint128, euint128) => euint128 test 3 (340282366920938463463367499312160836031, 340282366920938463463367499312160836031)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367499312160836031n); - input.add128(340282366920938463463367499312160836031n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463367499312160836031n); - }); - - it('test operator "max" overload (euint128, euint128) => euint128 test 4 (340282366920938463463367499312160836031, 340282366920938463463367499312160836027)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367499312160836031n); - input.add128(340282366920938463463367499312160836027n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463367499312160836031n); - }); - - it('test operator "add" overload (euint128, euint256) => euint256 test 1 (2, 170141183460469231731687303715884105729)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(2n); - input.add256(170141183460469231731687303715884105729n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(170141183460469231731687303715884105731n); - }); - - it('test operator "add" overload (euint128, euint256) => euint256 test 2 (170141183460469231731686007573348351546, 170141183460469231731686007573348351548)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(170141183460469231731686007573348351546n); - input.add256(170141183460469231731686007573348351548n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(340282366920938463463372015146696703094n); - }); - - it('test operator "add" overload (euint128, euint256) => euint256 test 3 (170141183460469231731686007573348351548, 170141183460469231731686007573348351548)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(170141183460469231731686007573348351548n); - input.add256(170141183460469231731686007573348351548n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(340282366920938463463372015146696703096n); - }); - - it('test operator "add" overload (euint128, euint256) => euint256 test 4 (170141183460469231731686007573348351548, 170141183460469231731686007573348351546)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(170141183460469231731686007573348351548n); - input.add256(170141183460469231731686007573348351546n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(340282366920938463463372015146696703094n); - }); - - it('test operator "sub" overload (euint128, euint256) => euint256 test 1 (340282366920938463463369549263218693865, 340282366920938463463369549263218693865)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463369549263218693865n); - input.add256(340282366920938463463369549263218693865n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.sub_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint128, euint256) => euint256 test 2 (340282366920938463463369549263218693865, 340282366920938463463369549263218693861)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463369549263218693865n); - input.add256(340282366920938463463369549263218693861n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.sub_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint128, euint256) => euint256 test 1 (2, 85070591730234615865843651857942052865)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(2n); - input.add256(85070591730234615865843651857942052865n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(170141183460469231731687303715884105730n); - }); - - it('test operator "mul" overload (euint128, euint256) => euint256 test 2 (9223372036854775809, 9223372036854775809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(9223372036854775809n); - input.add256(9223372036854775809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(85070591730234615884290395931651604481n); - }); - - it('test operator "mul" overload (euint128, euint256) => euint256 test 3 (9223372036854775809, 9223372036854775809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(9223372036854775809n); - input.add256(9223372036854775809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(85070591730234615884290395931651604481n); - }); - - it('test operator "mul" overload (euint128, euint256) => euint256 test 4 (9223372036854775809, 9223372036854775809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(9223372036854775809n); - input.add256(9223372036854775809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(85070591730234615884290395931651604481n); - }); - - it('test operator "and" overload (euint128, euint256) => euint256 test 1 (340282366920938463463366718158519885511, 115792089237316195423570985008687907853269984665640564039457581748247155679323)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463366718158519885511n); - input.add256(115792089237316195423570985008687907853269984665640564039457581748247155679323n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(340282366920938463463366717989234606147n); - }); - - it('test operator "and" overload (euint128, euint256) => euint256 test 2 (340282366920938463463366718158519885507, 340282366920938463463366718158519885511)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463366718158519885507n); - input.add256(340282366920938463463366718158519885511n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(340282366920938463463366718158519885507n); - }); - - it('test operator "and" overload (euint128, euint256) => euint256 test 3 (340282366920938463463366718158519885511, 340282366920938463463366718158519885511)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463366718158519885511n); - input.add256(340282366920938463463366718158519885511n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(340282366920938463463366718158519885511n); - }); - - it('test operator "and" overload (euint128, euint256) => euint256 test 4 (340282366920938463463366718158519885511, 340282366920938463463366718158519885507)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463366718158519885511n); - input.add256(340282366920938463463366718158519885507n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(340282366920938463463366718158519885507n); - }); - - it('test operator "or" overload (euint128, euint256) => euint256 test 1 (340282366920938463463366429103695675815, 115792089237316195423570985008687907853269984665640564039457583383018428109749)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463366429103695675815n); - input.add256(115792089237316195423570985008687907853269984665640564039457583383018428109749n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457583999099276579767n); - }); - - it('test operator "or" overload (euint128, euint256) => euint256 test 2 (340282366920938463463366429103695675811, 340282366920938463463366429103695675815)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463366429103695675811n); - input.add256(340282366920938463463366429103695675815n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(340282366920938463463366429103695675815n); - }); - - it('test operator "or" overload (euint128, euint256) => euint256 test 3 (340282366920938463463366429103695675815, 340282366920938463463366429103695675815)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463366429103695675815n); - input.add256(340282366920938463463366429103695675815n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(340282366920938463463366429103695675815n); - }); - - it('test operator "or" overload (euint128, euint256) => euint256 test 4 (340282366920938463463366429103695675815, 340282366920938463463366429103695675811)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463366429103695675815n); - input.add256(340282366920938463463366429103695675811n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(340282366920938463463366429103695675815n); - }); - - it('test operator "xor" overload (euint128, euint256) => euint256 test 1 (340282366920938463463370357504982561043, 115792089237316195423570985008687907853269984665640564039457576209743222065387)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463370357504982561043n); - input.add256(115792089237316195423570985008687907853269984665640564039457576209743222065387n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(115792089237316195423570985008687907852929702298719625575994215220393361046008n); - }); - - it('test operator "xor" overload (euint128, euint256) => euint256 test 2 (340282366920938463463370357504982561039, 340282366920938463463370357504982561043)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463370357504982561039n); - input.add256(340282366920938463463370357504982561043n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(28n); - }); - - it('test operator "xor" overload (euint128, euint256) => euint256 test 3 (340282366920938463463370357504982561043, 340282366920938463463370357504982561043)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463370357504982561043n); - input.add256(340282366920938463463370357504982561043n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint128, euint256) => euint256 test 4 (340282366920938463463370357504982561043, 340282366920938463463370357504982561039)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463370357504982561043n); - input.add256(340282366920938463463370357504982561039n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(28n); - }); - - it('test operator "eq" overload (euint128, euint256) => ebool test 1 (340282366920938463463367588896596491863, 115792089237316195423570985008687907853269984665640564039457578982740222216241)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367588896596491863n); - input.add256(115792089237316195423570985008687907853269984665640564039457578982740222216241n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint128, euint256) => ebool test 2 (340282366920938463463367588896596491859, 340282366920938463463367588896596491863)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367588896596491859n); - input.add256(340282366920938463463367588896596491863n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint128, euint256) => ebool test 3 (340282366920938463463367588896596491863, 340282366920938463463367588896596491863)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367588896596491863n); - input.add256(340282366920938463463367588896596491863n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint128, euint256) => ebool test 4 (340282366920938463463367588896596491863, 340282366920938463463367588896596491859)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367588896596491863n); - input.add256(340282366920938463463367588896596491859n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint128, euint256) => ebool test 1 (340282366920938463463374144988236257799, 115792089237316195423570985008687907853269984665640564039457582794848891263301)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463374144988236257799n); - input.add256(115792089237316195423570985008687907853269984665640564039457582794848891263301n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint128, euint256) => ebool test 2 (340282366920938463463374144988236257795, 340282366920938463463374144988236257799)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463374144988236257795n); - input.add256(340282366920938463463374144988236257799n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint128, euint256) => ebool test 3 (340282366920938463463374144988236257799, 340282366920938463463374144988236257799)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463374144988236257799n); - input.add256(340282366920938463463374144988236257799n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint128, euint256) => ebool test 4 (340282366920938463463374144988236257799, 340282366920938463463374144988236257795)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463374144988236257799n); - input.add256(340282366920938463463374144988236257795n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, euint256) => ebool test 1 (340282366920938463463372552646665539131, 115792089237316195423570985008687907853269984665640564039457578321851153049841)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463372552646665539131n); - input.add256(115792089237316195423570985008687907853269984665640564039457578321851153049841n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint128, euint256) => ebool test 2 (340282366920938463463372552646665539127, 340282366920938463463372552646665539131)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463372552646665539127n); - input.add256(340282366920938463463372552646665539131n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint128, euint256) => ebool test 3 (340282366920938463463372552646665539131, 340282366920938463463372552646665539131)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463372552646665539131n); - input.add256(340282366920938463463372552646665539131n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, euint256) => ebool test 4 (340282366920938463463372552646665539131, 340282366920938463463372552646665539127)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463372552646665539131n); - input.add256(340282366920938463463372552646665539127n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint128, euint256) => ebool test 1 (340282366920938463463370843114455636527, 115792089237316195423570985008687907853269984665640564039457583283635470770217)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463370843114455636527n); - input.add256(115792089237316195423570985008687907853269984665640564039457583283635470770217n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint128, euint256) => ebool test 2 (340282366920938463463370843114455636523, 340282366920938463463370843114455636527)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463370843114455636523n); - input.add256(340282366920938463463370843114455636527n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint128, euint256) => ebool test 3 (340282366920938463463370843114455636527, 340282366920938463463370843114455636527)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463370843114455636527n); - input.add256(340282366920938463463370843114455636527n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint128, euint256) => ebool test 4 (340282366920938463463370843114455636527, 340282366920938463463370843114455636523)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463370843114455636527n); - input.add256(340282366920938463463370843114455636523n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint256) => ebool test 1 (340282366920938463463370154534182411951, 115792089237316195423570985008687907853269984665640564039457582642838670062225)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463370154534182411951n); - input.add256(115792089237316195423570985008687907853269984665640564039457582642838670062225n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint256) => ebool test 2 (340282366920938463463370154534182411947, 340282366920938463463370154534182411951)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463370154534182411947n); - input.add256(340282366920938463463370154534182411951n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint256) => ebool test 3 (340282366920938463463370154534182411951, 340282366920938463463370154534182411951)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463370154534182411951n); - input.add256(340282366920938463463370154534182411951n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint256) => ebool test 4 (340282366920938463463370154534182411951, 340282366920938463463370154534182411947)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463370154534182411951n); - input.add256(340282366920938463463370154534182411947n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, euint256) => ebool test 1 (340282366920938463463373024758287549459, 115792089237316195423570985008687907853269984665640564039457580686028388504291)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463373024758287549459n); - input.add256(115792089237316195423570985008687907853269984665640564039457580686028388504291n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint128, euint256) => ebool test 2 (340282366920938463463373024758287549455, 340282366920938463463373024758287549459)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463373024758287549455n); - input.add256(340282366920938463463373024758287549459n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint128, euint256) => ebool test 3 (340282366920938463463373024758287549459, 340282366920938463463373024758287549459)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463373024758287549459n); - input.add256(340282366920938463463373024758287549459n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, euint256) => ebool test 4 (340282366920938463463373024758287549459, 340282366920938463463373024758287549455)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463373024758287549459n); - input.add256(340282366920938463463373024758287549455n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint128, euint256) => euint256 test 1 (340282366920938463463370734691749234713, 115792089237316195423570985008687907853269984665640564039457579316332311519059)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463370734691749234713n); - input.add256(115792089237316195423570985008687907853269984665640564039457579316332311519059n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(340282366920938463463370734691749234713n); - }); - - it('test operator "min" overload (euint128, euint256) => euint256 test 2 (340282366920938463463370734691749234709, 340282366920938463463370734691749234713)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463370734691749234709n); - input.add256(340282366920938463463370734691749234713n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(340282366920938463463370734691749234709n); - }); - - it('test operator "min" overload (euint128, euint256) => euint256 test 3 (340282366920938463463370734691749234713, 340282366920938463463370734691749234713)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463370734691749234713n); - input.add256(340282366920938463463370734691749234713n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(340282366920938463463370734691749234713n); - }); - - it('test operator "min" overload (euint128, euint256) => euint256 test 4 (340282366920938463463370734691749234713, 340282366920938463463370734691749234709)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463370734691749234713n); - input.add256(340282366920938463463370734691749234709n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(340282366920938463463370734691749234709n); - }); - - it('test operator "max" overload (euint128, euint256) => euint256 test 1 (340282366920938463463373789765297113341, 115792089237316195423570985008687907853269984665640564039457579894549860743867)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463373789765297113341n); - input.add256(115792089237316195423570985008687907853269984665640564039457579894549860743867n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579894549860743867n); - }); - - it('test operator "max" overload (euint128, euint256) => euint256 test 2 (340282366920938463463373789765297113337, 340282366920938463463373789765297113341)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463373789765297113337n); - input.add256(340282366920938463463373789765297113341n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(340282366920938463463373789765297113341n); - }); - - it('test operator "max" overload (euint128, euint256) => euint256 test 3 (340282366920938463463373789765297113341, 340282366920938463463373789765297113341)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463373789765297113341n); - input.add256(340282366920938463463373789765297113341n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(340282366920938463463373789765297113341n); - }); - - it('test operator "max" overload (euint128, euint256) => euint256 test 4 (340282366920938463463373789765297113341, 340282366920938463463373789765297113337)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463373789765297113341n); - input.add256(340282366920938463463373789765297113337n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint128_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(340282366920938463463373789765297113341n); - }); - - it('test operator "add" overload (euint128, uint128) => euint128 test 1 (170141183460469231731685489259224150459, 170141183460469231731685023392215721043)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(170141183460469231731685489259224150459n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_euint128_uint128( - encryptedAmount.handles[0], - 170141183460469231731685023392215721043n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463370512651439871502n); - }); - - it('test operator "add" overload (euint128, uint128) => euint128 test 2 (170141183460469231731685489259224150457, 170141183460469231731685489259224150459)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(170141183460469231731685489259224150457n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_euint128_uint128( - encryptedAmount.handles[0], - 170141183460469231731685489259224150459n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463370978518448300916n); - }); - - it('test operator "add" overload (euint128, uint128) => euint128 test 3 (170141183460469231731685489259224150459, 170141183460469231731685489259224150459)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(170141183460469231731685489259224150459n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_euint128_uint128( - encryptedAmount.handles[0], - 170141183460469231731685489259224150459n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463370978518448300918n); - }); - - it('test operator "add" overload (euint128, uint128) => euint128 test 4 (170141183460469231731685489259224150459, 170141183460469231731685489259224150457)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(170141183460469231731685489259224150459n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_euint128_uint128( - encryptedAmount.handles[0], - 170141183460469231731685489259224150457n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463370978518448300916n); - }); - - it('test operator "add" overload (uint128, euint128) => euint128 test 1 (170141183460469231731685837916615726593, 170141183460469231731685023392215721043)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(170141183460469231731685023392215721043n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_uint128_euint128( - 170141183460469231731685837916615726593n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463370861308831447636n); - }); - - it('test operator "add" overload (uint128, euint128) => euint128 test 2 (170141183460469231731685489259224150457, 170141183460469231731685489259224150459)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(170141183460469231731685489259224150459n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_uint128_euint128( - 170141183460469231731685489259224150457n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463370978518448300916n); - }); - - it('test operator "add" overload (uint128, euint128) => euint128 test 3 (170141183460469231731685489259224150459, 170141183460469231731685489259224150459)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(170141183460469231731685489259224150459n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_uint128_euint128( - 170141183460469231731685489259224150459n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463370978518448300918n); - }); - - it('test operator "add" overload (uint128, euint128) => euint128 test 4 (170141183460469231731685489259224150459, 170141183460469231731685489259224150457)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(170141183460469231731685489259224150457n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_uint128_euint128( - 170141183460469231731685489259224150459n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463370978518448300916n); - }); - - it('test operator "sub" overload (euint128, uint128) => euint128 test 1 (340282366920938463463366688248127833841, 340282366920938463463366688248127833841)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463366688248127833841n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.sub_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463366688248127833841n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint128, uint128) => euint128 test 2 (340282366920938463463366688248127833841, 340282366920938463463366688248127833837)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463366688248127833841n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.sub_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463366688248127833837n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "sub" overload (uint128, euint128) => euint128 test 1 (340282366920938463463366688248127833841, 340282366920938463463366688248127833841)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463366688248127833841n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.sub_uint128_euint128( - 340282366920938463463366688248127833841n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (uint128, euint128) => euint128 test 2 (340282366920938463463366688248127833841, 340282366920938463463366688248127833837)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463366688248127833837n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.sub_uint128_euint128( - 340282366920938463463366688248127833841n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint128, uint128) => euint128 test 1 (9223372036854775809, 9223372036854775809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(9223372036854775809n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_euint128_uint128( - encryptedAmount.handles[0], - 9223372036854775809n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(85070591730234615884290395931651604481n); - }); - - it('test operator "mul" overload (euint128, uint128) => euint128 test 2 (9223372036854775809, 9223372036854775809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(9223372036854775809n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_euint128_uint128( - encryptedAmount.handles[0], - 9223372036854775809n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(85070591730234615884290395931651604481n); - }); - - it('test operator "mul" overload (euint128, uint128) => euint128 test 3 (9223372036854775809, 9223372036854775809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(9223372036854775809n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_euint128_uint128( - encryptedAmount.handles[0], - 9223372036854775809n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(85070591730234615884290395931651604481n); - }); - - it('test operator "mul" overload (euint128, uint128) => euint128 test 4 (9223372036854775809, 9223372036854775809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(9223372036854775809n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_euint128_uint128( - encryptedAmount.handles[0], - 9223372036854775809n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(85070591730234615884290395931651604481n); - }); - - it('test operator "mul" overload (uint128, euint128) => euint128 test 1 (9223372036854775809, 9223372036854775809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(9223372036854775809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_uint128_euint128( - 9223372036854775809n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(85070591730234615884290395931651604481n); - }); - - it('test operator "mul" overload (uint128, euint128) => euint128 test 2 (9223372036854775809, 9223372036854775809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(9223372036854775809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_uint128_euint128( - 9223372036854775809n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(85070591730234615884290395931651604481n); - }); - - it('test operator "mul" overload (uint128, euint128) => euint128 test 3 (9223372036854775809, 9223372036854775809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(9223372036854775809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_uint128_euint128( - 9223372036854775809n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(85070591730234615884290395931651604481n); - }); - - it('test operator "mul" overload (uint128, euint128) => euint128 test 4 (9223372036854775809, 9223372036854775809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(9223372036854775809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_uint128_euint128( - 9223372036854775809n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(85070591730234615884290395931651604481n); - }); - - it('test operator "div" overload (euint128, uint128) => euint128 test 1 (340282366920938463463372619792959880891, 340282366920938463463368477899733272407)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463372619792959880891n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.div_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463368477899733272407n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(1n); - }); - - it('test operator "div" overload (euint128, uint128) => euint128 test 2 (340282366920938463463372619792959880887, 340282366920938463463372619792959880891)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463372619792959880887n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.div_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463372619792959880891n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "div" overload (euint128, uint128) => euint128 test 3 (340282366920938463463372619792959880891, 340282366920938463463372619792959880891)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463372619792959880891n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.div_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463372619792959880891n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(1n); - }); - - it('test operator "div" overload (euint128, uint128) => euint128 test 4 (340282366920938463463372619792959880891, 340282366920938463463372619792959880887)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463372619792959880891n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.div_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463372619792959880887n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(1n); - }); - - it('test operator "rem" overload (euint128, uint128) => euint128 test 1 (340282366920938463463367984231624733459, 340282366920938463463368025855706253793)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367984231624733459n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.rem_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463368025855706253793n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463367984231624733459n); - }); - - it('test operator "rem" overload (euint128, uint128) => euint128 test 2 (340282366920938463463367984231624733455, 340282366920938463463367984231624733459)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367984231624733455n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.rem_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463367984231624733459n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463367984231624733455n); - }); - - it('test operator "rem" overload (euint128, uint128) => euint128 test 3 (340282366920938463463367984231624733459, 340282366920938463463367984231624733459)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367984231624733459n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.rem_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463367984231624733459n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "rem" overload (euint128, uint128) => euint128 test 4 (340282366920938463463367984231624733459, 340282366920938463463367984231624733455)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367984231624733459n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.rem_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463367984231624733455n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "and" overload (euint128, uint128) => euint128 test 1 (340282366920938463463365754576278416105, 340282366920938463463366410191459861233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463365754576278416105n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463366410191459861233n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463365741001161851617n); - }); - - it('test operator "and" overload (euint128, uint128) => euint128 test 2 (340282366920938463463365754576278416101, 340282366920938463463365754576278416105)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463365754576278416101n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463365754576278416105n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463365754576278416097n); - }); - - it('test operator "and" overload (euint128, uint128) => euint128 test 3 (340282366920938463463365754576278416105, 340282366920938463463365754576278416105)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463365754576278416105n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463365754576278416105n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463365754576278416105n); - }); - - it('test operator "and" overload (euint128, uint128) => euint128 test 4 (340282366920938463463365754576278416105, 340282366920938463463365754576278416101)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463365754576278416105n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463365754576278416101n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463365754576278416097n); - }); - - it('test operator "and" overload (uint128, euint128) => euint128 test 1 (340282366920938463463371836375477224759, 340282366920938463463366410191459861233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463366410191459861233n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_uint128_euint128( - 340282366920938463463371836375477224759n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463366199075542663217n); - }); - - it('test operator "and" overload (uint128, euint128) => euint128 test 2 (340282366920938463463365754576278416101, 340282366920938463463365754576278416105)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463365754576278416105n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_uint128_euint128( - 340282366920938463463365754576278416101n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463365754576278416097n); - }); - - it('test operator "and" overload (uint128, euint128) => euint128 test 3 (340282366920938463463365754576278416105, 340282366920938463463365754576278416105)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463365754576278416105n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_uint128_euint128( - 340282366920938463463365754576278416105n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463365754576278416105n); - }); - - it('test operator "and" overload (uint128, euint128) => euint128 test 4 (340282366920938463463365754576278416105, 340282366920938463463365754576278416101)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463365754576278416101n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_uint128_euint128( - 340282366920938463463365754576278416105n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463365754576278416097n); - }); - - it('test operator "or" overload (euint128, uint128) => euint128 test 1 (340282366920938463463367655063545859643, 340282366920938463463373853783183776929)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367655063545859643n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463373853783183776929n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463374430271410986683n); - }); - - it('test operator "or" overload (euint128, uint128) => euint128 test 2 (340282366920938463463367655063545859639, 340282366920938463463367655063545859643)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367655063545859639n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463367655063545859643n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463367655063545859647n); - }); - - it('test operator "or" overload (euint128, uint128) => euint128 test 3 (340282366920938463463367655063545859643, 340282366920938463463367655063545859643)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367655063545859643n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463367655063545859643n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463367655063545859643n); - }); - - it('test operator "or" overload (euint128, uint128) => euint128 test 4 (340282366920938463463367655063545859643, 340282366920938463463367655063545859639)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367655063545859643n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463367655063545859639n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463367655063545859647n); - }); - - it('test operator "or" overload (uint128, euint128) => euint128 test 1 (340282366920938463463370547981929977503, 340282366920938463463373853783183776929)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463373853783183776929n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_uint128_euint128( - 340282366920938463463370547981929977503n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463373996101960916671n); - }); - - it('test operator "or" overload (uint128, euint128) => euint128 test 2 (340282366920938463463367655063545859639, 340282366920938463463367655063545859643)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463367655063545859643n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_uint128_euint128( - 340282366920938463463367655063545859639n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463367655063545859647n); - }); - - it('test operator "or" overload (uint128, euint128) => euint128 test 3 (340282366920938463463367655063545859643, 340282366920938463463367655063545859643)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463367655063545859643n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_uint128_euint128( - 340282366920938463463367655063545859643n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463367655063545859643n); - }); - - it('test operator "or" overload (uint128, euint128) => euint128 test 4 (340282366920938463463367655063545859643, 340282366920938463463367655063545859639)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463367655063545859639n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_uint128_euint128( - 340282366920938463463367655063545859643n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463367655063545859647n); - }); - - it('test operator "xor" overload (euint128, uint128) => euint128 test 1 (340282366920938463463372080691181989981, 340282366920938463463368386031692563719)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463372080691181989981n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463368386031692563719n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(8690927368893786n); - }); - - it('test operator "xor" overload (euint128, uint128) => euint128 test 2 (340282366920938463463368941059346865325, 340282366920938463463368941059346865329)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463368941059346865325n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463368941059346865329n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(28n); - }); - - it('test operator "xor" overload (euint128, uint128) => euint128 test 3 (340282366920938463463368941059346865329, 340282366920938463463368941059346865329)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463368941059346865329n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463368941059346865329n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint128, uint128) => euint128 test 4 (340282366920938463463368941059346865329, 340282366920938463463368941059346865325)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463368941059346865329n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463368941059346865325n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(28n); - }); - - it('test operator "xor" overload (uint128, euint128) => euint128 test 1 (340282366920938463463374269120313762865, 340282366920938463463368386031692563719)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463368386031692563719n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_uint128_euint128( - 340282366920938463463374269120313762865n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(6519991538245942n); - }); - - it('test operator "xor" overload (uint128, euint128) => euint128 test 2 (340282366920938463463368941059346865325, 340282366920938463463368941059346865329)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463368941059346865329n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_uint128_euint128( - 340282366920938463463368941059346865325n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(28n); - }); - - it('test operator "xor" overload (uint128, euint128) => euint128 test 3 (340282366920938463463368941059346865329, 340282366920938463463368941059346865329)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463368941059346865329n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_uint128_euint128( - 340282366920938463463368941059346865329n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (uint128, euint128) => euint128 test 4 (340282366920938463463368941059346865329, 340282366920938463463368941059346865325)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463368941059346865325n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_uint128_euint128( - 340282366920938463463368941059346865329n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(28n); - }); - - it('test operator "eq" overload (euint128, uint128) => ebool test 1 (340282366920938463463371368021216956093, 340282366920938463463373345909663104587)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463371368021216956093n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463373345909663104587n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint128, uint128) => ebool test 2 (340282366920938463463370243874611927701, 340282366920938463463370243874611927705)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463370243874611927701n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463370243874611927705n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint128, uint128) => ebool test 3 (340282366920938463463370243874611927705, 340282366920938463463370243874611927705)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463370243874611927705n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463370243874611927705n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint128, uint128) => ebool test 4 (340282366920938463463370243874611927705, 340282366920938463463370243874611927701)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463370243874611927705n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463370243874611927701n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint128, euint128) => ebool test 1 (340282366920938463463369712474902223435, 340282366920938463463373345909663104587)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463373345909663104587n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_uint128_euint128( - 340282366920938463463369712474902223435n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint128, euint128) => ebool test 2 (340282366920938463463370243874611927701, 340282366920938463463370243874611927705)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463370243874611927705n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_uint128_euint128( - 340282366920938463463370243874611927701n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint128, euint128) => ebool test 3 (340282366920938463463370243874611927705, 340282366920938463463370243874611927705)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463370243874611927705n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_uint128_euint128( - 340282366920938463463370243874611927705n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (uint128, euint128) => ebool test 4 (340282366920938463463370243874611927705, 340282366920938463463370243874611927701)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463370243874611927701n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_uint128_euint128( - 340282366920938463463370243874611927705n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint128, uint128) => ebool test 1 (340282366920938463463366690564024700303, 340282366920938463463373212539976330723)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463366690564024700303n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463373212539976330723n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint128, uint128) => ebool test 2 (340282366920938463463366105643215363061, 340282366920938463463366105643215363065)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463366105643215363061n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463366105643215363065n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint128, uint128) => ebool test 3 (340282366920938463463366105643215363065, 340282366920938463463366105643215363065)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463366105643215363065n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463366105643215363065n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint128, uint128) => ebool test 4 (340282366920938463463366105643215363065, 340282366920938463463366105643215363061)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463366105643215363065n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463366105643215363061n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint128, euint128) => ebool test 1 (340282366920938463463372802578174510491, 340282366920938463463373212539976330723)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463373212539976330723n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_uint128_euint128( - 340282366920938463463372802578174510491n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint128, euint128) => ebool test 2 (340282366920938463463366105643215363061, 340282366920938463463366105643215363065)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463366105643215363065n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_uint128_euint128( - 340282366920938463463366105643215363061n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint128, euint128) => ebool test 3 (340282366920938463463366105643215363065, 340282366920938463463366105643215363065)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463366105643215363065n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_uint128_euint128( - 340282366920938463463366105643215363065n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (uint128, euint128) => ebool test 4 (340282366920938463463366105643215363065, 340282366920938463463366105643215363061)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463366105643215363061n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_uint128_euint128( - 340282366920938463463366105643215363065n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, uint128) => ebool test 1 (340282366920938463463369991167430665173, 340282366920938463463370096368753149585)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463369991167430665173n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463370096368753149585n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint128, uint128) => ebool test 2 (340282366920938463463367243418798341495, 340282366920938463463367243418798341499)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367243418798341495n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463367243418798341499n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint128, uint128) => ebool test 3 (340282366920938463463367243418798341499, 340282366920938463463367243418798341499)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367243418798341499n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463367243418798341499n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, uint128) => ebool test 4 (340282366920938463463367243418798341499, 340282366920938463463367243418798341495)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367243418798341499n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463367243418798341495n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (uint128, euint128) => ebool test 1 (340282366920938463463370285053807900009, 340282366920938463463370096368753149585)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463370096368753149585n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_uint128_euint128( - 340282366920938463463370285053807900009n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (uint128, euint128) => ebool test 2 (340282366920938463463367243418798341495, 340282366920938463463367243418798341499)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463367243418798341499n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_uint128_euint128( - 340282366920938463463367243418798341495n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (uint128, euint128) => ebool test 3 (340282366920938463463367243418798341499, 340282366920938463463367243418798341499)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463367243418798341499n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_uint128_euint128( - 340282366920938463463367243418798341499n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (uint128, euint128) => ebool test 4 (340282366920938463463367243418798341499, 340282366920938463463367243418798341495)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463367243418798341495n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_uint128_euint128( - 340282366920938463463367243418798341499n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint128, uint128) => ebool test 1 (340282366920938463463367714696589499231, 340282366920938463463369886774124197135)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367714696589499231n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463369886774124197135n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint128, uint128) => ebool test 2 (340282366920938463463367714696589499227, 340282366920938463463367714696589499231)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367714696589499227n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463367714696589499231n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint128, uint128) => ebool test 3 (340282366920938463463367714696589499231, 340282366920938463463367714696589499231)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367714696589499231n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463367714696589499231n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint128, uint128) => ebool test 4 (340282366920938463463367714696589499231, 340282366920938463463367714696589499227)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367714696589499231n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463367714696589499227n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (uint128, euint128) => ebool test 1 (340282366920938463463371365285946007453, 340282366920938463463369886774124197135)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463369886774124197135n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_uint128_euint128( - 340282366920938463463371365285946007453n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (uint128, euint128) => ebool test 2 (340282366920938463463367714696589499227, 340282366920938463463367714696589499231)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463367714696589499231n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_uint128_euint128( - 340282366920938463463367714696589499227n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (uint128, euint128) => ebool test 3 (340282366920938463463367714696589499231, 340282366920938463463367714696589499231)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463367714696589499231n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_uint128_euint128( - 340282366920938463463367714696589499231n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (uint128, euint128) => ebool test 4 (340282366920938463463367714696589499231, 340282366920938463463367714696589499227)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463367714696589499227n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_uint128_euint128( - 340282366920938463463367714696589499231n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, uint128) => ebool test 1 (340282366920938463463373992528465349581, 340282366920938463463373835012809081201)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463373992528465349581n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463373835012809081201n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint128, uint128) => ebool test 2 (340282366920938463463372840104721436795, 340282366920938463463372840104721436799)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463372840104721436795n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463372840104721436799n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, uint128) => ebool test 3 (340282366920938463463372840104721436799, 340282366920938463463372840104721436799)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463372840104721436799n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463372840104721436799n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, uint128) => ebool test 4 (340282366920938463463372840104721436799, 340282366920938463463372840104721436795)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463372840104721436799n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463372840104721436795n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (uint128, euint128) => ebool test 1 (340282366920938463463374153561991926979, 340282366920938463463373835012809081201)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463373835012809081201n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_uint128_euint128( - 340282366920938463463374153561991926979n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (uint128, euint128) => ebool test 2 (340282366920938463463372840104721436795, 340282366920938463463372840104721436799)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463372840104721436799n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_uint128_euint128( - 340282366920938463463372840104721436795n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (uint128, euint128) => ebool test 3 (340282366920938463463372840104721436799, 340282366920938463463372840104721436799)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463372840104721436799n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_uint128_euint128( - 340282366920938463463372840104721436799n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (uint128, euint128) => ebool test 4 (340282366920938463463372840104721436799, 340282366920938463463372840104721436795)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463372840104721436795n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_uint128_euint128( - 340282366920938463463372840104721436799n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, uint128) => ebool test 1 (340282366920938463463368309276517872429, 340282366920938463463366305725915183957)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463368309276517872429n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463366305725915183957n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, uint128) => ebool test 2 (340282366920938463463368309276517872425, 340282366920938463463368309276517872429)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463368309276517872425n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463368309276517872429n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint128, uint128) => ebool test 3 (340282366920938463463368309276517872429, 340282366920938463463368309276517872429)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463368309276517872429n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463368309276517872429n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, uint128) => ebool test 4 (340282366920938463463368309276517872429, 340282366920938463463368309276517872425)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463368309276517872429n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463368309276517872425n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (uint128, euint128) => ebool test 1 (340282366920938463463371881592186712743, 340282366920938463463366305725915183957)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463366305725915183957n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_uint128_euint128( - 340282366920938463463371881592186712743n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (uint128, euint128) => ebool test 2 (340282366920938463463368309276517872425, 340282366920938463463368309276517872429)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463368309276517872429n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_uint128_euint128( - 340282366920938463463368309276517872425n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (uint128, euint128) => ebool test 3 (340282366920938463463368309276517872429, 340282366920938463463368309276517872429)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463368309276517872429n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_uint128_euint128( - 340282366920938463463368309276517872429n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (uint128, euint128) => ebool test 4 (340282366920938463463368309276517872429, 340282366920938463463368309276517872425)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463368309276517872425n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_uint128_euint128( - 340282366920938463463368309276517872429n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint128, uint128) => euint128 test 1 (340282366920938463463369507025632955721, 340282366920938463463369479362880511843)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463369507025632955721n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463369479362880511843n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463369479362880511843n); - }); - - it('test operator "min" overload (euint128, uint128) => euint128 test 2 (340282366920938463463369507025632955717, 340282366920938463463369507025632955721)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463369507025632955717n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463369507025632955721n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463369507025632955717n); - }); - - it('test operator "min" overload (euint128, uint128) => euint128 test 3 (340282366920938463463369507025632955721, 340282366920938463463369507025632955721)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463369507025632955721n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463369507025632955721n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463369507025632955721n); - }); - - it('test operator "min" overload (euint128, uint128) => euint128 test 4 (340282366920938463463369507025632955721, 340282366920938463463369507025632955717)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463369507025632955721n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463369507025632955717n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463369507025632955717n); - }); - - it('test operator "min" overload (uint128, euint128) => euint128 test 1 (340282366920938463463367460119738968177, 340282366920938463463369479362880511843)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463369479362880511843n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_uint128_euint128( - 340282366920938463463367460119738968177n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463367460119738968177n); - }); - - it('test operator "min" overload (uint128, euint128) => euint128 test 2 (340282366920938463463369507025632955717, 340282366920938463463369507025632955721)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463369507025632955721n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_uint128_euint128( - 340282366920938463463369507025632955717n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463369507025632955717n); - }); - - it('test operator "min" overload (uint128, euint128) => euint128 test 3 (340282366920938463463369507025632955721, 340282366920938463463369507025632955721)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463369507025632955721n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_uint128_euint128( - 340282366920938463463369507025632955721n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463369507025632955721n); - }); - - it('test operator "min" overload (uint128, euint128) => euint128 test 4 (340282366920938463463369507025632955721, 340282366920938463463369507025632955717)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463369507025632955717n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_uint128_euint128( - 340282366920938463463369507025632955721n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463369507025632955717n); - }); - - it('test operator "max" overload (euint128, uint128) => euint128 test 1 (340282366920938463463374311959896511759, 340282366920938463463371397781663603615)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463374311959896511759n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463371397781663603615n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463374311959896511759n); - }); - - it('test operator "max" overload (euint128, uint128) => euint128 test 2 (340282366920938463463367499312160836027, 340282366920938463463367499312160836031)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367499312160836027n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463367499312160836031n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463367499312160836031n); - }); - - it('test operator "max" overload (euint128, uint128) => euint128 test 3 (340282366920938463463367499312160836031, 340282366920938463463367499312160836031)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367499312160836031n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463367499312160836031n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463367499312160836031n); - }); - - it('test operator "max" overload (euint128, uint128) => euint128 test 4 (340282366920938463463367499312160836031, 340282366920938463463367499312160836027)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add128(340282366920938463463367499312160836031n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint128_uint128( - encryptedAmount.handles[0], - 340282366920938463463367499312160836027n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463367499312160836031n); - }); - - it('test operator "max" overload (uint128, euint128) => euint128 test 1 (340282366920938463463370589299931927619, 340282366920938463463371397781663603615)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463371397781663603615n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_uint128_euint128( - 340282366920938463463370589299931927619n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463371397781663603615n); - }); - - it('test operator "max" overload (uint128, euint128) => euint128 test 2 (340282366920938463463367499312160836027, 340282366920938463463367499312160836031)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463367499312160836031n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_uint128_euint128( - 340282366920938463463367499312160836027n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463367499312160836031n); - }); - - it('test operator "max" overload (uint128, euint128) => euint128 test 3 (340282366920938463463367499312160836031, 340282366920938463463367499312160836031)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463367499312160836031n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_uint128_euint128( - 340282366920938463463367499312160836031n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463367499312160836031n); - }); - - it('test operator "max" overload (uint128, euint128) => euint128 test 4 (340282366920938463463367499312160836031, 340282366920938463463367499312160836027)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - - input.add128(340282366920938463463367499312160836027n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_uint128_euint128( - 340282366920938463463367499312160836031n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract9.res128()); - expect(res).to.equal(340282366920938463463367499312160836031n); - }); - - it('test operator "add" overload (euint256, euint4) => euint256 test 1 (9, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(9n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(11n); - }); - - it('test operator "add" overload (euint256, euint4) => euint256 test 2 (6, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(6n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(14n); - }); - - it('test operator "add" overload (euint256, euint4) => euint256 test 3 (5, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(5n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(10n); - }); - - it('test operator "add" overload (euint256, euint4) => euint256 test 4 (8, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(8n); - input.add4(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(14n); - }); - - it('test operator "sub" overload (euint256, euint4) => euint256 test 1 (11, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(11n); - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.sub_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint256, euint4) => euint256 test 2 (11, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(11n); - input.add4(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.sub_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint256, euint4) => euint256 test 1 (5, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(5n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(10n); - }); - - it('test operator "mul" overload (euint256, euint4) => euint256 test 2 (3, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(3n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(15n); - }); - - it('test operator "mul" overload (euint256, euint4) => euint256 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(3n); - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(9n); - }); - - it('test operator "mul" overload (euint256, euint4) => euint256 test 4 (5, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(5n); - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(15n); - }); - - it('test operator "and" overload (euint256, euint4) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579364828919798977, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579364828919798977n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(1n); - }); - - it('test operator "and" overload (euint256, euint4) => euint256 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "and" overload (euint256, euint4) => euint256 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(8n); - }); - - it('test operator "and" overload (euint256, euint4) => euint256 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "or" overload (euint256, euint4) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579810763114124559, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579810763114124559n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579810763114124559n); - }); - - it('test operator "or" overload (euint256, euint4) => euint256 test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(10n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(14n); - }); - - it('test operator "or" overload (euint256, euint4) => euint256 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(14n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(14n); - }); - - it('test operator "or" overload (euint256, euint4) => euint256 test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(14n); - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(14n); - }); - - it('test operator "xor" overload (euint256, euint4) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582453903191902895, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457582453903191902895n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457582453903191902883n); - }); - - it('test operator "xor" overload (euint256, euint4) => euint256 test 2 (8, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(8n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint256, euint4) => euint256 test 3 (12, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(12n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint256, euint4) => euint256 test 4 (12, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(12n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint256, euint4) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457581942293222963611, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581942293222963611n); - input.add4(1n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint256, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint256, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint256, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint256, euint4) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457577394215847356385, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577394215847356385n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint256, euint4) => ebool test 2 (8, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(8n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint256, euint4) => ebool test 3 (12, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(12n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint256, euint4) => ebool test 4 (12, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(12n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, euint4) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457575496173341010993, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457575496173341010993n); - input.add4(1n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint256, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint256, euint4) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457576018520605547063, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457576018520605547063n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint256, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint256, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint256, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint4) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457578089704885195999, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457578089704885195999n); - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint256, euint4) => ebool test 2 (7, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(7n); - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint4) => ebool test 3 (11, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(11n); - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint4) => ebool test 4 (11, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(11n); - input.add4(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint4) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457580046200927487349, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457580046200927487349n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint4) => ebool test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(5n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint256, euint4) => ebool test 3 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(9n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint4) => ebool test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(9n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint256, euint4) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582664799758938101, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457582664799758938101n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(2n); - }); - - it('test operator "min" overload (euint256, euint4) => euint256 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "min" overload (euint256, euint4) => euint256 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(8n); - }); - - it('test operator "min" overload (euint256, euint4) => euint256 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "max" overload (euint256, euint4) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457577303760309863037, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577303760309863037n); - input.add4(1n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577303760309863037n); - }); - - it('test operator "max" overload (euint256, euint4) => euint256 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(8n); - }); - - it('test operator "max" overload (euint256, euint4) => euint256 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(8n); - }); - - it('test operator "max" overload (euint256, euint4) => euint256 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint256_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(8n); - }); - - it('test operator "add" overload (euint256, euint8) => euint256 test 1 (129, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(129n); - input.add8(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(131n); - }); - - it('test operator "add" overload (euint256, euint8) => euint256 test 2 (101, 103)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(101n); - input.add8(103n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(204n); - }); - - it('test operator "add" overload (euint256, euint8) => euint256 test 3 (103, 103)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(103n); - input.add8(103n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(206n); - }); - - it('test operator "add" overload (euint256, euint8) => euint256 test 4 (103, 101)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(103n); - input.add8(101n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(204n); - }); - - it('test operator "sub" overload (euint256, euint8) => euint256 test 1 (234, 234)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(234n); - input.add8(234n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.sub_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint256, euint8) => euint256 test 2 (234, 230)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(234n); - input.add8(230n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.sub_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint256, euint8) => euint256 test 1 (65, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(65n); - input.add8(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(130n); - }); - - it('test operator "mul" overload (euint256, euint8) => euint256 test 2 (13, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(13n); - input.add8(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(182n); - }); - - it('test operator "mul" overload (euint256, euint8) => euint256 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(14n); - input.add8(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(196n); - }); - - it('test operator "mul" overload (euint256, euint8) => euint256 test 4 (14, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(14n); - input.add8(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(182n); - }); - - it('test operator "and" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457580200311934752389, 160)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457580200311934752389n); - input.add8(160n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(128n); - }); - - it('test operator "and" overload (euint256, euint8) => euint256 test 2 (156, 160)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(156n); - input.add8(160n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(128n); - }); - - it('test operator "and" overload (euint256, euint8) => euint256 test 3 (160, 160)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(160n); - input.add8(160n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(160n); - }); - - it('test operator "and" overload (euint256, euint8) => euint256 test 4 (160, 156)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(160n); - input.add8(156n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(128n); - }); - - it('test operator "or" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579600697842114421, 25)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579600697842114421n); - input.add8(25n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579600697842114429n); - }); - - it('test operator "or" overload (euint256, euint8) => euint256 test 2 (21, 25)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(21n); - input.add8(25n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(29n); - }); - - it('test operator "or" overload (euint256, euint8) => euint256 test 3 (25, 25)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(25n); - input.add8(25n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(25n); - }); - - it('test operator "or" overload (euint256, euint8) => euint256 test 4 (25, 21)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(25n); - input.add8(21n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(29n); - }); - - it('test operator "xor" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457576224347045805665, 175)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457576224347045805665n); - input.add8(175n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576224347045805774n); - }); - - it('test operator "xor" overload (euint256, euint8) => euint256 test 2 (171, 175)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(171n); - input.add8(175n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint256, euint8) => euint256 test 3 (175, 175)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(175n); - input.add8(175n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint256, euint8) => euint256 test 4 (175, 171)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(175n); - input.add8(171n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint256, euint8) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457581724603808654415, 213)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581724603808654415n); - input.add8(213n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint256, euint8) => ebool test 2 (209, 213)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(209n); - input.add8(213n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint256, euint8) => ebool test 3 (213, 213)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(213n); - input.add8(213n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint256, euint8) => ebool test 4 (213, 209)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(213n); - input.add8(209n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint256, euint8) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457577306800788645475, 79)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577306800788645475n); - input.add8(79n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint256, euint8) => ebool test 2 (75, 79)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(75n); - input.add8(79n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint256, euint8) => ebool test 3 (79, 79)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(79n); - input.add8(79n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint256, euint8) => ebool test 4 (79, 75)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(79n); - input.add8(75n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, euint8) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457583777768346925767, 250)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457583777768346925767n); - input.add8(250n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, euint8) => ebool test 2 (246, 250)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(246n); - input.add8(250n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint256, euint8) => ebool test 3 (250, 250)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(250n); - input.add8(250n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, euint8) => ebool test 4 (250, 246)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(250n); - input.add8(246n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint256, euint8) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457583855482126679265, 93)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457583855482126679265n); - input.add8(93n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint256, euint8) => ebool test 2 (89, 93)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(89n); - input.add8(93n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint256, euint8) => ebool test 3 (93, 93)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(93n); - input.add8(93n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint256, euint8) => ebool test 4 (93, 89)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(93n); - input.add8(89n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint8) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457580743279895693245, 161)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457580743279895693245n); - input.add8(161n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint256, euint8) => ebool test 2 (157, 161)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(157n); - input.add8(161n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint8) => ebool test 3 (161, 161)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(161n); - input.add8(161n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint8) => ebool test 4 (161, 157)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(161n); - input.add8(157n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint8) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457575356850463874977, 220)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457575356850463874977n); - input.add8(220n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint8) => ebool test 2 (216, 220)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(216n); - input.add8(220n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint256, euint8) => ebool test 3 (220, 220)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(220n); - input.add8(220n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint8) => ebool test 4 (220, 216)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(220n); - input.add8(216n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457577026640283682165, 103)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577026640283682165n); - input.add8(103n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(103n); - }); - - it('test operator "min" overload (euint256, euint8) => euint256 test 2 (99, 103)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(99n); - input.add8(103n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(99n); - }); - - it('test operator "min" overload (euint256, euint8) => euint256 test 3 (103, 103)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(103n); - input.add8(103n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(103n); - }); - - it('test operator "min" overload (euint256, euint8) => euint256 test 4 (103, 99)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(103n); - input.add8(99n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(99n); - }); - - it('test operator "max" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457581923844171729579, 237)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581923844171729579n); - input.add8(237n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457581923844171729579n); - }); - - it('test operator "max" overload (euint256, euint8) => euint256 test 2 (233, 237)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(233n); - input.add8(237n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(237n); - }); - - it('test operator "max" overload (euint256, euint8) => euint256 test 3 (237, 237)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(237n); - input.add8(237n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(237n); - }); - - it('test operator "max" overload (euint256, euint8) => euint256 test 4 (237, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(237n); - input.add8(233n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(237n); - }); - - it('test operator "add" overload (euint256, euint16) => euint256 test 1 (32769, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(32769n); - input.add16(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(32771n); - }); - - it('test operator "add" overload (euint256, euint16) => euint256 test 2 (18590, 18592)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(18590n); - input.add16(18592n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(37182n); - }); - - it('test operator "add" overload (euint256, euint16) => euint256 test 3 (18592, 18592)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(18592n); - input.add16(18592n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(37184n); - }); - - it('test operator "add" overload (euint256, euint16) => euint256 test 4 (18592, 18590)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(18592n); - input.add16(18590n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.add_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(37182n); - }); - - it('test operator "sub" overload (euint256, euint16) => euint256 test 1 (46280, 46280)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(46280n); - input.add16(46280n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.sub_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint256, euint16) => euint256 test 2 (46280, 46276)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(46280n); - input.add16(46276n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.sub_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint256, euint16) => euint256 test 1 (16385, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(16385n); - input.add16(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(32770n); - }); - - it('test operator "mul" overload (euint256, euint16) => euint256 test 2 (233, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(233n); - input.add16(233n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(54289n); - }); - - it('test operator "mul" overload (euint256, euint16) => euint256 test 3 (233, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(233n); - input.add16(233n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(54289n); - }); - - it('test operator "mul" overload (euint256, euint16) => euint256 test 4 (233, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(233n); - input.add16(233n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.mul_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(54289n); - }); - - it('test operator "and" overload (euint256, euint16) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457581238581042328907, 21842)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581238581042328907n); - input.add16(21842n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(5442n); - }); - - it('test operator "and" overload (euint256, euint16) => euint256 test 2 (21838, 21842)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(21838n); - input.add16(21842n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(21826n); - }); - - it('test operator "and" overload (euint256, euint16) => euint256 test 3 (21842, 21842)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(21842n); - input.add16(21842n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(21842n); - }); - - it('test operator "and" overload (euint256, euint16) => euint256 test 4 (21842, 21838)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(21842n); - input.add16(21838n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.and_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(21826n); - }); -}); diff --git a/contracts/test/tfheOperations/tfheOperations11.ts b/contracts/test/tfheOperations/tfheOperations11.ts deleted file mode 100644 index 74694fec..00000000 --- a/contracts/test/tfheOperations/tfheOperations11.ts +++ /dev/null @@ -1,4821 +0,0 @@ -import { expect } from 'chai'; -import { ethers } from 'hardhat'; - -import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1'; -import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2'; -import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'; -import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4'; -import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5'; -import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6'; -import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7'; -import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8'; -import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9'; -import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10'; -import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11'; -import { - createInstances, - decrypt4, - decrypt8, - decrypt16, - decrypt32, - decrypt64, - decrypt128, - decrypt256, - decryptBool, -} from '../instance'; -import { getSigners, initSigners } from '../signers'; - -async function deployTfheTestFixture1(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture2(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture3(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture4(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture5(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture6(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture7(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite7'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture8(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite8'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture9(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite9'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture10(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite10'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture11(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite11'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -describe('TFHE operations 11', function () { - before(async function () { - await initSigners(1); - this.signers = await getSigners(); - - const contract1 = await deployTfheTestFixture1(); - this.contract1Address = await contract1.getAddress(); - this.contract1 = contract1; - - const contract2 = await deployTfheTestFixture2(); - this.contract2Address = await contract2.getAddress(); - this.contract2 = contract2; - - const contract3 = await deployTfheTestFixture3(); - this.contract3Address = await contract3.getAddress(); - this.contract3 = contract3; - - const contract4 = await deployTfheTestFixture4(); - this.contract4Address = await contract4.getAddress(); - this.contract4 = contract4; - - const contract5 = await deployTfheTestFixture5(); - this.contract5Address = await contract5.getAddress(); - this.contract5 = contract5; - - const contract6 = await deployTfheTestFixture6(); - this.contract6Address = await contract6.getAddress(); - this.contract6 = contract6; - - const contract7 = await deployTfheTestFixture7(); - this.contract7Address = await contract7.getAddress(); - this.contract7 = contract7; - - const contract8 = await deployTfheTestFixture8(); - this.contract8Address = await contract8.getAddress(); - this.contract8 = contract8; - - const contract9 = await deployTfheTestFixture9(); - this.contract9Address = await contract9.getAddress(); - this.contract9 = contract9; - - const contract10 = await deployTfheTestFixture10(); - this.contract10Address = await contract10.getAddress(); - this.contract10 = contract10; - - const contract11 = await deployTfheTestFixture11(); - this.contract11Address = await contract11.getAddress(); - this.contract11 = contract11; - - const instances = await createInstances(this.signers); - this.instances = instances; - }); - - it('test operator "or" overload (euint256, euint16) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582624616109811381, 9754)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457582624616109811381n); - input.add16(9754n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457582624616109811391n); - }); - - it('test operator "or" overload (euint256, euint16) => euint256 test 2 (9750, 9754)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(9750n); - input.add16(9754n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(9758n); - }); - - it('test operator "or" overload (euint256, euint16) => euint256 test 3 (9754, 9754)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(9754n); - input.add16(9754n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(9754n); - }); - - it('test operator "or" overload (euint256, euint16) => euint256 test 4 (9754, 9750)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(9754n); - input.add16(9750n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.or_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(9758n); - }); - - it('test operator "xor" overload (euint256, euint16) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457583698273346637887, 24298)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457583698273346637887n); - input.add16(24298n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457583698273346621141n); - }); - - it('test operator "xor" overload (euint256, euint16) => euint256 test 2 (24294, 24298)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(24294n); - input.add16(24298n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint256, euint16) => euint256 test 3 (24298, 24298)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(24298n); - input.add16(24298n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint256, euint16) => euint256 test 4 (24298, 24294)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(24298n); - input.add16(24294n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.xor_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(12n); - }); - - it('test operator "eq" overload (euint256, euint16) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457581937945784624293, 42555)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581937945784624293n); - input.add16(42555n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint256, euint16) => ebool test 2 (42551, 42555)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(42551n); - input.add16(42555n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint256, euint16) => ebool test 3 (42555, 42555)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(42555n); - input.add16(42555n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint256, euint16) => ebool test 4 (42555, 42551)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(42555n); - input.add16(42551n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.eq_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint256, euint16) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457575904968867077761, 30382)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457575904968867077761n); - input.add16(30382n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint256, euint16) => ebool test 2 (30378, 30382)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(30378n); - input.add16(30382n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint256, euint16) => ebool test 3 (30382, 30382)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(30382n); - input.add16(30382n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint256, euint16) => ebool test 4 (30382, 30378)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(30382n); - input.add16(30378n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ne_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, euint16) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457575882393460599321, 29301)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457575882393460599321n); - input.add16(29301n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, euint16) => ebool test 2 (29297, 29301)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(29297n); - input.add16(29301n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint256, euint16) => ebool test 3 (29301, 29301)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(29301n); - input.add16(29301n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, euint16) => ebool test 4 (29301, 29297)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(29301n); - input.add16(29297n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.ge_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint256, euint16) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457580207253841161561, 59068)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457580207253841161561n); - input.add16(59068n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint256, euint16) => ebool test 2 (59064, 59068)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(59064n); - input.add16(59068n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint256, euint16) => ebool test 3 (59068, 59068)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(59068n); - input.add16(59068n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint256, euint16) => ebool test 4 (59068, 59064)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(59068n); - input.add16(59064n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.gt_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint16) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457582351250639102167, 47994)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457582351250639102167n); - input.add16(47994n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint256, euint16) => ebool test 2 (47990, 47994)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(47990n); - input.add16(47994n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint16) => ebool test 3 (47994, 47994)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(47994n); - input.add16(47994n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint16) => ebool test 4 (47994, 47990)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(47994n); - input.add16(47990n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.le_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint16) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457581793657869781609, 60020)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581793657869781609n); - input.add16(60020n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint16) => ebool test 2 (60016, 60020)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(60016n); - input.add16(60020n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint256, euint16) => ebool test 3 (60020, 60020)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(60020n); - input.add16(60020n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint16) => ebool test 4 (60020, 60016)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(60020n); - input.add16(60016n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.lt_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract9.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint256, euint16) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579076951559173157, 24679)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579076951559173157n); - input.add16(24679n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(24679n); - }); - - it('test operator "min" overload (euint256, euint16) => euint256 test 2 (24675, 24679)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(24675n); - input.add16(24679n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(24675n); - }); - - it('test operator "min" overload (euint256, euint16) => euint256 test 3 (24679, 24679)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(24679n); - input.add16(24679n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(24679n); - }); - - it('test operator "min" overload (euint256, euint16) => euint256 test 4 (24679, 24675)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(24679n); - input.add16(24675n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.min_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(24675n); - }); - - it('test operator "max" overload (euint256, euint16) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457580891899920920375, 31998)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457580891899920920375n); - input.add16(31998n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457580891899920920375n); - }); - - it('test operator "max" overload (euint256, euint16) => euint256 test 2 (31994, 31998)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(31994n); - input.add16(31998n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(31998n); - }); - - it('test operator "max" overload (euint256, euint16) => euint256 test 3 (31998, 31998)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(31998n); - input.add16(31998n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(31998n); - }); - - it('test operator "max" overload (euint256, euint16) => euint256 test 4 (31998, 31994)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract9Address, this.signers.alice.address); - input.add256(31998n); - input.add16(31994n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract9.max_euint256_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract9.res256()); - expect(res).to.equal(31998n); - }); - - it('test operator "add" overload (euint256, euint32) => euint256 test 1 (2147483649, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(2147483649n); - input.add32(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(2147483651n); - }); - - it('test operator "add" overload (euint256, euint32) => euint256 test 2 (1298573356, 1298573358)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(1298573356n); - input.add32(1298573358n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(2597146714n); - }); - - it('test operator "add" overload (euint256, euint32) => euint256 test 3 (1298573358, 1298573358)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(1298573358n); - input.add32(1298573358n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(2597146716n); - }); - - it('test operator "add" overload (euint256, euint32) => euint256 test 4 (1298573358, 1298573356)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(1298573358n); - input.add32(1298573356n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(2597146714n); - }); - - it('test operator "sub" overload (euint256, euint32) => euint256 test 1 (2775500374, 2775500374)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(2775500374n); - input.add32(2775500374n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.sub_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint256, euint32) => euint256 test 2 (2775500374, 2775500370)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(2775500374n); - input.add32(2775500370n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.sub_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint256, euint32) => euint256 test 1 (1073741825, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(1073741825n); - input.add32(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(2147483650n); - }); - - it('test operator "mul" overload (euint256, euint32) => euint256 test 2 (60165, 60165)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(60165n); - input.add32(60165n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(3619827225n); - }); - - it('test operator "mul" overload (euint256, euint32) => euint256 test 3 (60165, 60165)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(60165n); - input.add32(60165n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(3619827225n); - }); - - it('test operator "mul" overload (euint256, euint32) => euint256 test 4 (60165, 60165)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(60165n); - input.add32(60165n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(3619827225n); - }); - - it('test operator "and" overload (euint256, euint32) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579114687562092581, 2312861009)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579114687562092581n); - input.add32(2312861009n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(1642497n); - }); - - it('test operator "and" overload (euint256, euint32) => euint256 test 2 (2312861005, 2312861009)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(2312861005n); - input.add32(2312861009n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(2312860993n); - }); - - it('test operator "and" overload (euint256, euint32) => euint256 test 3 (2312861009, 2312861009)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(2312861009n); - input.add32(2312861009n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(2312861009n); - }); - - it('test operator "and" overload (euint256, euint32) => euint256 test 4 (2312861009, 2312861005)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(2312861009n); - input.add32(2312861005n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(2312860993n); - }); - - it('test operator "or" overload (euint256, euint32) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457577374322978195673, 2490018786)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577374322978195673n); - input.add32(2490018786n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577374323247328251n); - }); - - it('test operator "or" overload (euint256, euint32) => euint256 test 2 (2490018782, 2490018786)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(2490018782n); - input.add32(2490018786n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(2490018814n); - }); - - it('test operator "or" overload (euint256, euint32) => euint256 test 3 (2490018786, 2490018786)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(2490018786n); - input.add32(2490018786n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(2490018786n); - }); - - it('test operator "or" overload (euint256, euint32) => euint256 test 4 (2490018786, 2490018782)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(2490018786n); - input.add32(2490018782n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(2490018814n); - }); - - it('test operator "xor" overload (euint256, euint32) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457575870021368542809, 1137098251)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457575870021368542809n); - input.add32(1137098251n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457575870020349413458n); - }); - - it('test operator "xor" overload (euint256, euint32) => euint256 test 2 (1137098247, 1137098251)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(1137098247n); - input.add32(1137098251n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint256, euint32) => euint256 test 3 (1137098251, 1137098251)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(1137098251n); - input.add32(1137098251n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint256, euint32) => euint256 test 4 (1137098251, 1137098247)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(1137098251n); - input.add32(1137098247n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(12n); - }); - - it('test operator "eq" overload (euint256, euint32) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457580556825298662935, 2172668277)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457580556825298662935n); - input.add32(2172668277n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint256, euint32) => ebool test 2 (2172668273, 2172668277)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(2172668273n); - input.add32(2172668277n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint256, euint32) => ebool test 3 (2172668277, 2172668277)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(2172668277n); - input.add32(2172668277n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint256, euint32) => ebool test 4 (2172668277, 2172668273)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(2172668277n); - input.add32(2172668273n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint256, euint32) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457583230004924210357, 3013060698)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457583230004924210357n); - input.add32(3013060698n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint256, euint32) => ebool test 2 (3013060694, 3013060698)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(3013060694n); - input.add32(3013060698n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint256, euint32) => ebool test 3 (3013060698, 3013060698)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(3013060698n); - input.add32(3013060698n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint256, euint32) => ebool test 4 (3013060698, 3013060694)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(3013060698n); - input.add32(3013060694n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, euint32) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457576727756037416977, 2466446241)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457576727756037416977n); - input.add32(2466446241n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, euint32) => ebool test 2 (2466446237, 2466446241)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(2466446237n); - input.add32(2466446241n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint256, euint32) => ebool test 3 (2466446241, 2466446241)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(2466446241n); - input.add32(2466446241n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, euint32) => ebool test 4 (2466446241, 2466446237)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(2466446241n); - input.add32(2466446237n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint256, euint32) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457580729313167530831, 902297828)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457580729313167530831n); - input.add32(902297828n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint256, euint32) => ebool test 2 (902297824, 902297828)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(902297824n); - input.add32(902297828n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint256, euint32) => ebool test 3 (902297828, 902297828)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(902297828n); - input.add32(902297828n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint256, euint32) => ebool test 4 (902297828, 902297824)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(902297828n); - input.add32(902297824n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint32) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457582845443410851747, 1340548693)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457582845443410851747n); - input.add32(1340548693n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint256, euint32) => ebool test 2 (1340548689, 1340548693)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(1340548689n); - input.add32(1340548693n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint32) => ebool test 3 (1340548693, 1340548693)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(1340548693n); - input.add32(1340548693n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint32) => ebool test 4 (1340548693, 1340548689)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(1340548693n); - input.add32(1340548689n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint32) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457577148837567008665, 1716202338)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577148837567008665n); - input.add32(1716202338n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint32) => ebool test 2 (1716202334, 1716202338)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(1716202334n); - input.add32(1716202338n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint256, euint32) => ebool test 3 (1716202338, 1716202338)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(1716202338n); - input.add32(1716202338n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint32) => ebool test 4 (1716202338, 1716202334)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(1716202338n); - input.add32(1716202334n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint256, euint32) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582240718630307135, 1248940496)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457582240718630307135n); - input.add32(1248940496n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(1248940496n); - }); - - it('test operator "min" overload (euint256, euint32) => euint256 test 2 (1248940492, 1248940496)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(1248940492n); - input.add32(1248940496n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(1248940492n); - }); - - it('test operator "min" overload (euint256, euint32) => euint256 test 3 (1248940496, 1248940496)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(1248940496n); - input.add32(1248940496n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(1248940496n); - }); - - it('test operator "min" overload (euint256, euint32) => euint256 test 4 (1248940496, 1248940492)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(1248940496n); - input.add32(1248940492n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(1248940492n); - }); - - it('test operator "max" overload (euint256, euint32) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457581701635304814489, 4274177144)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581701635304814489n); - input.add32(4274177144n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457581701635304814489n); - }); - - it('test operator "max" overload (euint256, euint32) => euint256 test 2 (4274177140, 4274177144)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(4274177140n); - input.add32(4274177144n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(4274177144n); - }); - - it('test operator "max" overload (euint256, euint32) => euint256 test 3 (4274177144, 4274177144)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(4274177144n); - input.add32(4274177144n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(4274177144n); - }); - - it('test operator "max" overload (euint256, euint32) => euint256 test 4 (4274177144, 4274177140)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(4274177144n); - input.add32(4274177140n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_euint256_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(4274177144n); - }); - - it('test operator "add" overload (euint256, euint64) => euint256 test 1 (9223372036854775809, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(9223372036854775809n); - input.add64(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(9223372036854775811n); - }); - - it('test operator "add" overload (euint256, euint64) => euint256 test 2 (9220748041203345234, 9220748041203345236)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(9220748041203345234n); - input.add64(9220748041203345236n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(18441496082406690470n); - }); - - it('test operator "add" overload (euint256, euint64) => euint256 test 3 (9220748041203345236, 9220748041203345236)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(9220748041203345236n); - input.add64(9220748041203345236n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(18441496082406690472n); - }); - - it('test operator "add" overload (euint256, euint64) => euint256 test 4 (9220748041203345236, 9220748041203345234)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(9220748041203345236n); - input.add64(9220748041203345234n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(18441496082406690470n); - }); - - it('test operator "sub" overload (euint256, euint64) => euint256 test 1 (18445296154698553701, 18445296154698553701)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18445296154698553701n); - input.add64(18445296154698553701n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.sub_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint256, euint64) => euint256 test 2 (18445296154698553701, 18445296154698553697)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18445296154698553701n); - input.add64(18445296154698553697n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.sub_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint256, euint64) => euint256 test 1 (4611686018427387905, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(4611686018427387905n); - input.add64(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(9223372036854775810n); - }); - - it('test operator "mul" overload (euint256, euint64) => euint256 test 2 (4292912378, 4292912378)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(4292912378n); - input.add64(4292912378n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(18429096685185614884n); - }); - - it('test operator "mul" overload (euint256, euint64) => euint256 test 3 (4292912378, 4292912378)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(4292912378n); - input.add64(4292912378n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(18429096685185614884n); - }); - - it('test operator "mul" overload (euint256, euint64) => euint256 test 4 (4292912378, 4292912378)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(4292912378n); - input.add64(4292912378n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(18429096685185614884n); - }); - - it('test operator "and" overload (euint256, euint64) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457578396814970518645, 18439393076952901085)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457578396814970518645n); - input.add64(18439393076952901085n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(18438862826454918229n); - }); - - it('test operator "and" overload (euint256, euint64) => euint256 test 2 (18439393076952901081, 18439393076952901085)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18439393076952901081n); - input.add64(18439393076952901085n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(18439393076952901081n); - }); - - it('test operator "and" overload (euint256, euint64) => euint256 test 3 (18439393076952901085, 18439393076952901085)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18439393076952901085n); - input.add64(18439393076952901085n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(18439393076952901085n); - }); - - it('test operator "and" overload (euint256, euint64) => euint256 test 4 (18439393076952901085, 18439393076952901081)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18439393076952901085n); - input.add64(18439393076952901081n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(18439393076952901081n); - }); - - it('test operator "or" overload (euint256, euint64) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457575138878497255467, 18441296418739792919)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457575138878497255467n); - input.add64(18441296418739792919n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457578657599316786239n); - }); - - it('test operator "or" overload (euint256, euint64) => euint256 test 2 (18441296418739792915, 18441296418739792919)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18441296418739792915n); - input.add64(18441296418739792919n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(18441296418739792919n); - }); - - it('test operator "or" overload (euint256, euint64) => euint256 test 3 (18441296418739792919, 18441296418739792919)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18441296418739792919n); - input.add64(18441296418739792919n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(18441296418739792919n); - }); - - it('test operator "or" overload (euint256, euint64) => euint256 test 4 (18441296418739792919, 18441296418739792915)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18441296418739792919n); - input.add64(18441296418739792915n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(18441296418739792919n); - }); - - it('test operator "xor" overload (euint256, euint64) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457581449682348833995, 18444753228810258299)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581449682348833995n); - input.add64(18444753228810258299n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039439141209004043664304n); - }); - - it('test operator "xor" overload (euint256, euint64) => euint256 test 2 (18444753228810258295, 18444753228810258299)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18444753228810258295n); - input.add64(18444753228810258299n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint256, euint64) => euint256 test 3 (18444753228810258299, 18444753228810258299)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18444753228810258299n); - input.add64(18444753228810258299n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint256, euint64) => euint256 test 4 (18444753228810258299, 18444753228810258295)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18444753228810258299n); - input.add64(18444753228810258295n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(12n); - }); - - it('test operator "eq" overload (euint256, euint64) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457579655327337947495, 18438962761364358079)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579655327337947495n); - input.add64(18438962761364358079n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint256, euint64) => ebool test 2 (18438962761364358075, 18438962761364358079)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18438962761364358075n); - input.add64(18438962761364358079n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint256, euint64) => ebool test 3 (18438962761364358079, 18438962761364358079)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18438962761364358079n); - input.add64(18438962761364358079n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint256, euint64) => ebool test 4 (18438962761364358079, 18438962761364358075)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18438962761364358079n); - input.add64(18438962761364358075n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint256, euint64) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457578997655721966093, 18437968835725654059)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457578997655721966093n); - input.add64(18437968835725654059n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint256, euint64) => ebool test 2 (18437968835725654055, 18437968835725654059)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18437968835725654055n); - input.add64(18437968835725654059n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint256, euint64) => ebool test 3 (18437968835725654059, 18437968835725654059)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18437968835725654059n); - input.add64(18437968835725654059n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint256, euint64) => ebool test 4 (18437968835725654059, 18437968835725654055)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18437968835725654059n); - input.add64(18437968835725654055n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, euint64) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457577778171434629241, 18443676400252575763)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577778171434629241n); - input.add64(18443676400252575763n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, euint64) => ebool test 2 (18443676400252575759, 18443676400252575763)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18443676400252575759n); - input.add64(18443676400252575763n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint256, euint64) => ebool test 3 (18443676400252575763, 18443676400252575763)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18443676400252575763n); - input.add64(18443676400252575763n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, euint64) => ebool test 4 (18443676400252575763, 18443676400252575759)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18443676400252575763n); - input.add64(18443676400252575759n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint256, euint64) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457582386276584123553, 18443192077233247397)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457582386276584123553n); - input.add64(18443192077233247397n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint256, euint64) => ebool test 2 (18443192077233247393, 18443192077233247397)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18443192077233247393n); - input.add64(18443192077233247397n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint256, euint64) => ebool test 3 (18443192077233247397, 18443192077233247397)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18443192077233247397n); - input.add64(18443192077233247397n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint256, euint64) => ebool test 4 (18443192077233247397, 18443192077233247393)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18443192077233247397n); - input.add64(18443192077233247393n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint64) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457576194967854445761, 18441295092771573001)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457576194967854445761n); - input.add64(18441295092771573001n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint256, euint64) => ebool test 2 (18441295092771572997, 18441295092771573001)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18441295092771572997n); - input.add64(18441295092771573001n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint64) => ebool test 3 (18441295092771573001, 18441295092771573001)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18441295092771573001n); - input.add64(18441295092771573001n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint64) => ebool test 4 (18441295092771573001, 18441295092771572997)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18441295092771573001n); - input.add64(18441295092771572997n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint64) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457577348858503949249, 18446356831740760619)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577348858503949249n); - input.add64(18446356831740760619n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint64) => ebool test 2 (18446356831740760615, 18446356831740760619)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18446356831740760615n); - input.add64(18446356831740760619n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint256, euint64) => ebool test 3 (18446356831740760619, 18446356831740760619)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18446356831740760619n); - input.add64(18446356831740760619n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint64) => ebool test 4 (18446356831740760619, 18446356831740760615)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18446356831740760619n); - input.add64(18446356831740760615n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint256, euint64) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579813847565218665, 18443636668516069273)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579813847565218665n); - input.add64(18443636668516069273n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(18443636668516069273n); - }); - - it('test operator "min" overload (euint256, euint64) => euint256 test 2 (18443636668516069269, 18443636668516069273)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18443636668516069269n); - input.add64(18443636668516069273n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(18443636668516069269n); - }); - - it('test operator "min" overload (euint256, euint64) => euint256 test 3 (18443636668516069273, 18443636668516069273)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18443636668516069273n); - input.add64(18443636668516069273n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(18443636668516069273n); - }); - - it('test operator "min" overload (euint256, euint64) => euint256 test 4 (18443636668516069273, 18443636668516069269)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18443636668516069273n); - input.add64(18443636668516069269n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(18443636668516069269n); - }); - - it('test operator "max" overload (euint256, euint64) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457583257576614099953, 18438250957457099341)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457583257576614099953n); - input.add64(18438250957457099341n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457583257576614099953n); - }); - - it('test operator "max" overload (euint256, euint64) => euint256 test 2 (18438250957457099337, 18438250957457099341)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18438250957457099337n); - input.add64(18438250957457099341n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(18438250957457099341n); - }); - - it('test operator "max" overload (euint256, euint64) => euint256 test 3 (18438250957457099341, 18438250957457099341)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18438250957457099341n); - input.add64(18438250957457099341n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(18438250957457099341n); - }); - - it('test operator "max" overload (euint256, euint64) => euint256 test 4 (18438250957457099341, 18438250957457099337)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(18438250957457099341n); - input.add64(18438250957457099337n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_euint256_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(18438250957457099341n); - }); - - it('test operator "add" overload (euint256, euint128) => euint256 test 1 (170141183460469231731687303715884105729, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(170141183460469231731687303715884105729n); - input.add128(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(170141183460469231731687303715884105731n); - }); - - it('test operator "add" overload (euint256, euint128) => euint256 test 2 (170141183460469231731684278054029333276, 170141183460469231731684278054029333278)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(170141183460469231731684278054029333276n); - input.add128(170141183460469231731684278054029333278n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(340282366920938463463368556108058666554n); - }); - - it('test operator "add" overload (euint256, euint128) => euint256 test 3 (170141183460469231731684278054029333278, 170141183460469231731684278054029333278)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(170141183460469231731684278054029333278n); - input.add128(170141183460469231731684278054029333278n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(340282366920938463463368556108058666556n); - }); - - it('test operator "add" overload (euint256, euint128) => euint256 test 4 (170141183460469231731684278054029333278, 170141183460469231731684278054029333276)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(170141183460469231731684278054029333278n); - input.add128(170141183460469231731684278054029333276n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(340282366920938463463368556108058666554n); - }); - - it('test operator "sub" overload (euint256, euint128) => euint256 test 1 (340282366920938463463373776145256730539, 340282366920938463463373776145256730539)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463373776145256730539n); - input.add128(340282366920938463463373776145256730539n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.sub_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint256, euint128) => euint256 test 2 (340282366920938463463373776145256730539, 340282366920938463463373776145256730535)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463373776145256730539n); - input.add128(340282366920938463463373776145256730535n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.sub_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint256, euint128) => euint256 test 1 (85070591730234615865843651857942052865, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(85070591730234615865843651857942052865n); - input.add128(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(170141183460469231731687303715884105730n); - }); - - it('test operator "mul" overload (euint256, euint128) => euint256 test 2 (9223372036854775809, 9223372036854775809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(9223372036854775809n); - input.add128(9223372036854775809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(85070591730234615884290395931651604481n); - }); - - it('test operator "mul" overload (euint256, euint128) => euint256 test 3 (9223372036854775809, 9223372036854775809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(9223372036854775809n); - input.add128(9223372036854775809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(85070591730234615884290395931651604481n); - }); - - it('test operator "mul" overload (euint256, euint128) => euint256 test 4 (9223372036854775809, 9223372036854775809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(9223372036854775809n); - input.add128(9223372036854775809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(85070591730234615884290395931651604481n); - }); - - it('test operator "and" overload (euint256, euint128) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582929951159672455, 340282366920938463463365847322826293787)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457582929951159672455n); - input.add128(340282366920938463463365847322826293787n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(340282366920938463463365636070292242947n); - }); - - it('test operator "and" overload (euint256, euint128) => euint256 test 2 (340282366920938463463365847322826293783, 340282366920938463463365847322826293787)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463365847322826293783n); - input.add128(340282366920938463463365847322826293787n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(340282366920938463463365847322826293779n); - }); - - it('test operator "and" overload (euint256, euint128) => euint256 test 3 (340282366920938463463365847322826293787, 340282366920938463463365847322826293787)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463365847322826293787n); - input.add128(340282366920938463463365847322826293787n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(340282366920938463463365847322826293787n); - }); - - it('test operator "and" overload (euint256, euint128) => euint256 test 4 (340282366920938463463365847322826293787, 340282366920938463463365847322826293783)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463365847322826293787n); - input.add128(340282366920938463463365847322826293783n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(340282366920938463463365847322826293779n); - }); - - it('test operator "or" overload (euint256, euint128) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457581776378743047187, 340282366920938463463373551062299472959)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581776378743047187n); - input.add128(340282366920938463463373551062299472959n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457582951827808547903n); - }); - - it('test operator "or" overload (euint256, euint128) => euint256 test 2 (340282366920938463463373551062299472955, 340282366920938463463373551062299472959)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463373551062299472955n); - input.add128(340282366920938463463373551062299472959n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(340282366920938463463373551062299472959n); - }); - - it('test operator "or" overload (euint256, euint128) => euint256 test 3 (340282366920938463463373551062299472959, 340282366920938463463373551062299472959)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463373551062299472959n); - input.add128(340282366920938463463373551062299472959n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(340282366920938463463373551062299472959n); - }); - - it('test operator "or" overload (euint256, euint128) => euint256 test 4 (340282366920938463463373551062299472959, 340282366920938463463373551062299472955)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463373551062299472959n); - input.add128(340282366920938463463373551062299472955n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(340282366920938463463373551062299472959n); - }); - - it('test operator "xor" overload (euint256, euint128) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582608158223098943, 340282366920938463463373070389452427715)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457582608158223098943n); - input.add128(340282366920938463463373070389452427715n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907852929702298719625575994209836984672105980n); - }); - - it('test operator "xor" overload (euint256, euint128) => euint256 test 2 (340282366920938463463373070389452427711, 340282366920938463463373070389452427715)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463373070389452427711n); - input.add128(340282366920938463463373070389452427715n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(124n); - }); - - it('test operator "xor" overload (euint256, euint128) => euint256 test 3 (340282366920938463463373070389452427715, 340282366920938463463373070389452427715)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463373070389452427715n); - input.add128(340282366920938463463373070389452427715n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint256, euint128) => euint256 test 4 (340282366920938463463373070389452427715, 340282366920938463463373070389452427711)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463373070389452427715n); - input.add128(340282366920938463463373070389452427711n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(124n); - }); - - it('test operator "eq" overload (euint256, euint128) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457583147947133304483, 340282366920938463463373080930672512019)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457583147947133304483n); - input.add128(340282366920938463463373080930672512019n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint256, euint128) => ebool test 2 (340282366920938463463373080930672512015, 340282366920938463463373080930672512019)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463373080930672512015n); - input.add128(340282366920938463463373080930672512019n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint256, euint128) => ebool test 3 (340282366920938463463373080930672512019, 340282366920938463463373080930672512019)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463373080930672512019n); - input.add128(340282366920938463463373080930672512019n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint256, euint128) => ebool test 4 (340282366920938463463373080930672512019, 340282366920938463463373080930672512015)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463373080930672512019n); - input.add128(340282366920938463463373080930672512015n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint256, euint128) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457576673614745401783, 340282366920938463463373230674573043227)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457576673614745401783n); - input.add128(340282366920938463463373230674573043227n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint256, euint128) => ebool test 2 (340282366920938463463373230674573043223, 340282366920938463463373230674573043227)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463373230674573043223n); - input.add128(340282366920938463463373230674573043227n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint256, euint128) => ebool test 3 (340282366920938463463373230674573043227, 340282366920938463463373230674573043227)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463373230674573043227n); - input.add128(340282366920938463463373230674573043227n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint256, euint128) => ebool test 4 (340282366920938463463373230674573043227, 340282366920938463463373230674573043223)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463373230674573043227n); - input.add128(340282366920938463463373230674573043223n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, euint128) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457581781091933664799, 340282366920938463463369397462507033255)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581781091933664799n); - input.add128(340282366920938463463369397462507033255n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, euint128) => ebool test 2 (340282366920938463463369397462507033251, 340282366920938463463369397462507033255)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463369397462507033251n); - input.add128(340282366920938463463369397462507033255n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint256, euint128) => ebool test 3 (340282366920938463463369397462507033255, 340282366920938463463369397462507033255)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463369397462507033255n); - input.add128(340282366920938463463369397462507033255n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, euint128) => ebool test 4 (340282366920938463463369397462507033255, 340282366920938463463369397462507033251)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463369397462507033255n); - input.add128(340282366920938463463369397462507033251n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint256, euint128) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457583305927195076375, 340282366920938463463370153073900549113)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457583305927195076375n); - input.add128(340282366920938463463370153073900549113n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint256, euint128) => ebool test 2 (340282366920938463463370153073900549109, 340282366920938463463370153073900549113)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463370153073900549109n); - input.add128(340282366920938463463370153073900549113n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint256, euint128) => ebool test 3 (340282366920938463463370153073900549113, 340282366920938463463370153073900549113)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463370153073900549113n); - input.add128(340282366920938463463370153073900549113n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint256, euint128) => ebool test 4 (340282366920938463463370153073900549113, 340282366920938463463370153073900549109)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463370153073900549113n); - input.add128(340282366920938463463370153073900549109n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint128) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457580916980779426235, 340282366920938463463367434270493244717)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457580916980779426235n); - input.add128(340282366920938463463367434270493244717n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint256, euint128) => ebool test 2 (340282366920938463463367434270493244713, 340282366920938463463367434270493244717)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463367434270493244713n); - input.add128(340282366920938463463367434270493244717n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint128) => ebool test 3 (340282366920938463463367434270493244717, 340282366920938463463367434270493244717)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463367434270493244717n); - input.add128(340282366920938463463367434270493244717n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint128) => ebool test 4 (340282366920938463463367434270493244717, 340282366920938463463367434270493244713)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463367434270493244717n); - input.add128(340282366920938463463367434270493244713n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint128) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457582200169426284819, 340282366920938463463367486483424293599)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457582200169426284819n); - input.add128(340282366920938463463367486483424293599n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint128) => ebool test 2 (340282366920938463463367486483424293595, 340282366920938463463367486483424293599)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463367486483424293595n); - input.add128(340282366920938463463367486483424293599n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint256, euint128) => ebool test 3 (340282366920938463463367486483424293599, 340282366920938463463367486483424293599)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463367486483424293599n); - input.add128(340282366920938463463367486483424293599n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint128) => ebool test 4 (340282366920938463463367486483424293599, 340282366920938463463367486483424293595)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463367486483424293599n); - input.add128(340282366920938463463367486483424293595n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint256, euint128) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457578748486524440321, 340282366920938463463370032475222092647)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457578748486524440321n); - input.add128(340282366920938463463370032475222092647n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(340282366920938463463370032475222092647n); - }); - - it('test operator "min" overload (euint256, euint128) => euint256 test 2 (340282366920938463463370032475222092643, 340282366920938463463370032475222092647)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463370032475222092643n); - input.add128(340282366920938463463370032475222092647n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(340282366920938463463370032475222092643n); - }); - - it('test operator "min" overload (euint256, euint128) => euint256 test 3 (340282366920938463463370032475222092647, 340282366920938463463370032475222092647)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463370032475222092647n); - input.add128(340282366920938463463370032475222092647n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(340282366920938463463370032475222092647n); - }); - - it('test operator "min" overload (euint256, euint128) => euint256 test 4 (340282366920938463463370032475222092647, 340282366920938463463370032475222092643)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463370032475222092647n); - input.add128(340282366920938463463370032475222092643n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(340282366920938463463370032475222092643n); - }); - - it('test operator "max" overload (euint256, euint128) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457580295384680552043, 340282366920938463463368511201134180813)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457580295384680552043n); - input.add128(340282366920938463463368511201134180813n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457580295384680552043n); - }); - - it('test operator "max" overload (euint256, euint128) => euint256 test 2 (340282366920938463463368511201134180809, 340282366920938463463368511201134180813)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463368511201134180809n); - input.add128(340282366920938463463368511201134180813n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(340282366920938463463368511201134180813n); - }); - - it('test operator "max" overload (euint256, euint128) => euint256 test 3 (340282366920938463463368511201134180813, 340282366920938463463368511201134180813)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463368511201134180813n); - input.add128(340282366920938463463368511201134180813n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(340282366920938463463368511201134180813n); - }); - - it('test operator "max" overload (euint256, euint128) => euint256 test 4 (340282366920938463463368511201134180813, 340282366920938463463368511201134180809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(340282366920938463463368511201134180813n); - input.add128(340282366920938463463368511201134180809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_euint256_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(340282366920938463463368511201134180813n); - }); - - it('test operator "add" overload (euint256, euint256) => euint256 test 1 (57896044618658097711785492504343953926634992332820282019728789013802824080146, 57896044618658097711785492504343953926634992332820282019728788109485910742180)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(57896044618658097711785492504343953926634992332820282019728789013802824080146n); - input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742180n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577123288734822326n); - }); - - it('test operator "add" overload (euint256, euint256) => euint256 test 2 (57896044618658097711785492504343953926634992332820282019728788109485910742178, 57896044618658097711785492504343953926634992332820282019728788109485910742180)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742178n); - input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742180n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484358n); - }); - - it('test operator "add" overload (euint256, euint256) => euint256 test 3 (57896044618658097711785492504343953926634992332820282019728788109485910742180, 57896044618658097711785492504343953926634992332820282019728788109485910742180)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742180n); - input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742180n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484360n); - }); - - it('test operator "add" overload (euint256, euint256) => euint256 test 4 (57896044618658097711785492504343953926634992332820282019728788109485910742180, 57896044618658097711785492504343953926634992332820282019728788109485910742178)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742180n); - input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742178n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484358n); - }); - - it('test operator "sub" overload (euint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579667871013646565, 115792089237316195423570985008687907853269984665640564039457579667871013646565)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579667871013646565n); - input.add256(115792089237316195423570985008687907853269984665640564039457579667871013646565n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.sub_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457579667871013646565, 115792089237316195423570985008687907853269984665640564039457579667871013646561)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579667871013646565n); - input.add256(115792089237316195423570985008687907853269984665640564039457579667871013646561n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.sub_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint256, euint256) => euint256 test 1 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(170141183460469231731687303715884105729n); - input.add256(170141183460469231731687303715884105729n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); - }); - - it('test operator "mul" overload (euint256, euint256) => euint256 test 2 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(170141183460469231731687303715884105729n); - input.add256(170141183460469231731687303715884105729n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); - }); - - it('test operator "mul" overload (euint256, euint256) => euint256 test 3 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(170141183460469231731687303715884105729n); - input.add256(170141183460469231731687303715884105729n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); - }); - - it('test operator "mul" overload (euint256, euint256) => euint256 test 4 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(170141183460469231731687303715884105729n); - input.add256(170141183460469231731687303715884105729n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); - }); - - it('test operator "and" overload (euint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457580473854578773963, 115792089237316195423570985008687907853269984665640564039457579064265044491325)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457580473854578773963n); - input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491325n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457575671150140541961n); - }); - - it('test operator "and" overload (euint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457579064265044491321, 115792089237316195423570985008687907853269984665640564039457579064265044491325)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491321n); - input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491325n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491321n); - }); - - it('test operator "and" overload (euint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457579064265044491325, 115792089237316195423570985008687907853269984665640564039457579064265044491325)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491325n); - input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491325n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491325n); - }); - - it('test operator "and" overload (euint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457579064265044491325, 115792089237316195423570985008687907853269984665640564039457579064265044491321)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491325n); - input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491321n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491321n); - }); - - it('test operator "or" overload (euint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579093390716184697, 115792089237316195423570985008687907853269984665640564039457580393822758166581)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184697n); - input.add256(115792089237316195423570985008687907853269984665640564039457580393822758166581n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457583914753535699069n); - }); - - it('test operator "or" overload (euint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457579093390716184693, 115792089237316195423570985008687907853269984665640564039457579093390716184697)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184693n); - input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184697n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184701n); - }); - - it('test operator "or" overload (euint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457579093390716184697, 115792089237316195423570985008687907853269984665640564039457579093390716184697)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184697n); - input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184697n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184697n); - }); - - it('test operator "or" overload (euint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457579093390716184697, 115792089237316195423570985008687907853269984665640564039457579093390716184693)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184697n); - input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184693n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184701n); - }); - - it('test operator "xor" overload (euint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582495469225451093, 115792089237316195423570985008687907853269984665640564039457581801761034193859)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457582495469225451093n); - input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193859n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(714633272808854n); - }); - - it('test operator "xor" overload (euint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457581801761034193855, 115792089237316195423570985008687907853269984665640564039457581801761034193859)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193855n); - input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193859n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(124n); - }); - - it('test operator "xor" overload (euint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457581801761034193859, 115792089237316195423570985008687907853269984665640564039457581801761034193859)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193859n); - input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193859n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457581801761034193859, 115792089237316195423570985008687907853269984665640564039457581801761034193855)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193859n); - input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193855n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(124n); - }); - - it('test operator "eq" overload (euint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457579028937132718443, 115792089237316195423570985008687907853269984665640564039457575281612927984431)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579028937132718443n); - input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984431n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457575281612927984427, 115792089237316195423570985008687907853269984665640564039457575281612927984431)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984427n); - input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984431n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457575281612927984431, 115792089237316195423570985008687907853269984665640564039457575281612927984431)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984431n); - input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984431n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457575281612927984431, 115792089237316195423570985008687907853269984665640564039457575281612927984427)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984431n); - input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984427n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457581421114730215071, 115792089237316195423570985008687907853269984665640564039457577745710288733723)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581421114730215071n); - input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733723n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457577745710288733719, 115792089237316195423570985008687907853269984665640564039457577745710288733723)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733719n); - input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733723n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457577745710288733723, 115792089237316195423570985008687907853269984665640564039457577745710288733723)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733723n); - input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733723n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457577745710288733723, 115792089237316195423570985008687907853269984665640564039457577745710288733719)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733723n); - input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733719n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457579759156646767465, 115792089237316195423570985008687907853269984665640564039457581776880742255263)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767465n); - input.add256(115792089237316195423570985008687907853269984665640564039457581776880742255263n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457579759156646767461, 115792089237316195423570985008687907853269984665640564039457579759156646767465)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767461n); - input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767465n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457579759156646767465, 115792089237316195423570985008687907853269984665640564039457579759156646767465)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767465n); - input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767465n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457579759156646767465, 115792089237316195423570985008687907853269984665640564039457579759156646767461)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767465n); - input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767461n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457580885855005541993, 115792089237316195423570985008687907853269984665640564039457582339622165148199)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541993n); - input.add256(115792089237316195423570985008687907853269984665640564039457582339622165148199n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457580885855005541989, 115792089237316195423570985008687907853269984665640564039457580885855005541993)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541989n); - input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541993n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457580885855005541993, 115792089237316195423570985008687907853269984665640564039457580885855005541993)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541993n); - input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541993n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457580885855005541993, 115792089237316195423570985008687907853269984665640564039457580885855005541989)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541993n); - input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541989n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457583300217912499775, 115792089237316195423570985008687907853269984665640564039457582857952818399809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457583300217912499775n); - input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457582857952818399805, 115792089237316195423570985008687907853269984665640564039457582857952818399809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399805n); - input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457582857952818399809, 115792089237316195423570985008687907853269984665640564039457582857952818399809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399809n); - input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457582857952818399809, 115792089237316195423570985008687907853269984665640564039457582857952818399805)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399809n); - input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399805n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457579345439988102233, 115792089237316195423570985008687907853269984665640564039457575518813902238261)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579345439988102233n); - input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238261n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457575518813902238257, 115792089237316195423570985008687907853269984665640564039457575518813902238261)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238257n); - input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238261n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457575518813902238261, 115792089237316195423570985008687907853269984665640564039457575518813902238261)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238261n); - input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238261n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457575518813902238261, 115792089237316195423570985008687907853269984665640564039457575518813902238257)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238261n); - input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238257n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579091097262441647, 115792089237316195423570985008687907853269984665640564039457577447088911778291)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579091097262441647n); - input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778291n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778291n); - }); - - it('test operator "min" overload (euint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457577447088911778287, 115792089237316195423570985008687907853269984665640564039457577447088911778291)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778287n); - input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778291n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778287n); - }); - - it('test operator "min" overload (euint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457577447088911778291, 115792089237316195423570985008687907853269984665640564039457577447088911778291)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778291n); - input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778291n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778291n); - }); - - it('test operator "min" overload (euint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457577447088911778291, 115792089237316195423570985008687907853269984665640564039457577447088911778287)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778291n); - input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778287n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778287n); - }); - - it('test operator "max" overload (euint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457577915867722108039, 115792089237316195423570985008687907853269984665640564039457577809030115355409)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577915867722108039n); - input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355409n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577915867722108039n); - }); - - it('test operator "max" overload (euint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457577809030115355405, 115792089237316195423570985008687907853269984665640564039457577809030115355409)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355405n); - input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355409n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577809030115355409n); - }); - - it('test operator "max" overload (euint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457577809030115355409, 115792089237316195423570985008687907853269984665640564039457577809030115355409)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355409n); - input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355409n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577809030115355409n); - }); - - it('test operator "max" overload (euint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457577809030115355409, 115792089237316195423570985008687907853269984665640564039457577809030115355405)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355409n); - input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355405n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_euint256_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577809030115355409n); - }); - - it('test operator "add" overload (euint256, uint256) => euint256 test 1 (57896044618658097711785492504343953926634992332820282019728789013802824080146, 57896044618658097711785492504343953926634992332820282019728788733583887971237)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(57896044618658097711785492504343953926634992332820282019728789013802824080146n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_euint256_uint256( - encryptedAmount.handles[0], - 57896044618658097711785492504343953926634992332820282019728788733583887971237n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577747386712051383n); - }); - - it('test operator "add" overload (euint256, uint256) => euint256 test 2 (57896044618658097711785492504343953926634992332820282019728788109485910742178, 57896044618658097711785492504343953926634992332820282019728788109485910742180)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742178n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_euint256_uint256( - encryptedAmount.handles[0], - 57896044618658097711785492504343953926634992332820282019728788109485910742180n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484358n); - }); - - it('test operator "add" overload (euint256, uint256) => euint256 test 3 (57896044618658097711785492504343953926634992332820282019728788109485910742180, 57896044618658097711785492504343953926634992332820282019728788109485910742180)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742180n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_euint256_uint256( - encryptedAmount.handles[0], - 57896044618658097711785492504343953926634992332820282019728788109485910742180n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484360n); - }); - - it('test operator "add" overload (euint256, uint256) => euint256 test 4 (57896044618658097711785492504343953926634992332820282019728788109485910742180, 57896044618658097711785492504343953926634992332820282019728788109485910742178)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742180n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_euint256_uint256( - encryptedAmount.handles[0], - 57896044618658097711785492504343953926634992332820282019728788109485910742178n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484358n); - }); - - it('test operator "add" overload (uint256, euint256) => euint256 test 1 (57896044618658097711785492504343953926634992332820282019728789372175656948236, 57896044618658097711785492504343953926634992332820282019728788733583887971237)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(57896044618658097711785492504343953926634992332820282019728788733583887971237n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_uint256_euint256( - 57896044618658097711785492504343953926634992332820282019728789372175656948236n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457578105759544919473n); - }); - - it('test operator "add" overload (uint256, euint256) => euint256 test 2 (57896044618658097711785492504343953926634992332820282019728788109485910742178, 57896044618658097711785492504343953926634992332820282019728788109485910742180)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742180n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_uint256_euint256( - 57896044618658097711785492504343953926634992332820282019728788109485910742178n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484358n); - }); - - it('test operator "add" overload (uint256, euint256) => euint256 test 3 (57896044618658097711785492504343953926634992332820282019728788109485910742180, 57896044618658097711785492504343953926634992332820282019728788109485910742180)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742180n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_uint256_euint256( - 57896044618658097711785492504343953926634992332820282019728788109485910742180n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484360n); - }); - - it('test operator "add" overload (uint256, euint256) => euint256 test 4 (57896044618658097711785492504343953926634992332820282019728788109485910742180, 57896044618658097711785492504343953926634992332820282019728788109485910742178)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(57896044618658097711785492504343953926634992332820282019728788109485910742178n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.add_uint256_euint256( - 57896044618658097711785492504343953926634992332820282019728788109485910742180n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576218971821484358n); - }); - - it('test operator "sub" overload (euint256, uint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579667871013646565, 115792089237316195423570985008687907853269984665640564039457579667871013646565)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579667871013646565n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.sub_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457579667871013646565n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint256, uint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457579667871013646565, 115792089237316195423570985008687907853269984665640564039457579667871013646561)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579667871013646565n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.sub_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457579667871013646561n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "sub" overload (uint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579667871013646565, 115792089237316195423570985008687907853269984665640564039457579667871013646565)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457579667871013646565n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.sub_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457579667871013646565n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (uint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457579667871013646565, 115792089237316195423570985008687907853269984665640564039457579667871013646561)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457579667871013646561n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.sub_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457579667871013646565n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint256, uint256) => euint256 test 1 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(170141183460469231731687303715884105729n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_euint256_uint256( - encryptedAmount.handles[0], - 170141183460469231731687303715884105729n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); - }); - - it('test operator "mul" overload (euint256, uint256) => euint256 test 2 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(170141183460469231731687303715884105729n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_euint256_uint256( - encryptedAmount.handles[0], - 170141183460469231731687303715884105729n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); - }); - - it('test operator "mul" overload (euint256, uint256) => euint256 test 3 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(170141183460469231731687303715884105729n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_euint256_uint256( - encryptedAmount.handles[0], - 170141183460469231731687303715884105729n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); - }); - - it('test operator "mul" overload (euint256, uint256) => euint256 test 4 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(170141183460469231731687303715884105729n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_euint256_uint256( - encryptedAmount.handles[0], - 170141183460469231731687303715884105729n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); - }); - - it('test operator "mul" overload (uint256, euint256) => euint256 test 1 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(170141183460469231731687303715884105729n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_uint256_euint256( - 170141183460469231731687303715884105729n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); - }); - - it('test operator "mul" overload (uint256, euint256) => euint256 test 2 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(170141183460469231731687303715884105729n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_uint256_euint256( - 170141183460469231731687303715884105729n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); - }); - - it('test operator "mul" overload (uint256, euint256) => euint256 test 3 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(170141183460469231731687303715884105729n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_uint256_euint256( - 170141183460469231731687303715884105729n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); - }); - - it('test operator "mul" overload (uint256, euint256) => euint256 test 4 (170141183460469231731687303715884105729, 170141183460469231731687303715884105729)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(170141183460469231731687303715884105729n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.mul_uint256_euint256( - 170141183460469231731687303715884105729n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(28948022309329048855892746252171976963657778533331079473327770609410050621441n); - }); - - it('test operator "div" overload (euint256, uint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457583310417243027629, 115792089237316195423570985008687907853269984665640564039457577919950085050983)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457583310417243027629n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.div_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457577919950085050983n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(1n); - }); - - it('test operator "div" overload (euint256, uint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457576535097376895415, 115792089237316195423570985008687907853269984665640564039457576535097376895419)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457576535097376895415n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.div_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457576535097376895419n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "div" overload (euint256, uint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457576535097376895419, 115792089237316195423570985008687907853269984665640564039457576535097376895419)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457576535097376895419n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.div_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457576535097376895419n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(1n); - }); - - it('test operator "div" overload (euint256, uint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457576535097376895419, 115792089237316195423570985008687907853269984665640564039457576535097376895415)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457576535097376895419n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.div_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457576535097376895415n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(1n); - }); - - it('test operator "rem" overload (euint256, uint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457578502975350831453, 115792089237316195423570985008687907853269984665640564039457581127377285906497)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457578502975350831453n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.rem_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457581127377285906497n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457578502975350831453n); - }); - - it('test operator "rem" overload (euint256, uint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457577137781640958323, 115792089237316195423570985008687907853269984665640564039457577137781640958327)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577137781640958323n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.rem_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457577137781640958327n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577137781640958323n); - }); - - it('test operator "rem" overload (euint256, uint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457577137781640958327, 115792089237316195423570985008687907853269984665640564039457577137781640958327)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577137781640958327n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.rem_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457577137781640958327n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "rem" overload (euint256, uint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457577137781640958327, 115792089237316195423570985008687907853269984665640564039457577137781640958323)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577137781640958327n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.rem_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457577137781640958323n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "and" overload (euint256, uint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457580473854578773963, 115792089237316195423570985008687907853269984665640564039457581816489991853517)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457580473854578773963n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457581816489991853517n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579557951374476745n); - }); - - it('test operator "and" overload (euint256, uint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457579064265044491321, 115792089237316195423570985008687907853269984665640564039457579064265044491325)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491321n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457579064265044491325n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491321n); - }); - - it('test operator "and" overload (euint256, uint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457579064265044491325, 115792089237316195423570985008687907853269984665640564039457579064265044491325)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491325n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457579064265044491325n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491325n); - }); - - it('test operator "and" overload (euint256, uint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457579064265044491325, 115792089237316195423570985008687907853269984665640564039457579064265044491321)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491325n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457579064265044491321n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491321n); - }); - - it('test operator "and" overload (uint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457576516611416206839, 115792089237316195423570985008687907853269984665640564039457581816489991853517)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457581816489991853517n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457576516611416206839n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457575038788798842309n); - }); - - it('test operator "and" overload (uint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457579064265044491321, 115792089237316195423570985008687907853269984665640564039457579064265044491325)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491325n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457579064265044491321n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491321n); - }); - - it('test operator "and" overload (uint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457579064265044491325, 115792089237316195423570985008687907853269984665640564039457579064265044491325)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491325n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457579064265044491325n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491325n); - }); - - it('test operator "and" overload (uint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457579064265044491325, 115792089237316195423570985008687907853269984665640564039457579064265044491321)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457579064265044491321n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.and_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457579064265044491325n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579064265044491321n); - }); - - it('test operator "or" overload (euint256, uint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579093390716184697, 115792089237316195423570985008687907853269984665640564039457575617602160724601)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184697n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457575617602160724601n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579147311516134009n); - }); - - it('test operator "or" overload (euint256, uint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457579093390716184693, 115792089237316195423570985008687907853269984665640564039457579093390716184697)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184693n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457579093390716184697n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184701n); - }); - - it('test operator "or" overload (euint256, uint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457579093390716184697, 115792089237316195423570985008687907853269984665640564039457579093390716184697)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184697n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457579093390716184697n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184697n); - }); - - it('test operator "or" overload (euint256, uint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457579093390716184697, 115792089237316195423570985008687907853269984665640564039457579093390716184693)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184697n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457579093390716184693n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184701n); - }); - - it('test operator "or" overload (uint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457580060042571469423, 115792089237316195423570985008687907853269984665640564039457575617602160724601)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457575617602160724601n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457580060042571469423n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457580622993567439487n); - }); - - it('test operator "or" overload (uint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457579093390716184693, 115792089237316195423570985008687907853269984665640564039457579093390716184697)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184697n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457579093390716184693n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184701n); - }); - - it('test operator "or" overload (uint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457579093390716184697, 115792089237316195423570985008687907853269984665640564039457579093390716184697)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184697n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457579093390716184697n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184697n); - }); - - it('test operator "or" overload (uint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457579093390716184697, 115792089237316195423570985008687907853269984665640564039457579093390716184693)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457579093390716184693n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.or_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457579093390716184697n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579093390716184701n); - }); - - it('test operator "xor" overload (euint256, uint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582495469225451093, 115792089237316195423570985008687907853269984665640564039457579143464719512889)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457582495469225451093n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457579143464719512889n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(5655612635835244n); - }); - - it('test operator "xor" overload (euint256, uint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457581801761034193855, 115792089237316195423570985008687907853269984665640564039457581801761034193859)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193855n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457581801761034193859n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(124n); - }); - - it('test operator "xor" overload (euint256, uint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457581801761034193859, 115792089237316195423570985008687907853269984665640564039457581801761034193859)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193859n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457581801761034193859n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint256, uint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457581801761034193859, 115792089237316195423570985008687907853269984665640564039457581801761034193855)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193859n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457581801761034193855n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(124n); - }); - - it('test operator "xor" overload (uint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579014577469369511, 115792089237316195423570985008687907853269984665640564039457579143464719512889)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457579143464719512889n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457579014577469369511n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(269763301726622n); - }); - - it('test operator "xor" overload (uint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457581801761034193855, 115792089237316195423570985008687907853269984665640564039457581801761034193859)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193859n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457581801761034193855n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(124n); - }); - - it('test operator "xor" overload (uint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457581801761034193859, 115792089237316195423570985008687907853269984665640564039457581801761034193859)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193859n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457581801761034193859n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (uint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457581801761034193859, 115792089237316195423570985008687907853269984665640564039457581801761034193855)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457581801761034193855n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.xor_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457581801761034193859n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(124n); - }); -}); diff --git a/contracts/test/tfheOperations/tfheOperations12.ts b/contracts/test/tfheOperations/tfheOperations12.ts deleted file mode 100644 index 3c4e4b0f..00000000 --- a/contracts/test/tfheOperations/tfheOperations12.ts +++ /dev/null @@ -1,3953 +0,0 @@ -import { expect } from 'chai'; -import { ethers } from 'hardhat'; - -import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1'; -import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2'; -import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'; -import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4'; -import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5'; -import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6'; -import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7'; -import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8'; -import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9'; -import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10'; -import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11'; -import { - createInstances, - decrypt4, - decrypt8, - decrypt16, - decrypt32, - decrypt64, - decrypt128, - decrypt256, - decryptBool, -} from '../instance'; -import { getSigners, initSigners } from '../signers'; - -async function deployTfheTestFixture1(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture2(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture3(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture4(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture5(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture6(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture7(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite7'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture8(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite8'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture9(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite9'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture10(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite10'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture11(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite11'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -describe('TFHE operations 12', function () { - before(async function () { - await initSigners(1); - this.signers = await getSigners(); - - const contract1 = await deployTfheTestFixture1(); - this.contract1Address = await contract1.getAddress(); - this.contract1 = contract1; - - const contract2 = await deployTfheTestFixture2(); - this.contract2Address = await contract2.getAddress(); - this.contract2 = contract2; - - const contract3 = await deployTfheTestFixture3(); - this.contract3Address = await contract3.getAddress(); - this.contract3 = contract3; - - const contract4 = await deployTfheTestFixture4(); - this.contract4Address = await contract4.getAddress(); - this.contract4 = contract4; - - const contract5 = await deployTfheTestFixture5(); - this.contract5Address = await contract5.getAddress(); - this.contract5 = contract5; - - const contract6 = await deployTfheTestFixture6(); - this.contract6Address = await contract6.getAddress(); - this.contract6 = contract6; - - const contract7 = await deployTfheTestFixture7(); - this.contract7Address = await contract7.getAddress(); - this.contract7 = contract7; - - const contract8 = await deployTfheTestFixture8(); - this.contract8Address = await contract8.getAddress(); - this.contract8 = contract8; - - const contract9 = await deployTfheTestFixture9(); - this.contract9Address = await contract9.getAddress(); - this.contract9 = contract9; - - const contract10 = await deployTfheTestFixture10(); - this.contract10Address = await contract10.getAddress(); - this.contract10 = contract10; - - const contract11 = await deployTfheTestFixture11(); - this.contract11Address = await contract11.getAddress(); - this.contract11 = contract11; - - const instances = await createInstances(this.signers); - this.instances = instances; - }); - - it('test operator "eq" overload (euint256, uint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457579028937132718443, 115792089237316195423570985008687907853269984665640564039457576393900678416361)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579028937132718443n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457576393900678416361n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint256, uint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457575281612927984427, 115792089237316195423570985008687907853269984665640564039457575281612927984431)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984427n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457575281612927984431n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint256, uint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457575281612927984431, 115792089237316195423570985008687907853269984665640564039457575281612927984431)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984431n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457575281612927984431n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint256, uint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457575281612927984431, 115792089237316195423570985008687907853269984665640564039457575281612927984427)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984431n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457575281612927984427n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457577173439170014457, 115792089237316195423570985008687907853269984665640564039457576393900678416361)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457576393900678416361n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457577173439170014457n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457575281612927984427, 115792089237316195423570985008687907853269984665640564039457575281612927984431)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984431n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457575281612927984427n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457575281612927984431, 115792089237316195423570985008687907853269984665640564039457575281612927984431)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984431n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457575281612927984431n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (uint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457575281612927984431, 115792089237316195423570985008687907853269984665640564039457575281612927984427)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457575281612927984427n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.eq_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457575281612927984431n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint256, uint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457581421114730215071, 115792089237316195423570985008687907853269984665640564039457583491257588609271)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581421114730215071n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457583491257588609271n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint256, uint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457577745710288733719, 115792089237316195423570985008687907853269984665640564039457577745710288733723)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733719n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457577745710288733723n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint256, uint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457577745710288733723, 115792089237316195423570985008687907853269984665640564039457577745710288733723)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733723n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457577745710288733723n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint256, uint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457577745710288733723, 115792089237316195423570985008687907853269984665640564039457577745710288733719)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733723n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457577745710288733719n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457583026693216867801, 115792089237316195423570985008687907853269984665640564039457583491257588609271)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457583491257588609271n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457583026693216867801n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457577745710288733719, 115792089237316195423570985008687907853269984665640564039457577745710288733723)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733723n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457577745710288733719n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457577745710288733723, 115792089237316195423570985008687907853269984665640564039457577745710288733723)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733723n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457577745710288733723n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (uint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457577745710288733723, 115792089237316195423570985008687907853269984665640564039457577745710288733719)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457577745710288733719n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ne_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457577745710288733723n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, uint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457579759156646767465, 115792089237316195423570985008687907853269984665640564039457580411660636009627)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767465n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457580411660636009627n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint256, uint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457579759156646767461, 115792089237316195423570985008687907853269984665640564039457579759156646767465)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767461n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457579759156646767465n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint256, uint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457579759156646767465, 115792089237316195423570985008687907853269984665640564039457579759156646767465)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767465n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457579759156646767465n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint256, uint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457579759156646767465, 115792089237316195423570985008687907853269984665640564039457579759156646767461)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767465n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457579759156646767461n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (uint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457581430272333247909, 115792089237316195423570985008687907853269984665640564039457580411660636009627)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457580411660636009627n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457581430272333247909n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (uint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457579759156646767461, 115792089237316195423570985008687907853269984665640564039457579759156646767465)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767465n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457579759156646767461n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (uint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457579759156646767465, 115792089237316195423570985008687907853269984665640564039457579759156646767465)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767465n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457579759156646767465n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (uint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457579759156646767465, 115792089237316195423570985008687907853269984665640564039457579759156646767461)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457579759156646767461n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.ge_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457579759156646767465n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint256, uint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457580885855005541993, 115792089237316195423570985008687907853269984665640564039457576330419987992913)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541993n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457576330419987992913n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint256, uint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457580885855005541989, 115792089237316195423570985008687907853269984665640564039457580885855005541993)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541989n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457580885855005541993n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint256, uint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457580885855005541993, 115792089237316195423570985008687907853269984665640564039457580885855005541993)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541993n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457580885855005541993n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint256, uint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457580885855005541993, 115792089237316195423570985008687907853269984665640564039457580885855005541989)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541993n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457580885855005541989n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (uint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457583273117366659453, 115792089237316195423570985008687907853269984665640564039457576330419987992913)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457576330419987992913n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457583273117366659453n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (uint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457580885855005541989, 115792089237316195423570985008687907853269984665640564039457580885855005541993)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541993n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457580885855005541989n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (uint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457580885855005541993, 115792089237316195423570985008687907853269984665640564039457580885855005541993)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541993n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457580885855005541993n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (uint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457580885855005541993, 115792089237316195423570985008687907853269984665640564039457580885855005541989)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457580885855005541989n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.gt_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457580885855005541993n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, uint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457583300217912499775, 115792089237316195423570985008687907853269984665640564039457580310546116642945)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457583300217912499775n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457580310546116642945n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint256, uint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457582857952818399805, 115792089237316195423570985008687907853269984665640564039457582857952818399809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399805n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457582857952818399809n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, uint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457582857952818399809, 115792089237316195423570985008687907853269984665640564039457582857952818399809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399809n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457582857952818399809n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint256, uint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457582857952818399809, 115792089237316195423570985008687907853269984665640564039457582857952818399805)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399809n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457582857952818399805n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (uint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457579919776168086147, 115792089237316195423570985008687907853269984665640564039457580310546116642945)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457580310546116642945n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457579919776168086147n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (uint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457582857952818399805, 115792089237316195423570985008687907853269984665640564039457582857952818399809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457582857952818399805n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (uint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457582857952818399809, 115792089237316195423570985008687907853269984665640564039457582857952818399809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457582857952818399809n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (uint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457582857952818399809, 115792089237316195423570985008687907853269984665640564039457582857952818399805)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457582857952818399805n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.le_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457582857952818399809n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, uint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457579345439988102233, 115792089237316195423570985008687907853269984665640564039457581362267810923471)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579345439988102233n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457581362267810923471n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint256, uint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457575518813902238257, 115792089237316195423570985008687907853269984665640564039457575518813902238261)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238257n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457575518813902238261n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint256, uint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457575518813902238261, 115792089237316195423570985008687907853269984665640564039457575518813902238261)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238261n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457575518813902238261n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint256, uint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457575518813902238261, 115792089237316195423570985008687907853269984665640564039457575518813902238257)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238261n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457575518813902238257n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (uint256, euint256) => ebool test 1 (115792089237316195423570985008687907853269984665640564039457578628645763210627, 115792089237316195423570985008687907853269984665640564039457581362267810923471)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457581362267810923471n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457578628645763210627n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (uint256, euint256) => ebool test 2 (115792089237316195423570985008687907853269984665640564039457575518813902238257, 115792089237316195423570985008687907853269984665640564039457575518813902238261)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238261n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457575518813902238257n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (uint256, euint256) => ebool test 3 (115792089237316195423570985008687907853269984665640564039457575518813902238261, 115792089237316195423570985008687907853269984665640564039457575518813902238261)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238261n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457575518813902238261n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (uint256, euint256) => ebool test 4 (115792089237316195423570985008687907853269984665640564039457575518813902238261, 115792089237316195423570985008687907853269984665640564039457575518813902238257)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457575518813902238257n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.lt_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457575518813902238261n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract10.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint256, uint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579091097262441647, 115792089237316195423570985008687907853269984665640564039457576915935387349417)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457579091097262441647n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457576915935387349417n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576915935387349417n); - }); - - it('test operator "min" overload (euint256, uint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457577447088911778287, 115792089237316195423570985008687907853269984665640564039457577447088911778291)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778287n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457577447088911778291n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778287n); - }); - - it('test operator "min" overload (euint256, uint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457577447088911778291, 115792089237316195423570985008687907853269984665640564039457577447088911778291)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778291n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457577447088911778291n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778291n); - }); - - it('test operator "min" overload (euint256, uint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457577447088911778291, 115792089237316195423570985008687907853269984665640564039457577447088911778287)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778291n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457577447088911778287n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778287n); - }); - - it('test operator "min" overload (uint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457579127166009597401, 115792089237316195423570985008687907853269984665640564039457576915935387349417)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457576915935387349417n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457579127166009597401n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457576915935387349417n); - }); - - it('test operator "min" overload (uint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457577447088911778287, 115792089237316195423570985008687907853269984665640564039457577447088911778291)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778291n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457577447088911778287n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778287n); - }); - - it('test operator "min" overload (uint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457577447088911778291, 115792089237316195423570985008687907853269984665640564039457577447088911778291)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778291n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457577447088911778291n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778291n); - }); - - it('test operator "min" overload (uint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457577447088911778291, 115792089237316195423570985008687907853269984665640564039457577447088911778287)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457577447088911778287n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.min_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457577447088911778291n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577447088911778287n); - }); - - it('test operator "max" overload (euint256, uint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457577915867722108039, 115792089237316195423570985008687907853269984665640564039457582764130067775401)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577915867722108039n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457582764130067775401n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457582764130067775401n); - }); - - it('test operator "max" overload (euint256, uint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457577809030115355405, 115792089237316195423570985008687907853269984665640564039457577809030115355409)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355405n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457577809030115355409n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577809030115355409n); - }); - - it('test operator "max" overload (euint256, uint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457577809030115355409, 115792089237316195423570985008687907853269984665640564039457577809030115355409)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355409n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457577809030115355409n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577809030115355409n); - }); - - it('test operator "max" overload (euint256, uint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457577809030115355409, 115792089237316195423570985008687907853269984665640564039457577809030115355405)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355409n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_euint256_uint256( - encryptedAmount.handles[0], - 115792089237316195423570985008687907853269984665640564039457577809030115355405n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577809030115355409n); - }); - - it('test operator "max" overload (uint256, euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582906409122638869, 115792089237316195423570985008687907853269984665640564039457582764130067775401)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457582764130067775401n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457582906409122638869n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457582906409122638869n); - }); - - it('test operator "max" overload (uint256, euint256) => euint256 test 2 (115792089237316195423570985008687907853269984665640564039457577809030115355405, 115792089237316195423570985008687907853269984665640564039457577809030115355409)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355409n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457577809030115355405n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577809030115355409n); - }); - - it('test operator "max" overload (uint256, euint256) => euint256 test 3 (115792089237316195423570985008687907853269984665640564039457577809030115355409, 115792089237316195423570985008687907853269984665640564039457577809030115355409)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355409n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457577809030115355409n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577809030115355409n); - }); - - it('test operator "max" overload (uint256, euint256) => euint256 test 4 (115792089237316195423570985008687907853269984665640564039457577809030115355409, 115792089237316195423570985008687907853269984665640564039457577809030115355405)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - - input.add256(115792089237316195423570985008687907853269984665640564039457577809030115355405n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.max_uint256_euint256( - 115792089237316195423570985008687907853269984665640564039457577809030115355409n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract10.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577809030115355409n); - }); - - it('test operator "shl" overload (euint4, uint8) => euint4 test 1 (1, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add4(1n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.shl_euint4_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract10.res4()); - expect(res).to.equal(4n); - }); - - it('test operator "shl" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add4(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.shl_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract10.res4()); - expect(res).to.equal(4n); - }); - - it('test operator "shl" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.shl_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract10.res4()); - expect(res).to.equal(8n); - }); - - it('test operator "shl" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.shl_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract10.res4()); - expect(res).to.equal(8n); - }); - - it('test operator "shr" overload (euint4, uint8) => euint4 test 1 (4, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add4(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.shr_euint4_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract10.res4()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add4(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.shr_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract10.res4()); - expect(res).to.equal(4n); - }); - - it('test operator "shr" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.shr_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract10.res4()); - expect(res).to.equal(8n); - }); - - it('test operator "shr" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.shr_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract10.res4()); - expect(res).to.equal(8n); - }); - - it('test operator "rotl" overload (euint4, uint8) => euint4 test 1 (1, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add4(1n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.rotl_euint4_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract10.res4()); - expect(res).to.equal(4n); - }); - - it('test operator "rotl" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add4(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.rotl_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract10.res4()); - expect(res).to.equal(4n); - }); - - it('test operator "rotl" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.rotl_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract10.res4()); - expect(res).to.equal(8n); - }); - - it('test operator "rotl" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.rotl_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract10.res4()); - expect(res).to.equal(8n); - }); - - it('test operator "rotr" overload (euint4, uint8) => euint4 test 1 (14, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add4(14n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.rotr_euint4_uint8(encryptedAmount.handles[0], 1n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract10.res4()); - expect(res).to.equal(7n); - }); - - it('test operator "rotr" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add4(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.rotr_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract10.res4()); - expect(res).to.equal(4n); - }); - - it('test operator "rotr" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.rotr_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract10.res4()); - expect(res).to.equal(8n); - }); - - it('test operator "rotr" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract10Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract10.rotr_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract10.res4()); - expect(res).to.equal(8n); - }); - - it('test operator "shl" overload (euint8, euint8) => euint8 test 1 (44, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(44n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(192n); - }); - - it('test operator "shl" overload (euint8, euint8) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "shl" overload (euint8, euint8) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(8n); - }); - - it('test operator "shl" overload (euint8, euint8) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(128n); - }); - - it('test operator "shl" overload (euint8, uint8) => euint8 test 1 (44, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(44n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(192n); - }); - - it('test operator "shl" overload (euint8, uint8) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "shl" overload (euint8, uint8) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(8n); - }); - - it('test operator "shl" overload (euint8, uint8) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(128n); - }); - - it('test operator "shr" overload (euint8, euint8) => euint8 test 1 (160, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(160n); - input.add8(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(20n); - }); - - it('test operator "shr" overload (euint8, euint8) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "shr" overload (euint8, euint8) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(8n); - }); - - it('test operator "shr" overload (euint8, euint8) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint8, uint8) => euint8 test 1 (160, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(160n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint8_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(20n); - }); - - it('test operator "shr" overload (euint8, uint8) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "shr" overload (euint8, uint8) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(8n); - }); - - it('test operator "shr" overload (euint8, uint8) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(0n); - }); - - it('test operator "rotl" overload (euint8, euint8) => euint8 test 1 (150, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(150n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(105n); - }); - - it('test operator "rotl" overload (euint8, euint8) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "rotl" overload (euint8, euint8) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(8n); - }); - - it('test operator "rotl" overload (euint8, euint8) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(128n); - }); - - it('test operator "rotl" overload (euint8, uint8) => euint8 test 1 (150, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(150n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(105n); - }); - - it('test operator "rotl" overload (euint8, uint8) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "rotl" overload (euint8, uint8) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(8n); - }); - - it('test operator "rotl" overload (euint8, uint8) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(128n); - }); - - it('test operator "rotr" overload (euint8, euint8) => euint8 test 1 (52, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(52n); - input.add8(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(208n); - }); - - it('test operator "rotr" overload (euint8, euint8) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "rotr" overload (euint8, euint8) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(8n); - }); - - it('test operator "rotr" overload (euint8, euint8) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(128n); - }); - - it('test operator "rotr" overload (euint8, uint8) => euint8 test 1 (52, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(52n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint8_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(208n); - }); - - it('test operator "rotr" overload (euint8, uint8) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "rotr" overload (euint8, uint8) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint8_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(8n); - }); - - it('test operator "rotr" overload (euint8, uint8) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint8_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(128n); - }); - - it('test operator "shl" overload (euint16, euint8) => euint16 test 1 (10029, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(10029n); - input.add8(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(58784n); - }); - - it('test operator "shl" overload (euint16, euint8) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(1024n); - }); - - it('test operator "shl" overload (euint16, euint8) => euint16 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(2048n); - }); - - it('test operator "shl" overload (euint16, euint8) => euint16 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(128n); - }); - - it('test operator "shl" overload (euint16, uint8) => euint16 test 1 (10029, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(10029n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint16_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(58784n); - }); - - it('test operator "shl" overload (euint16, uint8) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(1024n); - }); - - it('test operator "shl" overload (euint16, uint8) => euint16 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(2048n); - }); - - it('test operator "shl" overload (euint16, uint8) => euint16 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint16_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(128n); - }); - - it('test operator "shr" overload (euint16, euint8) => euint16 test 1 (63034, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(63034n); - input.add8(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(984n); - }); - - it('test operator "shr" overload (euint16, euint8) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint16, euint8) => euint16 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint16, euint8) => euint16 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint16, uint8) => euint16 test 1 (63034, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(63034n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint16_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(984n); - }); - - it('test operator "shr" overload (euint16, uint8) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint16, uint8) => euint16 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint16, uint8) => euint16 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint16_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "rotl" overload (euint16, euint8) => euint16 test 1 (34007, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(34007n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(19832n); - }); - - it('test operator "rotl" overload (euint16, euint8) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(1024n); - }); - - it('test operator "rotl" overload (euint16, euint8) => euint16 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(2048n); - }); - - it('test operator "rotl" overload (euint16, euint8) => euint16 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(128n); - }); - - it('test operator "rotl" overload (euint16, uint8) => euint16 test 1 (34007, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(34007n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint16_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(19832n); - }); - - it('test operator "rotl" overload (euint16, uint8) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(1024n); - }); - - it('test operator "rotl" overload (euint16, uint8) => euint16 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(2048n); - }); - - it('test operator "rotl" overload (euint16, uint8) => euint16 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint16_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(128n); - }); - - it('test operator "rotr" overload (euint16, euint8) => euint16 test 1 (32201, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(32201n); - input.add8(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(12217n); - }); - - it('test operator "rotr" overload (euint16, euint8) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(1024n); - }); - - it('test operator "rotr" overload (euint16, euint8) => euint16 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(2048n); - }); - - it('test operator "rotr" overload (euint16, euint8) => euint16 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(32768n); - }); - - it('test operator "rotr" overload (euint16, uint8) => euint16 test 1 (32201, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(32201n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint16_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(12217n); - }); - - it('test operator "rotr" overload (euint16, uint8) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(1024n); - }); - - it('test operator "rotr" overload (euint16, uint8) => euint16 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint16_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(2048n); - }); - - it('test operator "rotr" overload (euint16, uint8) => euint16 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint16_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(32768n); - }); - - it('test operator "shl" overload (euint32, euint8) => euint32 test 1 (3189891720, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(3189891720n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(3793627264n); - }); - - it('test operator "shl" overload (euint32, euint8) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(1024n); - }); - - it('test operator "shl" overload (euint32, euint8) => euint32 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(2048n); - }); - - it('test operator "shl" overload (euint32, euint8) => euint32 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(128n); - }); - - it('test operator "shl" overload (euint32, uint8) => euint32 test 1 (3189891720, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(3189891720n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(3793627264n); - }); - - it('test operator "shl" overload (euint32, uint8) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(1024n); - }); - - it('test operator "shl" overload (euint32, uint8) => euint32 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(2048n); - }); - - it('test operator "shl" overload (euint32, uint8) => euint32 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(128n); - }); - - it('test operator "shr" overload (euint32, euint8) => euint32 test 1 (1720949149, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(1720949149n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(107559321n); - }); - - it('test operator "shr" overload (euint32, euint8) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint32, euint8) => euint32 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint32, euint8) => euint32 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint32, uint8) => euint32 test 1 (1720949149, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(1720949149n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(107559321n); - }); - - it('test operator "shr" overload (euint32, uint8) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint32, uint8) => euint32 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint32, uint8) => euint32 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "rotl" overload (euint32, euint8) => euint32 test 1 (10430463, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(10430463n); - input.add8(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(83443704n); - }); - - it('test operator "rotl" overload (euint32, euint8) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(1024n); - }); - - it('test operator "rotl" overload (euint32, euint8) => euint32 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(2048n); - }); - - it('test operator "rotl" overload (euint32, euint8) => euint32 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(128n); - }); - - it('test operator "rotl" overload (euint32, uint8) => euint32 test 1 (10430463, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(10430463n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint32_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(83443704n); - }); - - it('test operator "rotl" overload (euint32, uint8) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(1024n); - }); - - it('test operator "rotl" overload (euint32, uint8) => euint32 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(2048n); - }); - - it('test operator "rotl" overload (euint32, uint8) => euint32 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(128n); - }); - - it('test operator "rotr" overload (euint32, euint8) => euint32 test 1 (3489309750, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(3489309750n); - input.add8(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(1839199560n); - }); - - it('test operator "rotr" overload (euint32, euint8) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(67108864n); - }); - - it('test operator "rotr" overload (euint32, euint8) => euint32 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(134217728n); - }); - - it('test operator "rotr" overload (euint32, euint8) => euint32 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(2147483648n); - }); - - it('test operator "rotr" overload (euint32, uint8) => euint32 test 1 (3489309750, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(3489309750n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint32_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(1839199560n); - }); - - it('test operator "rotr" overload (euint32, uint8) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(67108864n); - }); - - it('test operator "rotr" overload (euint32, uint8) => euint32 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint32_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(134217728n); - }); - - it('test operator "rotr" overload (euint32, uint8) => euint32 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint32_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(2147483648n); - }); - - it('test operator "shl" overload (euint64, euint8) => euint64 test 1 (18438852048643145403, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(18438852048643145403n); - input.add8(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(17941654469459553984n); - }); - - it('test operator "shl" overload (euint64, euint8) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(1024n); - }); - - it('test operator "shl" overload (euint64, euint8) => euint64 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(2048n); - }); - - it('test operator "shl" overload (euint64, euint8) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(128n); - }); - - it('test operator "shl" overload (euint64, uint8) => euint64 test 1 (18438852048643145403, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(18438852048643145403n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint64_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(17941654469459553984n); - }); - - it('test operator "shl" overload (euint64, uint8) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(1024n); - }); - - it('test operator "shl" overload (euint64, uint8) => euint64 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(2048n); - }); - - it('test operator "shl" overload (euint64, uint8) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint64_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(128n); - }); - - it('test operator "shr" overload (euint64, euint8) => euint64 test 1 (18444486134915793097, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(18444486134915793097n); - input.add8(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(288195095858059267n); - }); - - it('test operator "shr" overload (euint64, euint8) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint64, euint8) => euint64 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint64, euint8) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint64, uint8) => euint64 test 1 (18444486134915793097, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(18444486134915793097n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint64_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(288195095858059267n); - }); - - it('test operator "shr" overload (euint64, uint8) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint64, uint8) => euint64 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint64, uint8) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint64_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "rotl" overload (euint64, euint8) => euint64 test 1 (18440494415218168649, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(18440494415218168649n); - input.add8(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(17646787786812531967n); - }); - - it('test operator "rotl" overload (euint64, euint8) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(1024n); - }); - - it('test operator "rotl" overload (euint64, euint8) => euint64 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(2048n); - }); - - it('test operator "rotl" overload (euint64, euint8) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(128n); - }); - - it('test operator "rotl" overload (euint64, uint8) => euint64 test 1 (18440494415218168649, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(18440494415218168649n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint64_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(17646787786812531967n); - }); - - it('test operator "rotl" overload (euint64, uint8) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(1024n); - }); - - it('test operator "rotl" overload (euint64, uint8) => euint64 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(2048n); - }); - - it('test operator "rotl" overload (euint64, uint8) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint64_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(128n); - }); - - it('test operator "rotr" overload (euint64, euint8) => euint64 test 1 (18444475066789617897, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(18444475066789617897n); - input.add8(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(4611402392562396189n); - }); - - it('test operator "rotr" overload (euint64, euint8) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(288230376151711744n); - }); - - it('test operator "rotr" overload (euint64, euint8) => euint64 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(576460752303423488n); - }); - - it('test operator "rotr" overload (euint64, euint8) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(9223372036854775808n); - }); - - it('test operator "rotr" overload (euint64, uint8) => euint64 test 1 (18444475066789617897, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(18444475066789617897n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint64_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(4611402392562396189n); - }); - - it('test operator "rotr" overload (euint64, uint8) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(288230376151711744n); - }); - - it('test operator "rotr" overload (euint64, uint8) => euint64 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint64_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(576460752303423488n); - }); - - it('test operator "rotr" overload (euint64, uint8) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint64_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(9223372036854775808n); - }); - - it('test operator "shl" overload (euint128, euint8) => euint128 test 1 (340282366920938463463366293596486217477, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(340282366920938463463366293596486217477n); - input.add8(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(340282366920938463463108564702744404128n); - }); - - it('test operator "shl" overload (euint128, euint8) => euint128 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(1024n); - }); - - it('test operator "shl" overload (euint128, euint8) => euint128 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(2048n); - }); - - it('test operator "shl" overload (euint128, euint8) => euint128 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(128n); - }); - - it('test operator "shl" overload (euint128, uint8) => euint128 test 1 (340282366920938463463366293596486217477, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(340282366920938463463366293596486217477n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint128_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(340282366920938463463108564702744404128n); - }); - - it('test operator "shl" overload (euint128, uint8) => euint128 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(1024n); - }); - - it('test operator "shl" overload (euint128, uint8) => euint128 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(2048n); - }); - - it('test operator "shl" overload (euint128, uint8) => euint128 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint128_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(128n); - }); - - it('test operator "shr" overload (euint128, euint8) => euint128 test 1 (340282366920938463463368208225205051841, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(340282366920938463463368208225205051841n); - input.add8(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(85070591730234615865842052056301262960n); - }); - - it('test operator "shr" overload (euint128, euint8) => euint128 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint128, euint8) => euint128 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint128, euint8) => euint128 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint128, uint8) => euint128 test 1 (340282366920938463463368208225205051841, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(340282366920938463463368208225205051841n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint128_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(85070591730234615865842052056301262960n); - }); - - it('test operator "shr" overload (euint128, uint8) => euint128 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint128, uint8) => euint128 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint128, uint8) => euint128 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint128_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "rotl" overload (euint128, euint8) => euint128 test 1 (340282366920938463463369231473752264653, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(340282366920938463463369231473752264653n); - input.add8(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(340282366920938463463331599767640637039n); - }); - - it('test operator "rotl" overload (euint128, euint8) => euint128 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(1024n); - }); - - it('test operator "rotl" overload (euint128, euint8) => euint128 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(2048n); - }); - - it('test operator "rotl" overload (euint128, euint8) => euint128 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(128n); - }); - - it('test operator "rotl" overload (euint128, uint8) => euint128 test 1 (340282366920938463463369231473752264653, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(340282366920938463463369231473752264653n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint128_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(340282366920938463463331599767640637039n); - }); - - it('test operator "rotl" overload (euint128, uint8) => euint128 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(1024n); - }); - - it('test operator "rotl" overload (euint128, uint8) => euint128 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(2048n); - }); - - it('test operator "rotl" overload (euint128, uint8) => euint128 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint128_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(128n); - }); - - it('test operator "rotr" overload (euint128, euint8) => euint128 test 1 (340282366920938463463366872490223703215, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(340282366920938463463366872490223703215n); - input.add8(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(340282366920938463463372673696382084395n); - }); - - it('test operator "rotr" overload (euint128, euint8) => euint128 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(5316911983139663491615228241121378304n); - }); - - it('test operator "rotr" overload (euint128, euint8) => euint128 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(10633823966279326983230456482242756608n); - }); - - it('test operator "rotr" overload (euint128, euint8) => euint128 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(170141183460469231731687303715884105728n); - }); - - it('test operator "rotr" overload (euint128, uint8) => euint128 test 1 (340282366920938463463366872490223703215, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(340282366920938463463366872490223703215n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint128_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(340282366920938463463372673696382084395n); - }); - - it('test operator "rotr" overload (euint128, uint8) => euint128 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(5316911983139663491615228241121378304n); - }); - - it('test operator "rotr" overload (euint128, uint8) => euint128 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint128_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(10633823966279326983230456482242756608n); - }); - - it('test operator "rotr" overload (euint128, uint8) => euint128 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint128_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(170141183460469231731687303715884105728n); - }); - - it('test operator "shl" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457578572299000463425, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457578572299000463425n); - input.add8(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039456888249304595046528n); - }); - - it('test operator "shl" overload (euint256, euint8) => euint256 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(1024n); - }); - - it('test operator "shl" overload (euint256, euint8) => euint256 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(2048n); - }); - - it('test operator "shl" overload (euint256, euint8) => euint256 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(128n); - }); - - it('test operator "shl" overload (euint256, uint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457578572299000463425, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457578572299000463425n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint256_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039456888249304595046528n); - }); - - it('test operator "shl" overload (euint256, uint8) => euint256 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(1024n); - }); - - it('test operator "shl" overload (euint256, uint8) => euint256 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(2048n); - }); - - it('test operator "shl" overload (euint256, uint8) => euint256 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shl_euint256_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(128n); - }); - - it('test operator "shr" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457578470671649972655, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457578470671649972655n); - input.add8(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(28948022309329048855892746252171976963317496166410141009864394617667912493163n); - }); - - it('test operator "shr" overload (euint256, euint8) => euint256 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint256, euint8) => euint256 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint256, euint8) => euint256 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint256, uint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457578470671649972655, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457578470671649972655n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint256_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(28948022309329048855892746252171976963317496166410141009864394617667912493163n); - }); - - it('test operator "shr" overload (euint256, uint8) => euint256 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint256, uint8) => euint256 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "shr" overload (euint256, uint8) => euint256 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.shr_euint256_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "rotl" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582882208711886349, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457582882208711886349n); - input.add8(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457439917747657180927n); - }); - - it('test operator "rotl" overload (euint256, euint8) => euint256 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(1024n); - }); - - it('test operator "rotl" overload (euint256, euint8) => euint256 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(2048n); - }); - - it('test operator "rotl" overload (euint256, euint8) => euint256 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(128n); - }); - - it('test operator "rotl" overload (euint256, uint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457582882208711886349, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457582882208711886349n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint256_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457439917747657180927n); - }); - - it('test operator "rotl" overload (euint256, uint8) => euint256 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(1024n); - }); - - it('test operator "rotl" overload (euint256, uint8) => euint256 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(2048n); - }); - - it('test operator "rotl" overload (euint256, uint8) => euint256 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotl_euint256_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(128n); - }); - - it('test operator "rotr" overload (euint256, euint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457581545102921797223, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581545102921797223n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(57896044618658097711785492504343953926634992332820282019728791850030926829798n); - }); - - it('test operator "rotr" overload (euint256, euint8) => euint256 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(1809251394333065553493296640760748560207343510400633813116524750123642650624n); - }); - - it('test operator "rotr" overload (euint256, euint8) => euint256 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(3618502788666131106986593281521497120414687020801267626233049500247285301248n); - }); - - it('test operator "rotr" overload (euint256, euint8) => euint256 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint256_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(57896044618658097711785492504343953926634992332820282019728792003956564819968n); - }); - - it('test operator "rotr" overload (euint256, uint8) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457581545102921797223, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581545102921797223n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint256_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(57896044618658097711785492504343953926634992332820282019728791850030926829798n); - }); - - it('test operator "rotr" overload (euint256, uint8) => euint256 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(1809251394333065553493296640760748560207343510400633813116524750123642650624n); - }); - - it('test operator "rotr" overload (euint256, uint8) => euint256 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint256_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(3618502788666131106986593281521497120414687020801267626233049500247285301248n); - }); - - it('test operator "rotr" overload (euint256, uint8) => euint256 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.rotr_euint256_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(57896044618658097711785492504343953926634992332820282019728792003956564819968n); - }); - - it('test operator "neg" overload (euint4) => euint4 test 1 (7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add4(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.neg_euint4(encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract11.res4()); - expect(res).to.equal(9n); - }); - - it('test operator "not" overload (euint4) => euint4 test 1 (4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.not_euint4(encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract11.res4()); - expect(res).to.equal(11n); - }); - - it('test operator "neg" overload (euint8) => euint8 test 1 (211)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(211n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.neg_euint8(encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(45n); - }); - - it('test operator "not" overload (euint8) => euint8 test 1 (221)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add8(221n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.not_euint8(encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract11.res8()); - expect(res).to.equal(34n); - }); - - it('test operator "neg" overload (euint16) => euint16 test 1 (26686)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(26686n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.neg_euint16(encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(38850n); - }); - - it('test operator "not" overload (euint16) => euint16 test 1 (1813)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add16(1813n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.not_euint16(encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract11.res16()); - expect(res).to.equal(63722n); - }); - - it('test operator "neg" overload (euint32) => euint32 test 1 (3401457377)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(3401457377n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.neg_euint32(encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(893509919n); - }); - - it('test operator "not" overload (euint32) => euint32 test 1 (2456808918)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add32(2456808918n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.not_euint32(encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract11.res32()); - expect(res).to.equal(1838158377n); - }); - - it('test operator "neg" overload (euint64) => euint64 test 1 (18441984683925217775)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(18441984683925217775n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.neg_euint64(encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(4759389784333841n); - }); - - it('test operator "not" overload (euint64) => euint64 test 1 (18438471929660169839)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add64(18438471929660169839n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.not_euint64(encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt64(await this.contract11.res64()); - expect(res).to.equal(8272144049381776n); - }); - - it('test operator "neg" overload (euint128) => euint128 test 1 (340282366920938463463373162594455712433)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(340282366920938463463373162594455712433n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.neg_euint128(encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(1444837312499023n); - }); - - it('test operator "not" overload (euint128) => euint128 test 1 (340282366920938463463374264817331350741)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add128(340282366920938463463374264817331350741n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.not_euint128(encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt128(await this.contract11.res128()); - expect(res).to.equal(342614436860714n); - }); -}); diff --git a/contracts/test/tfheOperations/tfheOperations13.ts b/contracts/test/tfheOperations/tfheOperations13.ts deleted file mode 100644 index db18a0e6..00000000 --- a/contracts/test/tfheOperations/tfheOperations13.ts +++ /dev/null @@ -1,221 +0,0 @@ -import { expect } from 'chai'; -import { ethers } from 'hardhat'; - -import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1'; -import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2'; -import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'; -import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4'; -import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5'; -import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6'; -import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7'; -import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8'; -import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9'; -import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10'; -import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11'; -import { - createInstances, - decrypt4, - decrypt8, - decrypt16, - decrypt32, - decrypt64, - decrypt128, - decrypt256, - decryptBool, -} from '../instance'; -import { getSigners, initSigners } from '../signers'; - -async function deployTfheTestFixture1(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture2(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture3(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture4(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture5(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture6(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture7(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite7'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture8(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite8'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture9(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite9'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture10(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite10'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture11(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite11'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -describe('TFHE operations 13', function () { - before(async function () { - await initSigners(1); - this.signers = await getSigners(); - - const contract1 = await deployTfheTestFixture1(); - this.contract1Address = await contract1.getAddress(); - this.contract1 = contract1; - - const contract2 = await deployTfheTestFixture2(); - this.contract2Address = await contract2.getAddress(); - this.contract2 = contract2; - - const contract3 = await deployTfheTestFixture3(); - this.contract3Address = await contract3.getAddress(); - this.contract3 = contract3; - - const contract4 = await deployTfheTestFixture4(); - this.contract4Address = await contract4.getAddress(); - this.contract4 = contract4; - - const contract5 = await deployTfheTestFixture5(); - this.contract5Address = await contract5.getAddress(); - this.contract5 = contract5; - - const contract6 = await deployTfheTestFixture6(); - this.contract6Address = await contract6.getAddress(); - this.contract6 = contract6; - - const contract7 = await deployTfheTestFixture7(); - this.contract7Address = await contract7.getAddress(); - this.contract7 = contract7; - - const contract8 = await deployTfheTestFixture8(); - this.contract8Address = await contract8.getAddress(); - this.contract8 = contract8; - - const contract9 = await deployTfheTestFixture9(); - this.contract9Address = await contract9.getAddress(); - this.contract9 = contract9; - - const contract10 = await deployTfheTestFixture10(); - this.contract10Address = await contract10.getAddress(); - this.contract10 = contract10; - - const contract11 = await deployTfheTestFixture11(); - this.contract11Address = await contract11.getAddress(); - this.contract11 = contract11; - - const instances = await createInstances(this.signers); - this.instances = instances; - }); - - it('test operator "neg" overload (euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457578680357072424439)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457578680357072424439n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.neg_euint256(encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(5327556057215497n); - }); - - it('test operator "not" overload (euint256) => euint256 test 1 (115792089237316195423570985008687907853269984665640564039457581938347870429377)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract11Address, this.signers.alice.address); - input.add256(115792089237316195423570985008687907853269984665640564039457581938347870429377n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract11.not_euint256(encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt256(await this.contract11.res256()); - expect(res).to.equal(2069565259210558n); - }); -}); diff --git a/contracts/test/tfheOperations/tfheOperations2.ts b/contracts/test/tfheOperations/tfheOperations2.ts deleted file mode 100644 index 93245365..00000000 --- a/contracts/test/tfheOperations/tfheOperations2.ts +++ /dev/null @@ -1,4357 +0,0 @@ -import { expect } from 'chai'; -import { ethers } from 'hardhat'; - -import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1'; -import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2'; -import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'; -import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4'; -import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5'; -import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6'; -import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7'; -import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8'; -import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9'; -import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10'; -import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11'; -import { - createInstances, - decrypt4, - decrypt8, - decrypt16, - decrypt32, - decrypt64, - decrypt128, - decrypt256, - decryptBool, -} from '../instance'; -import { getSigners, initSigners } from '../signers'; - -async function deployTfheTestFixture1(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture2(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture3(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture4(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture5(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture6(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture7(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite7'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture8(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite8'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture9(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite9'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture10(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite10'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture11(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite11'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -describe('TFHE operations 2', function () { - before(async function () { - await initSigners(1); - this.signers = await getSigners(); - - const contract1 = await deployTfheTestFixture1(); - this.contract1Address = await contract1.getAddress(); - this.contract1 = contract1; - - const contract2 = await deployTfheTestFixture2(); - this.contract2Address = await contract2.getAddress(); - this.contract2 = contract2; - - const contract3 = await deployTfheTestFixture3(); - this.contract3Address = await contract3.getAddress(); - this.contract3 = contract3; - - const contract4 = await deployTfheTestFixture4(); - this.contract4Address = await contract4.getAddress(); - this.contract4 = contract4; - - const contract5 = await deployTfheTestFixture5(); - this.contract5Address = await contract5.getAddress(); - this.contract5 = contract5; - - const contract6 = await deployTfheTestFixture6(); - this.contract6Address = await contract6.getAddress(); - this.contract6 = contract6; - - const contract7 = await deployTfheTestFixture7(); - this.contract7Address = await contract7.getAddress(); - this.contract7 = contract7; - - const contract8 = await deployTfheTestFixture8(); - this.contract8Address = await contract8.getAddress(); - this.contract8 = contract8; - - const contract9 = await deployTfheTestFixture9(); - this.contract9Address = await contract9.getAddress(); - this.contract9 = contract9; - - const contract10 = await deployTfheTestFixture10(); - this.contract10Address = await contract10.getAddress(); - this.contract10 = contract10; - - const contract11 = await deployTfheTestFixture11(); - this.contract11Address = await contract11.getAddress(); - this.contract11 = contract11; - - const instances = await createInstances(this.signers); - this.instances = instances; - }); - - it('test operator "le" overload (euint4, euint128) => ebool test 1 (5, 340282366920938463463372463025889881069)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add128(340282366920938463463372463025889881069n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint128) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add128(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint128) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add128(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint128) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add128(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.le_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint4, euint128) => ebool test 1 (8, 340282366920938463463367828600285579945)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add128(340282366920938463463367828600285579945n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint4, euint128) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add128(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint4, euint128) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add128(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint4, euint128) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add128(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.lt_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract1.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint4, euint128) => euint128 test 1 (14, 340282366920938463463373484167219835469)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add128(340282366920938463463373484167219835469n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(14n); - }); - - it('test operator "min" overload (euint4, euint128) => euint128 test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(10n); - input.add128(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(10n); - }); - - it('test operator "min" overload (euint4, euint128) => euint128 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add128(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(14n); - }); - - it('test operator "min" overload (euint4, euint128) => euint128 test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add128(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.min_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(10n); - }); - - it('test operator "max" overload (euint4, euint128) => euint128 test 1 (1, 340282366920938463463366284713062311837)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(1n); - input.add128(340282366920938463463366284713062311837n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(340282366920938463463366284713062311837n); - }); - - it('test operator "max" overload (euint4, euint128) => euint128 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add128(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(8n); - }); - - it('test operator "max" overload (euint4, euint128) => euint128 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add128(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(8n); - }); - - it('test operator "max" overload (euint4, euint128) => euint128 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add128(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.max_euint4_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract1.res128()); - expect(res).to.equal(8n); - }); - - it('test operator "add" overload (euint4, euint256) => euint256 test 1 (2, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(2n); - input.add256(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(11n); - }); - - it('test operator "add" overload (euint4, euint256) => euint256 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add256(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(12n); - }); - - it('test operator "add" overload (euint4, euint256) => euint256 test 3 (5, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add256(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(10n); - }); - - it('test operator "add" overload (euint4, euint256) => euint256 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add256(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.add_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(12n); - }); - - it('test operator "sub" overload (euint4, euint256) => euint256 test 1 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add256(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.sub_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint4, euint256) => euint256 test 2 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(14n); - input.add256(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.sub_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint4, euint256) => euint256 test 1 (2, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(2n); - input.add256(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(10n); - }); - - it('test operator "mul" overload (euint4, euint256) => euint256 test 2 (3, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); - input.add256(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(15n); - }); - - it('test operator "mul" overload (euint4, euint256) => euint256 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); - input.add256(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(9n); - }); - - it('test operator "mul" overload (euint4, euint256) => euint256 test 4 (5, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add256(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.mul_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(15n); - }); - - it('test operator "and" overload (euint4, euint256) => euint256 test 1 (3, 115792089237316195423570985008687907853269984665640564039457581650107790454269)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(3n); - input.add256(115792089237316195423570985008687907853269984665640564039457581650107790454269n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(1n); - }); - - it('test operator "and" overload (euint4, euint256) => euint256 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add256(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "and" overload (euint4, euint256) => euint256 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add256(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(8n); - }); - - it('test operator "and" overload (euint4, euint256) => euint256 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add256(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.and_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "or" overload (euint4, euint256) => euint256 test 1 (8, 115792089237316195423570985008687907853269984665640564039457583166606888282231)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add256(115792089237316195423570985008687907853269984665640564039457583166606888282231n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457583166606888282239n); - }); - - it('test operator "or" overload (euint4, euint256) => euint256 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add256(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(12n); - }); - - it('test operator "or" overload (euint4, euint256) => euint256 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add256(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(8n); - }); - - it('test operator "or" overload (euint4, euint256) => euint256 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add256(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.or_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint4, euint256) => euint256 test 1 (5, 115792089237316195423570985008687907853269984665640564039457578855535245251769)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(5n); - input.add256(115792089237316195423570985008687907853269984665640564039457578855535245251769n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457578855535245251772n); - }); - - it('test operator "xor" overload (euint4, euint256) => euint256 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(4n); - input.add256(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint4, euint256) => euint256 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add256(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint4, euint256) => euint256 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract1Address, this.signers.alice.address); - input.add4(8n); - input.add256(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract1.xor_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract1.res256()); - expect(res).to.equal(12n); - }); - - it('test operator "eq" overload (euint4, euint256) => ebool test 1 (14, 115792089237316195423570985008687907853269984665640564039457583778640701263885)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(14n); - input.add256(115792089237316195423570985008687907853269984665640564039457583778640701263885n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint4, euint256) => ebool test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(10n); - input.add256(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint4, euint256) => ebool test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(14n); - input.add256(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint4, euint256) => ebool test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(14n); - input.add256(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint4, euint256) => ebool test 1 (14, 115792089237316195423570985008687907853269984665640564039457581114073806378677)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(14n); - input.add256(115792089237316195423570985008687907853269984665640564039457581114073806378677n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint4, euint256) => ebool test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(10n); - input.add256(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint4, euint256) => ebool test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(14n); - input.add256(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint4, euint256) => ebool test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(14n); - input.add256(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint4, euint256) => ebool test 1 (5, 115792089237316195423570985008687907853269984665640564039457582400238586978263)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(5n); - input.add256(115792089237316195423570985008687907853269984665640564039457582400238586978263n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint4, euint256) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(4n); - input.add256(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint4, euint256) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - input.add256(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint4, euint256) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - input.add256(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint4, euint256) => ebool test 1 (1, 115792089237316195423570985008687907853269984665640564039457576918680285784187)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(1n); - input.add256(115792089237316195423570985008687907853269984665640564039457576918680285784187n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint256) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(4n); - input.add256(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint256) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - input.add256(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, euint256) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - input.add256(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint256) => ebool test 1 (12, 115792089237316195423570985008687907853269984665640564039457582708981712427829)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(12n); - input.add256(115792089237316195423570985008687907853269984665640564039457582708981712427829n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint256) => ebool test 2 (8, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - input.add256(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint256) => ebool test 3 (12, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(12n); - input.add256(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, euint256) => ebool test 4 (12, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(12n); - input.add256(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint4, euint256) => ebool test 1 (11, 115792089237316195423570985008687907853269984665640564039457582432165171824629)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(11n); - input.add256(115792089237316195423570985008687907853269984665640564039457582432165171824629n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint4, euint256) => ebool test 2 (7, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(7n); - input.add256(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint4, euint256) => ebool test 3 (11, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(11n); - input.add256(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint4, euint256) => ebool test 4 (11, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(11n); - input.add256(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint4, euint256) => euint256 test 1 (1, 115792089237316195423570985008687907853269984665640564039457580584483222103041)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(1n); - input.add256(115792089237316195423570985008687907853269984665640564039457580584483222103041n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract2.res256()); - expect(res).to.equal(1n); - }); - - it('test operator "min" overload (euint4, euint256) => euint256 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(4n); - input.add256(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract2.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "min" overload (euint4, euint256) => euint256 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - input.add256(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract2.res256()); - expect(res).to.equal(8n); - }); - - it('test operator "min" overload (euint4, euint256) => euint256 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - input.add256(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract2.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "max" overload (euint4, euint256) => euint256 test 1 (9, 115792089237316195423570985008687907853269984665640564039457577693528211281505)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(9n); - input.add256(115792089237316195423570985008687907853269984665640564039457577693528211281505n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract2.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457577693528211281505n); - }); - - it('test operator "max" overload (euint4, euint256) => euint256 test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(5n); - input.add256(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract2.res256()); - expect(res).to.equal(9n); - }); - - it('test operator "max" overload (euint4, euint256) => euint256 test 3 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(9n); - input.add256(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract2.res256()); - expect(res).to.equal(9n); - }); - - it('test operator "max" overload (euint4, euint256) => euint256 test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(9n); - input.add256(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_euint4_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract2.res256()); - expect(res).to.equal(9n); - }); - - it('test operator "add" overload (euint4, uint8) => euint4 test 1 (9, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(9n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint4_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(11n); - }); - - it('test operator "add" overload (euint4, uint8) => euint4 test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(5n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(14n); - }); - - it('test operator "add" overload (euint4, uint8) => euint4 test 3 (5, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(5n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint4_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(10n); - }); - - it('test operator "add" overload (euint4, uint8) => euint4 test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(9n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint4_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(14n); - }); - - it('test operator "add" overload (uint8, euint4) => euint4 test 1 (6, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_uint8_euint4(6n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(15n); - }); - - it('test operator "add" overload (uint8, euint4) => euint4 test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(14n); - }); - - it('test operator "add" overload (uint8, euint4) => euint4 test 3 (5, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(10n); - }); - - it('test operator "add" overload (uint8, euint4) => euint4 test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(14n); - }); - - it('test operator "sub" overload (euint4, uint8) => euint4 test 1 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.sub_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint4, uint8) => euint4 test 2 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.sub_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(4n); - }); - - it('test operator "sub" overload (uint8, euint4) => euint4 test 1 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.sub_uint8_euint4(14n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (uint8, euint4) => euint4 test 2 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.sub_uint8_euint4(14n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint4, uint8) => euint4 test 1 (3, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(3n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(12n); - }); - - it('test operator "mul" overload (euint4, uint8) => euint4 test 2 (3, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(3n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint4_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(15n); - }); - - it('test operator "mul" overload (euint4, uint8) => euint4 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(3n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint4_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(9n); - }); - - it('test operator "mul" overload (euint4, uint8) => euint4 test 4 (5, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(5n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint4_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(15n); - }); - - it('test operator "mul" overload (uint8, euint4) => euint4 test 1 (2, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_uint8_euint4(2n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(8n); - }); - - it('test operator "mul" overload (uint8, euint4) => euint4 test 2 (3, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_uint8_euint4(3n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(15n); - }); - - it('test operator "mul" overload (uint8, euint4) => euint4 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_uint8_euint4(3n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(9n); - }); - - it('test operator "mul" overload (uint8, euint4) => euint4 test 4 (5, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(15n); - }); - - it('test operator "div" overload (euint4, uint8) => euint4 test 1 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(14n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.div_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(1n); - }); - - it('test operator "div" overload (euint4, uint8) => euint4 test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(10n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.div_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(0n); - }); - - it('test operator "div" overload (euint4, uint8) => euint4 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(14n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.div_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(1n); - }); - - it('test operator "div" overload (euint4, uint8) => euint4 test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(14n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.div_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(1n); - }); - - it('test operator "rem" overload (euint4, uint8) => euint4 test 1 (13, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(13n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.rem_euint4_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(1n); - }); - - it('test operator "rem" overload (euint4, uint8) => euint4 test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(9n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.rem_euint4_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(9n); - }); - - it('test operator "rem" overload (euint4, uint8) => euint4 test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(13n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.rem_euint4_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(0n); - }); - - it('test operator "rem" overload (euint4, uint8) => euint4 test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(13n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.rem_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(4n); - }); - - it('test operator "and" overload (euint4, uint8) => euint4 test 1 (10, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(10n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(0n); - }); - - it('test operator "and" overload (euint4, uint8) => euint4 test 2 (6, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(6n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(2n); - }); - - it('test operator "and" overload (euint4, uint8) => euint4 test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(10n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(10n); - }); - - it('test operator "and" overload (euint4, uint8) => euint4 test 4 (10, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(10n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_euint4_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(2n); - }); - - it('test operator "and" overload (uint8, euint4) => euint4 test 1 (12, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_uint8_euint4(12n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(4n); - }); - - it('test operator "and" overload (uint8, euint4) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(0n); - }); - - it('test operator "and" overload (uint8, euint4) => euint4 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(8n); - }); - - it('test operator "and" overload (uint8, euint4) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(0n); - }); - - it('test operator "or" overload (euint4, uint8) => euint4 test 1 (8, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(9n); - }); - - it('test operator "or" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(12n); - }); - - it('test operator "or" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(8n); - }); - - it('test operator "or" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(12n); - }); - - it('test operator "or" overload (uint8, euint4) => euint4 test 1 (13, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_uint8_euint4(13n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(15n); - }); - - it('test operator "or" overload (uint8, euint4) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(12n); - }); - - it('test operator "or" overload (uint8, euint4) => euint4 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(8n); - }); - - it('test operator "or" overload (uint8, euint4) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint4, uint8) => euint4 test 1 (10, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(10n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_euint4_uint8(encryptedAmount.handles[0], 12n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(6n); - }); - - it('test operator "xor" overload (euint4, uint8) => euint4 test 2 (6, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(6n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint4, uint8) => euint4 test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(10n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint4, uint8) => euint4 test 4 (10, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(10n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_euint4_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (uint8, euint4) => euint4 test 1 (1, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_uint8_euint4(1n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(5n); - }); - - it('test operator "xor" overload (uint8, euint4) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (uint8, euint4) => euint4 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (uint8, euint4) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(12n); - }); - - it('test operator "eq" overload (euint4, uint8) => ebool test 1 (14, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(14n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint4_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint4, uint8) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint4, uint8) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint4, uint8) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint8, euint4) => ebool test 1 (1, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_uint8_euint4(1n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint8, euint4) => ebool test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint8, euint4) => ebool test 3 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (uint8, euint4) => ebool test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint4, uint8) => ebool test 1 (8, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint4, uint8) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint4, uint8) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint4, uint8) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint8, euint4) => ebool test 1 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint8, euint4) => ebool test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint8, euint4) => ebool test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_uint8_euint4(13n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (uint8, euint4) => ebool test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_uint8_euint4(13n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint4, uint8) => ebool test 1 (3, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(3n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint4_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint4, uint8) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint4, uint8) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint4, uint8) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (uint8, euint4) => ebool test 1 (14, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(1n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_uint8_euint4(14n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (uint8, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (uint8, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (uint8, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint4, uint8) => ebool test 1 (1, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(1n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint4_uint8(encryptedAmount.handles[0], 3n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, uint8) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, uint8) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint4, uint8) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (uint8, euint4) => ebool test 1 (1, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_uint8_euint4(1n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (uint8, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_uint8_euint4(4n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (uint8, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (uint8, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_uint8_euint4(8n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, uint8) => ebool test 1 (1, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(1n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint4_uint8(encryptedAmount.handles[0], 2n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, uint8) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, uint8) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint4, uint8) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (uint8, euint4) => ebool test 1 (11, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_uint8_euint4(11n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (uint8, euint4) => ebool test 2 (6, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_uint8_euint4(6n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (uint8, euint4) => ebool test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_uint8_euint4(10n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (uint8, euint4) => ebool test 4 (10, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_uint8_euint4(10n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint4, uint8) => ebool test 1 (12, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(12n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint4_uint8(encryptedAmount.handles[0], 9n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint4, uint8) => ebool test 2 (8, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint4_uint8(encryptedAmount.handles[0], 12n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint4, uint8) => ebool test 3 (12, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(12n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint4_uint8(encryptedAmount.handles[0], 12n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint4, uint8) => ebool test 4 (12, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(12n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (uint8, euint4) => ebool test 1 (5, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (uint8, euint4) => ebool test 2 (7, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_uint8_euint4(7n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (uint8, euint4) => ebool test 3 (11, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_uint8_euint4(11n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (uint8, euint4) => ebool test 4 (11, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_uint8_euint4(11n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint4, uint8) => euint4 test 1 (5, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(5n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint4_uint8(encryptedAmount.handles[0], 5n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(5n); - }); - - it('test operator "min" overload (euint4, uint8) => euint4 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(4n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(4n); - }); - - it('test operator "min" overload (euint4, uint8) => euint4 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint4_uint8(encryptedAmount.handles[0], 8n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(8n); - }); - - it('test operator "min" overload (euint4, uint8) => euint4 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(8n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint4_uint8(encryptedAmount.handles[0], 4n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(4n); - }); - - it('test operator "min" overload (uint8, euint4) => euint4 test 1 (5, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_uint8_euint4(5n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(5n); - }); - - it('test operator "min" overload (uint8, euint4) => euint4 test 2 (7, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_uint8_euint4(7n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(7n); - }); - - it('test operator "min" overload (uint8, euint4) => euint4 test 3 (11, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_uint8_euint4(11n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(11n); - }); - - it('test operator "min" overload (uint8, euint4) => euint4 test 4 (11, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_uint8_euint4(11n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(7n); - }); - - it('test operator "max" overload (euint4, uint8) => euint4 test 1 (14, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(14n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_euint4_uint8(encryptedAmount.handles[0], 7n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(14n); - }); - - it('test operator "max" overload (euint4, uint8) => euint4 test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(10n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(14n); - }); - - it('test operator "max" overload (euint4, uint8) => euint4 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(14n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_euint4_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(14n); - }); - - it('test operator "max" overload (euint4, uint8) => euint4 test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add4(14n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_euint4_uint8(encryptedAmount.handles[0], 10n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(14n); - }); - - it('test operator "max" overload (uint8, euint4) => euint4 test 1 (14, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_uint8_euint4(14n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(14n); - }); - - it('test operator "max" overload (uint8, euint4) => euint4 test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_uint8_euint4(9n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(13n); - }); - - it('test operator "max" overload (uint8, euint4) => euint4 test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_uint8_euint4(13n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(13n); - }); - - it('test operator "max" overload (uint8, euint4) => euint4 test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_uint8_euint4(13n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt4(await this.contract2.res4()); - expect(res).to.equal(13n); - }); - - it('test operator "add" overload (euint8, euint4) => euint8 test 1 (10, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(10n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(12n); - }); - - it('test operator "add" overload (euint8, euint4) => euint8 test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(5n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(14n); - }); - - it('test operator "add" overload (euint8, euint4) => euint8 test 3 (5, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(5n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(10n); - }); - - it('test operator "add" overload (euint8, euint4) => euint8 test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(9n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(14n); - }); - - it('test operator "sub" overload (euint8, euint4) => euint8 test 1 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(14n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.sub_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint8, euint4) => euint8 test 2 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(14n); - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.sub_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint8, euint4) => euint8 test 1 (7, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(7n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(14n); - }); - - it('test operator "mul" overload (euint8, euint4) => euint8 test 2 (3, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(3n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(15n); - }); - - it('test operator "mul" overload (euint8, euint4) => euint8 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(3n); - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(9n); - }); - - it('test operator "mul" overload (euint8, euint4) => euint8 test 4 (5, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(5n); - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(15n); - }); - - it('test operator "and" overload (euint8, euint4) => euint8 test 1 (118, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(118n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "and" overload (euint8, euint4) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(0n); - }); - - it('test operator "and" overload (euint8, euint4) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(8n); - }); - - it('test operator "and" overload (euint8, euint4) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(0n); - }); - - it('test operator "or" overload (euint8, euint4) => euint8 test 1 (189, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(189n); - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(191n); - }); - - it('test operator "or" overload (euint8, euint4) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(12n); - }); - - it('test operator "or" overload (euint8, euint4) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(8n); - }); - - it('test operator "or" overload (euint8, euint4) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint8, euint4) => euint8 test 1 (104, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(104n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(108n); - }); - - it('test operator "xor" overload (euint8, euint4) => euint8 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint8, euint4) => euint8 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint8, euint4) => euint8 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(12n); - }); - - it('test operator "eq" overload (euint8, euint4) => ebool test 1 (65, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(65n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint8, euint4) => ebool test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(5n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint8, euint4) => ebool test 3 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(9n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint8, euint4) => ebool test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(9n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint8, euint4) => ebool test 1 (27, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(27n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint8, euint4) => ebool test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(9n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint8, euint4) => ebool test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(13n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint8, euint4) => ebool test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(13n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint8, euint4) => ebool test 1 (53, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(53n); - input.add4(1n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint8, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint8, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint8, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint8, euint4) => ebool test 1 (94, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(94n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint8, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint4) => ebool test 1 (26, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(26n); - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint8, euint4) => ebool test 2 (6, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(6n); - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint4) => ebool test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(10n); - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint4) => ebool test 4 (10, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(10n); - input.add4(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint8, euint4) => ebool test 1 (163, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(163n); - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint8, euint4) => ebool test 2 (7, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(7n); - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint8, euint4) => ebool test 3 (11, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(11n); - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint8, euint4) => ebool test 4 (11, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(11n); - input.add4(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint8, euint4) => euint8 test 1 (51, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(51n); - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(11n); - }); - - it('test operator "min" overload (euint8, euint4) => euint8 test 2 (7, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(7n); - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(7n); - }); - - it('test operator "min" overload (euint8, euint4) => euint8 test 3 (11, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(11n); - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(11n); - }); - - it('test operator "min" overload (euint8, euint4) => euint8 test 4 (11, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(11n); - input.add4(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(7n); - }); - - it('test operator "max" overload (euint8, euint4) => euint8 test 1 (62, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(62n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(62n); - }); - - it('test operator "max" overload (euint8, euint4) => euint8 test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(9n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(13n); - }); - - it('test operator "max" overload (euint8, euint4) => euint8 test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(13n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(13n); - }); - - it('test operator "max" overload (euint8, euint4) => euint8 test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(13n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_euint8_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(13n); - }); - - it('test operator "add" overload (euint8, euint8) => euint8 test 1 (219, 18)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(219n); - input.add8(18n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(237n); - }); - - it('test operator "add" overload (euint8, euint8) => euint8 test 2 (14, 18)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(14n); - input.add8(18n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(32n); - }); - - it('test operator "add" overload (euint8, euint8) => euint8 test 3 (18, 18)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(18n); - input.add8(18n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(36n); - }); - - it('test operator "add" overload (euint8, euint8) => euint8 test 4 (18, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(18n); - input.add8(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(32n); - }); - - it('test operator "sub" overload (euint8, euint8) => euint8 test 1 (152, 152)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(152n); - input.add8(152n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.sub_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint8, euint8) => euint8 test 2 (152, 148)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(152n); - input.add8(148n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.sub_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint8, euint8) => euint8 test 1 (8, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(8n); - input.add8(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(96n); - }); - - it('test operator "mul" overload (euint8, euint8) => euint8 test 2 (12, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(12n); - input.add8(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(168n); - }); - - it('test operator "mul" overload (euint8, euint8) => euint8 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(14n); - input.add8(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(196n); - }); - - it('test operator "mul" overload (euint8, euint8) => euint8 test 4 (14, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(14n); - input.add8(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(168n); - }); - - it('test operator "and" overload (euint8, euint8) => euint8 test 1 (183, 135)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(183n); - input.add8(135n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(135n); - }); - - it('test operator "and" overload (euint8, euint8) => euint8 test 2 (131, 135)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(131n); - input.add8(135n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(131n); - }); - - it('test operator "and" overload (euint8, euint8) => euint8 test 3 (135, 135)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(135n); - input.add8(135n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(135n); - }); - - it('test operator "and" overload (euint8, euint8) => euint8 test 4 (135, 131)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(135n); - input.add8(131n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(131n); - }); - - it('test operator "or" overload (euint8, euint8) => euint8 test 1 (189, 251)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(189n); - input.add8(251n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(255n); - }); - - it('test operator "or" overload (euint8, euint8) => euint8 test 2 (185, 189)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(185n); - input.add8(189n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(189n); - }); - - it('test operator "or" overload (euint8, euint8) => euint8 test 3 (189, 189)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(189n); - input.add8(189n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(189n); - }); - - it('test operator "or" overload (euint8, euint8) => euint8 test 4 (189, 185)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(189n); - input.add8(185n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(189n); - }); - - it('test operator "xor" overload (euint8, euint8) => euint8 test 1 (234, 150)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(234n); - input.add8(150n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(124n); - }); - - it('test operator "xor" overload (euint8, euint8) => euint8 test 2 (146, 150)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(146n); - input.add8(150n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint8, euint8) => euint8 test 3 (150, 150)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(150n); - input.add8(150n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint8, euint8) => euint8 test 4 (150, 146)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(150n); - input.add8(146n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint8, euint8) => ebool test 1 (175, 224)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(175n); - input.add8(224n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint8, euint8) => ebool test 2 (171, 175)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(171n); - input.add8(175n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint8, euint8) => ebool test 3 (175, 175)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(175n); - input.add8(175n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint8, euint8) => ebool test 4 (175, 171)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(175n); - input.add8(171n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint8, euint8) => ebool test 1 (197, 245)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(197n); - input.add8(245n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint8, euint8) => ebool test 2 (193, 197)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(193n); - input.add8(197n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint8, euint8) => ebool test 3 (197, 197)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(197n); - input.add8(197n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint8, euint8) => ebool test 4 (197, 193)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(197n); - input.add8(193n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint8, euint8) => ebool test 1 (63, 190)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(63n); - input.add8(190n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint8, euint8) => ebool test 2 (59, 63)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(59n); - input.add8(63n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint8, euint8) => ebool test 3 (63, 63)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(63n); - input.add8(63n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint8, euint8) => ebool test 4 (63, 59)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(63n); - input.add8(59n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint8, euint8) => ebool test 1 (239, 212)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(239n); - input.add8(212n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint8, euint8) => ebool test 2 (208, 212)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(208n); - input.add8(212n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, euint8) => ebool test 3 (212, 212)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(212n); - input.add8(212n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, euint8) => ebool test 4 (212, 208)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(212n); - input.add8(208n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint8) => ebool test 1 (124, 71)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(124n); - input.add8(71n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint8, euint8) => ebool test 2 (67, 71)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(67n); - input.add8(71n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint8) => ebool test 3 (71, 71)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(71n); - input.add8(71n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint8) => ebool test 4 (71, 67)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(71n); - input.add8(67n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint8, euint8) => ebool test 1 (221, 45)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(221n); - input.add8(45n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint8, euint8) => ebool test 2 (41, 45)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(41n); - input.add8(45n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint8, euint8) => ebool test 3 (45, 45)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(45n); - input.add8(45n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint8, euint8) => ebool test 4 (45, 41)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(45n); - input.add8(41n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint8, euint8) => euint8 test 1 (183, 84)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(183n); - input.add8(84n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(84n); - }); - - it('test operator "min" overload (euint8, euint8) => euint8 test 2 (80, 84)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(80n); - input.add8(84n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(80n); - }); - - it('test operator "min" overload (euint8, euint8) => euint8 test 3 (84, 84)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(84n); - input.add8(84n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(84n); - }); - - it('test operator "min" overload (euint8, euint8) => euint8 test 4 (84, 80)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(84n); - input.add8(80n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(80n); - }); - - it('test operator "max" overload (euint8, euint8) => euint8 test 1 (17, 182)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(17n); - input.add8(182n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(182n); - }); - - it('test operator "max" overload (euint8, euint8) => euint8 test 2 (13, 17)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(13n); - input.add8(17n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(17n); - }); - - it('test operator "max" overload (euint8, euint8) => euint8 test 3 (17, 17)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(17n); - input.add8(17n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(17n); - }); - - it('test operator "max" overload (euint8, euint8) => euint8 test 4 (17, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(17n); - input.add8(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_euint8_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt8(await this.contract2.res8()); - expect(res).to.equal(17n); - }); - - it('test operator "add" overload (euint8, euint16) => euint16 test 1 (2, 132)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(2n); - input.add16(132n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(134n); - }); - - it('test operator "add" overload (euint8, euint16) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(4n); - input.add16(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(12n); - }); - - it('test operator "add" overload (euint8, euint16) => euint16 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(8n); - input.add16(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(16n); - }); - - it('test operator "add" overload (euint8, euint16) => euint16 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(8n); - input.add16(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(12n); - }); - - it('test operator "sub" overload (euint8, euint16) => euint16 test 1 (32, 32)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(32n); - input.add16(32n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.sub_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint8, euint16) => euint16 test 2 (32, 28)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(32n); - input.add16(28n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.sub_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint8, euint16) => euint16 test 1 (2, 60)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(2n); - input.add16(60n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(120n); - }); - - it('test operator "mul" overload (euint8, euint16) => euint16 test 2 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(13n); - input.add16(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(169n); - }); - - it('test operator "mul" overload (euint8, euint16) => euint16 test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(13n); - input.add16(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(169n); - }); - - it('test operator "mul" overload (euint8, euint16) => euint16 test 4 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(13n); - input.add16(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(169n); - }); - - it('test operator "and" overload (euint8, euint16) => euint16 test 1 (225, 29113)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(225n); - input.add16(29113n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(161n); - }); - - it('test operator "and" overload (euint8, euint16) => euint16 test 2 (221, 225)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(221n); - input.add16(225n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(193n); - }); - - it('test operator "and" overload (euint8, euint16) => euint16 test 3 (225, 225)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(225n); - input.add16(225n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(225n); - }); - - it('test operator "and" overload (euint8, euint16) => euint16 test 4 (225, 221)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(225n); - input.add16(221n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(193n); - }); -}); diff --git a/contracts/test/tfheOperations/tfheOperations3.ts b/contracts/test/tfheOperations/tfheOperations3.ts deleted file mode 100644 index 33df958e..00000000 --- a/contracts/test/tfheOperations/tfheOperations3.ts +++ /dev/null @@ -1,4613 +0,0 @@ -import { expect } from 'chai'; -import { ethers } from 'hardhat'; - -import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1'; -import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2'; -import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'; -import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4'; -import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5'; -import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6'; -import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7'; -import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8'; -import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9'; -import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10'; -import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11'; -import { - createInstances, - decrypt4, - decrypt8, - decrypt16, - decrypt32, - decrypt64, - decrypt128, - decrypt256, - decryptBool, -} from '../instance'; -import { getSigners, initSigners } from '../signers'; - -async function deployTfheTestFixture1(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture2(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture3(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture4(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture5(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture6(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture7(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite7'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture8(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite8'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture9(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite9'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture10(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite10'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture11(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite11'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -describe('TFHE operations 3', function () { - before(async function () { - await initSigners(1); - this.signers = await getSigners(); - - const contract1 = await deployTfheTestFixture1(); - this.contract1Address = await contract1.getAddress(); - this.contract1 = contract1; - - const contract2 = await deployTfheTestFixture2(); - this.contract2Address = await contract2.getAddress(); - this.contract2 = contract2; - - const contract3 = await deployTfheTestFixture3(); - this.contract3Address = await contract3.getAddress(); - this.contract3 = contract3; - - const contract4 = await deployTfheTestFixture4(); - this.contract4Address = await contract4.getAddress(); - this.contract4 = contract4; - - const contract5 = await deployTfheTestFixture5(); - this.contract5Address = await contract5.getAddress(); - this.contract5 = contract5; - - const contract6 = await deployTfheTestFixture6(); - this.contract6Address = await contract6.getAddress(); - this.contract6 = contract6; - - const contract7 = await deployTfheTestFixture7(); - this.contract7Address = await contract7.getAddress(); - this.contract7 = contract7; - - const contract8 = await deployTfheTestFixture8(); - this.contract8Address = await contract8.getAddress(); - this.contract8 = contract8; - - const contract9 = await deployTfheTestFixture9(); - this.contract9Address = await contract9.getAddress(); - this.contract9 = contract9; - - const contract10 = await deployTfheTestFixture10(); - this.contract10Address = await contract10.getAddress(); - this.contract10 = contract10; - - const contract11 = await deployTfheTestFixture11(); - this.contract11Address = await contract11.getAddress(); - this.contract11 = contract11; - - const instances = await createInstances(this.signers); - this.instances = instances; - }); - - it('test operator "or" overload (euint8, euint16) => euint16 test 1 (20, 28056)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(20n); - input.add16(28056n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(28060n); - }); - - it('test operator "or" overload (euint8, euint16) => euint16 test 2 (16, 20)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(16n); - input.add16(20n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(20n); - }); - - it('test operator "or" overload (euint8, euint16) => euint16 test 3 (20, 20)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(20n); - input.add16(20n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(20n); - }); - - it('test operator "or" overload (euint8, euint16) => euint16 test 4 (20, 16)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(20n); - input.add16(16n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(20n); - }); - - it('test operator "xor" overload (euint8, euint16) => euint16 test 1 (233, 6463)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(233n); - input.add16(6463n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(6614n); - }); - - it('test operator "xor" overload (euint8, euint16) => euint16 test 2 (229, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(229n); - input.add16(233n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint8, euint16) => euint16 test 3 (233, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(233n); - input.add16(233n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint8, euint16) => euint16 test 4 (233, 229)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(233n); - input.add16(229n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(12n); - }); - - it('test operator "eq" overload (euint8, euint16) => ebool test 1 (205, 56577)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(205n); - input.add16(56577n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint8, euint16) => ebool test 2 (201, 205)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(201n); - input.add16(205n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint8, euint16) => ebool test 3 (205, 205)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(205n); - input.add16(205n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint8, euint16) => ebool test 4 (205, 201)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(205n); - input.add16(201n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint8, euint16) => ebool test 1 (128, 47128)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(128n); - input.add16(47128n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint8, euint16) => ebool test 2 (124, 128)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(124n); - input.add16(128n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint8, euint16) => ebool test 3 (128, 128)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(128n); - input.add16(128n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint8, euint16) => ebool test 4 (128, 124)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(128n); - input.add16(124n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint8, euint16) => ebool test 1 (93, 62769)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(93n); - input.add16(62769n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint8, euint16) => ebool test 2 (89, 93)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(89n); - input.add16(93n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint8, euint16) => ebool test 3 (93, 93)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(93n); - input.add16(93n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint8, euint16) => ebool test 4 (93, 89)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(93n); - input.add16(89n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint8, euint16) => ebool test 1 (207, 17375)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(207n); - input.add16(17375n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, euint16) => ebool test 2 (203, 207)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(203n); - input.add16(207n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, euint16) => ebool test 3 (207, 207)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(207n); - input.add16(207n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, euint16) => ebool test 4 (207, 203)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(207n); - input.add16(203n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint16) => ebool test 1 (32, 25116)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(32n); - input.add16(25116n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint16) => ebool test 2 (28, 32)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(28n); - input.add16(32n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint16) => ebool test 3 (32, 32)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(32n); - input.add16(32n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint16) => ebool test 4 (32, 28)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(32n); - input.add16(28n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.le_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint8, euint16) => ebool test 1 (31, 45682)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(31n); - input.add16(45682n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint8, euint16) => ebool test 2 (27, 31)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(27n); - input.add16(31n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint8, euint16) => ebool test 3 (31, 31)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(31n); - input.add16(31n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint8, euint16) => ebool test 4 (31, 27)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(31n); - input.add16(27n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.lt_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint8, euint16) => euint16 test 1 (83, 49187)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(83n); - input.add16(49187n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(83n); - }); - - it('test operator "min" overload (euint8, euint16) => euint16 test 2 (79, 83)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(79n); - input.add16(83n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(79n); - }); - - it('test operator "min" overload (euint8, euint16) => euint16 test 3 (83, 83)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(83n); - input.add16(83n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(83n); - }); - - it('test operator "min" overload (euint8, euint16) => euint16 test 4 (83, 79)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(83n); - input.add16(79n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.min_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(79n); - }); - - it('test operator "max" overload (euint8, euint16) => euint16 test 1 (252, 21942)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(252n); - input.add16(21942n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(21942n); - }); - - it('test operator "max" overload (euint8, euint16) => euint16 test 2 (248, 252)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(248n); - input.add16(252n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(252n); - }); - - it('test operator "max" overload (euint8, euint16) => euint16 test 3 (252, 252)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(252n); - input.add16(252n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(252n); - }); - - it('test operator "max" overload (euint8, euint16) => euint16 test 4 (252, 248)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(252n); - input.add16(248n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.max_euint8_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract2.res16()); - expect(res).to.equal(252n); - }); - - it('test operator "add" overload (euint8, euint32) => euint32 test 1 (2, 251)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(2n); - input.add32(251n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(253n); - }); - - it('test operator "add" overload (euint8, euint32) => euint32 test 2 (59, 63)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(59n); - input.add32(63n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(122n); - }); - - it('test operator "add" overload (euint8, euint32) => euint32 test 3 (63, 63)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(63n); - input.add32(63n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(126n); - }); - - it('test operator "add" overload (euint8, euint32) => euint32 test 4 (63, 59)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(63n); - input.add32(59n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.add_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(122n); - }); - - it('test operator "sub" overload (euint8, euint32) => euint32 test 1 (102, 102)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(102n); - input.add32(102n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.sub_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint8, euint32) => euint32 test 2 (102, 98)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(102n); - input.add32(98n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.sub_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint8, euint32) => euint32 test 1 (2, 79)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(2n); - input.add32(79n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(158n); - }); - - it('test operator "mul" overload (euint8, euint32) => euint32 test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(10n); - input.add32(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(140n); - }); - - it('test operator "mul" overload (euint8, euint32) => euint32 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(14n); - input.add32(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(196n); - }); - - it('test operator "mul" overload (euint8, euint32) => euint32 test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(14n); - input.add32(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.mul_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(140n); - }); - - it('test operator "and" overload (euint8, euint32) => euint32 test 1 (114, 3684671928)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(114n); - input.add32(3684671928n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(48n); - }); - - it('test operator "and" overload (euint8, euint32) => euint32 test 2 (110, 114)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(110n); - input.add32(114n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(98n); - }); - - it('test operator "and" overload (euint8, euint32) => euint32 test 3 (114, 114)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(114n); - input.add32(114n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(114n); - }); - - it('test operator "and" overload (euint8, euint32) => euint32 test 4 (114, 110)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(114n); - input.add32(110n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.and_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(98n); - }); - - it('test operator "or" overload (euint8, euint32) => euint32 test 1 (64, 694910711)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(64n); - input.add32(694910711n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(694910711n); - }); - - it('test operator "or" overload (euint8, euint32) => euint32 test 2 (60, 64)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(60n); - input.add32(64n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(124n); - }); - - it('test operator "or" overload (euint8, euint32) => euint32 test 3 (64, 64)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(64n); - input.add32(64n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(64n); - }); - - it('test operator "or" overload (euint8, euint32) => euint32 test 4 (64, 60)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(64n); - input.add32(60n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.or_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(124n); - }); - - it('test operator "xor" overload (euint8, euint32) => euint32 test 1 (200, 3474428988)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(200n); - input.add32(3474428988n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(3474429172n); - }); - - it('test operator "xor" overload (euint8, euint32) => euint32 test 2 (196, 200)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(196n); - input.add32(200n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint8, euint32) => euint32 test 3 (200, 200)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(200n); - input.add32(200n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint8, euint32) => euint32 test 4 (200, 196)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(200n); - input.add32(196n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.xor_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract2.res32()); - expect(res).to.equal(12n); - }); - - it('test operator "eq" overload (euint8, euint32) => ebool test 1 (226, 3320102390)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(226n); - input.add32(3320102390n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint8, euint32) => ebool test 2 (222, 226)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(222n); - input.add32(226n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint8, euint32) => ebool test 3 (226, 226)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(226n); - input.add32(226n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint8, euint32) => ebool test 4 (226, 222)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(226n); - input.add32(222n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.eq_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint8, euint32) => ebool test 1 (134, 943645708)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(134n); - input.add32(943645708n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint8, euint32) => ebool test 2 (130, 134)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(130n); - input.add32(134n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint8, euint32) => ebool test 3 (134, 134)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(134n); - input.add32(134n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint8, euint32) => ebool test 4 (134, 130)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(134n); - input.add32(130n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ne_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint8, euint32) => ebool test 1 (108, 54055221)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(108n); - input.add32(54055221n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint8, euint32) => ebool test 2 (104, 108)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(104n); - input.add32(108n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint8, euint32) => ebool test 3 (108, 108)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(108n); - input.add32(108n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint8, euint32) => ebool test 4 (108, 104)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(108n); - input.add32(104n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.ge_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint8, euint32) => ebool test 1 (16, 2217853328)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(16n); - input.add32(2217853328n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, euint32) => ebool test 2 (12, 16)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(12n); - input.add32(16n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, euint32) => ebool test 3 (16, 16)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(16n); - input.add32(16n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, euint32) => ebool test 4 (16, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract2Address, this.signers.alice.address); - input.add8(16n); - input.add32(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract2.gt_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract2.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint32) => ebool test 1 (162, 1086789383)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(162n); - input.add32(1086789383n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint32) => ebool test 2 (158, 162)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(158n); - input.add32(162n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint32) => ebool test 3 (162, 162)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(162n); - input.add32(162n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint32) => ebool test 4 (162, 158)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(162n); - input.add32(158n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint8, euint32) => ebool test 1 (111, 1481942282)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(111n); - input.add32(1481942282n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint8, euint32) => ebool test 2 (107, 111)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(107n); - input.add32(111n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint8, euint32) => ebool test 3 (111, 111)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(111n); - input.add32(111n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint8, euint32) => ebool test 4 (111, 107)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(111n); - input.add32(107n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint8, euint32) => euint32 test 1 (248, 4182541699)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(248n); - input.add32(4182541699n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(248n); - }); - - it('test operator "min" overload (euint8, euint32) => euint32 test 2 (244, 248)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(244n); - input.add32(248n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(244n); - }); - - it('test operator "min" overload (euint8, euint32) => euint32 test 3 (248, 248)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(248n); - input.add32(248n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(248n); - }); - - it('test operator "min" overload (euint8, euint32) => euint32 test 4 (248, 244)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(248n); - input.add32(244n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(244n); - }); - - it('test operator "max" overload (euint8, euint32) => euint32 test 1 (31, 3976371021)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(31n); - input.add32(3976371021n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(3976371021n); - }); - - it('test operator "max" overload (euint8, euint32) => euint32 test 2 (27, 31)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(27n); - input.add32(31n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(31n); - }); - - it('test operator "max" overload (euint8, euint32) => euint32 test 3 (31, 31)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(31n); - input.add32(31n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(31n); - }); - - it('test operator "max" overload (euint8, euint32) => euint32 test 4 (31, 27)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(31n); - input.add32(27n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint8_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract3.res32()); - expect(res).to.equal(31n); - }); - - it('test operator "add" overload (euint8, euint64) => euint64 test 1 (2, 129)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(2n); - input.add64(129n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(131n); - }); - - it('test operator "add" overload (euint8, euint64) => euint64 test 2 (87, 91)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(87n); - input.add64(91n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(178n); - }); - - it('test operator "add" overload (euint8, euint64) => euint64 test 3 (91, 91)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(91n); - input.add64(91n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(182n); - }); - - it('test operator "add" overload (euint8, euint64) => euint64 test 4 (91, 87)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(91n); - input.add64(87n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(178n); - }); - - it('test operator "sub" overload (euint8, euint64) => euint64 test 1 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(8n); - input.add64(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.sub_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint8, euint64) => euint64 test 2 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(8n); - input.add64(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.sub_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint8, euint64) => euint64 test 1 (2, 65)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(2n); - input.add64(65n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(130n); - }); - - it('test operator "mul" overload (euint8, euint64) => euint64 test 2 (8, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(8n); - input.add64(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(80n); - }); - - it('test operator "mul" overload (euint8, euint64) => euint64 test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(10n); - input.add64(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(100n); - }); - - it('test operator "mul" overload (euint8, euint64) => euint64 test 4 (10, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(10n); - input.add64(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(80n); - }); - - it('test operator "and" overload (euint8, euint64) => euint64 test 1 (203, 18443868996555285517)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(203n); - input.add64(18443868996555285517n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(9n); - }); - - it('test operator "and" overload (euint8, euint64) => euint64 test 2 (199, 203)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(199n); - input.add64(203n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(195n); - }); - - it('test operator "and" overload (euint8, euint64) => euint64 test 3 (203, 203)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(203n); - input.add64(203n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(203n); - }); - - it('test operator "and" overload (euint8, euint64) => euint64 test 4 (203, 199)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(203n); - input.add64(199n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(195n); - }); - - it('test operator "or" overload (euint8, euint64) => euint64 test 1 (22, 18446578065470955215)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(22n); - input.add64(18446578065470955215n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(18446578065470955231n); - }); - - it('test operator "or" overload (euint8, euint64) => euint64 test 2 (18, 22)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(18n); - input.add64(22n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(22n); - }); - - it('test operator "or" overload (euint8, euint64) => euint64 test 3 (22, 22)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(22n); - input.add64(22n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(22n); - }); - - it('test operator "or" overload (euint8, euint64) => euint64 test 4 (22, 18)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(22n); - input.add64(18n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(22n); - }); - - it('test operator "xor" overload (euint8, euint64) => euint64 test 1 (250, 18438760776575021013)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(250n); - input.add64(18438760776575021013n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(18438760776575020847n); - }); - - it('test operator "xor" overload (euint8, euint64) => euint64 test 2 (246, 250)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(246n); - input.add64(250n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint8, euint64) => euint64 test 3 (250, 250)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(250n); - input.add64(250n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint8, euint64) => euint64 test 4 (250, 246)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(250n); - input.add64(246n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(12n); - }); - - it('test operator "eq" overload (euint8, euint64) => ebool test 1 (141, 18441419220641833889)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(141n); - input.add64(18441419220641833889n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint8, euint64) => ebool test 2 (137, 141)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(137n); - input.add64(141n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint8, euint64) => ebool test 3 (141, 141)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(141n); - input.add64(141n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint8, euint64) => ebool test 4 (141, 137)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(141n); - input.add64(137n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint8, euint64) => ebool test 1 (99, 18445356789087657925)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(99n); - input.add64(18445356789087657925n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint8, euint64) => ebool test 2 (95, 99)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(95n); - input.add64(99n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint8, euint64) => ebool test 3 (99, 99)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(99n); - input.add64(99n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint8, euint64) => ebool test 4 (99, 95)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(99n); - input.add64(95n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint8, euint64) => ebool test 1 (27, 18441594146418724591)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(27n); - input.add64(18441594146418724591n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint8, euint64) => ebool test 2 (23, 27)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(23n); - input.add64(27n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint8, euint64) => ebool test 3 (27, 27)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(27n); - input.add64(27n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint8, euint64) => ebool test 4 (27, 23)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(27n); - input.add64(23n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint8, euint64) => ebool test 1 (58, 18442407989859516937)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(58n); - input.add64(18442407989859516937n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, euint64) => ebool test 2 (54, 58)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(54n); - input.add64(58n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, euint64) => ebool test 3 (58, 58)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(58n); - input.add64(58n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, euint64) => ebool test 4 (58, 54)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(58n); - input.add64(54n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint64) => ebool test 1 (124, 18443185604881328715)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(124n); - input.add64(18443185604881328715n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint64) => ebool test 2 (120, 124)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(120n); - input.add64(124n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint64) => ebool test 3 (124, 124)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(124n); - input.add64(124n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint64) => ebool test 4 (124, 120)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(124n); - input.add64(120n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint8, euint64) => ebool test 1 (213, 18441867518419136505)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(213n); - input.add64(18441867518419136505n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint8, euint64) => ebool test 2 (209, 213)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(209n); - input.add64(213n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint8, euint64) => ebool test 3 (213, 213)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(213n); - input.add64(213n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint8, euint64) => ebool test 4 (213, 209)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(213n); - input.add64(209n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint8, euint64) => euint64 test 1 (6, 18443833870782244811)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(6n); - input.add64(18443833870782244811n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(6n); - }); - - it('test operator "min" overload (euint8, euint64) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(4n); - input.add64(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "min" overload (euint8, euint64) => euint64 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(8n); - input.add64(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(8n); - }); - - it('test operator "min" overload (euint8, euint64) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(8n); - input.add64(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "max" overload (euint8, euint64) => euint64 test 1 (217, 18441870389911940983)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(217n); - input.add64(18441870389911940983n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(18441870389911940983n); - }); - - it('test operator "max" overload (euint8, euint64) => euint64 test 2 (213, 217)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(213n); - input.add64(217n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(217n); - }); - - it('test operator "max" overload (euint8, euint64) => euint64 test 3 (217, 217)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(217n); - input.add64(217n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(217n); - }); - - it('test operator "max" overload (euint8, euint64) => euint64 test 4 (217, 213)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(217n); - input.add64(213n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint8_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract3.res64()); - expect(res).to.equal(217n); - }); - - it('test operator "add" overload (euint8, euint128) => euint128 test 1 (2, 129)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(2n); - input.add128(129n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(131n); - }); - - it('test operator "add" overload (euint8, euint128) => euint128 test 2 (16, 20)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(16n); - input.add128(20n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(36n); - }); - - it('test operator "add" overload (euint8, euint128) => euint128 test 3 (20, 20)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(20n); - input.add128(20n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(40n); - }); - - it('test operator "add" overload (euint8, euint128) => euint128 test 4 (20, 16)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(20n); - input.add128(16n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(36n); - }); - - it('test operator "sub" overload (euint8, euint128) => euint128 test 1 (157, 157)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(157n); - input.add128(157n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.sub_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint8, euint128) => euint128 test 2 (157, 153)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(157n); - input.add128(153n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.sub_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint8, euint128) => euint128 test 1 (2, 65)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(2n); - input.add128(65n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(130n); - }); - - it('test operator "mul" overload (euint8, euint128) => euint128 test 2 (9, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(9n); - input.add128(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(90n); - }); - - it('test operator "mul" overload (euint8, euint128) => euint128 test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(10n); - input.add128(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(100n); - }); - - it('test operator "mul" overload (euint8, euint128) => euint128 test 4 (10, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(10n); - input.add128(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(90n); - }); - - it('test operator "and" overload (euint8, euint128) => euint128 test 1 (72, 340282366920938463463369134248162755643)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(72n); - input.add128(340282366920938463463369134248162755643n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(8n); - }); - - it('test operator "and" overload (euint8, euint128) => euint128 test 2 (68, 72)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(68n); - input.add128(72n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(64n); - }); - - it('test operator "and" overload (euint8, euint128) => euint128 test 3 (72, 72)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(72n); - input.add128(72n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(72n); - }); - - it('test operator "and" overload (euint8, euint128) => euint128 test 4 (72, 68)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(72n); - input.add128(68n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(64n); - }); - - it('test operator "or" overload (euint8, euint128) => euint128 test 1 (1, 340282366920938463463371478178042182733)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(1n); - input.add128(340282366920938463463371478178042182733n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(340282366920938463463371478178042182733n); - }); - - it('test operator "or" overload (euint8, euint128) => euint128 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(4n); - input.add128(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(12n); - }); - - it('test operator "or" overload (euint8, euint128) => euint128 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(8n); - input.add128(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(8n); - }); - - it('test operator "or" overload (euint8, euint128) => euint128 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(8n); - input.add128(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint8, euint128) => euint128 test 1 (142, 340282366920938463463373089327559876459)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(142n); - input.add128(340282366920938463463373089327559876459n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(340282366920938463463373089327559876581n); - }); - - it('test operator "xor" overload (euint8, euint128) => euint128 test 2 (138, 142)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(138n); - input.add128(142n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint8, euint128) => euint128 test 3 (142, 142)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(142n); - input.add128(142n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint8, euint128) => euint128 test 4 (142, 138)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(142n); - input.add128(138n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint8, euint128) => ebool test 1 (111, 340282366920938463463367365018688833419)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(111n); - input.add128(340282366920938463463367365018688833419n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint8, euint128) => ebool test 2 (107, 111)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(107n); - input.add128(111n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint8, euint128) => ebool test 3 (111, 111)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(111n); - input.add128(111n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint8, euint128) => ebool test 4 (111, 107)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(111n); - input.add128(107n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint8, euint128) => ebool test 1 (226, 340282366920938463463366961237977601965)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(226n); - input.add128(340282366920938463463366961237977601965n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint8, euint128) => ebool test 2 (222, 226)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(222n); - input.add128(226n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint8, euint128) => ebool test 3 (226, 226)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(226n); - input.add128(226n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint8, euint128) => ebool test 4 (226, 222)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(226n); - input.add128(222n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint8, euint128) => ebool test 1 (198, 340282366920938463463372202187873997337)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(198n); - input.add128(340282366920938463463372202187873997337n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint8, euint128) => ebool test 2 (194, 198)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(194n); - input.add128(198n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint8, euint128) => ebool test 3 (198, 198)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(198n); - input.add128(198n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint8, euint128) => ebool test 4 (198, 194)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(198n); - input.add128(194n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint8, euint128) => ebool test 1 (246, 340282366920938463463368600113789095143)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(246n); - input.add128(340282366920938463463368600113789095143n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, euint128) => ebool test 2 (242, 246)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(242n); - input.add128(246n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, euint128) => ebool test 3 (246, 246)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(246n); - input.add128(246n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, euint128) => ebool test 4 (246, 242)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(246n); - input.add128(242n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint128) => ebool test 1 (108, 340282366920938463463369577015243486211)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(108n); - input.add128(340282366920938463463369577015243486211n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint128) => ebool test 2 (104, 108)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(104n); - input.add128(108n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint128) => ebool test 3 (108, 108)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(108n); - input.add128(108n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint128) => ebool test 4 (108, 104)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(108n); - input.add128(104n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint8, euint128) => ebool test 1 (90, 340282366920938463463366855244560424809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(90n); - input.add128(340282366920938463463366855244560424809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint8, euint128) => ebool test 2 (86, 90)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(86n); - input.add128(90n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint8, euint128) => ebool test 3 (90, 90)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(90n); - input.add128(90n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint8, euint128) => ebool test 4 (90, 86)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(90n); - input.add128(86n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint8, euint128) => euint128 test 1 (143, 340282366920938463463368314352737250889)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(143n); - input.add128(340282366920938463463368314352737250889n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(143n); - }); - - it('test operator "min" overload (euint8, euint128) => euint128 test 2 (139, 143)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(139n); - input.add128(143n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(139n); - }); - - it('test operator "min" overload (euint8, euint128) => euint128 test 3 (143, 143)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(143n); - input.add128(143n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(143n); - }); - - it('test operator "min" overload (euint8, euint128) => euint128 test 4 (143, 139)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(143n); - input.add128(139n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(139n); - }); - - it('test operator "max" overload (euint8, euint128) => euint128 test 1 (109, 340282366920938463463369292859038505161)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(109n); - input.add128(340282366920938463463369292859038505161n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(340282366920938463463369292859038505161n); - }); - - it('test operator "max" overload (euint8, euint128) => euint128 test 2 (105, 109)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(105n); - input.add128(109n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(109n); - }); - - it('test operator "max" overload (euint8, euint128) => euint128 test 3 (109, 109)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(109n); - input.add128(109n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(109n); - }); - - it('test operator "max" overload (euint8, euint128) => euint128 test 4 (109, 105)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(109n); - input.add128(105n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint8_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract3.res128()); - expect(res).to.equal(109n); - }); - - it('test operator "add" overload (euint8, euint256) => euint256 test 1 (2, 129)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(2n); - input.add256(129n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(131n); - }); - - it('test operator "add" overload (euint8, euint256) => euint256 test 2 (82, 86)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(82n); - input.add256(86n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(168n); - }); - - it('test operator "add" overload (euint8, euint256) => euint256 test 3 (86, 86)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(86n); - input.add256(86n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(172n); - }); - - it('test operator "add" overload (euint8, euint256) => euint256 test 4 (86, 82)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(86n); - input.add256(82n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(168n); - }); - - it('test operator "sub" overload (euint8, euint256) => euint256 test 1 (224, 224)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(224n); - input.add256(224n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.sub_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint8, euint256) => euint256 test 2 (224, 220)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(224n); - input.add256(220n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.sub_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint8, euint256) => euint256 test 1 (2, 65)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(2n); - input.add256(65n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(130n); - }); - - it('test operator "mul" overload (euint8, euint256) => euint256 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(4n); - input.add256(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(32n); - }); - - it('test operator "mul" overload (euint8, euint256) => euint256 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(8n); - input.add256(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(64n); - }); - - it('test operator "mul" overload (euint8, euint256) => euint256 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(8n); - input.add256(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(32n); - }); - - it('test operator "and" overload (euint8, euint256) => euint256 test 1 (180, 115792089237316195423570985008687907853269984665640564039457579349353950071771)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(180n); - input.add256(115792089237316195423570985008687907853269984665640564039457579349353950071771n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(144n); - }); - - it('test operator "and" overload (euint8, euint256) => euint256 test 2 (176, 180)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(176n); - input.add256(180n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(176n); - }); - - it('test operator "and" overload (euint8, euint256) => euint256 test 3 (180, 180)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(180n); - input.add256(180n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(180n); - }); - - it('test operator "and" overload (euint8, euint256) => euint256 test 4 (180, 176)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(180n); - input.add256(176n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(176n); - }); - - it('test operator "or" overload (euint8, euint256) => euint256 test 1 (46, 115792089237316195423570985008687907853269984665640564039457582375126935756687)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(46n); - input.add256(115792089237316195423570985008687907853269984665640564039457582375126935756687n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457582375126935756719n); - }); - - it('test operator "or" overload (euint8, euint256) => euint256 test 2 (42, 46)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(42n); - input.add256(46n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(46n); - }); - - it('test operator "or" overload (euint8, euint256) => euint256 test 3 (46, 46)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(46n); - input.add256(46n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(46n); - }); - - it('test operator "or" overload (euint8, euint256) => euint256 test 4 (46, 42)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(46n); - input.add256(42n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(46n); - }); - - it('test operator "xor" overload (euint8, euint256) => euint256 test 1 (244, 115792089237316195423570985008687907853269984665640564039457578624058101395789)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(244n); - input.add256(115792089237316195423570985008687907853269984665640564039457578624058101395789n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457578624058101395897n); - }); - - it('test operator "xor" overload (euint8, euint256) => euint256 test 2 (240, 244)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(240n); - input.add256(244n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint8, euint256) => euint256 test 3 (244, 244)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(244n); - input.add256(244n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint8, euint256) => euint256 test 4 (244, 240)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(244n); - input.add256(240n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint8, euint256) => ebool test 1 (160, 115792089237316195423570985008687907853269984665640564039457581836943917626145)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(160n); - input.add256(115792089237316195423570985008687907853269984665640564039457581836943917626145n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint8, euint256) => ebool test 2 (156, 160)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(156n); - input.add256(160n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint8, euint256) => ebool test 3 (160, 160)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(160n); - input.add256(160n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint8, euint256) => ebool test 4 (160, 156)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(160n); - input.add256(156n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint8, euint256) => ebool test 1 (214, 115792089237316195423570985008687907853269984665640564039457580955238657941683)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(214n); - input.add256(115792089237316195423570985008687907853269984665640564039457580955238657941683n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint8, euint256) => ebool test 2 (210, 214)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(210n); - input.add256(214n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint8, euint256) => ebool test 3 (214, 214)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(214n); - input.add256(214n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint8, euint256) => ebool test 4 (214, 210)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(214n); - input.add256(210n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint8, euint256) => ebool test 1 (195, 115792089237316195423570985008687907853269984665640564039457578830037010369755)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(195n); - input.add256(115792089237316195423570985008687907853269984665640564039457578830037010369755n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint8, euint256) => ebool test 2 (191, 195)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(191n); - input.add256(195n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint8, euint256) => ebool test 3 (195, 195)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(195n); - input.add256(195n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint8, euint256) => ebool test 4 (195, 191)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(195n); - input.add256(191n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint8, euint256) => ebool test 1 (73, 115792089237316195423570985008687907853269984665640564039457582598668635855029)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(73n); - input.add256(115792089237316195423570985008687907853269984665640564039457582598668635855029n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, euint256) => ebool test 2 (69, 73)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(69n); - input.add256(73n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, euint256) => ebool test 3 (73, 73)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(73n); - input.add256(73n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, euint256) => ebool test 4 (73, 69)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(73n); - input.add256(69n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint256) => ebool test 1 (133, 115792089237316195423570985008687907853269984665640564039457576630649713670389)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(133n); - input.add256(115792089237316195423570985008687907853269984665640564039457576630649713670389n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint256) => ebool test 2 (129, 133)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(129n); - input.add256(133n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint256) => ebool test 3 (133, 133)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(133n); - input.add256(133n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, euint256) => ebool test 4 (133, 129)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(133n); - input.add256(129n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint8, euint256) => ebool test 1 (142, 115792089237316195423570985008687907853269984665640564039457583972137475354729)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(142n); - input.add256(115792089237316195423570985008687907853269984665640564039457583972137475354729n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint8, euint256) => ebool test 2 (138, 142)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(138n); - input.add256(142n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint8, euint256) => ebool test 3 (142, 142)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(142n); - input.add256(142n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint8, euint256) => ebool test 4 (142, 138)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(142n); - input.add256(138n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint8, euint256) => euint256 test 1 (227, 115792089237316195423570985008687907853269984665640564039457575642377411188527)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(227n); - input.add256(115792089237316195423570985008687907853269984665640564039457575642377411188527n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(227n); - }); - - it('test operator "min" overload (euint8, euint256) => euint256 test 2 (223, 227)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(223n); - input.add256(227n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(223n); - }); - - it('test operator "min" overload (euint8, euint256) => euint256 test 3 (227, 227)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(227n); - input.add256(227n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(227n); - }); - - it('test operator "min" overload (euint8, euint256) => euint256 test 4 (227, 223)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(227n); - input.add256(223n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(223n); - }); - - it('test operator "max" overload (euint8, euint256) => euint256 test 1 (187, 115792089237316195423570985008687907853269984665640564039457583763268749719689)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(187n); - input.add256(115792089237316195423570985008687907853269984665640564039457583763268749719689n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457583763268749719689n); - }); - - it('test operator "max" overload (euint8, euint256) => euint256 test 2 (183, 187)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(183n); - input.add256(187n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(187n); - }); - - it('test operator "max" overload (euint8, euint256) => euint256 test 3 (187, 187)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(187n); - input.add256(187n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(187n); - }); - - it('test operator "max" overload (euint8, euint256) => euint256 test 4 (187, 183)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(187n); - input.add256(183n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint8_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract3.res256()); - expect(res).to.equal(187n); - }); - - it('test operator "add" overload (euint8, uint8) => euint8 test 1 (110, 64)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(110n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_euint8_uint8(encryptedAmount.handles[0], 64n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(174n); - }); - - it('test operator "add" overload (euint8, uint8) => euint8 test 2 (14, 18)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(14n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_euint8_uint8(encryptedAmount.handles[0], 18n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(32n); - }); - - it('test operator "add" overload (euint8, uint8) => euint8 test 3 (18, 18)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(18n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_euint8_uint8(encryptedAmount.handles[0], 18n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(36n); - }); - - it('test operator "add" overload (euint8, uint8) => euint8 test 4 (18, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(18n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_euint8_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(32n); - }); - - it('test operator "add" overload (uint8, euint8) => euint8 test 1 (52, 126)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(126n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_uint8_euint8(52n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(178n); - }); - - it('test operator "add" overload (uint8, euint8) => euint8 test 2 (14, 18)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(18n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_uint8_euint8(14n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(32n); - }); - - it('test operator "add" overload (uint8, euint8) => euint8 test 3 (18, 18)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(18n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_uint8_euint8(18n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(36n); - }); - - it('test operator "add" overload (uint8, euint8) => euint8 test 4 (18, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_uint8_euint8(18n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(32n); - }); - - it('test operator "sub" overload (euint8, uint8) => euint8 test 1 (152, 152)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(152n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.sub_euint8_uint8(encryptedAmount.handles[0], 152n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint8, uint8) => euint8 test 2 (152, 148)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(152n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.sub_euint8_uint8(encryptedAmount.handles[0], 148n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "sub" overload (uint8, euint8) => euint8 test 1 (152, 152)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(152n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.sub_uint8_euint8(152n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (uint8, euint8) => euint8 test 2 (152, 148)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(148n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.sub_uint8_euint8(152n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint8, uint8) => euint8 test 1 (14, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(14n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_euint8_uint8(encryptedAmount.handles[0], 6n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(84n); - }); - - it('test operator "mul" overload (euint8, uint8) => euint8 test 2 (12, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(12n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_euint8_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(168n); - }); - - it('test operator "mul" overload (euint8, uint8) => euint8 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(14n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_euint8_uint8(encryptedAmount.handles[0], 14n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(196n); - }); - - it('test operator "mul" overload (euint8, uint8) => euint8 test 4 (14, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(14n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_euint8_uint8(encryptedAmount.handles[0], 12n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(168n); - }); - - it('test operator "mul" overload (uint8, euint8) => euint8 test 1 (12, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_uint8_euint8(12n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(132n); - }); - - it('test operator "mul" overload (uint8, euint8) => euint8 test 2 (12, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_uint8_euint8(12n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(168n); - }); - - it('test operator "mul" overload (uint8, euint8) => euint8 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_uint8_euint8(14n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(196n); - }); - - it('test operator "mul" overload (uint8, euint8) => euint8 test 4 (14, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_uint8_euint8(14n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(168n); - }); - - it('test operator "div" overload (euint8, uint8) => euint8 test 1 (87, 167)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(87n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.div_euint8_uint8(encryptedAmount.handles[0], 167n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(0n); - }); - - it('test operator "div" overload (euint8, uint8) => euint8 test 2 (31, 35)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(31n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.div_euint8_uint8(encryptedAmount.handles[0], 35n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(0n); - }); - - it('test operator "div" overload (euint8, uint8) => euint8 test 3 (35, 35)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(35n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.div_euint8_uint8(encryptedAmount.handles[0], 35n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(1n); - }); - - it('test operator "div" overload (euint8, uint8) => euint8 test 4 (35, 31)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(35n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.div_euint8_uint8(encryptedAmount.handles[0], 31n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(1n); - }); - - it('test operator "rem" overload (euint8, uint8) => euint8 test 1 (85, 232)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(85n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.rem_euint8_uint8(encryptedAmount.handles[0], 232n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(85n); - }); - - it('test operator "rem" overload (euint8, uint8) => euint8 test 2 (38, 42)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(38n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.rem_euint8_uint8(encryptedAmount.handles[0], 42n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(38n); - }); - - it('test operator "rem" overload (euint8, uint8) => euint8 test 3 (42, 42)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(42n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.rem_euint8_uint8(encryptedAmount.handles[0], 42n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(0n); - }); - - it('test operator "rem" overload (euint8, uint8) => euint8 test 4 (42, 38)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(42n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.rem_euint8_uint8(encryptedAmount.handles[0], 38n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "and" overload (euint8, uint8) => euint8 test 1 (183, 70)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(183n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_euint8_uint8(encryptedAmount.handles[0], 70n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(6n); - }); - - it('test operator "and" overload (euint8, uint8) => euint8 test 2 (131, 135)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(131n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_euint8_uint8(encryptedAmount.handles[0], 135n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(131n); - }); - - it('test operator "and" overload (euint8, uint8) => euint8 test 3 (135, 135)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(135n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_euint8_uint8(encryptedAmount.handles[0], 135n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(135n); - }); - - it('test operator "and" overload (euint8, uint8) => euint8 test 4 (135, 131)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(135n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_euint8_uint8(encryptedAmount.handles[0], 131n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(131n); - }); - - it('test operator "and" overload (uint8, euint8) => euint8 test 1 (146, 70)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(70n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_uint8_euint8(146n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(2n); - }); - - it('test operator "and" overload (uint8, euint8) => euint8 test 2 (131, 135)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(135n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_uint8_euint8(131n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(131n); - }); - - it('test operator "and" overload (uint8, euint8) => euint8 test 3 (135, 135)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(135n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_uint8_euint8(135n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(135n); - }); - - it('test operator "and" overload (uint8, euint8) => euint8 test 4 (135, 131)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(131n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_uint8_euint8(135n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(131n); - }); - - it('test operator "or" overload (euint8, uint8) => euint8 test 1 (189, 140)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(189n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_euint8_uint8(encryptedAmount.handles[0], 140n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(189n); - }); - - it('test operator "or" overload (euint8, uint8) => euint8 test 2 (185, 189)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(185n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_euint8_uint8(encryptedAmount.handles[0], 189n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(189n); - }); - - it('test operator "or" overload (euint8, uint8) => euint8 test 3 (189, 189)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(189n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_euint8_uint8(encryptedAmount.handles[0], 189n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(189n); - }); - - it('test operator "or" overload (euint8, uint8) => euint8 test 4 (189, 185)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(189n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_euint8_uint8(encryptedAmount.handles[0], 185n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(189n); - }); - - it('test operator "or" overload (uint8, euint8) => euint8 test 1 (139, 140)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(140n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_uint8_euint8(139n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(143n); - }); - - it('test operator "or" overload (uint8, euint8) => euint8 test 2 (185, 189)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(189n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_uint8_euint8(185n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(189n); - }); - - it('test operator "or" overload (uint8, euint8) => euint8 test 3 (189, 189)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(189n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_uint8_euint8(189n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(189n); - }); - - it('test operator "or" overload (uint8, euint8) => euint8 test 4 (189, 185)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(185n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_uint8_euint8(189n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(189n); - }); - - it('test operator "xor" overload (euint8, uint8) => euint8 test 1 (234, 201)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(234n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_euint8_uint8(encryptedAmount.handles[0], 201n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(35n); - }); - - it('test operator "xor" overload (euint8, uint8) => euint8 test 2 (146, 150)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(146n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_euint8_uint8(encryptedAmount.handles[0], 150n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint8, uint8) => euint8 test 3 (150, 150)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(150n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_euint8_uint8(encryptedAmount.handles[0], 150n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint8, uint8) => euint8 test 4 (150, 146)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(150n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_euint8_uint8(encryptedAmount.handles[0], 146n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (uint8, euint8) => euint8 test 1 (181, 201)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(201n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_uint8_euint8(181n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(124n); - }); - - it('test operator "xor" overload (uint8, euint8) => euint8 test 2 (146, 150)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(150n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_uint8_euint8(146n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (uint8, euint8) => euint8 test 3 (150, 150)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(150n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_uint8_euint8(150n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (uint8, euint8) => euint8 test 4 (150, 146)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(146n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_uint8_euint8(150n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(4n); - }); -}); diff --git a/contracts/test/tfheOperations/tfheOperations4.ts b/contracts/test/tfheOperations/tfheOperations4.ts deleted file mode 100644 index 6dbd34d9..00000000 --- a/contracts/test/tfheOperations/tfheOperations4.ts +++ /dev/null @@ -1,4595 +0,0 @@ -import { expect } from 'chai'; -import { ethers } from 'hardhat'; - -import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1'; -import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2'; -import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'; -import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4'; -import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5'; -import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6'; -import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7'; -import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8'; -import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9'; -import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10'; -import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11'; -import { - createInstances, - decrypt4, - decrypt8, - decrypt16, - decrypt32, - decrypt64, - decrypt128, - decrypt256, - decryptBool, -} from '../instance'; -import { getSigners, initSigners } from '../signers'; - -async function deployTfheTestFixture1(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture2(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture3(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture4(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture5(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture6(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture7(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite7'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture8(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite8'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture9(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite9'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture10(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite10'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture11(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite11'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -describe('TFHE operations 4', function () { - before(async function () { - await initSigners(1); - this.signers = await getSigners(); - - const contract1 = await deployTfheTestFixture1(); - this.contract1Address = await contract1.getAddress(); - this.contract1 = contract1; - - const contract2 = await deployTfheTestFixture2(); - this.contract2Address = await contract2.getAddress(); - this.contract2 = contract2; - - const contract3 = await deployTfheTestFixture3(); - this.contract3Address = await contract3.getAddress(); - this.contract3 = contract3; - - const contract4 = await deployTfheTestFixture4(); - this.contract4Address = await contract4.getAddress(); - this.contract4 = contract4; - - const contract5 = await deployTfheTestFixture5(); - this.contract5Address = await contract5.getAddress(); - this.contract5 = contract5; - - const contract6 = await deployTfheTestFixture6(); - this.contract6Address = await contract6.getAddress(); - this.contract6 = contract6; - - const contract7 = await deployTfheTestFixture7(); - this.contract7Address = await contract7.getAddress(); - this.contract7 = contract7; - - const contract8 = await deployTfheTestFixture8(); - this.contract8Address = await contract8.getAddress(); - this.contract8 = contract8; - - const contract9 = await deployTfheTestFixture9(); - this.contract9Address = await contract9.getAddress(); - this.contract9 = contract9; - - const contract10 = await deployTfheTestFixture10(); - this.contract10Address = await contract10.getAddress(); - this.contract10 = contract10; - - const contract11 = await deployTfheTestFixture11(); - this.contract11Address = await contract11.getAddress(); - this.contract11 = contract11; - - const instances = await createInstances(this.signers); - this.instances = instances; - }); - - it('test operator "eq" overload (euint8, uint8) => ebool test 1 (175, 253)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(175n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_euint8_uint8(encryptedAmount.handles[0], 253n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint8, uint8) => ebool test 2 (171, 175)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(171n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_euint8_uint8(encryptedAmount.handles[0], 175n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint8, uint8) => ebool test 3 (175, 175)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(175n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_euint8_uint8(encryptedAmount.handles[0], 175n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint8, uint8) => ebool test 4 (175, 171)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(175n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_euint8_uint8(encryptedAmount.handles[0], 171n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint8, euint8) => ebool test 1 (158, 253)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(253n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_uint8_euint8(158n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint8, euint8) => ebool test 2 (171, 175)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(175n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_uint8_euint8(171n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint8, euint8) => ebool test 3 (175, 175)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(175n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_uint8_euint8(175n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (uint8, euint8) => ebool test 4 (175, 171)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(171n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_uint8_euint8(175n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint8, uint8) => ebool test 1 (197, 40)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(197n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_euint8_uint8(encryptedAmount.handles[0], 40n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint8, uint8) => ebool test 2 (193, 197)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(193n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_euint8_uint8(encryptedAmount.handles[0], 197n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint8, uint8) => ebool test 3 (197, 197)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(197n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_euint8_uint8(encryptedAmount.handles[0], 197n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint8, uint8) => ebool test 4 (197, 193)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(197n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_euint8_uint8(encryptedAmount.handles[0], 193n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint8, euint8) => ebool test 1 (243, 40)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(40n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_uint8_euint8(243n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint8, euint8) => ebool test 2 (193, 197)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(197n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_uint8_euint8(193n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint8, euint8) => ebool test 3 (197, 197)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(197n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_uint8_euint8(197n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (uint8, euint8) => ebool test 4 (197, 193)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(193n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_uint8_euint8(197n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint8, uint8) => ebool test 1 (63, 223)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(63n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_euint8_uint8(encryptedAmount.handles[0], 223n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint8, uint8) => ebool test 2 (59, 63)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(59n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_euint8_uint8(encryptedAmount.handles[0], 63n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint8, uint8) => ebool test 3 (63, 63)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(63n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_euint8_uint8(encryptedAmount.handles[0], 63n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint8, uint8) => ebool test 4 (63, 59)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(63n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_euint8_uint8(encryptedAmount.handles[0], 59n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (uint8, euint8) => ebool test 1 (3, 223)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(223n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_uint8_euint8(3n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (uint8, euint8) => ebool test 2 (59, 63)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(63n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_uint8_euint8(59n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (uint8, euint8) => ebool test 3 (63, 63)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(63n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_uint8_euint8(63n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (uint8, euint8) => ebool test 4 (63, 59)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(59n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_uint8_euint8(63n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint8, uint8) => ebool test 1 (239, 184)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(239n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_euint8_uint8(encryptedAmount.handles[0], 184n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint8, uint8) => ebool test 2 (208, 212)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(208n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_euint8_uint8(encryptedAmount.handles[0], 212n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, uint8) => ebool test 3 (212, 212)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(212n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_euint8_uint8(encryptedAmount.handles[0], 212n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint8, uint8) => ebool test 4 (212, 208)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(212n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_euint8_uint8(encryptedAmount.handles[0], 208n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (uint8, euint8) => ebool test 1 (188, 184)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(184n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_uint8_euint8(188n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (uint8, euint8) => ebool test 2 (208, 212)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(212n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_uint8_euint8(208n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (uint8, euint8) => ebool test 3 (212, 212)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(212n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_uint8_euint8(212n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (uint8, euint8) => ebool test 4 (212, 208)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(208n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_uint8_euint8(212n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, uint8) => ebool test 1 (124, 152)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(124n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint8_uint8(encryptedAmount.handles[0], 152n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, uint8) => ebool test 2 (67, 71)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(67n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint8_uint8(encryptedAmount.handles[0], 71n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, uint8) => ebool test 3 (71, 71)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(71n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint8_uint8(encryptedAmount.handles[0], 71n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint8, uint8) => ebool test 4 (71, 67)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(71n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint8_uint8(encryptedAmount.handles[0], 67n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (uint8, euint8) => ebool test 1 (25, 152)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(152n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_uint8_euint8(25n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (uint8, euint8) => ebool test 2 (67, 71)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(71n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_uint8_euint8(67n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (uint8, euint8) => ebool test 3 (71, 71)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(71n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_uint8_euint8(71n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (uint8, euint8) => ebool test 4 (71, 67)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(67n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_uint8_euint8(71n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint8, uint8) => ebool test 1 (221, 96)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(221n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint8_uint8(encryptedAmount.handles[0], 96n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint8, uint8) => ebool test 2 (41, 45)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(41n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint8_uint8(encryptedAmount.handles[0], 45n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint8, uint8) => ebool test 3 (45, 45)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(45n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint8_uint8(encryptedAmount.handles[0], 45n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint8, uint8) => ebool test 4 (45, 41)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(45n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint8_uint8(encryptedAmount.handles[0], 41n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (uint8, euint8) => ebool test 1 (225, 96)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(96n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_uint8_euint8(225n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (uint8, euint8) => ebool test 2 (41, 45)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(45n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_uint8_euint8(41n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (uint8, euint8) => ebool test 3 (45, 45)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(45n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_uint8_euint8(45n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (uint8, euint8) => ebool test 4 (45, 41)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(41n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_uint8_euint8(45n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint8, uint8) => euint8 test 1 (183, 152)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(183n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint8_uint8(encryptedAmount.handles[0], 152n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(152n); - }); - - it('test operator "min" overload (euint8, uint8) => euint8 test 2 (80, 84)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(80n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint8_uint8(encryptedAmount.handles[0], 84n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(80n); - }); - - it('test operator "min" overload (euint8, uint8) => euint8 test 3 (84, 84)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(84n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint8_uint8(encryptedAmount.handles[0], 84n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(84n); - }); - - it('test operator "min" overload (euint8, uint8) => euint8 test 4 (84, 80)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(84n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint8_uint8(encryptedAmount.handles[0], 80n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(80n); - }); - - it('test operator "min" overload (uint8, euint8) => euint8 test 1 (22, 152)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(152n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_uint8_euint8(22n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(22n); - }); - - it('test operator "min" overload (uint8, euint8) => euint8 test 2 (80, 84)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(84n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_uint8_euint8(80n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(80n); - }); - - it('test operator "min" overload (uint8, euint8) => euint8 test 3 (84, 84)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(84n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_uint8_euint8(84n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(84n); - }); - - it('test operator "min" overload (uint8, euint8) => euint8 test 4 (84, 80)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(80n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_uint8_euint8(84n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(80n); - }); - - it('test operator "max" overload (euint8, uint8) => euint8 test 1 (17, 83)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(17n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint8_uint8(encryptedAmount.handles[0], 83n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(83n); - }); - - it('test operator "max" overload (euint8, uint8) => euint8 test 2 (13, 17)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(13n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint8_uint8(encryptedAmount.handles[0], 17n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(17n); - }); - - it('test operator "max" overload (euint8, uint8) => euint8 test 3 (17, 17)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(17n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint8_uint8(encryptedAmount.handles[0], 17n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(17n); - }); - - it('test operator "max" overload (euint8, uint8) => euint8 test 4 (17, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add8(17n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint8_uint8(encryptedAmount.handles[0], 13n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(17n); - }); - - it('test operator "max" overload (uint8, euint8) => euint8 test 1 (46, 83)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(83n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_uint8_euint8(46n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(83n); - }); - - it('test operator "max" overload (uint8, euint8) => euint8 test 2 (13, 17)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(17n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_uint8_euint8(13n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(17n); - }); - - it('test operator "max" overload (uint8, euint8) => euint8 test 3 (17, 17)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(17n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_uint8_euint8(17n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(17n); - }); - - it('test operator "max" overload (uint8, euint8) => euint8 test 4 (17, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - - input.add8(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_uint8_euint8(17n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt8(await this.contract3.res8()); - expect(res).to.equal(17n); - }); - - it('test operator "add" overload (euint16, euint4) => euint16 test 1 (8, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(10n); - }); - - it('test operator "add" overload (euint16, euint4) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(12n); - }); - - it('test operator "add" overload (euint16, euint4) => euint16 test 3 (5, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(5n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(10n); - }); - - it('test operator "add" overload (euint16, euint4) => euint16 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.add_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(12n); - }); - - it('test operator "sub" overload (euint16, euint4) => euint16 test 1 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(14n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.sub_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint16, euint4) => euint16 test 2 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(14n); - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.sub_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint16, euint4) => euint16 test 1 (5, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(5n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(10n); - }); - - it('test operator "mul" overload (euint16, euint4) => euint16 test 2 (3, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(3n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(15n); - }); - - it('test operator "mul" overload (euint16, euint4) => euint16 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(3n); - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(9n); - }); - - it('test operator "mul" overload (euint16, euint4) => euint16 test 4 (5, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(5n); - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.mul_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(15n); - }); - - it('test operator "and" overload (euint16, euint4) => euint16 test 1 (57634, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(57634n); - input.add4(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(2n); - }); - - it('test operator "and" overload (euint16, euint4) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "and" overload (euint16, euint4) => euint16 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(8n); - }); - - it('test operator "and" overload (euint16, euint4) => euint16 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.and_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "or" overload (euint16, euint4) => euint16 test 1 (31310, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(31310n); - input.add4(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(31310n); - }); - - it('test operator "or" overload (euint16, euint4) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(12n); - }); - - it('test operator "or" overload (euint16, euint4) => euint16 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(8n); - }); - - it('test operator "or" overload (euint16, euint4) => euint16 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.or_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint16, euint4) => euint16 test 1 (57076, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(57076n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(57082n); - }); - - it('test operator "xor" overload (euint16, euint4) => euint16 test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(10n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint16, euint4) => euint16 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(14n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint16, euint4) => euint16 test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(14n); - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.xor_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint16, euint4) => ebool test 1 (51541, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(51541n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint16, euint4) => ebool test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(10n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint16, euint4) => ebool test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(14n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint16, euint4) => ebool test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(14n); - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.eq_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint16, euint4) => ebool test 1 (26709, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(26709n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint16, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint16, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint16, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ne_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint16, euint4) => ebool test 1 (60257, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(60257n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint16, euint4) => ebool test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(9n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint16, euint4) => ebool test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(13n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint16, euint4) => ebool test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(13n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.ge_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint16, euint4) => ebool test 1 (57987, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(57987n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint16, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.gt_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint4) => ebool test 1 (26735, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(26735n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint16, euint4) => ebool test 2 (8, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint4) => ebool test 3 (12, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint4) => ebool test 4 (12, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(12n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.le_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint16, euint4) => ebool test 1 (38459, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(38459n); - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint16, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint16, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint16, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.lt_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract3.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint16, euint4) => euint16 test 1 (35993, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(35993n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(14n); - }); - - it('test operator "min" overload (euint16, euint4) => euint16 test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(10n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(10n); - }); - - it('test operator "min" overload (euint16, euint4) => euint16 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(14n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(14n); - }); - - it('test operator "min" overload (euint16, euint4) => euint16 test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(14n); - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.min_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(10n); - }); - - it('test operator "max" overload (euint16, euint4) => euint16 test 1 (22967, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(22967n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(22967n); - }); - - it('test operator "max" overload (euint16, euint4) => euint16 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(8n); - }); - - it('test operator "max" overload (euint16, euint4) => euint16 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(8n); - }); - - it('test operator "max" overload (euint16, euint4) => euint16 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract3Address, this.signers.alice.address); - input.add16(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract3.max_euint16_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract3.res16()); - expect(res).to.equal(8n); - }); - - it('test operator "add" overload (euint16, euint8) => euint16 test 1 (205, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(205n); - input.add8(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(207n); - }); - - it('test operator "add" overload (euint16, euint8) => euint16 test 2 (90, 94)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(90n); - input.add8(94n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(184n); - }); - - it('test operator "add" overload (euint16, euint8) => euint16 test 3 (94, 94)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(94n); - input.add8(94n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(188n); - }); - - it('test operator "add" overload (euint16, euint8) => euint16 test 4 (94, 90)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(94n); - input.add8(90n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(184n); - }); - - it('test operator "sub" overload (euint16, euint8) => euint16 test 1 (195, 195)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(195n); - input.add8(195n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.sub_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint16, euint8) => euint16 test 2 (195, 191)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(195n); - input.add8(191n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.sub_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint16, euint8) => euint16 test 1 (87, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(87n); - input.add8(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(174n); - }); - - it('test operator "mul" overload (euint16, euint8) => euint16 test 2 (9, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(9n); - input.add8(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(90n); - }); - - it('test operator "mul" overload (euint16, euint8) => euint16 test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(10n); - input.add8(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(100n); - }); - - it('test operator "mul" overload (euint16, euint8) => euint16 test 4 (10, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(10n); - input.add8(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(90n); - }); - - it('test operator "and" overload (euint16, euint8) => euint16 test 1 (41347, 138)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(41347n); - input.add8(138n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(130n); - }); - - it('test operator "and" overload (euint16, euint8) => euint16 test 2 (134, 138)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(134n); - input.add8(138n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(130n); - }); - - it('test operator "and" overload (euint16, euint8) => euint16 test 3 (138, 138)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(138n); - input.add8(138n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(138n); - }); - - it('test operator "and" overload (euint16, euint8) => euint16 test 4 (138, 134)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(138n); - input.add8(134n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(130n); - }); - - it('test operator "or" overload (euint16, euint8) => euint16 test 1 (20350, 200)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(20350n); - input.add8(200n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(20478n); - }); - - it('test operator "or" overload (euint16, euint8) => euint16 test 2 (196, 200)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(196n); - input.add8(200n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(204n); - }); - - it('test operator "or" overload (euint16, euint8) => euint16 test 3 (200, 200)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(200n); - input.add8(200n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(200n); - }); - - it('test operator "or" overload (euint16, euint8) => euint16 test 4 (200, 196)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(200n); - input.add8(196n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(204n); - }); - - it('test operator "xor" overload (euint16, euint8) => euint16 test 1 (14933, 231)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(14933n); - input.add8(231n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(15026n); - }); - - it('test operator "xor" overload (euint16, euint8) => euint16 test 2 (227, 231)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(227n); - input.add8(231n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint16, euint8) => euint16 test 3 (231, 231)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(231n); - input.add8(231n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint16, euint8) => euint16 test 4 (231, 227)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(231n); - input.add8(227n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint16, euint8) => ebool test 1 (33521, 144)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(33521n); - input.add8(144n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint16, euint8) => ebool test 2 (140, 144)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(140n); - input.add8(144n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint16, euint8) => ebool test 3 (144, 144)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(144n); - input.add8(144n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint16, euint8) => ebool test 4 (144, 140)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(144n); - input.add8(140n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint16, euint8) => ebool test 1 (13794, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(13794n); - input.add8(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint16, euint8) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(4n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint16, euint8) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(8n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint16, euint8) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(8n); - input.add8(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint16, euint8) => ebool test 1 (8192, 143)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(8192n); - input.add8(143n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint16, euint8) => ebool test 2 (139, 143)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(139n); - input.add8(143n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint16, euint8) => ebool test 3 (143, 143)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(143n); - input.add8(143n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint16, euint8) => ebool test 4 (143, 139)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(143n); - input.add8(139n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint16, euint8) => ebool test 1 (18049, 102)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(18049n); - input.add8(102n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint16, euint8) => ebool test 2 (98, 102)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(98n); - input.add8(102n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, euint8) => ebool test 3 (102, 102)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(102n); - input.add8(102n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, euint8) => ebool test 4 (102, 98)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(102n); - input.add8(98n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint8) => ebool test 1 (7541, 42)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(7541n); - input.add8(42n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint16, euint8) => ebool test 2 (38, 42)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(38n); - input.add8(42n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint8) => ebool test 3 (42, 42)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(42n); - input.add8(42n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint8) => ebool test 4 (42, 38)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(42n); - input.add8(38n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint16, euint8) => ebool test 1 (6772, 147)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(6772n); - input.add8(147n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint16, euint8) => ebool test 2 (143, 147)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(143n); - input.add8(147n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint16, euint8) => ebool test 3 (147, 147)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(147n); - input.add8(147n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint16, euint8) => ebool test 4 (147, 143)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(147n); - input.add8(143n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint16, euint8) => euint16 test 1 (16954, 238)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(16954n); - input.add8(238n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(238n); - }); - - it('test operator "min" overload (euint16, euint8) => euint16 test 2 (234, 238)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(234n); - input.add8(238n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(234n); - }); - - it('test operator "min" overload (euint16, euint8) => euint16 test 3 (238, 238)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(238n); - input.add8(238n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(238n); - }); - - it('test operator "min" overload (euint16, euint8) => euint16 test 4 (238, 234)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(238n); - input.add8(234n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(234n); - }); - - it('test operator "max" overload (euint16, euint8) => euint16 test 1 (22246, 39)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(22246n); - input.add8(39n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(22246n); - }); - - it('test operator "max" overload (euint16, euint8) => euint16 test 2 (35, 39)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(35n); - input.add8(39n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(39n); - }); - - it('test operator "max" overload (euint16, euint8) => euint16 test 3 (39, 39)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(39n); - input.add8(39n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(39n); - }); - - it('test operator "max" overload (euint16, euint8) => euint16 test 4 (39, 35)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(39n); - input.add8(35n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(39n); - }); - - it('test operator "add" overload (euint16, euint16) => euint16 test 1 (26028, 36322)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(26028n); - input.add16(36322n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(62350n); - }); - - it('test operator "add" overload (euint16, euint16) => euint16 test 2 (26024, 26028)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(26024n); - input.add16(26028n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(52052n); - }); - - it('test operator "add" overload (euint16, euint16) => euint16 test 3 (26028, 26028)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(26028n); - input.add16(26028n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(52056n); - }); - - it('test operator "add" overload (euint16, euint16) => euint16 test 4 (26028, 26024)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(26028n); - input.add16(26024n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(52052n); - }); - - it('test operator "sub" overload (euint16, euint16) => euint16 test 1 (14486, 14486)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(14486n); - input.add16(14486n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.sub_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint16, euint16) => euint16 test 2 (14486, 14482)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(14486n); - input.add16(14482n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.sub_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint16, euint16) => euint16 test 1 (117, 200)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(117n); - input.add16(200n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(23400n); - }); - - it('test operator "mul" overload (euint16, euint16) => euint16 test 2 (233, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(233n); - input.add16(233n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(54289n); - }); - - it('test operator "mul" overload (euint16, euint16) => euint16 test 3 (233, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(233n); - input.add16(233n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(54289n); - }); - - it('test operator "mul" overload (euint16, euint16) => euint16 test 4 (233, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(233n); - input.add16(233n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(54289n); - }); - - it('test operator "and" overload (euint16, euint16) => euint16 test 1 (25969, 38750)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(25969n); - input.add16(38750n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(1360n); - }); - - it('test operator "and" overload (euint16, euint16) => euint16 test 2 (25965, 25969)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(25965n); - input.add16(25969n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(25953n); - }); - - it('test operator "and" overload (euint16, euint16) => euint16 test 3 (25969, 25969)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(25969n); - input.add16(25969n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(25969n); - }); - - it('test operator "and" overload (euint16, euint16) => euint16 test 4 (25969, 25965)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(25969n); - input.add16(25965n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(25953n); - }); - - it('test operator "or" overload (euint16, euint16) => euint16 test 1 (41436, 37567)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(41436n); - input.add16(37567n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(46079n); - }); - - it('test operator "or" overload (euint16, euint16) => euint16 test 2 (37563, 37567)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(37563n); - input.add16(37567n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(37567n); - }); - - it('test operator "or" overload (euint16, euint16) => euint16 test 3 (37567, 37567)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(37567n); - input.add16(37567n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(37567n); - }); - - it('test operator "or" overload (euint16, euint16) => euint16 test 4 (37567, 37563)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(37567n); - input.add16(37563n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(37567n); - }); - - it('test operator "xor" overload (euint16, euint16) => euint16 test 1 (65327, 25546)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(65327n); - input.add16(25546n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(40165n); - }); - - it('test operator "xor" overload (euint16, euint16) => euint16 test 2 (25542, 25546)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(25542n); - input.add16(25546n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint16, euint16) => euint16 test 3 (25546, 25546)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(25546n); - input.add16(25546n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint16, euint16) => euint16 test 4 (25546, 25542)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(25546n); - input.add16(25542n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(12n); - }); - - it('test operator "eq" overload (euint16, euint16) => ebool test 1 (45930, 43845)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(45930n); - input.add16(43845n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint16, euint16) => ebool test 2 (43841, 43845)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(43841n); - input.add16(43845n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint16, euint16) => ebool test 3 (43845, 43845)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(43845n); - input.add16(43845n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint16, euint16) => ebool test 4 (43845, 43841)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(43845n); - input.add16(43841n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint16, euint16) => ebool test 1 (16378, 60161)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(16378n); - input.add16(60161n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint16, euint16) => ebool test 2 (16374, 16378)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(16374n); - input.add16(16378n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint16, euint16) => ebool test 3 (16378, 16378)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(16378n); - input.add16(16378n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint16, euint16) => ebool test 4 (16378, 16374)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(16378n); - input.add16(16374n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint16, euint16) => ebool test 1 (51651, 13068)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(51651n); - input.add16(13068n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint16, euint16) => ebool test 2 (13064, 13068)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(13064n); - input.add16(13068n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint16, euint16) => ebool test 3 (13068, 13068)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(13068n); - input.add16(13068n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint16, euint16) => ebool test 4 (13068, 13064)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(13068n); - input.add16(13064n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint16, euint16) => ebool test 1 (49523, 63498)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(49523n); - input.add16(63498n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, euint16) => ebool test 2 (49519, 49523)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(49519n); - input.add16(49523n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, euint16) => ebool test 3 (49523, 49523)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(49523n); - input.add16(49523n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, euint16) => ebool test 4 (49523, 49519)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(49523n); - input.add16(49519n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint16) => ebool test 1 (20803, 873)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(20803n); - input.add16(873n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint16, euint16) => ebool test 2 (869, 873)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(869n); - input.add16(873n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint16) => ebool test 3 (873, 873)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(873n); - input.add16(873n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint16) => ebool test 4 (873, 869)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(873n); - input.add16(869n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint16, euint16) => ebool test 1 (34482, 5146)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(34482n); - input.add16(5146n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint16, euint16) => ebool test 2 (5142, 5146)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(5142n); - input.add16(5146n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint16, euint16) => ebool test 3 (5146, 5146)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(5146n); - input.add16(5146n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint16, euint16) => ebool test 4 (5146, 5142)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(5146n); - input.add16(5142n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint16, euint16) => euint16 test 1 (32718, 8269)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(32718n); - input.add16(8269n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(8269n); - }); - - it('test operator "min" overload (euint16, euint16) => euint16 test 2 (8265, 8269)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(8265n); - input.add16(8269n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(8265n); - }); - - it('test operator "min" overload (euint16, euint16) => euint16 test 3 (8269, 8269)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(8269n); - input.add16(8269n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(8269n); - }); - - it('test operator "min" overload (euint16, euint16) => euint16 test 4 (8269, 8265)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(8269n); - input.add16(8265n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(8265n); - }); - - it('test operator "max" overload (euint16, euint16) => euint16 test 1 (37775, 22432)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(37775n); - input.add16(22432n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(37775n); - }); - - it('test operator "max" overload (euint16, euint16) => euint16 test 2 (22428, 22432)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(22428n); - input.add16(22432n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(22432n); - }); - - it('test operator "max" overload (euint16, euint16) => euint16 test 3 (22432, 22432)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(22432n); - input.add16(22432n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(22432n); - }); - - it('test operator "max" overload (euint16, euint16) => euint16 test 4 (22432, 22428)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(22432n); - input.add16(22428n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(22432n); - }); - - it('test operator "add" overload (euint16, euint32) => euint32 test 1 (2, 52896)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(2n); - input.add32(52896n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(52898n); - }); - - it('test operator "add" overload (euint16, euint32) => euint32 test 2 (19184, 19188)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(19184n); - input.add32(19188n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(38372n); - }); - - it('test operator "add" overload (euint16, euint32) => euint32 test 3 (19188, 19188)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(19188n); - input.add32(19188n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(38376n); - }); - - it('test operator "add" overload (euint16, euint32) => euint32 test 4 (19188, 19184)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(19188n); - input.add32(19184n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(38372n); - }); - - it('test operator "sub" overload (euint16, euint32) => euint32 test 1 (32818, 32818)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(32818n); - input.add32(32818n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.sub_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint16, euint32) => euint32 test 2 (32818, 32814)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(32818n); - input.add32(32814n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.sub_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint16, euint32) => euint32 test 1 (2, 27164)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(2n); - input.add32(27164n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(54328n); - }); - - it('test operator "mul" overload (euint16, euint32) => euint32 test 2 (244, 244)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(244n); - input.add32(244n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(59536n); - }); - - it('test operator "mul" overload (euint16, euint32) => euint32 test 3 (244, 244)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(244n); - input.add32(244n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(59536n); - }); - - it('test operator "mul" overload (euint16, euint32) => euint32 test 4 (244, 244)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(244n); - input.add32(244n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(59536n); - }); - - it('test operator "and" overload (euint16, euint32) => euint32 test 1 (10444, 4022047212)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(10444n); - input.add32(4022047212n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(204n); - }); - - it('test operator "and" overload (euint16, euint32) => euint32 test 2 (10440, 10444)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(10440n); - input.add32(10444n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(10440n); - }); - - it('test operator "and" overload (euint16, euint32) => euint32 test 3 (10444, 10444)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(10444n); - input.add32(10444n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(10444n); - }); - - it('test operator "and" overload (euint16, euint32) => euint32 test 4 (10444, 10440)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(10444n); - input.add32(10440n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(10440n); - }); - - it('test operator "or" overload (euint16, euint32) => euint32 test 1 (36595, 3887874863)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(36595n); - input.add32(3887874863n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(3887910911n); - }); - - it('test operator "or" overload (euint16, euint32) => euint32 test 2 (36591, 36595)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(36591n); - input.add32(36595n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(36607n); - }); - - it('test operator "or" overload (euint16, euint32) => euint32 test 3 (36595, 36595)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(36595n); - input.add32(36595n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(36595n); - }); - - it('test operator "or" overload (euint16, euint32) => euint32 test 4 (36595, 36591)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(36595n); - input.add32(36591n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(36607n); - }); - - it('test operator "xor" overload (euint16, euint32) => euint32 test 1 (23121, 1351735572)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(23121n); - input.add32(1351735572n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(1351713605n); - }); - - it('test operator "xor" overload (euint16, euint32) => euint32 test 2 (23117, 23121)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(23117n); - input.add32(23121n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(28n); - }); - - it('test operator "xor" overload (euint16, euint32) => euint32 test 3 (23121, 23121)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(23121n); - input.add32(23121n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint16, euint32) => euint32 test 4 (23121, 23117)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(23121n); - input.add32(23117n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(28n); - }); - - it('test operator "eq" overload (euint16, euint32) => ebool test 1 (14585, 2487581396)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(14585n); - input.add32(2487581396n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint16, euint32) => ebool test 2 (14581, 14585)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(14581n); - input.add32(14585n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint16, euint32) => ebool test 3 (14585, 14585)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(14585n); - input.add32(14585n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint16, euint32) => ebool test 4 (14585, 14581)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(14585n); - input.add32(14581n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint16, euint32) => ebool test 1 (30095, 2933999842)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(30095n); - input.add32(2933999842n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint16, euint32) => ebool test 2 (30091, 30095)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(30091n); - input.add32(30095n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint16, euint32) => ebool test 3 (30095, 30095)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(30095n); - input.add32(30095n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint16, euint32) => ebool test 4 (30095, 30091)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(30095n); - input.add32(30091n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint16, euint32) => ebool test 1 (63432, 458410498)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(63432n); - input.add32(458410498n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint16, euint32) => ebool test 2 (63428, 63432)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(63428n); - input.add32(63432n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint16, euint32) => ebool test 3 (63432, 63432)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(63432n); - input.add32(63432n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint16, euint32) => ebool test 4 (63432, 63428)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(63432n); - input.add32(63428n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint16, euint32) => ebool test 1 (8095, 1426308540)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(8095n); - input.add32(1426308540n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, euint32) => ebool test 2 (8091, 8095)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(8091n); - input.add32(8095n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, euint32) => ebool test 3 (8095, 8095)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(8095n); - input.add32(8095n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, euint32) => ebool test 4 (8095, 8091)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(8095n); - input.add32(8091n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint32) => ebool test 1 (44937, 2020262580)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(44937n); - input.add32(2020262580n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint32) => ebool test 2 (44933, 44937)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(44933n); - input.add32(44937n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint32) => ebool test 3 (44937, 44937)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(44937n); - input.add32(44937n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint32) => ebool test 4 (44937, 44933)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(44937n); - input.add32(44933n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint16, euint32) => ebool test 1 (31744, 3296344536)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(31744n); - input.add32(3296344536n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint16, euint32) => ebool test 2 (31740, 31744)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(31740n); - input.add32(31744n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint16, euint32) => ebool test 3 (31744, 31744)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(31744n); - input.add32(31744n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint16, euint32) => ebool test 4 (31744, 31740)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(31744n); - input.add32(31740n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint16, euint32) => euint32 test 1 (8199, 2465008600)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(8199n); - input.add32(2465008600n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(8199n); - }); - - it('test operator "min" overload (euint16, euint32) => euint32 test 2 (8195, 8199)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(8195n); - input.add32(8199n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(8195n); - }); - - it('test operator "min" overload (euint16, euint32) => euint32 test 3 (8199, 8199)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(8199n); - input.add32(8199n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(8199n); - }); - - it('test operator "min" overload (euint16, euint32) => euint32 test 4 (8199, 8195)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(8199n); - input.add32(8195n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(8195n); - }); - - it('test operator "max" overload (euint16, euint32) => euint32 test 1 (6434, 2918687585)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(6434n); - input.add32(2918687585n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(2918687585n); - }); - - it('test operator "max" overload (euint16, euint32) => euint32 test 2 (6430, 6434)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(6430n); - input.add32(6434n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(6434n); - }); - - it('test operator "max" overload (euint16, euint32) => euint32 test 3 (6434, 6434)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(6434n); - input.add32(6434n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(6434n); - }); - - it('test operator "max" overload (euint16, euint32) => euint32 test 4 (6434, 6430)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(6434n); - input.add32(6430n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract4.res32()); - expect(res).to.equal(6434n); - }); - - it('test operator "add" overload (euint16, euint64) => euint64 test 1 (2, 65506)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(2n); - input.add64(65506n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(65508n); - }); - - it('test operator "add" overload (euint16, euint64) => euint64 test 2 (32347, 32349)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(32347n); - input.add64(32349n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(64696n); - }); - - it('test operator "add" overload (euint16, euint64) => euint64 test 3 (32349, 32349)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(32349n); - input.add64(32349n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(64698n); - }); - - it('test operator "add" overload (euint16, euint64) => euint64 test 4 (32349, 32347)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(32349n); - input.add64(32347n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(64696n); - }); - - it('test operator "sub" overload (euint16, euint64) => euint64 test 1 (12596, 12596)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(12596n); - input.add64(12596n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.sub_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint16, euint64) => euint64 test 2 (12596, 12592)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(12596n); - input.add64(12592n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.sub_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint16, euint64) => euint64 test 1 (2, 32755)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(2n); - input.add64(32755n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(65510n); - }); - - it('test operator "mul" overload (euint16, euint64) => euint64 test 2 (216, 216)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(216n); - input.add64(216n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(46656n); - }); - - it('test operator "mul" overload (euint16, euint64) => euint64 test 3 (216, 216)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(216n); - input.add64(216n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(46656n); - }); - - it('test operator "mul" overload (euint16, euint64) => euint64 test 4 (216, 216)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(216n); - input.add64(216n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(46656n); - }); - - it('test operator "and" overload (euint16, euint64) => euint64 test 1 (46498, 18443921867836499841)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(46498n); - input.add64(18443921867836499841n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(9600n); - }); - - it('test operator "and" overload (euint16, euint64) => euint64 test 2 (46494, 46498)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(46494n); - input.add64(46498n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(46466n); - }); - - it('test operator "and" overload (euint16, euint64) => euint64 test 3 (46498, 46498)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(46498n); - input.add64(46498n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(46498n); - }); - - it('test operator "and" overload (euint16, euint64) => euint64 test 4 (46498, 46494)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(46498n); - input.add64(46494n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(46466n); - }); - - it('test operator "or" overload (euint16, euint64) => euint64 test 1 (8318, 18443891473910549169)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(8318n); - input.add64(18443891473910549169n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(18443891473910557439n); - }); - - it('test operator "or" overload (euint16, euint64) => euint64 test 2 (8314, 8318)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(8314n); - input.add64(8318n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(8318n); - }); - - it('test operator "or" overload (euint16, euint64) => euint64 test 3 (8318, 8318)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(8318n); - input.add64(8318n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(8318n); - }); - - it('test operator "or" overload (euint16, euint64) => euint64 test 4 (8318, 8314)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(8318n); - input.add64(8314n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(8318n); - }); - - it('test operator "xor" overload (euint16, euint64) => euint64 test 1 (47675, 18446725910384356169)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(47675n); - input.add64(18446725910384356169n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(18446725910384382322n); - }); - - it('test operator "xor" overload (euint16, euint64) => euint64 test 2 (47671, 47675)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(47671n); - input.add64(47675n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint16, euint64) => euint64 test 3 (47675, 47675)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(47675n); - input.add64(47675n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint16, euint64) => euint64 test 4 (47675, 47671)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(47675n); - input.add64(47671n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(12n); - }); - - it('test operator "eq" overload (euint16, euint64) => ebool test 1 (29419, 18446062766310773765)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(29419n); - input.add64(18446062766310773765n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint16, euint64) => ebool test 2 (29415, 29419)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(29415n); - input.add64(29419n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint16, euint64) => ebool test 3 (29419, 29419)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(29419n); - input.add64(29419n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint16, euint64) => ebool test 4 (29419, 29415)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(29419n); - input.add64(29415n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint16, euint64) => ebool test 1 (9855, 18438572273104866201)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(9855n); - input.add64(18438572273104866201n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint16, euint64) => ebool test 2 (9851, 9855)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(9851n); - input.add64(9855n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint16, euint64) => ebool test 3 (9855, 9855)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(9855n); - input.add64(9855n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint16, euint64) => ebool test 4 (9855, 9851)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(9855n); - input.add64(9851n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); -}); diff --git a/contracts/test/tfheOperations/tfheOperations5.ts b/contracts/test/tfheOperations/tfheOperations5.ts deleted file mode 100644 index 8bdaf504..00000000 --- a/contracts/test/tfheOperations/tfheOperations5.ts +++ /dev/null @@ -1,4357 +0,0 @@ -import { expect } from 'chai'; -import { ethers } from 'hardhat'; - -import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1'; -import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2'; -import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'; -import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4'; -import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5'; -import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6'; -import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7'; -import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8'; -import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9'; -import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10'; -import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11'; -import { - createInstances, - decrypt4, - decrypt8, - decrypt16, - decrypt32, - decrypt64, - decrypt128, - decrypt256, - decryptBool, -} from '../instance'; -import { getSigners, initSigners } from '../signers'; - -async function deployTfheTestFixture1(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture2(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture3(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture4(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture5(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture6(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture7(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite7'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture8(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite8'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture9(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite9'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture10(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite10'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture11(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite11'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -describe('TFHE operations 5', function () { - before(async function () { - await initSigners(1); - this.signers = await getSigners(); - - const contract1 = await deployTfheTestFixture1(); - this.contract1Address = await contract1.getAddress(); - this.contract1 = contract1; - - const contract2 = await deployTfheTestFixture2(); - this.contract2Address = await contract2.getAddress(); - this.contract2 = contract2; - - const contract3 = await deployTfheTestFixture3(); - this.contract3Address = await contract3.getAddress(); - this.contract3 = contract3; - - const contract4 = await deployTfheTestFixture4(); - this.contract4Address = await contract4.getAddress(); - this.contract4 = contract4; - - const contract5 = await deployTfheTestFixture5(); - this.contract5Address = await contract5.getAddress(); - this.contract5 = contract5; - - const contract6 = await deployTfheTestFixture6(); - this.contract6Address = await contract6.getAddress(); - this.contract6 = contract6; - - const contract7 = await deployTfheTestFixture7(); - this.contract7Address = await contract7.getAddress(); - this.contract7 = contract7; - - const contract8 = await deployTfheTestFixture8(); - this.contract8Address = await contract8.getAddress(); - this.contract8 = contract8; - - const contract9 = await deployTfheTestFixture9(); - this.contract9Address = await contract9.getAddress(); - this.contract9 = contract9; - - const contract10 = await deployTfheTestFixture10(); - this.contract10Address = await contract10.getAddress(); - this.contract10 = contract10; - - const contract11 = await deployTfheTestFixture11(); - this.contract11Address = await contract11.getAddress(); - this.contract11 = contract11; - - const instances = await createInstances(this.signers); - this.instances = instances; - }); - - it('test operator "ge" overload (euint16, euint64) => ebool test 1 (14081, 18444389415407077285)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(14081n); - input.add64(18444389415407077285n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint16, euint64) => ebool test 2 (14077, 14081)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(14077n); - input.add64(14081n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint16, euint64) => ebool test 3 (14081, 14081)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(14081n); - input.add64(14081n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint16, euint64) => ebool test 4 (14081, 14077)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(14081n); - input.add64(14077n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint16, euint64) => ebool test 1 (45007, 18445308410216818905)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(45007n); - input.add64(18445308410216818905n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, euint64) => ebool test 2 (45003, 45007)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(45003n); - input.add64(45007n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, euint64) => ebool test 3 (45007, 45007)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(45007n); - input.add64(45007n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, euint64) => ebool test 4 (45007, 45003)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(45007n); - input.add64(45003n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint64) => ebool test 1 (33530, 18441393339688273439)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(33530n); - input.add64(18441393339688273439n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint64) => ebool test 2 (33526, 33530)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(33526n); - input.add64(33530n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint64) => ebool test 3 (33530, 33530)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(33530n); - input.add64(33530n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint64) => ebool test 4 (33530, 33526)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(33530n); - input.add64(33526n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint16, euint64) => ebool test 1 (7192, 18440977990475901673)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(7192n); - input.add64(18440977990475901673n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint16, euint64) => ebool test 2 (7188, 7192)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(7188n); - input.add64(7192n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint16, euint64) => ebool test 3 (7192, 7192)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(7192n); - input.add64(7192n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint16, euint64) => ebool test 4 (7192, 7188)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(7192n); - input.add64(7188n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint16, euint64) => euint64 test 1 (64768, 18439640713575288835)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(64768n); - input.add64(18439640713575288835n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(64768n); - }); - - it('test operator "min" overload (euint16, euint64) => euint64 test 2 (64764, 64768)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(64764n); - input.add64(64768n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(64764n); - }); - - it('test operator "min" overload (euint16, euint64) => euint64 test 3 (64768, 64768)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(64768n); - input.add64(64768n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(64768n); - }); - - it('test operator "min" overload (euint16, euint64) => euint64 test 4 (64768, 64764)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(64768n); - input.add64(64764n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(64764n); - }); - - it('test operator "max" overload (euint16, euint64) => euint64 test 1 (43725, 18443087667786395005)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(43725n); - input.add64(18443087667786395005n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(18443087667786395005n); - }); - - it('test operator "max" overload (euint16, euint64) => euint64 test 2 (43721, 43725)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(43721n); - input.add64(43725n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(43725n); - }); - - it('test operator "max" overload (euint16, euint64) => euint64 test 3 (43725, 43725)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(43725n); - input.add64(43725n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(43725n); - }); - - it('test operator "max" overload (euint16, euint64) => euint64 test 4 (43725, 43721)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(43725n); - input.add64(43721n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract4.res64()); - expect(res).to.equal(43725n); - }); - - it('test operator "add" overload (euint16, euint128) => euint128 test 1 (2, 32769)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(2n); - input.add128(32769n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(32771n); - }); - - it('test operator "add" overload (euint16, euint128) => euint128 test 2 (25454, 25456)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(25454n); - input.add128(25456n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(50910n); - }); - - it('test operator "add" overload (euint16, euint128) => euint128 test 3 (25456, 25456)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(25456n); - input.add128(25456n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(50912n); - }); - - it('test operator "add" overload (euint16, euint128) => euint128 test 4 (25456, 25454)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(25456n); - input.add128(25454n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(50910n); - }); - - it('test operator "sub" overload (euint16, euint128) => euint128 test 1 (45485, 45485)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(45485n); - input.add128(45485n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.sub_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint16, euint128) => euint128 test 2 (45485, 45481)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(45485n); - input.add128(45481n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.sub_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint16, euint128) => euint128 test 1 (2, 16385)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(2n); - input.add128(16385n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(32770n); - }); - - it('test operator "mul" overload (euint16, euint128) => euint128 test 2 (206, 206)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(206n); - input.add128(206n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(42436n); - }); - - it('test operator "mul" overload (euint16, euint128) => euint128 test 3 (206, 206)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(206n); - input.add128(206n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(42436n); - }); - - it('test operator "mul" overload (euint16, euint128) => euint128 test 4 (206, 206)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(206n); - input.add128(206n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(42436n); - }); - - it('test operator "and" overload (euint16, euint128) => euint128 test 1 (10041, 340282366920938463463370138658990657653)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(10041n); - input.add128(340282366920938463463370138658990657653n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(49n); - }); - - it('test operator "and" overload (euint16, euint128) => euint128 test 2 (10037, 10041)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(10037n); - input.add128(10041n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(10033n); - }); - - it('test operator "and" overload (euint16, euint128) => euint128 test 3 (10041, 10041)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(10041n); - input.add128(10041n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(10041n); - }); - - it('test operator "and" overload (euint16, euint128) => euint128 test 4 (10041, 10037)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(10041n); - input.add128(10037n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(10033n); - }); - - it('test operator "or" overload (euint16, euint128) => euint128 test 1 (65101, 340282366920938463463368378388212688025)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(65101n); - input.add128(340282366920938463463368378388212688025n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(340282366920938463463368378388212743901n); - }); - - it('test operator "or" overload (euint16, euint128) => euint128 test 2 (65097, 65101)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(65097n); - input.add128(65101n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(65101n); - }); - - it('test operator "or" overload (euint16, euint128) => euint128 test 3 (65101, 65101)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(65101n); - input.add128(65101n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(65101n); - }); - - it('test operator "or" overload (euint16, euint128) => euint128 test 4 (65101, 65097)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(65101n); - input.add128(65097n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(65101n); - }); - - it('test operator "xor" overload (euint16, euint128) => euint128 test 1 (57137, 340282366920938463463372706296613530555)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(57137n); - input.add128(340282366920938463463372706296613530555n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(340282366920938463463372706296613549194n); - }); - - it('test operator "xor" overload (euint16, euint128) => euint128 test 2 (57133, 57137)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(57133n); - input.add128(57137n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(28n); - }); - - it('test operator "xor" overload (euint16, euint128) => euint128 test 3 (57137, 57137)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(57137n); - input.add128(57137n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint16, euint128) => euint128 test 4 (57137, 57133)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(57137n); - input.add128(57133n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(28n); - }); - - it('test operator "eq" overload (euint16, euint128) => ebool test 1 (47922, 340282366920938463463372663915711616945)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(47922n); - input.add128(340282366920938463463372663915711616945n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint16, euint128) => ebool test 2 (47918, 47922)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(47918n); - input.add128(47922n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint16, euint128) => ebool test 3 (47922, 47922)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(47922n); - input.add128(47922n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint16, euint128) => ebool test 4 (47922, 47918)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(47922n); - input.add128(47918n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint16, euint128) => ebool test 1 (58939, 340282366920938463463367826166753900405)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(58939n); - input.add128(340282366920938463463367826166753900405n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint16, euint128) => ebool test 2 (58935, 58939)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(58935n); - input.add128(58939n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint16, euint128) => ebool test 3 (58939, 58939)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(58939n); - input.add128(58939n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint16, euint128) => ebool test 4 (58939, 58935)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(58939n); - input.add128(58935n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint16, euint128) => ebool test 1 (25628, 340282366920938463463367234559875664879)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(25628n); - input.add128(340282366920938463463367234559875664879n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint16, euint128) => ebool test 2 (25624, 25628)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(25624n); - input.add128(25628n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint16, euint128) => ebool test 3 (25628, 25628)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(25628n); - input.add128(25628n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint16, euint128) => ebool test 4 (25628, 25624)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(25628n); - input.add128(25624n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint16, euint128) => ebool test 1 (29493, 340282366920938463463370329441548615949)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(29493n); - input.add128(340282366920938463463370329441548615949n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, euint128) => ebool test 2 (29489, 29493)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(29489n); - input.add128(29493n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, euint128) => ebool test 3 (29493, 29493)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(29493n); - input.add128(29493n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, euint128) => ebool test 4 (29493, 29489)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(29493n); - input.add128(29489n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint128) => ebool test 1 (63634, 340282366920938463463365626120025172451)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(63634n); - input.add128(340282366920938463463365626120025172451n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint128) => ebool test 2 (63630, 63634)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(63630n); - input.add128(63634n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint128) => ebool test 3 (63634, 63634)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(63634n); - input.add128(63634n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint128) => ebool test 4 (63634, 63630)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(63634n); - input.add128(63630n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint16, euint128) => ebool test 1 (16589, 340282366920938463463371297893972390287)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(16589n); - input.add128(340282366920938463463371297893972390287n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint16, euint128) => ebool test 2 (16585, 16589)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(16585n); - input.add128(16589n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint16, euint128) => ebool test 3 (16589, 16589)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(16589n); - input.add128(16589n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint16, euint128) => ebool test 4 (16589, 16585)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(16589n); - input.add128(16585n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint16, euint128) => euint128 test 1 (47213, 340282366920938463463367215507048923025)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(47213n); - input.add128(340282366920938463463367215507048923025n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(47213n); - }); - - it('test operator "min" overload (euint16, euint128) => euint128 test 2 (47209, 47213)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(47209n); - input.add128(47213n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(47209n); - }); - - it('test operator "min" overload (euint16, euint128) => euint128 test 3 (47213, 47213)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(47213n); - input.add128(47213n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(47213n); - }); - - it('test operator "min" overload (euint16, euint128) => euint128 test 4 (47213, 47209)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(47213n); - input.add128(47209n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(47209n); - }); - - it('test operator "max" overload (euint16, euint128) => euint128 test 1 (41694, 340282366920938463463370312817461607687)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(41694n); - input.add128(340282366920938463463370312817461607687n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(340282366920938463463370312817461607687n); - }); - - it('test operator "max" overload (euint16, euint128) => euint128 test 2 (41690, 41694)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(41690n); - input.add128(41694n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(41694n); - }); - - it('test operator "max" overload (euint16, euint128) => euint128 test 3 (41694, 41694)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(41694n); - input.add128(41694n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(41694n); - }); - - it('test operator "max" overload (euint16, euint128) => euint128 test 4 (41694, 41690)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(41694n); - input.add128(41690n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract4.res128()); - expect(res).to.equal(41694n); - }); - - it('test operator "add" overload (euint16, euint256) => euint256 test 1 (2, 32769)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(2n); - input.add256(32769n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(32771n); - }); - - it('test operator "add" overload (euint16, euint256) => euint256 test 2 (20019, 20021)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(20019n); - input.add256(20021n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(40040n); - }); - - it('test operator "add" overload (euint16, euint256) => euint256 test 3 (20021, 20021)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(20021n); - input.add256(20021n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(40042n); - }); - - it('test operator "add" overload (euint16, euint256) => euint256 test 4 (20021, 20019)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(20021n); - input.add256(20019n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(40040n); - }); - - it('test operator "sub" overload (euint16, euint256) => euint256 test 1 (40273, 40273)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(40273n); - input.add256(40273n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.sub_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint16, euint256) => euint256 test 2 (40273, 40269)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(40273n); - input.add256(40269n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.sub_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint16, euint256) => euint256 test 1 (2, 16385)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(2n); - input.add256(16385n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(32770n); - }); - - it('test operator "mul" overload (euint16, euint256) => euint256 test 2 (228, 228)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(228n); - input.add256(228n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(51984n); - }); - - it('test operator "mul" overload (euint16, euint256) => euint256 test 3 (228, 228)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(228n); - input.add256(228n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(51984n); - }); - - it('test operator "mul" overload (euint16, euint256) => euint256 test 4 (228, 228)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(228n); - input.add256(228n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(51984n); - }); - - it('test operator "and" overload (euint16, euint256) => euint256 test 1 (12579, 115792089237316195423570985008687907853269984665640564039457582458858424079051)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(12579n); - input.add256(115792089237316195423570985008687907853269984665640564039457582458858424079051n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(4099n); - }); - - it('test operator "and" overload (euint16, euint256) => euint256 test 2 (12575, 12579)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(12575n); - input.add256(12579n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(12547n); - }); - - it('test operator "and" overload (euint16, euint256) => euint256 test 3 (12579, 12579)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(12579n); - input.add256(12579n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(12579n); - }); - - it('test operator "and" overload (euint16, euint256) => euint256 test 4 (12579, 12575)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(12579n); - input.add256(12575n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.and_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(12547n); - }); - - it('test operator "or" overload (euint16, euint256) => euint256 test 1 (31079, 115792089237316195423570985008687907853269984665640564039457575275996784888971)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(31079n); - input.add256(115792089237316195423570985008687907853269984665640564039457575275996784888971n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457575275996784917999n); - }); - - it('test operator "or" overload (euint16, euint256) => euint256 test 2 (31075, 31079)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(31075n); - input.add256(31079n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(31079n); - }); - - it('test operator "or" overload (euint16, euint256) => euint256 test 3 (31079, 31079)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(31079n); - input.add256(31079n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(31079n); - }); - - it('test operator "or" overload (euint16, euint256) => euint256 test 4 (31079, 31075)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(31079n); - input.add256(31075n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.or_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(31079n); - }); - - it('test operator "xor" overload (euint16, euint256) => euint256 test 1 (21805, 115792089237316195423570985008687907853269984665640564039457581252703610907733)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(21805n); - input.add256(115792089237316195423570985008687907853269984665640564039457581252703610907733n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457581252703610927480n); - }); - - it('test operator "xor" overload (euint16, euint256) => euint256 test 2 (21801, 21805)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(21801n); - input.add256(21805n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint16, euint256) => euint256 test 3 (21805, 21805)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(21805n); - input.add256(21805n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint16, euint256) => euint256 test 4 (21805, 21801)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(21805n); - input.add256(21801n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.xor_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint16, euint256) => ebool test 1 (55138, 115792089237316195423570985008687907853269984665640564039457576200268434748919)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(55138n); - input.add256(115792089237316195423570985008687907853269984665640564039457576200268434748919n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint16, euint256) => ebool test 2 (55134, 55138)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(55134n); - input.add256(55138n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint16, euint256) => ebool test 3 (55138, 55138)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(55138n); - input.add256(55138n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint16, euint256) => ebool test 4 (55138, 55134)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(55138n); - input.add256(55134n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.eq_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint16, euint256) => ebool test 1 (41071, 115792089237316195423570985008687907853269984665640564039457577958679700892209)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(41071n); - input.add256(115792089237316195423570985008687907853269984665640564039457577958679700892209n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint16, euint256) => ebool test 2 (41067, 41071)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(41067n); - input.add256(41071n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint16, euint256) => ebool test 3 (41071, 41071)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(41071n); - input.add256(41071n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint16, euint256) => ebool test 4 (41071, 41067)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(41071n); - input.add256(41067n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ne_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint16, euint256) => ebool test 1 (50106, 115792089237316195423570985008687907853269984665640564039457582313908377810967)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(50106n); - input.add256(115792089237316195423570985008687907853269984665640564039457582313908377810967n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint16, euint256) => ebool test 2 (50102, 50106)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(50102n); - input.add256(50106n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint16, euint256) => ebool test 3 (50106, 50106)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(50106n); - input.add256(50106n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint16, euint256) => ebool test 4 (50106, 50102)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(50106n); - input.add256(50102n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.ge_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint16, euint256) => ebool test 1 (30875, 115792089237316195423570985008687907853269984665640564039457575028224206757889)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(30875n); - input.add256(115792089237316195423570985008687907853269984665640564039457575028224206757889n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, euint256) => ebool test 2 (30871, 30875)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(30871n); - input.add256(30875n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, euint256) => ebool test 3 (30875, 30875)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(30875n); - input.add256(30875n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, euint256) => ebool test 4 (30875, 30871)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(30875n); - input.add256(30871n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.gt_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint256) => ebool test 1 (10398, 115792089237316195423570985008687907853269984665640564039457582877023510899415)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(10398n); - input.add256(115792089237316195423570985008687907853269984665640564039457582877023510899415n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint256) => ebool test 2 (10394, 10398)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(10394n); - input.add256(10398n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint256) => ebool test 3 (10398, 10398)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(10398n); - input.add256(10398n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, euint256) => ebool test 4 (10398, 10394)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(10398n); - input.add256(10394n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.le_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint16, euint256) => ebool test 1 (58145, 115792089237316195423570985008687907853269984665640564039457578303118040864491)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(58145n); - input.add256(115792089237316195423570985008687907853269984665640564039457578303118040864491n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint16, euint256) => ebool test 2 (58141, 58145)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(58141n); - input.add256(58145n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint16, euint256) => ebool test 3 (58145, 58145)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(58145n); - input.add256(58145n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint16, euint256) => ebool test 4 (58145, 58141)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(58145n); - input.add256(58141n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.lt_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract4.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint16, euint256) => euint256 test 1 (56701, 115792089237316195423570985008687907853269984665640564039457576701213568693639)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(56701n); - input.add256(115792089237316195423570985008687907853269984665640564039457576701213568693639n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(56701n); - }); - - it('test operator "min" overload (euint16, euint256) => euint256 test 2 (56697, 56701)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(56697n); - input.add256(56701n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(56697n); - }); - - it('test operator "min" overload (euint16, euint256) => euint256 test 3 (56701, 56701)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(56701n); - input.add256(56701n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(56701n); - }); - - it('test operator "min" overload (euint16, euint256) => euint256 test 4 (56701, 56697)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(56701n); - input.add256(56697n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.min_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(56697n); - }); - - it('test operator "max" overload (euint16, euint256) => euint256 test 1 (35663, 115792089237316195423570985008687907853269984665640564039457581066242393293579)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(35663n); - input.add256(115792089237316195423570985008687907853269984665640564039457581066242393293579n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457581066242393293579n); - }); - - it('test operator "max" overload (euint16, euint256) => euint256 test 2 (35659, 35663)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(35659n); - input.add256(35663n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(35663n); - }); - - it('test operator "max" overload (euint16, euint256) => euint256 test 3 (35663, 35663)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(35663n); - input.add256(35663n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(35663n); - }); - - it('test operator "max" overload (euint16, euint256) => euint256 test 4 (35663, 35659)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(35663n); - input.add256(35659n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.max_euint16_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract4.res256()); - expect(res).to.equal(35663n); - }); - - it('test operator "add" overload (euint16, uint16) => euint16 test 1 (26028, 15417)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(26028n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_uint16(encryptedAmount.handles[0], 15417n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(41445n); - }); - - it('test operator "add" overload (euint16, uint16) => euint16 test 2 (26024, 26028)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(26024n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_uint16(encryptedAmount.handles[0], 26028n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(52052n); - }); - - it('test operator "add" overload (euint16, uint16) => euint16 test 3 (26028, 26028)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(26028n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_uint16(encryptedAmount.handles[0], 26028n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(52056n); - }); - - it('test operator "add" overload (euint16, uint16) => euint16 test 4 (26028, 26024)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(26028n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_euint16_uint16(encryptedAmount.handles[0], 26024n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(52052n); - }); - - it('test operator "add" overload (uint16, euint16) => euint16 test 1 (22897, 15417)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add16(15417n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_uint16_euint16(22897n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(38314n); - }); - - it('test operator "add" overload (uint16, euint16) => euint16 test 2 (26024, 26028)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add16(26028n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_uint16_euint16(26024n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(52052n); - }); - - it('test operator "add" overload (uint16, euint16) => euint16 test 3 (26028, 26028)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add16(26028n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_uint16_euint16(26028n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(52056n); - }); - - it('test operator "add" overload (uint16, euint16) => euint16 test 4 (26028, 26024)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add16(26024n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.add_uint16_euint16(26028n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(52052n); - }); - - it('test operator "sub" overload (euint16, uint16) => euint16 test 1 (14486, 14486)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(14486n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.sub_euint16_uint16(encryptedAmount.handles[0], 14486n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint16, uint16) => euint16 test 2 (14486, 14482)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(14486n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.sub_euint16_uint16(encryptedAmount.handles[0], 14482n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(4n); - }); - - it('test operator "sub" overload (uint16, euint16) => euint16 test 1 (14486, 14486)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add16(14486n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.sub_uint16_euint16(14486n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (uint16, euint16) => euint16 test 2 (14486, 14482)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add16(14482n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.sub_uint16_euint16(14486n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint16, uint16) => euint16 test 1 (233, 168)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(233n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_uint16(encryptedAmount.handles[0], 168n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(39144n); - }); - - it('test operator "mul" overload (euint16, uint16) => euint16 test 2 (233, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(233n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_uint16(encryptedAmount.handles[0], 233n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(54289n); - }); - - it('test operator "mul" overload (euint16, uint16) => euint16 test 3 (233, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(233n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_uint16(encryptedAmount.handles[0], 233n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(54289n); - }); - - it('test operator "mul" overload (euint16, uint16) => euint16 test 4 (233, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - input.add16(233n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_euint16_uint16(encryptedAmount.handles[0], 233n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(54289n); - }); - - it('test operator "mul" overload (uint16, euint16) => euint16 test 1 (140, 168)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add16(168n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_uint16_euint16(140n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(23520n); - }); - - it('test operator "mul" overload (uint16, euint16) => euint16 test 2 (233, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add16(233n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_uint16_euint16(233n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(54289n); - }); - - it('test operator "mul" overload (uint16, euint16) => euint16 test 3 (233, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add16(233n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_uint16_euint16(233n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(54289n); - }); - - it('test operator "mul" overload (uint16, euint16) => euint16 test 4 (233, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract4Address, this.signers.alice.address); - - input.add16(233n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract4.mul_uint16_euint16(233n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract4.res16()); - expect(res).to.equal(54289n); - }); - - it('test operator "div" overload (euint16, uint16) => euint16 test 1 (20304, 59132)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(20304n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.div_euint16_uint16(encryptedAmount.handles[0], 59132n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "div" overload (euint16, uint16) => euint16 test 2 (20300, 20304)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(20300n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.div_euint16_uint16(encryptedAmount.handles[0], 20304n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "div" overload (euint16, uint16) => euint16 test 3 (20304, 20304)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(20304n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.div_euint16_uint16(encryptedAmount.handles[0], 20304n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(1n); - }); - - it('test operator "div" overload (euint16, uint16) => euint16 test 4 (20304, 20300)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(20304n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.div_euint16_uint16(encryptedAmount.handles[0], 20300n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(1n); - }); - - it('test operator "rem" overload (euint16, uint16) => euint16 test 1 (41581, 40239)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(41581n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.rem_euint16_uint16(encryptedAmount.handles[0], 40239n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(1342n); - }); - - it('test operator "rem" overload (euint16, uint16) => euint16 test 2 (40817, 40821)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(40817n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.rem_euint16_uint16(encryptedAmount.handles[0], 40821n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(40817n); - }); - - it('test operator "rem" overload (euint16, uint16) => euint16 test 3 (40821, 40821)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(40821n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.rem_euint16_uint16(encryptedAmount.handles[0], 40821n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "rem" overload (euint16, uint16) => euint16 test 4 (40821, 40817)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(40821n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.rem_euint16_uint16(encryptedAmount.handles[0], 40817n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(4n); - }); - - it('test operator "and" overload (euint16, uint16) => euint16 test 1 (25969, 39616)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(25969n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint16_uint16(encryptedAmount.handles[0], 39616n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(64n); - }); - - it('test operator "and" overload (euint16, uint16) => euint16 test 2 (25965, 25969)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(25965n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint16_uint16(encryptedAmount.handles[0], 25969n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(25953n); - }); - - it('test operator "and" overload (euint16, uint16) => euint16 test 3 (25969, 25969)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(25969n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint16_uint16(encryptedAmount.handles[0], 25969n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(25969n); - }); - - it('test operator "and" overload (euint16, uint16) => euint16 test 4 (25969, 25965)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(25969n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint16_uint16(encryptedAmount.handles[0], 25965n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(25953n); - }); - - it('test operator "and" overload (uint16, euint16) => euint16 test 1 (12551, 39616)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(39616n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_uint16_euint16(12551n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(4096n); - }); - - it('test operator "and" overload (uint16, euint16) => euint16 test 2 (25965, 25969)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(25969n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_uint16_euint16(25965n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(25953n); - }); - - it('test operator "and" overload (uint16, euint16) => euint16 test 3 (25969, 25969)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(25969n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_uint16_euint16(25969n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(25969n); - }); - - it('test operator "and" overload (uint16, euint16) => euint16 test 4 (25969, 25965)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(25965n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_uint16_euint16(25969n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(25953n); - }); - - it('test operator "or" overload (euint16, uint16) => euint16 test 1 (41436, 27184)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(41436n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint16_uint16(encryptedAmount.handles[0], 27184n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(60412n); - }); - - it('test operator "or" overload (euint16, uint16) => euint16 test 2 (37563, 37567)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(37563n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint16_uint16(encryptedAmount.handles[0], 37567n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(37567n); - }); - - it('test operator "or" overload (euint16, uint16) => euint16 test 3 (37567, 37567)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(37567n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint16_uint16(encryptedAmount.handles[0], 37567n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(37567n); - }); - - it('test operator "or" overload (euint16, uint16) => euint16 test 4 (37567, 37563)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(37567n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint16_uint16(encryptedAmount.handles[0], 37563n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(37567n); - }); - - it('test operator "or" overload (uint16, euint16) => euint16 test 1 (65174, 27184)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(27184n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_uint16_euint16(65174n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(65206n); - }); - - it('test operator "or" overload (uint16, euint16) => euint16 test 2 (37563, 37567)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(37567n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_uint16_euint16(37563n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(37567n); - }); - - it('test operator "or" overload (uint16, euint16) => euint16 test 3 (37567, 37567)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(37567n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_uint16_euint16(37567n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(37567n); - }); - - it('test operator "or" overload (uint16, euint16) => euint16 test 4 (37567, 37563)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(37563n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_uint16_euint16(37567n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(37567n); - }); - - it('test operator "xor" overload (euint16, uint16) => euint16 test 1 (65327, 31297)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(65327n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint16_uint16(encryptedAmount.handles[0], 31297n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(34158n); - }); - - it('test operator "xor" overload (euint16, uint16) => euint16 test 2 (25542, 25546)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(25542n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint16_uint16(encryptedAmount.handles[0], 25546n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint16, uint16) => euint16 test 3 (25546, 25546)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(25546n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint16_uint16(encryptedAmount.handles[0], 25546n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint16, uint16) => euint16 test 4 (25546, 25542)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(25546n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint16_uint16(encryptedAmount.handles[0], 25542n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (uint16, euint16) => euint16 test 1 (33651, 31297)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(31297n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_uint16_euint16(33651n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(63794n); - }); - - it('test operator "xor" overload (uint16, euint16) => euint16 test 2 (25542, 25546)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(25546n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_uint16_euint16(25542n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (uint16, euint16) => euint16 test 3 (25546, 25546)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(25546n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_uint16_euint16(25546n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (uint16, euint16) => euint16 test 4 (25546, 25542)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(25542n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_uint16_euint16(25546n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(12n); - }); - - it('test operator "eq" overload (euint16, uint16) => ebool test 1 (45930, 25309)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(45930n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint16_uint16(encryptedAmount.handles[0], 25309n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint16, uint16) => ebool test 2 (43841, 43845)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(43841n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint16_uint16(encryptedAmount.handles[0], 43845n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint16, uint16) => ebool test 3 (43845, 43845)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(43845n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint16_uint16(encryptedAmount.handles[0], 43845n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint16, uint16) => ebool test 4 (43845, 43841)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(43845n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint16_uint16(encryptedAmount.handles[0], 43841n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint16, euint16) => ebool test 1 (50532, 25309)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(25309n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_uint16_euint16(50532n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint16, euint16) => ebool test 2 (43841, 43845)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(43845n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_uint16_euint16(43841n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint16, euint16) => ebool test 3 (43845, 43845)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(43845n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_uint16_euint16(43845n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (uint16, euint16) => ebool test 4 (43845, 43841)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(43841n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_uint16_euint16(43845n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint16, uint16) => ebool test 1 (16378, 35706)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(16378n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint16_uint16(encryptedAmount.handles[0], 35706n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint16, uint16) => ebool test 2 (16374, 16378)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(16374n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint16_uint16(encryptedAmount.handles[0], 16378n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint16, uint16) => ebool test 3 (16378, 16378)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(16378n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint16_uint16(encryptedAmount.handles[0], 16378n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint16, uint16) => ebool test 4 (16378, 16374)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(16378n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint16_uint16(encryptedAmount.handles[0], 16374n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint16, euint16) => ebool test 1 (43595, 35706)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(35706n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_uint16_euint16(43595n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint16, euint16) => ebool test 2 (16374, 16378)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(16378n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_uint16_euint16(16374n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint16, euint16) => ebool test 3 (16378, 16378)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(16378n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_uint16_euint16(16378n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (uint16, euint16) => ebool test 4 (16378, 16374)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(16374n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_uint16_euint16(16378n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint16, uint16) => ebool test 1 (51651, 48781)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(51651n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint16_uint16(encryptedAmount.handles[0], 48781n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint16, uint16) => ebool test 2 (13064, 13068)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(13064n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint16_uint16(encryptedAmount.handles[0], 13068n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint16, uint16) => ebool test 3 (13068, 13068)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(13068n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint16_uint16(encryptedAmount.handles[0], 13068n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint16, uint16) => ebool test 4 (13068, 13064)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(13068n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint16_uint16(encryptedAmount.handles[0], 13064n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (uint16, euint16) => ebool test 1 (60450, 48781)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(48781n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_uint16_euint16(60450n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (uint16, euint16) => ebool test 2 (13064, 13068)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(13068n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_uint16_euint16(13064n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (uint16, euint16) => ebool test 3 (13068, 13068)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(13068n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_uint16_euint16(13068n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (uint16, euint16) => ebool test 4 (13068, 13064)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(13064n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_uint16_euint16(13068n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint16, uint16) => ebool test 1 (49523, 10749)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(49523n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint16_uint16(encryptedAmount.handles[0], 10749n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint16, uint16) => ebool test 2 (49519, 49523)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(49519n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint16_uint16(encryptedAmount.handles[0], 49523n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, uint16) => ebool test 3 (49523, 49523)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(49523n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint16_uint16(encryptedAmount.handles[0], 49523n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint16, uint16) => ebool test 4 (49523, 49519)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(49523n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint16_uint16(encryptedAmount.handles[0], 49519n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (uint16, euint16) => ebool test 1 (38042, 10749)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(10749n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_uint16_euint16(38042n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (uint16, euint16) => ebool test 2 (49519, 49523)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(49523n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_uint16_euint16(49519n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (uint16, euint16) => ebool test 3 (49523, 49523)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(49523n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_uint16_euint16(49523n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (uint16, euint16) => ebool test 4 (49523, 49519)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(49519n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_uint16_euint16(49523n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, uint16) => ebool test 1 (20803, 27442)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(20803n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_euint16_uint16(encryptedAmount.handles[0], 27442n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, uint16) => ebool test 2 (869, 873)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(869n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_euint16_uint16(encryptedAmount.handles[0], 873n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, uint16) => ebool test 3 (873, 873)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(873n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_euint16_uint16(encryptedAmount.handles[0], 873n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint16, uint16) => ebool test 4 (873, 869)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(873n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_euint16_uint16(encryptedAmount.handles[0], 869n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (uint16, euint16) => ebool test 1 (36363, 27442)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(27442n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_uint16_euint16(36363n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (uint16, euint16) => ebool test 2 (869, 873)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(873n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_uint16_euint16(869n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (uint16, euint16) => ebool test 3 (873, 873)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(873n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_uint16_euint16(873n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (uint16, euint16) => ebool test 4 (873, 869)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(869n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_uint16_euint16(873n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint16, uint16) => ebool test 1 (34482, 38499)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(34482n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_euint16_uint16(encryptedAmount.handles[0], 38499n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint16, uint16) => ebool test 2 (5142, 5146)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(5142n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_euint16_uint16(encryptedAmount.handles[0], 5146n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint16, uint16) => ebool test 3 (5146, 5146)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(5146n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_euint16_uint16(encryptedAmount.handles[0], 5146n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint16, uint16) => ebool test 4 (5146, 5142)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(5146n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_euint16_uint16(encryptedAmount.handles[0], 5142n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (uint16, euint16) => ebool test 1 (21462, 38499)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(38499n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_uint16_euint16(21462n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (uint16, euint16) => ebool test 2 (5142, 5146)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(5146n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_uint16_euint16(5142n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (uint16, euint16) => ebool test 3 (5146, 5146)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(5146n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_uint16_euint16(5146n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (uint16, euint16) => ebool test 4 (5146, 5142)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(5142n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_uint16_euint16(5146n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint16, uint16) => euint16 test 1 (32718, 54097)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(32718n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_euint16_uint16(encryptedAmount.handles[0], 54097n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(32718n); - }); - - it('test operator "min" overload (euint16, uint16) => euint16 test 2 (8265, 8269)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(8265n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_euint16_uint16(encryptedAmount.handles[0], 8269n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(8265n); - }); - - it('test operator "min" overload (euint16, uint16) => euint16 test 3 (8269, 8269)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(8269n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_euint16_uint16(encryptedAmount.handles[0], 8269n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(8269n); - }); - - it('test operator "min" overload (euint16, uint16) => euint16 test 4 (8269, 8265)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(8269n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_euint16_uint16(encryptedAmount.handles[0], 8265n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(8265n); - }); - - it('test operator "min" overload (uint16, euint16) => euint16 test 1 (24240, 54097)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(54097n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_uint16_euint16(24240n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(24240n); - }); - - it('test operator "min" overload (uint16, euint16) => euint16 test 2 (8265, 8269)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(8269n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_uint16_euint16(8265n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(8265n); - }); - - it('test operator "min" overload (uint16, euint16) => euint16 test 3 (8269, 8269)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(8269n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_uint16_euint16(8269n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(8269n); - }); - - it('test operator "min" overload (uint16, euint16) => euint16 test 4 (8269, 8265)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(8265n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_uint16_euint16(8269n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(8265n); - }); - - it('test operator "max" overload (euint16, uint16) => euint16 test 1 (37775, 25405)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(37775n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_euint16_uint16(encryptedAmount.handles[0], 25405n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(37775n); - }); - - it('test operator "max" overload (euint16, uint16) => euint16 test 2 (22428, 22432)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(22428n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_euint16_uint16(encryptedAmount.handles[0], 22432n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(22432n); - }); - - it('test operator "max" overload (euint16, uint16) => euint16 test 3 (22432, 22432)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(22432n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_euint16_uint16(encryptedAmount.handles[0], 22432n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(22432n); - }); - - it('test operator "max" overload (euint16, uint16) => euint16 test 4 (22432, 22428)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add16(22432n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_euint16_uint16(encryptedAmount.handles[0], 22428n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(22432n); - }); - - it('test operator "max" overload (uint16, euint16) => euint16 test 1 (1122, 25405)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(25405n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_uint16_euint16(1122n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(25405n); - }); - - it('test operator "max" overload (uint16, euint16) => euint16 test 2 (22428, 22432)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(22432n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_uint16_euint16(22428n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(22432n); - }); - - it('test operator "max" overload (uint16, euint16) => euint16 test 3 (22432, 22432)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(22432n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_uint16_euint16(22432n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(22432n); - }); - - it('test operator "max" overload (uint16, euint16) => euint16 test 4 (22432, 22428)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - - input.add16(22428n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_uint16_euint16(22432n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt16(await this.contract5.res16()); - expect(res).to.equal(22432n); - }); - - it('test operator "add" overload (euint32, euint4) => euint32 test 1 (10, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(10n); - input.add4(1n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.add_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(11n); - }); - - it('test operator "add" overload (euint32, euint4) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.add_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(12n); - }); - - it('test operator "add" overload (euint32, euint4) => euint32 test 3 (5, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(5n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.add_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(10n); - }); - - it('test operator "add" overload (euint32, euint4) => euint32 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.add_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(12n); - }); - - it('test operator "sub" overload (euint32, euint4) => euint32 test 1 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.sub_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint32, euint4) => euint32 test 2 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.sub_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint32, euint4) => euint32 test 1 (6, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(6n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.mul_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(12n); - }); - - it('test operator "mul" overload (euint32, euint4) => euint32 test 2 (3, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.mul_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(15n); - }); - - it('test operator "mul" overload (euint32, euint4) => euint32 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3n); - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.mul_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(9n); - }); - - it('test operator "mul" overload (euint32, euint4) => euint32 test 4 (5, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(5n); - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.mul_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(15n); - }); - - it('test operator "and" overload (euint32, euint4) => euint32 test 1 (3337809992, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3337809992n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "and" overload (euint32, euint4) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "and" overload (euint32, euint4) => euint32 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(8n); - }); - - it('test operator "and" overload (euint32, euint4) => euint32 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "or" overload (euint32, euint4) => euint32 test 1 (1671920698, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1671920698n); - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(1671920699n); - }); - - it('test operator "or" overload (euint32, euint4) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(12n); - }); - - it('test operator "or" overload (euint32, euint4) => euint32 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(8n); - }); - - it('test operator "or" overload (euint32, euint4) => euint32 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint32, euint4) => euint32 test 1 (4009369108, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4009369108n); - input.add4(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(4009369106n); - }); - - it('test operator "xor" overload (euint32, euint4) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint32, euint4) => euint32 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint32, euint4) => euint32 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(12n); - }); - - it('test operator "eq" overload (euint32, euint4) => ebool test 1 (1592167767, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1592167767n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint32, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint32, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint32, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint32, euint4) => ebool test 1 (2761853602, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(2761853602n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint32, euint4) => ebool test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(9n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint32, euint4) => ebool test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(13n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint32, euint4) => ebool test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(13n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, euint4) => ebool test 1 (417230890, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(417230890n); - input.add4(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint32, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint32, euint4) => ebool test 1 (3015562136, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3015562136n); - input.add4(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint32, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint32, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint32, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint4) => ebool test 1 (1297036148, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1297036148n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint32, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint32, euint4) => ebool test 1 (2282621038, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(2282621038n); - input.add4(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint32, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint32, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint32, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint32, euint4) => euint32 test 1 (52471261, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(52471261n); - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(11n); - }); - - it('test operator "min" overload (euint32, euint4) => euint32 test 2 (7, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(7n); - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(7n); - }); - - it('test operator "min" overload (euint32, euint4) => euint32 test 3 (11, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(11n); - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(11n); - }); - - it('test operator "min" overload (euint32, euint4) => euint32 test 4 (11, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(11n); - input.add4(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(7n); - }); - - it('test operator "max" overload (euint32, euint4) => euint32 test 1 (1089745104, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1089745104n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(1089745104n); - }); - - it('test operator "max" overload (euint32, euint4) => euint32 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(8n); - }); - - it('test operator "max" overload (euint32, euint4) => euint32 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(8n); - }); - - it('test operator "max" overload (euint32, euint4) => euint32 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_euint32_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(8n); - }); - - it('test operator "add" overload (euint32, euint8) => euint32 test 1 (129, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(129n); - input.add8(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.add_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(131n); - }); - - it('test operator "add" overload (euint32, euint8) => euint32 test 2 (79, 81)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(79n); - input.add8(81n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.add_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(160n); - }); - - it('test operator "add" overload (euint32, euint8) => euint32 test 3 (81, 81)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(81n); - input.add8(81n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.add_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(162n); - }); - - it('test operator "add" overload (euint32, euint8) => euint32 test 4 (81, 79)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(81n); - input.add8(79n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.add_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(160n); - }); - - it('test operator "sub" overload (euint32, euint8) => euint32 test 1 (69, 69)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(69n); - input.add8(69n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.sub_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint32, euint8) => euint32 test 2 (69, 65)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(69n); - input.add8(65n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.sub_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(4n); - }); -}); diff --git a/contracts/test/tfheOperations/tfheOperations6.ts b/contracts/test/tfheOperations/tfheOperations6.ts deleted file mode 100644 index 08d806b1..00000000 --- a/contracts/test/tfheOperations/tfheOperations6.ts +++ /dev/null @@ -1,4851 +0,0 @@ -import { expect } from 'chai'; -import { ethers } from 'hardhat'; - -import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1'; -import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2'; -import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'; -import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4'; -import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5'; -import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6'; -import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7'; -import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8'; -import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9'; -import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10'; -import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11'; -import { - createInstances, - decrypt4, - decrypt8, - decrypt16, - decrypt32, - decrypt64, - decrypt128, - decrypt256, - decryptBool, -} from '../instance'; -import { getSigners, initSigners } from '../signers'; - -async function deployTfheTestFixture1(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture2(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture3(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture4(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture5(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture6(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture7(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite7'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture8(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite8'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture9(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite9'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture10(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite10'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture11(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite11'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -describe('TFHE operations 6', function () { - before(async function () { - await initSigners(1); - this.signers = await getSigners(); - - const contract1 = await deployTfheTestFixture1(); - this.contract1Address = await contract1.getAddress(); - this.contract1 = contract1; - - const contract2 = await deployTfheTestFixture2(); - this.contract2Address = await contract2.getAddress(); - this.contract2 = contract2; - - const contract3 = await deployTfheTestFixture3(); - this.contract3Address = await contract3.getAddress(); - this.contract3 = contract3; - - const contract4 = await deployTfheTestFixture4(); - this.contract4Address = await contract4.getAddress(); - this.contract4 = contract4; - - const contract5 = await deployTfheTestFixture5(); - this.contract5Address = await contract5.getAddress(); - this.contract5 = contract5; - - const contract6 = await deployTfheTestFixture6(); - this.contract6Address = await contract6.getAddress(); - this.contract6 = contract6; - - const contract7 = await deployTfheTestFixture7(); - this.contract7Address = await contract7.getAddress(); - this.contract7 = contract7; - - const contract8 = await deployTfheTestFixture8(); - this.contract8Address = await contract8.getAddress(); - this.contract8 = contract8; - - const contract9 = await deployTfheTestFixture9(); - this.contract9Address = await contract9.getAddress(); - this.contract9 = contract9; - - const contract10 = await deployTfheTestFixture10(); - this.contract10Address = await contract10.getAddress(); - this.contract10 = contract10; - - const contract11 = await deployTfheTestFixture11(); - this.contract11Address = await contract11.getAddress(); - this.contract11 = contract11; - - const instances = await createInstances(this.signers); - this.instances = instances; - }); - - it('test operator "mul" overload (euint32, euint8) => euint32 test 1 (114, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(114n); - input.add8(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.mul_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(228n); - }); - - it('test operator "mul" overload (euint32, euint8) => euint32 test 2 (15, 16)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(15n); - input.add8(16n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.mul_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(240n); - }); - - it('test operator "mul" overload (euint32, euint8) => euint32 test 3 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(9n); - input.add8(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.mul_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(81n); - }); - - it('test operator "mul" overload (euint32, euint8) => euint32 test 4 (16, 15)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(16n); - input.add8(15n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.mul_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(240n); - }); - - it('test operator "and" overload (euint32, euint8) => euint32 test 1 (2846739700, 34)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(2846739700n); - input.add8(34n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(32n); - }); - - it('test operator "and" overload (euint32, euint8) => euint32 test 2 (30, 34)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(30n); - input.add8(34n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(2n); - }); - - it('test operator "and" overload (euint32, euint8) => euint32 test 3 (34, 34)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(34n); - input.add8(34n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(34n); - }); - - it('test operator "and" overload (euint32, euint8) => euint32 test 4 (34, 30)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(34n); - input.add8(30n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(2n); - }); - - it('test operator "or" overload (euint32, euint8) => euint32 test 1 (143668880, 184)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(143668880n); - input.add8(184n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(143668920n); - }); - - it('test operator "or" overload (euint32, euint8) => euint32 test 2 (180, 184)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(180n); - input.add8(184n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(188n); - }); - - it('test operator "or" overload (euint32, euint8) => euint32 test 3 (184, 184)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(184n); - input.add8(184n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(184n); - }); - - it('test operator "or" overload (euint32, euint8) => euint32 test 4 (184, 180)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(184n); - input.add8(180n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(188n); - }); - - it('test operator "xor" overload (euint32, euint8) => euint32 test 1 (1756250914, 211)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1756250914n); - input.add8(211n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(1756251121n); - }); - - it('test operator "xor" overload (euint32, euint8) => euint32 test 2 (207, 211)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(207n); - input.add8(211n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(28n); - }); - - it('test operator "xor" overload (euint32, euint8) => euint32 test 3 (211, 211)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(211n); - input.add8(211n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint32, euint8) => euint32 test 4 (211, 207)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(211n); - input.add8(207n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(28n); - }); - - it('test operator "eq" overload (euint32, euint8) => ebool test 1 (2371399582, 166)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(2371399582n); - input.add8(166n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint32, euint8) => ebool test 2 (162, 166)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(162n); - input.add8(166n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint32, euint8) => ebool test 3 (166, 166)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(166n); - input.add8(166n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint32, euint8) => ebool test 4 (166, 162)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(166n); - input.add8(162n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint32, euint8) => ebool test 1 (1535914080, 80)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1535914080n); - input.add8(80n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint32, euint8) => ebool test 2 (76, 80)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(76n); - input.add8(80n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint32, euint8) => ebool test 3 (80, 80)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(80n); - input.add8(80n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint32, euint8) => ebool test 4 (80, 76)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(80n); - input.add8(76n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, euint8) => ebool test 1 (1009223821, 187)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1009223821n); - input.add8(187n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, euint8) => ebool test 2 (183, 187)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(183n); - input.add8(187n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint32, euint8) => ebool test 3 (187, 187)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(187n); - input.add8(187n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, euint8) => ebool test 4 (187, 183)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(187n); - input.add8(183n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint32, euint8) => ebool test 1 (1381529874, 57)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1381529874n); - input.add8(57n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint32, euint8) => ebool test 2 (53, 57)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(53n); - input.add8(57n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint32, euint8) => ebool test 3 (57, 57)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(57n); - input.add8(57n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint32, euint8) => ebool test 4 (57, 53)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(57n); - input.add8(53n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint8) => ebool test 1 (884339915, 183)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(884339915n); - input.add8(183n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint32, euint8) => ebool test 2 (179, 183)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(179n); - input.add8(183n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint8) => ebool test 3 (183, 183)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(183n); - input.add8(183n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint8) => ebool test 4 (183, 179)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(183n); - input.add8(179n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint32, euint8) => ebool test 1 (1459989337, 220)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1459989337n); - input.add8(220n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint32, euint8) => ebool test 2 (216, 220)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(216n); - input.add8(220n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint32, euint8) => ebool test 3 (220, 220)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(220n); - input.add8(220n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint32, euint8) => ebool test 4 (220, 216)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(220n); - input.add8(216n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint32, euint8) => euint32 test 1 (2070023085, 28)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(2070023085n); - input.add8(28n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(28n); - }); - - it('test operator "min" overload (euint32, euint8) => euint32 test 2 (24, 28)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(24n); - input.add8(28n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(24n); - }); - - it('test operator "min" overload (euint32, euint8) => euint32 test 3 (28, 28)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(28n); - input.add8(28n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(28n); - }); - - it('test operator "min" overload (euint32, euint8) => euint32 test 4 (28, 24)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(28n); - input.add8(24n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(24n); - }); - - it('test operator "max" overload (euint32, euint8) => euint32 test 1 (2231185000, 65)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(2231185000n); - input.add8(65n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(2231185000n); - }); - - it('test operator "max" overload (euint32, euint8) => euint32 test 2 (61, 65)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(61n); - input.add8(65n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(65n); - }); - - it('test operator "max" overload (euint32, euint8) => euint32 test 3 (65, 65)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(65n); - input.add8(65n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(65n); - }); - - it('test operator "max" overload (euint32, euint8) => euint32 test 4 (65, 61)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(65n); - input.add8(61n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_euint32_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(65n); - }); - - it('test operator "add" overload (euint32, euint16) => euint32 test 1 (35595, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(35595n); - input.add16(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.add_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(35606n); - }); - - it('test operator "add" overload (euint32, euint16) => euint32 test 2 (18477, 18479)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(18477n); - input.add16(18479n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.add_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(36956n); - }); - - it('test operator "add" overload (euint32, euint16) => euint32 test 3 (18479, 18479)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(18479n); - input.add16(18479n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.add_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(36958n); - }); - - it('test operator "add" overload (euint32, euint16) => euint32 test 4 (18479, 18477)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(18479n); - input.add16(18477n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.add_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(36956n); - }); - - it('test operator "sub" overload (euint32, euint16) => euint32 test 1 (18922, 18922)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(18922n); - input.add16(18922n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.sub_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint32, euint16) => euint32 test 2 (18922, 18918)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(18922n); - input.add16(18918n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.sub_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint32, euint16) => euint32 test 1 (30224, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(30224n); - input.add16(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.mul_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(60448n); - }); - - it('test operator "mul" overload (euint32, euint16) => euint32 test 2 (160, 160)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(160n); - input.add16(160n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.mul_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(25600n); - }); - - it('test operator "mul" overload (euint32, euint16) => euint32 test 3 (160, 160)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(160n); - input.add16(160n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.mul_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(25600n); - }); - - it('test operator "mul" overload (euint32, euint16) => euint32 test 4 (160, 160)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(160n); - input.add16(160n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.mul_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(25600n); - }); - - it('test operator "and" overload (euint32, euint16) => euint32 test 1 (1681139161, 6880)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1681139161n); - input.add16(6880n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(192n); - }); - - it('test operator "and" overload (euint32, euint16) => euint32 test 2 (6876, 6880)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(6876n); - input.add16(6880n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(6848n); - }); - - it('test operator "and" overload (euint32, euint16) => euint32 test 3 (6880, 6880)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(6880n); - input.add16(6880n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(6880n); - }); - - it('test operator "and" overload (euint32, euint16) => euint32 test 4 (6880, 6876)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(6880n); - input.add16(6876n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(6848n); - }); - - it('test operator "or" overload (euint32, euint16) => euint32 test 1 (68701034, 41103)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(68701034n); - input.add16(41103n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(68742127n); - }); - - it('test operator "or" overload (euint32, euint16) => euint32 test 2 (41099, 41103)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(41099n); - input.add16(41103n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(41103n); - }); - - it('test operator "or" overload (euint32, euint16) => euint32 test 3 (41103, 41103)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(41103n); - input.add16(41103n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(41103n); - }); - - it('test operator "or" overload (euint32, euint16) => euint32 test 4 (41103, 41099)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(41103n); - input.add16(41099n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(41103n); - }); - - it('test operator "xor" overload (euint32, euint16) => euint32 test 1 (3818112177, 23871)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3818112177n); - input.add16(23871n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(3818101134n); - }); - - it('test operator "xor" overload (euint32, euint16) => euint32 test 2 (23867, 23871)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(23867n); - input.add16(23871n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint32, euint16) => euint32 test 3 (23871, 23871)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(23871n); - input.add16(23871n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint32, euint16) => euint32 test 4 (23871, 23867)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(23871n); - input.add16(23867n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint32, euint16) => ebool test 1 (843782707, 34473)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(843782707n); - input.add16(34473n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint32, euint16) => ebool test 2 (34469, 34473)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(34469n); - input.add16(34473n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint32, euint16) => ebool test 3 (34473, 34473)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(34473n); - input.add16(34473n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint32, euint16) => ebool test 4 (34473, 34469)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(34473n); - input.add16(34469n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint32, euint16) => ebool test 1 (3735850389, 7960)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3735850389n); - input.add16(7960n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint32, euint16) => ebool test 2 (7956, 7960)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(7956n); - input.add16(7960n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint32, euint16) => ebool test 3 (7960, 7960)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(7960n); - input.add16(7960n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint32, euint16) => ebool test 4 (7960, 7956)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(7960n); - input.add16(7956n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, euint16) => ebool test 1 (3233856655, 54626)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3233856655n); - input.add16(54626n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, euint16) => ebool test 2 (54622, 54626)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(54622n); - input.add16(54626n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint32, euint16) => ebool test 3 (54626, 54626)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(54626n); - input.add16(54626n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, euint16) => ebool test 4 (54626, 54622)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(54626n); - input.add16(54622n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint32, euint16) => ebool test 1 (1059995818, 54018)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1059995818n); - input.add16(54018n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint32, euint16) => ebool test 2 (54014, 54018)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(54014n); - input.add16(54018n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint32, euint16) => ebool test 3 (54018, 54018)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(54018n); - input.add16(54018n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint32, euint16) => ebool test 4 (54018, 54014)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(54018n); - input.add16(54014n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint16) => ebool test 1 (787386715, 25220)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(787386715n); - input.add16(25220n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint32, euint16) => ebool test 2 (25216, 25220)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(25216n); - input.add16(25220n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint16) => ebool test 3 (25220, 25220)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(25220n); - input.add16(25220n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint16) => ebool test 4 (25220, 25216)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(25220n); - input.add16(25216n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint32, euint16) => ebool test 1 (2091084769, 25571)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(2091084769n); - input.add16(25571n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint32, euint16) => ebool test 2 (25567, 25571)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(25567n); - input.add16(25571n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint32, euint16) => ebool test 3 (25571, 25571)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(25571n); - input.add16(25571n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint32, euint16) => ebool test 4 (25571, 25567)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(25571n); - input.add16(25567n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint32, euint16) => euint32 test 1 (3265803083, 25661)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3265803083n); - input.add16(25661n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(25661n); - }); - - it('test operator "min" overload (euint32, euint16) => euint32 test 2 (25657, 25661)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(25657n); - input.add16(25661n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(25657n); - }); - - it('test operator "min" overload (euint32, euint16) => euint32 test 3 (25661, 25661)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(25661n); - input.add16(25661n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(25661n); - }); - - it('test operator "min" overload (euint32, euint16) => euint32 test 4 (25661, 25657)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(25661n); - input.add16(25657n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(25657n); - }); - - it('test operator "max" overload (euint32, euint16) => euint32 test 1 (1606859063, 42684)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1606859063n); - input.add16(42684n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(1606859063n); - }); - - it('test operator "max" overload (euint32, euint16) => euint32 test 2 (42680, 42684)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(42680n); - input.add16(42684n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(42684n); - }); - - it('test operator "max" overload (euint32, euint16) => euint32 test 3 (42684, 42684)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(42684n); - input.add16(42684n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(42684n); - }); - - it('test operator "max" overload (euint32, euint16) => euint32 test 4 (42684, 42680)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(42684n); - input.add16(42680n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_euint32_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(42684n); - }); - - it('test operator "add" overload (euint32, euint32) => euint32 test 1 (1855544902, 1743021443)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1855544902n); - input.add32(1743021443n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.add_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(3598566345n); - }); - - it('test operator "add" overload (euint32, euint32) => euint32 test 2 (1743021441, 1743021443)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1743021441n); - input.add32(1743021443n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.add_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(3486042884n); - }); - - it('test operator "add" overload (euint32, euint32) => euint32 test 3 (1743021443, 1743021443)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1743021443n); - input.add32(1743021443n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.add_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(3486042886n); - }); - - it('test operator "add" overload (euint32, euint32) => euint32 test 4 (1743021443, 1743021441)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1743021443n); - input.add32(1743021441n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.add_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(3486042884n); - }); - - it('test operator "sub" overload (euint32, euint32) => euint32 test 1 (1818111464, 1818111464)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1818111464n); - input.add32(1818111464n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.sub_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint32, euint32) => euint32 test 2 (1818111464, 1818111460)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1818111464n); - input.add32(1818111460n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.sub_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint32, euint32) => euint32 test 1 (96111, 23856)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(96111n); - input.add32(23856n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.mul_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(2292824016n); - }); - - it('test operator "mul" overload (euint32, euint32) => euint32 test 2 (47710, 47710)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(47710n); - input.add32(47710n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.mul_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(2276244100n); - }); - - it('test operator "mul" overload (euint32, euint32) => euint32 test 3 (47710, 47710)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(47710n); - input.add32(47710n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.mul_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(2276244100n); - }); - - it('test operator "mul" overload (euint32, euint32) => euint32 test 4 (47710, 47710)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(47710n); - input.add32(47710n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.mul_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(2276244100n); - }); - - it('test operator "and" overload (euint32, euint32) => euint32 test 1 (3317288822, 1342588191)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3317288822n); - input.add32(1342588191n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(1073759510n); - }); - - it('test operator "and" overload (euint32, euint32) => euint32 test 2 (1342588187, 1342588191)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1342588187n); - input.add32(1342588191n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(1342588187n); - }); - - it('test operator "and" overload (euint32, euint32) => euint32 test 3 (1342588191, 1342588191)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1342588191n); - input.add32(1342588191n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(1342588191n); - }); - - it('test operator "and" overload (euint32, euint32) => euint32 test 4 (1342588191, 1342588187)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1342588191n); - input.add32(1342588187n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(1342588187n); - }); - - it('test operator "or" overload (euint32, euint32) => euint32 test 1 (1707541891, 1244554527)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1707541891n); - input.add32(1244554527n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(1877960095n); - }); - - it('test operator "or" overload (euint32, euint32) => euint32 test 2 (1244554523, 1244554527)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1244554523n); - input.add32(1244554527n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(1244554527n); - }); - - it('test operator "or" overload (euint32, euint32) => euint32 test 3 (1244554527, 1244554527)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1244554527n); - input.add32(1244554527n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(1244554527n); - }); - - it('test operator "or" overload (euint32, euint32) => euint32 test 4 (1244554527, 1244554523)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1244554527n); - input.add32(1244554523n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(1244554527n); - }); - - it('test operator "xor" overload (euint32, euint32) => euint32 test 1 (3766539452, 3557659859)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3766539452n); - input.add32(3557659859n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(881672303n); - }); - - it('test operator "xor" overload (euint32, euint32) => euint32 test 2 (3557659855, 3557659859)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3557659855n); - input.add32(3557659859n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(28n); - }); - - it('test operator "xor" overload (euint32, euint32) => euint32 test 3 (3557659859, 3557659859)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3557659859n); - input.add32(3557659859n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint32, euint32) => euint32 test 4 (3557659859, 3557659855)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3557659859n); - input.add32(3557659855n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(28n); - }); - - it('test operator "eq" overload (euint32, euint32) => ebool test 1 (3899668665, 3823635226)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3899668665n); - input.add32(3823635226n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint32, euint32) => ebool test 2 (3823635222, 3823635226)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3823635222n); - input.add32(3823635226n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint32, euint32) => ebool test 3 (3823635226, 3823635226)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3823635226n); - input.add32(3823635226n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint32, euint32) => ebool test 4 (3823635226, 3823635222)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3823635226n); - input.add32(3823635222n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint32, euint32) => ebool test 1 (440396727, 1222940316)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(440396727n); - input.add32(1222940316n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint32, euint32) => ebool test 2 (440396723, 440396727)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(440396723n); - input.add32(440396727n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint32, euint32) => ebool test 3 (440396727, 440396727)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(440396727n); - input.add32(440396727n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint32, euint32) => ebool test 4 (440396727, 440396723)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(440396727n); - input.add32(440396723n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, euint32) => ebool test 1 (929694790, 907768232)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(929694790n); - input.add32(907768232n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, euint32) => ebool test 2 (907768228, 907768232)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(907768228n); - input.add32(907768232n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint32, euint32) => ebool test 3 (907768232, 907768232)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(907768232n); - input.add32(907768232n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, euint32) => ebool test 4 (907768232, 907768228)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(907768232n); - input.add32(907768228n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint32, euint32) => ebool test 1 (3794643996, 619151916)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3794643996n); - input.add32(619151916n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint32, euint32) => ebool test 2 (619151912, 619151916)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(619151912n); - input.add32(619151916n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint32, euint32) => ebool test 3 (619151916, 619151916)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(619151916n); - input.add32(619151916n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint32, euint32) => ebool test 4 (619151916, 619151912)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(619151916n); - input.add32(619151912n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint32) => ebool test 1 (1814515265, 1215301262)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1814515265n); - input.add32(1215301262n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint32, euint32) => ebool test 2 (1215301258, 1215301262)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1215301258n); - input.add32(1215301262n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint32) => ebool test 3 (1215301262, 1215301262)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1215301262n); - input.add32(1215301262n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint32) => ebool test 4 (1215301262, 1215301258)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1215301262n); - input.add32(1215301258n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.le_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint32, euint32) => ebool test 1 (597865082, 2797648845)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(597865082n); - input.add32(2797648845n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint32, euint32) => ebool test 2 (597865078, 597865082)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(597865078n); - input.add32(597865082n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint32, euint32) => ebool test 3 (597865082, 597865082)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(597865082n); - input.add32(597865082n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint32, euint32) => ebool test 4 (597865082, 597865078)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(597865082n); - input.add32(597865078n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.lt_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint32, euint32) => euint32 test 1 (3167993396, 3198148813)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3167993396n); - input.add32(3198148813n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(3167993396n); - }); - - it('test operator "min" overload (euint32, euint32) => euint32 test 2 (3167993392, 3167993396)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3167993392n); - input.add32(3167993396n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(3167993392n); - }); - - it('test operator "min" overload (euint32, euint32) => euint32 test 3 (3167993396, 3167993396)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3167993396n); - input.add32(3167993396n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(3167993396n); - }); - - it('test operator "min" overload (euint32, euint32) => euint32 test 4 (3167993396, 3167993392)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3167993396n); - input.add32(3167993392n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.min_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(3167993392n); - }); - - it('test operator "max" overload (euint32, euint32) => euint32 test 1 (1310408559, 1943659319)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1310408559n); - input.add32(1943659319n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(1943659319n); - }); - - it('test operator "max" overload (euint32, euint32) => euint32 test 2 (1310408555, 1310408559)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1310408555n); - input.add32(1310408559n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(1310408559n); - }); - - it('test operator "max" overload (euint32, euint32) => euint32 test 3 (1310408559, 1310408559)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1310408559n); - input.add32(1310408559n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(1310408559n); - }); - - it('test operator "max" overload (euint32, euint32) => euint32 test 4 (1310408559, 1310408555)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1310408559n); - input.add32(1310408555n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.max_euint32_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract5.res32()); - expect(res).to.equal(1310408559n); - }); - - it('test operator "add" overload (euint32, euint64) => euint64 test 1 (2, 4294187631)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(2n); - input.add64(4294187631n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.add_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4294187633n); - }); - - it('test operator "add" overload (euint32, euint64) => euint64 test 2 (1977492101, 1977492105)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1977492101n); - input.add64(1977492105n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.add_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(3954984206n); - }); - - it('test operator "add" overload (euint32, euint64) => euint64 test 3 (1977492105, 1977492105)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1977492105n); - input.add64(1977492105n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.add_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(3954984210n); - }); - - it('test operator "add" overload (euint32, euint64) => euint64 test 4 (1977492105, 1977492101)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1977492105n); - input.add64(1977492101n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.add_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(3954984206n); - }); - - it('test operator "sub" overload (euint32, euint64) => euint64 test 1 (2880371585, 2880371585)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(2880371585n); - input.add64(2880371585n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.sub_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint32, euint64) => euint64 test 2 (2880371585, 2880371581)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(2880371585n); - input.add64(2880371581n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.sub_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint32, euint64) => euint64 test 1 (2, 2146877501)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(2n); - input.add64(2146877501n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.mul_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4293755002n); - }); - - it('test operator "mul" overload (euint32, euint64) => euint64 test 2 (43587, 43587)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(43587n); - input.add64(43587n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.mul_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(1899826569n); - }); - - it('test operator "mul" overload (euint32, euint64) => euint64 test 3 (43587, 43587)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(43587n); - input.add64(43587n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.mul_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(1899826569n); - }); - - it('test operator "mul" overload (euint32, euint64) => euint64 test 4 (43587, 43587)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(43587n); - input.add64(43587n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.mul_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(1899826569n); - }); - - it('test operator "and" overload (euint32, euint64) => euint64 test 1 (1745478480, 18442616126135451977)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1745478480n); - input.add64(18442616126135451977n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(1208074560n); - }); - - it('test operator "and" overload (euint32, euint64) => euint64 test 2 (1745478476, 1745478480)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1745478476n); - input.add64(1745478480n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(1745478464n); - }); - - it('test operator "and" overload (euint32, euint64) => euint64 test 3 (1745478480, 1745478480)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1745478480n); - input.add64(1745478480n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(1745478480n); - }); - - it('test operator "and" overload (euint32, euint64) => euint64 test 4 (1745478480, 1745478476)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1745478480n); - input.add64(1745478476n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.and_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(1745478464n); - }); - - it('test operator "or" overload (euint32, euint64) => euint64 test 1 (1546853992, 18445417582546475671)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1546853992n); - input.add64(18445417582546475671n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18445417583755615999n); - }); - - it('test operator "or" overload (euint32, euint64) => euint64 test 2 (1546853988, 1546853992)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1546853988n); - input.add64(1546853992n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(1546853996n); - }); - - it('test operator "or" overload (euint32, euint64) => euint64 test 3 (1546853992, 1546853992)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1546853992n); - input.add64(1546853992n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(1546853992n); - }); - - it('test operator "or" overload (euint32, euint64) => euint64 test 4 (1546853992, 1546853988)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1546853992n); - input.add64(1546853988n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.or_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(1546853996n); - }); - - it('test operator "xor" overload (euint32, euint64) => euint64 test 1 (390302983, 18441970713749353087)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(390302983n); - input.add64(18441970713749353087n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(18441970713904316280n); - }); - - it('test operator "xor" overload (euint32, euint64) => euint64 test 2 (390302979, 390302983)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(390302979n); - input.add64(390302983n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint32, euint64) => euint64 test 3 (390302983, 390302983)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(390302983n); - input.add64(390302983n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint32, euint64) => euint64 test 4 (390302983, 390302979)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(390302983n); - input.add64(390302979n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.xor_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract5.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint32, euint64) => ebool test 1 (3575591686, 18441139457541916589)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3575591686n); - input.add64(18441139457541916589n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint32, euint64) => ebool test 2 (3575591682, 3575591686)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3575591682n); - input.add64(3575591686n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint32, euint64) => ebool test 3 (3575591686, 3575591686)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3575591686n); - input.add64(3575591686n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint32, euint64) => ebool test 4 (3575591686, 3575591682)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(3575591686n); - input.add64(3575591682n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.eq_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint32, euint64) => ebool test 1 (1132249413, 18438312419950369711)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1132249413n); - input.add64(18438312419950369711n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint32, euint64) => ebool test 2 (1132249409, 1132249413)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1132249409n); - input.add64(1132249413n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint32, euint64) => ebool test 3 (1132249413, 1132249413)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1132249413n); - input.add64(1132249413n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint32, euint64) => ebool test 4 (1132249413, 1132249409)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1132249413n); - input.add64(1132249409n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ne_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, euint64) => ebool test 1 (2716663813, 18446666024340671893)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(2716663813n); - input.add64(18446666024340671893n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint32, euint64) => ebool test 2 (2716663809, 2716663813)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(2716663809n); - input.add64(2716663813n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint32, euint64) => ebool test 3 (2716663813, 2716663813)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(2716663813n); - input.add64(2716663813n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, euint64) => ebool test 4 (2716663813, 2716663809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(2716663813n); - input.add64(2716663809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.ge_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint32, euint64) => ebool test 1 (1898220780, 18441112726231908571)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1898220780n); - input.add64(18441112726231908571n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint32, euint64) => ebool test 2 (1898220776, 1898220780)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1898220776n); - input.add64(1898220780n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint32, euint64) => ebool test 3 (1898220780, 1898220780)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1898220780n); - input.add64(1898220780n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint32, euint64) => ebool test 4 (1898220780, 1898220776)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract5Address, this.signers.alice.address); - input.add32(1898220780n); - input.add64(1898220776n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract5.gt_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract5.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint64) => ebool test 1 (1718048813, 18439987431102861375)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1718048813n); - input.add64(18439987431102861375n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint64) => ebool test 2 (1718048809, 1718048813)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1718048809n); - input.add64(1718048813n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint64) => ebool test 3 (1718048813, 1718048813)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1718048813n); - input.add64(1718048813n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint64) => ebool test 4 (1718048813, 1718048809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1718048813n); - input.add64(1718048809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint32, euint64) => ebool test 1 (3259927115, 18445091130782070813)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3259927115n); - input.add64(18445091130782070813n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint32, euint64) => ebool test 2 (3259927111, 3259927115)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3259927111n); - input.add64(3259927115n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint32, euint64) => ebool test 3 (3259927115, 3259927115)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3259927115n); - input.add64(3259927115n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint32, euint64) => ebool test 4 (3259927115, 3259927111)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3259927115n); - input.add64(3259927111n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint32, euint64) => euint64 test 1 (1841925700, 18442933982305840083)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1841925700n); - input.add64(18442933982305840083n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(1841925700n); - }); - - it('test operator "min" overload (euint32, euint64) => euint64 test 2 (1841925696, 1841925700)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1841925696n); - input.add64(1841925700n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(1841925696n); - }); - - it('test operator "min" overload (euint32, euint64) => euint64 test 3 (1841925700, 1841925700)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1841925700n); - input.add64(1841925700n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(1841925700n); - }); - - it('test operator "min" overload (euint32, euint64) => euint64 test 4 (1841925700, 1841925696)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1841925700n); - input.add64(1841925696n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(1841925696n); - }); - - it('test operator "max" overload (euint32, euint64) => euint64 test 1 (1980815436, 18446246159979986155)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1980815436n); - input.add64(18446246159979986155n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(18446246159979986155n); - }); - - it('test operator "max" overload (euint32, euint64) => euint64 test 2 (1980815432, 1980815436)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1980815432n); - input.add64(1980815436n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(1980815436n); - }); - - it('test operator "max" overload (euint32, euint64) => euint64 test 3 (1980815436, 1980815436)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1980815436n); - input.add64(1980815436n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(1980815436n); - }); - - it('test operator "max" overload (euint32, euint64) => euint64 test 4 (1980815436, 1980815432)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1980815436n); - input.add64(1980815432n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint32_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(1980815436n); - }); - - it('test operator "add" overload (euint32, euint128) => euint128 test 1 (2, 2147483649)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2n); - input.add128(2147483649n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(2147483651n); - }); - - it('test operator "add" overload (euint32, euint128) => euint128 test 2 (788156404, 788156408)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(788156404n); - input.add128(788156408n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(1576312812n); - }); - - it('test operator "add" overload (euint32, euint128) => euint128 test 3 (788156408, 788156408)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(788156408n); - input.add128(788156408n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(1576312816n); - }); - - it('test operator "add" overload (euint32, euint128) => euint128 test 4 (788156408, 788156404)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(788156408n); - input.add128(788156404n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(1576312812n); - }); - - it('test operator "sub" overload (euint32, euint128) => euint128 test 1 (3561141951, 3561141951)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3561141951n); - input.add128(3561141951n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.sub_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint32, euint128) => euint128 test 2 (3561141951, 3561141947)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3561141951n); - input.add128(3561141947n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.sub_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint32, euint128) => euint128 test 1 (2, 1073741825)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2n); - input.add128(1073741825n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(2147483650n); - }); - - it('test operator "mul" overload (euint32, euint128) => euint128 test 2 (63676, 63676)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(63676n); - input.add128(63676n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(4054632976n); - }); - - it('test operator "mul" overload (euint32, euint128) => euint128 test 3 (63676, 63676)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(63676n); - input.add128(63676n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(4054632976n); - }); - - it('test operator "mul" overload (euint32, euint128) => euint128 test 4 (63676, 63676)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(63676n); - input.add128(63676n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(4054632976n); - }); - - it('test operator "and" overload (euint32, euint128) => euint128 test 1 (2659354872, 340282366920938463463373182215335994821)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2659354872n); - input.add128(340282366920938463463373182215335994821n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(2424307904n); - }); - - it('test operator "and" overload (euint32, euint128) => euint128 test 2 (2659354868, 2659354872)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2659354868n); - input.add128(2659354872n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(2659354864n); - }); - - it('test operator "and" overload (euint32, euint128) => euint128 test 3 (2659354872, 2659354872)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2659354872n); - input.add128(2659354872n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(2659354872n); - }); - - it('test operator "and" overload (euint32, euint128) => euint128 test 4 (2659354872, 2659354868)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2659354872n); - input.add128(2659354868n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(2659354864n); - }); - - it('test operator "or" overload (euint32, euint128) => euint128 test 1 (1775515615, 340282366920938463463365726409727391809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1775515615n); - input.add128(340282366920938463463365726409727391809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(340282366920938463463365726409758064607n); - }); - - it('test operator "or" overload (euint32, euint128) => euint128 test 2 (1775515611, 1775515615)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1775515611n); - input.add128(1775515615n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(1775515615n); - }); - - it('test operator "or" overload (euint32, euint128) => euint128 test 3 (1775515615, 1775515615)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1775515615n); - input.add128(1775515615n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(1775515615n); - }); - - it('test operator "or" overload (euint32, euint128) => euint128 test 4 (1775515615, 1775515611)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1775515615n); - input.add128(1775515611n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(1775515615n); - }); - - it('test operator "xor" overload (euint32, euint128) => euint128 test 1 (3049009589, 340282366920938463463368216078619273371)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3049009589n); - input.add128(340282366920938463463368216078619273371n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(340282366920938463463368216080538425646n); - }); - - it('test operator "xor" overload (euint32, euint128) => euint128 test 2 (3049009585, 3049009589)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3049009585n); - input.add128(3049009589n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint32, euint128) => euint128 test 3 (3049009589, 3049009589)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3049009589n); - input.add128(3049009589n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint32, euint128) => euint128 test 4 (3049009589, 3049009585)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3049009589n); - input.add128(3049009585n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint32, euint128) => ebool test 1 (764411697, 340282366920938463463368167171281881439)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(764411697n); - input.add128(340282366920938463463368167171281881439n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint32, euint128) => ebool test 2 (764411693, 764411697)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(764411693n); - input.add128(764411697n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint32, euint128) => ebool test 3 (764411697, 764411697)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(764411697n); - input.add128(764411697n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint32, euint128) => ebool test 4 (764411697, 764411693)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(764411697n); - input.add128(764411693n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint32, euint128) => ebool test 1 (3303815983, 340282366920938463463373693800095408137)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3303815983n); - input.add128(340282366920938463463373693800095408137n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint32, euint128) => ebool test 2 (3303815979, 3303815983)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3303815979n); - input.add128(3303815983n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint32, euint128) => ebool test 3 (3303815983, 3303815983)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3303815983n); - input.add128(3303815983n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint32, euint128) => ebool test 4 (3303815983, 3303815979)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3303815983n); - input.add128(3303815979n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, euint128) => ebool test 1 (3786584955, 340282366920938463463367364294961686443)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3786584955n); - input.add128(340282366920938463463367364294961686443n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint32, euint128) => ebool test 2 (3786584951, 3786584955)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3786584951n); - input.add128(3786584955n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint32, euint128) => ebool test 3 (3786584955, 3786584955)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3786584955n); - input.add128(3786584955n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, euint128) => ebool test 4 (3786584955, 3786584951)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3786584955n); - input.add128(3786584951n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint32, euint128) => ebool test 1 (4277077408, 340282366920938463463374604764991737889)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(4277077408n); - input.add128(340282366920938463463374604764991737889n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint32, euint128) => ebool test 2 (4277077404, 4277077408)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(4277077404n); - input.add128(4277077408n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint32, euint128) => ebool test 3 (4277077408, 4277077408)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(4277077408n); - input.add128(4277077408n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint32, euint128) => ebool test 4 (4277077408, 4277077404)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(4277077408n); - input.add128(4277077404n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint128) => ebool test 1 (867198677, 340282366920938463463369757600308236313)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(867198677n); - input.add128(340282366920938463463369757600308236313n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint128) => ebool test 2 (867198673, 867198677)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(867198673n); - input.add128(867198677n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint128) => ebool test 3 (867198677, 867198677)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(867198677n); - input.add128(867198677n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint128) => ebool test 4 (867198677, 867198673)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(867198677n); - input.add128(867198673n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint32, euint128) => ebool test 1 (2093199071, 340282366920938463463370622002914075235)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2093199071n); - input.add128(340282366920938463463370622002914075235n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint32, euint128) => ebool test 2 (2093199067, 2093199071)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2093199067n); - input.add128(2093199071n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint32, euint128) => ebool test 3 (2093199071, 2093199071)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2093199071n); - input.add128(2093199071n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint32, euint128) => ebool test 4 (2093199071, 2093199067)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2093199071n); - input.add128(2093199067n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint32, euint128) => euint128 test 1 (4003399201, 340282366920938463463365902462339741051)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(4003399201n); - input.add128(340282366920938463463365902462339741051n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(4003399201n); - }); - - it('test operator "min" overload (euint32, euint128) => euint128 test 2 (4003399197, 4003399201)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(4003399197n); - input.add128(4003399201n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(4003399197n); - }); - - it('test operator "min" overload (euint32, euint128) => euint128 test 3 (4003399201, 4003399201)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(4003399201n); - input.add128(4003399201n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(4003399201n); - }); - - it('test operator "min" overload (euint32, euint128) => euint128 test 4 (4003399201, 4003399197)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(4003399201n); - input.add128(4003399197n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(4003399197n); - }); - - it('test operator "max" overload (euint32, euint128) => euint128 test 1 (731106649, 340282366920938463463370948491424745963)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(731106649n); - input.add128(340282366920938463463370948491424745963n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(340282366920938463463370948491424745963n); - }); - - it('test operator "max" overload (euint32, euint128) => euint128 test 2 (731106645, 731106649)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(731106645n); - input.add128(731106649n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(731106649n); - }); - - it('test operator "max" overload (euint32, euint128) => euint128 test 3 (731106649, 731106649)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(731106649n); - input.add128(731106649n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(731106649n); - }); - - it('test operator "max" overload (euint32, euint128) => euint128 test 4 (731106649, 731106645)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(731106649n); - input.add128(731106645n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint32_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract6.res128()); - expect(res).to.equal(731106649n); - }); - - it('test operator "add" overload (euint32, euint256) => euint256 test 1 (2, 2147483649)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2n); - input.add256(2147483649n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(2147483651n); - }); - - it('test operator "add" overload (euint32, euint256) => euint256 test 2 (1370548128, 1370548130)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1370548128n); - input.add256(1370548130n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(2741096258n); - }); - - it('test operator "add" overload (euint32, euint256) => euint256 test 3 (1370548130, 1370548130)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1370548130n); - input.add256(1370548130n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(2741096260n); - }); - - it('test operator "add" overload (euint32, euint256) => euint256 test 4 (1370548130, 1370548128)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1370548130n); - input.add256(1370548128n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(2741096258n); - }); - - it('test operator "sub" overload (euint32, euint256) => euint256 test 1 (3022897647, 3022897647)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3022897647n); - input.add256(3022897647n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.sub_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint32, euint256) => euint256 test 2 (3022897647, 3022897643)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3022897647n); - input.add256(3022897643n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.sub_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint32, euint256) => euint256 test 1 (2, 1073741825)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2n); - input.add256(1073741825n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(2147483650n); - }); - - it('test operator "mul" overload (euint32, euint256) => euint256 test 2 (59596, 59596)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(59596n); - input.add256(59596n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(3551683216n); - }); - - it('test operator "mul" overload (euint32, euint256) => euint256 test 3 (59596, 59596)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(59596n); - input.add256(59596n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(3551683216n); - }); - - it('test operator "mul" overload (euint32, euint256) => euint256 test 4 (59596, 59596)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(59596n); - input.add256(59596n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(3551683216n); - }); - - it('test operator "and" overload (euint32, euint256) => euint256 test 1 (3994882895, 115792089237316195423570985008687907853269984665640564039457577397354470817443)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3994882895n); - input.add256(115792089237316195423570985008687907853269984665640564039457577397354470817443n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(1310528003n); - }); - - it('test operator "and" overload (euint32, euint256) => euint256 test 2 (3994882891, 3994882895)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3994882891n); - input.add256(3994882895n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(3994882891n); - }); - - it('test operator "and" overload (euint32, euint256) => euint256 test 3 (3994882895, 3994882895)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3994882895n); - input.add256(3994882895n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(3994882895n); - }); - - it('test operator "and" overload (euint32, euint256) => euint256 test 4 (3994882895, 3994882891)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3994882895n); - input.add256(3994882891n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(3994882891n); - }); - - it('test operator "or" overload (euint32, euint256) => euint256 test 1 (2321952704, 115792089237316195423570985008687907853269984665640564039457581516412469896587)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2321952704n); - input.add256(115792089237316195423570985008687907853269984665640564039457581516412469896587n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457581516414655131595n); - }); - - it('test operator "or" overload (euint32, euint256) => euint256 test 2 (2321952700, 2321952704)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2321952700n); - input.add256(2321952704n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(2321952764n); - }); - - it('test operator "or" overload (euint32, euint256) => euint256 test 3 (2321952704, 2321952704)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2321952704n); - input.add256(2321952704n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(2321952704n); - }); - - it('test operator "or" overload (euint32, euint256) => euint256 test 4 (2321952704, 2321952700)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2321952704n); - input.add256(2321952700n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(2321952764n); - }); - - it('test operator "xor" overload (euint32, euint256) => euint256 test 1 (3706671686, 115792089237316195423570985008687907853269984665640564039457578090382088595177)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3706671686n); - input.add256(115792089237316195423570985008687907853269984665640564039457578090382088595177n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457578090383101310127n); - }); - - it('test operator "xor" overload (euint32, euint256) => euint256 test 2 (3706671682, 3706671686)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3706671682n); - input.add256(3706671686n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint32, euint256) => euint256 test 3 (3706671686, 3706671686)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3706671686n); - input.add256(3706671686n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint32, euint256) => euint256 test 4 (3706671686, 3706671682)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3706671686n); - input.add256(3706671682n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint32, euint256) => ebool test 1 (1808856605, 115792089237316195423570985008687907853269984665640564039457582106419349698079)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1808856605n); - input.add256(115792089237316195423570985008687907853269984665640564039457582106419349698079n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint32, euint256) => ebool test 2 (1808856601, 1808856605)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1808856601n); - input.add256(1808856605n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint32, euint256) => ebool test 3 (1808856605, 1808856605)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1808856605n); - input.add256(1808856605n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint32, euint256) => ebool test 4 (1808856605, 1808856601)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1808856605n); - input.add256(1808856601n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint32, euint256) => ebool test 1 (3268569536, 115792089237316195423570985008687907853269984665640564039457577368549107012293)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3268569536n); - input.add256(115792089237316195423570985008687907853269984665640564039457577368549107012293n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint32, euint256) => ebool test 2 (3268569532, 3268569536)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3268569532n); - input.add256(3268569536n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint32, euint256) => ebool test 3 (3268569536, 3268569536)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3268569536n); - input.add256(3268569536n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint32, euint256) => ebool test 4 (3268569536, 3268569532)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3268569536n); - input.add256(3268569532n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, euint256) => ebool test 1 (3646475026, 115792089237316195423570985008687907853269984665640564039457583473653753763859)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3646475026n); - input.add256(115792089237316195423570985008687907853269984665640564039457583473653753763859n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint32, euint256) => ebool test 2 (3646475022, 3646475026)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3646475022n); - input.add256(3646475026n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint32, euint256) => ebool test 3 (3646475026, 3646475026)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3646475026n); - input.add256(3646475026n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, euint256) => ebool test 4 (3646475026, 3646475022)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3646475026n); - input.add256(3646475022n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint32, euint256) => ebool test 1 (27376130, 115792089237316195423570985008687907853269984665640564039457582301524979306099)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(27376130n); - input.add256(115792089237316195423570985008687907853269984665640564039457582301524979306099n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint32, euint256) => ebool test 2 (27376126, 27376130)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(27376126n); - input.add256(27376130n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint32, euint256) => ebool test 3 (27376130, 27376130)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(27376130n); - input.add256(27376130n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint32, euint256) => ebool test 4 (27376130, 27376126)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(27376130n); - input.add256(27376126n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint256) => ebool test 1 (2709381066, 115792089237316195423570985008687907853269984665640564039457582000267248354603)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2709381066n); - input.add256(115792089237316195423570985008687907853269984665640564039457582000267248354603n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint256) => ebool test 2 (2709381062, 2709381066)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2709381062n); - input.add256(2709381066n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint256) => ebool test 3 (2709381066, 2709381066)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2709381066n); - input.add256(2709381066n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, euint256) => ebool test 4 (2709381066, 2709381062)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2709381066n); - input.add256(2709381062n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint32, euint256) => ebool test 1 (3016190595, 115792089237316195423570985008687907853269984665640564039457583853908247743739)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3016190595n); - input.add256(115792089237316195423570985008687907853269984665640564039457583853908247743739n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint32, euint256) => ebool test 2 (3016190591, 3016190595)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3016190591n); - input.add256(3016190595n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint32, euint256) => ebool test 3 (3016190595, 3016190595)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3016190595n); - input.add256(3016190595n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint32, euint256) => ebool test 4 (3016190595, 3016190591)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3016190595n); - input.add256(3016190591n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); -}); diff --git a/contracts/test/tfheOperations/tfheOperations7.ts b/contracts/test/tfheOperations/tfheOperations7.ts deleted file mode 100644 index 078e9d2d..00000000 --- a/contracts/test/tfheOperations/tfheOperations7.ts +++ /dev/null @@ -1,4789 +0,0 @@ -import { expect } from 'chai'; -import { ethers } from 'hardhat'; - -import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1'; -import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2'; -import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'; -import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4'; -import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5'; -import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6'; -import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7'; -import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8'; -import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9'; -import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10'; -import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11'; -import { - createInstances, - decrypt4, - decrypt8, - decrypt16, - decrypt32, - decrypt64, - decrypt128, - decrypt256, - decryptBool, -} from '../instance'; -import { getSigners, initSigners } from '../signers'; - -async function deployTfheTestFixture1(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture2(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture3(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture4(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture5(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture6(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture7(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite7'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture8(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite8'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture9(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite9'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture10(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite10'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture11(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite11'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -describe('TFHE operations 7', function () { - before(async function () { - await initSigners(1); - this.signers = await getSigners(); - - const contract1 = await deployTfheTestFixture1(); - this.contract1Address = await contract1.getAddress(); - this.contract1 = contract1; - - const contract2 = await deployTfheTestFixture2(); - this.contract2Address = await contract2.getAddress(); - this.contract2 = contract2; - - const contract3 = await deployTfheTestFixture3(); - this.contract3Address = await contract3.getAddress(); - this.contract3 = contract3; - - const contract4 = await deployTfheTestFixture4(); - this.contract4Address = await contract4.getAddress(); - this.contract4 = contract4; - - const contract5 = await deployTfheTestFixture5(); - this.contract5Address = await contract5.getAddress(); - this.contract5 = contract5; - - const contract6 = await deployTfheTestFixture6(); - this.contract6Address = await contract6.getAddress(); - this.contract6 = contract6; - - const contract7 = await deployTfheTestFixture7(); - this.contract7Address = await contract7.getAddress(); - this.contract7 = contract7; - - const contract8 = await deployTfheTestFixture8(); - this.contract8Address = await contract8.getAddress(); - this.contract8 = contract8; - - const contract9 = await deployTfheTestFixture9(); - this.contract9Address = await contract9.getAddress(); - this.contract9 = contract9; - - const contract10 = await deployTfheTestFixture10(); - this.contract10Address = await contract10.getAddress(); - this.contract10 = contract10; - - const contract11 = await deployTfheTestFixture11(); - this.contract11Address = await contract11.getAddress(); - this.contract11 = contract11; - - const instances = await createInstances(this.signers); - this.instances = instances; - }); - - it('test operator "min" overload (euint32, euint256) => euint256 test 1 (3608929890, 115792089237316195423570985008687907853269984665640564039457579751481725336191)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3608929890n); - input.add256(115792089237316195423570985008687907853269984665640564039457579751481725336191n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(3608929890n); - }); - - it('test operator "min" overload (euint32, euint256) => euint256 test 2 (3608929886, 3608929890)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3608929886n); - input.add256(3608929890n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(3608929886n); - }); - - it('test operator "min" overload (euint32, euint256) => euint256 test 3 (3608929890, 3608929890)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3608929890n); - input.add256(3608929890n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(3608929890n); - }); - - it('test operator "min" overload (euint32, euint256) => euint256 test 4 (3608929890, 3608929886)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3608929890n); - input.add256(3608929886n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(3608929886n); - }); - - it('test operator "max" overload (euint32, euint256) => euint256 test 1 (2079496081, 115792089237316195423570985008687907853269984665640564039457579470316273335423)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2079496081n); - input.add256(115792089237316195423570985008687907853269984665640564039457579470316273335423n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457579470316273335423n); - }); - - it('test operator "max" overload (euint32, euint256) => euint256 test 2 (2079496077, 2079496081)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2079496077n); - input.add256(2079496081n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(2079496081n); - }); - - it('test operator "max" overload (euint32, euint256) => euint256 test 3 (2079496081, 2079496081)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2079496081n); - input.add256(2079496081n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(2079496081n); - }); - - it('test operator "max" overload (euint32, euint256) => euint256 test 4 (2079496081, 2079496077)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(2079496081n); - input.add256(2079496077n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint32_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract6.res256()); - expect(res).to.equal(2079496081n); - }); - - it('test operator "add" overload (euint32, uint32) => euint32 test 1 (1855544902, 749023821)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1855544902n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_euint32_uint32( - encryptedAmount.handles[0], - 749023821n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(2604568723n); - }); - - it('test operator "add" overload (euint32, uint32) => euint32 test 2 (1743021441, 1743021443)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1743021441n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_euint32_uint32( - encryptedAmount.handles[0], - 1743021443n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(3486042884n); - }); - - it('test operator "add" overload (euint32, uint32) => euint32 test 3 (1743021443, 1743021443)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1743021443n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_euint32_uint32( - encryptedAmount.handles[0], - 1743021443n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(3486042886n); - }); - - it('test operator "add" overload (euint32, uint32) => euint32 test 4 (1743021443, 1743021441)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1743021443n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_euint32_uint32( - encryptedAmount.handles[0], - 1743021441n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(3486042884n); - }); - - it('test operator "add" overload (uint32, euint32) => euint32 test 1 (1745146365, 1498047640)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1498047640n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_uint32_euint32( - 1745146365n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(3243194005n); - }); - - it('test operator "add" overload (uint32, euint32) => euint32 test 2 (1743021441, 1743021443)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1743021443n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_uint32_euint32( - 1743021441n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(3486042884n); - }); - - it('test operator "add" overload (uint32, euint32) => euint32 test 3 (1743021443, 1743021443)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1743021443n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_uint32_euint32( - 1743021443n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(3486042886n); - }); - - it('test operator "add" overload (uint32, euint32) => euint32 test 4 (1743021443, 1743021441)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1743021441n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_uint32_euint32( - 1743021443n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(3486042884n); - }); - - it('test operator "sub" overload (euint32, uint32) => euint32 test 1 (1818111464, 1818111464)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1818111464n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.sub_euint32_uint32( - encryptedAmount.handles[0], - 1818111464n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint32, uint32) => euint32 test 2 (1818111464, 1818111460)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1818111464n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.sub_euint32_uint32( - encryptedAmount.handles[0], - 1818111460n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(4n); - }); - - it('test operator "sub" overload (uint32, euint32) => euint32 test 1 (1818111464, 1818111464)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1818111464n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.sub_uint32_euint32( - 1818111464n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (uint32, euint32) => euint32 test 2 (1818111464, 1818111460)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1818111460n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.sub_uint32_euint32( - 1818111464n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint32, uint32) => euint32 test 1 (48056, 45037)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(48056n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_euint32_uint32(encryptedAmount.handles[0], 45037n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(2164298072n); - }); - - it('test operator "mul" overload (euint32, uint32) => euint32 test 2 (47710, 47710)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(47710n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_euint32_uint32(encryptedAmount.handles[0], 47710n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(2276244100n); - }); - - it('test operator "mul" overload (euint32, uint32) => euint32 test 3 (47710, 47710)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(47710n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_euint32_uint32(encryptedAmount.handles[0], 47710n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(2276244100n); - }); - - it('test operator "mul" overload (euint32, uint32) => euint32 test 4 (47710, 47710)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(47710n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_euint32_uint32(encryptedAmount.handles[0], 47710n, encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(2276244100n); - }); - - it('test operator "mul" overload (uint32, euint32) => euint32 test 1 (25623, 45037)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(45037n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_uint32_euint32(25623n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1153983051n); - }); - - it('test operator "mul" overload (uint32, euint32) => euint32 test 2 (47710, 47710)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(47710n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_uint32_euint32(47710n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(2276244100n); - }); - - it('test operator "mul" overload (uint32, euint32) => euint32 test 3 (47710, 47710)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(47710n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_uint32_euint32(47710n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(2276244100n); - }); - - it('test operator "mul" overload (uint32, euint32) => euint32 test 4 (47710, 47710)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(47710n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_uint32_euint32(47710n, encryptedAmount.handles[0], encryptedAmount.inputProof); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(2276244100n); - }); - - it('test operator "div" overload (euint32, uint32) => euint32 test 1 (1492630984, 1624831749)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1492630984n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.div_euint32_uint32( - encryptedAmount.handles[0], - 1624831749n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "div" overload (euint32, uint32) => euint32 test 2 (1492630980, 1492630984)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1492630980n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.div_euint32_uint32( - encryptedAmount.handles[0], - 1492630984n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "div" overload (euint32, uint32) => euint32 test 3 (1492630984, 1492630984)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1492630984n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.div_euint32_uint32( - encryptedAmount.handles[0], - 1492630984n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1n); - }); - - it('test operator "div" overload (euint32, uint32) => euint32 test 4 (1492630984, 1492630980)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1492630984n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.div_euint32_uint32( - encryptedAmount.handles[0], - 1492630980n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1n); - }); - - it('test operator "rem" overload (euint32, uint32) => euint32 test 1 (631407091, 2150413493)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(631407091n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.rem_euint32_uint32( - encryptedAmount.handles[0], - 2150413493n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(631407091n); - }); - - it('test operator "rem" overload (euint32, uint32) => euint32 test 2 (631407087, 631407091)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(631407087n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.rem_euint32_uint32( - encryptedAmount.handles[0], - 631407091n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(631407087n); - }); - - it('test operator "rem" overload (euint32, uint32) => euint32 test 3 (631407091, 631407091)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(631407091n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.rem_euint32_uint32( - encryptedAmount.handles[0], - 631407091n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "rem" overload (euint32, uint32) => euint32 test 4 (631407091, 631407087)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(631407091n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.rem_euint32_uint32( - encryptedAmount.handles[0], - 631407087n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(4n); - }); - - it('test operator "and" overload (euint32, uint32) => euint32 test 1 (3317288822, 510484248)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3317288822n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_euint32_uint32( - encryptedAmount.handles[0], - 510484248n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(69816080n); - }); - - it('test operator "and" overload (euint32, uint32) => euint32 test 2 (1342588187, 1342588191)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1342588187n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_euint32_uint32( - encryptedAmount.handles[0], - 1342588191n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1342588187n); - }); - - it('test operator "and" overload (euint32, uint32) => euint32 test 3 (1342588191, 1342588191)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1342588191n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_euint32_uint32( - encryptedAmount.handles[0], - 1342588191n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1342588191n); - }); - - it('test operator "and" overload (euint32, uint32) => euint32 test 4 (1342588191, 1342588187)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1342588191n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_euint32_uint32( - encryptedAmount.handles[0], - 1342588187n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1342588187n); - }); - - it('test operator "and" overload (uint32, euint32) => euint32 test 1 (3731064608, 510484248)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(510484248n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_uint32_euint32( - 3731064608n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(509675264n); - }); - - it('test operator "and" overload (uint32, euint32) => euint32 test 2 (1342588187, 1342588191)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1342588191n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_uint32_euint32( - 1342588187n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1342588187n); - }); - - it('test operator "and" overload (uint32, euint32) => euint32 test 3 (1342588191, 1342588191)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1342588191n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_uint32_euint32( - 1342588191n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1342588191n); - }); - - it('test operator "and" overload (uint32, euint32) => euint32 test 4 (1342588191, 1342588187)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1342588187n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_uint32_euint32( - 1342588191n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1342588187n); - }); - - it('test operator "or" overload (euint32, uint32) => euint32 test 1 (1707541891, 1007760424)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1707541891n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_euint32_uint32( - encryptedAmount.handles[0], - 1007760424n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(2111255979n); - }); - - it('test operator "or" overload (euint32, uint32) => euint32 test 2 (1244554523, 1244554527)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1244554523n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_euint32_uint32( - encryptedAmount.handles[0], - 1244554527n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1244554527n); - }); - - it('test operator "or" overload (euint32, uint32) => euint32 test 3 (1244554527, 1244554527)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1244554527n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_euint32_uint32( - encryptedAmount.handles[0], - 1244554527n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1244554527n); - }); - - it('test operator "or" overload (euint32, uint32) => euint32 test 4 (1244554527, 1244554523)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1244554527n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_euint32_uint32( - encryptedAmount.handles[0], - 1244554523n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1244554527n); - }); - - it('test operator "or" overload (uint32, euint32) => euint32 test 1 (1405809228, 1007760424)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1007760424n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_uint32_euint32( - 1405809228n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(2145121900n); - }); - - it('test operator "or" overload (uint32, euint32) => euint32 test 2 (1244554523, 1244554527)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1244554527n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_uint32_euint32( - 1244554523n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1244554527n); - }); - - it('test operator "or" overload (uint32, euint32) => euint32 test 3 (1244554527, 1244554527)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1244554527n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_uint32_euint32( - 1244554527n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1244554527n); - }); - - it('test operator "or" overload (uint32, euint32) => euint32 test 4 (1244554527, 1244554523)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1244554523n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_uint32_euint32( - 1244554527n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1244554527n); - }); - - it('test operator "xor" overload (euint32, uint32) => euint32 test 1 (3766539452, 3890491814)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3766539452n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_euint32_uint32( - encryptedAmount.handles[0], - 3890491814n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(124052762n); - }); - - it('test operator "xor" overload (euint32, uint32) => euint32 test 2 (3557659855, 3557659859)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3557659855n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_euint32_uint32( - encryptedAmount.handles[0], - 3557659859n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(28n); - }); - - it('test operator "xor" overload (euint32, uint32) => euint32 test 3 (3557659859, 3557659859)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3557659859n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_euint32_uint32( - encryptedAmount.handles[0], - 3557659859n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint32, uint32) => euint32 test 4 (3557659859, 3557659855)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3557659859n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_euint32_uint32( - encryptedAmount.handles[0], - 3557659855n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(28n); - }); - - it('test operator "xor" overload (uint32, euint32) => euint32 test 1 (1940474497, 3890491814)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(3890491814n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_uint32_euint32( - 1940474497n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(2488105767n); - }); - - it('test operator "xor" overload (uint32, euint32) => euint32 test 2 (3557659855, 3557659859)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(3557659859n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_uint32_euint32( - 3557659855n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(28n); - }); - - it('test operator "xor" overload (uint32, euint32) => euint32 test 3 (3557659859, 3557659859)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(3557659859n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_uint32_euint32( - 3557659859n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (uint32, euint32) => euint32 test 4 (3557659859, 3557659855)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(3557659855n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_uint32_euint32( - 3557659859n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(28n); - }); - - it('test operator "eq" overload (euint32, uint32) => ebool test 1 (3899668665, 2460864818)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3899668665n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_euint32_uint32( - encryptedAmount.handles[0], - 2460864818n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint32, uint32) => ebool test 2 (3823635222, 3823635226)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3823635222n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_euint32_uint32( - encryptedAmount.handles[0], - 3823635226n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint32, uint32) => ebool test 3 (3823635226, 3823635226)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3823635226n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_euint32_uint32( - encryptedAmount.handles[0], - 3823635226n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint32, uint32) => ebool test 4 (3823635226, 3823635222)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3823635226n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_euint32_uint32( - encryptedAmount.handles[0], - 3823635222n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint32, euint32) => ebool test 1 (3310168424, 2460864818)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(2460864818n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_uint32_euint32( - 3310168424n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint32, euint32) => ebool test 2 (3823635222, 3823635226)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(3823635226n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_uint32_euint32( - 3823635222n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint32, euint32) => ebool test 3 (3823635226, 3823635226)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(3823635226n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_uint32_euint32( - 3823635226n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (uint32, euint32) => ebool test 4 (3823635226, 3823635222)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(3823635222n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_uint32_euint32( - 3823635226n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint32, uint32) => ebool test 1 (440396727, 826320072)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(440396727n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_euint32_uint32( - encryptedAmount.handles[0], - 826320072n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint32, uint32) => ebool test 2 (440396723, 440396727)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(440396723n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_euint32_uint32( - encryptedAmount.handles[0], - 440396727n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint32, uint32) => ebool test 3 (440396727, 440396727)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(440396727n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_euint32_uint32( - encryptedAmount.handles[0], - 440396727n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint32, uint32) => ebool test 4 (440396727, 440396723)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(440396727n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_euint32_uint32( - encryptedAmount.handles[0], - 440396723n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint32, euint32) => ebool test 1 (3496297299, 826320072)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(826320072n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_uint32_euint32( - 3496297299n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint32, euint32) => ebool test 2 (440396723, 440396727)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(440396727n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_uint32_euint32( - 440396723n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint32, euint32) => ebool test 3 (440396727, 440396727)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(440396727n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_uint32_euint32( - 440396727n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (uint32, euint32) => ebool test 4 (440396727, 440396723)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(440396723n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_uint32_euint32( - 440396727n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, uint32) => ebool test 1 (929694790, 603878469)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(929694790n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_euint32_uint32( - encryptedAmount.handles[0], - 603878469n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, uint32) => ebool test 2 (907768228, 907768232)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(907768228n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_euint32_uint32( - encryptedAmount.handles[0], - 907768232n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint32, uint32) => ebool test 3 (907768232, 907768232)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(907768232n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_euint32_uint32( - encryptedAmount.handles[0], - 907768232n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint32, uint32) => ebool test 4 (907768232, 907768228)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(907768232n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_euint32_uint32( - encryptedAmount.handles[0], - 907768228n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (uint32, euint32) => ebool test 1 (2155494187, 603878469)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(603878469n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_uint32_euint32( - 2155494187n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (uint32, euint32) => ebool test 2 (907768228, 907768232)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(907768232n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_uint32_euint32( - 907768228n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (uint32, euint32) => ebool test 3 (907768232, 907768232)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(907768232n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_uint32_euint32( - 907768232n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (uint32, euint32) => ebool test 4 (907768232, 907768228)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(907768228n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_uint32_euint32( - 907768232n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint32, uint32) => ebool test 1 (3794643996, 3726690353)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3794643996n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_euint32_uint32( - encryptedAmount.handles[0], - 3726690353n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint32, uint32) => ebool test 2 (619151912, 619151916)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(619151912n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_euint32_uint32( - encryptedAmount.handles[0], - 619151916n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint32, uint32) => ebool test 3 (619151916, 619151916)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(619151916n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_euint32_uint32( - encryptedAmount.handles[0], - 619151916n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint32, uint32) => ebool test 4 (619151916, 619151912)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(619151916n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_euint32_uint32( - encryptedAmount.handles[0], - 619151912n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (uint32, euint32) => ebool test 1 (3642906183, 3726690353)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(3726690353n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_uint32_euint32( - 3642906183n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (uint32, euint32) => ebool test 2 (619151912, 619151916)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(619151916n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_uint32_euint32( - 619151912n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (uint32, euint32) => ebool test 3 (619151916, 619151916)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(619151916n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_uint32_euint32( - 619151916n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (uint32, euint32) => ebool test 4 (619151916, 619151912)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(619151912n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_uint32_euint32( - 619151916n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, uint32) => ebool test 1 (1814515265, 524803703)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1814515265n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint32_uint32( - encryptedAmount.handles[0], - 524803703n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint32, uint32) => ebool test 2 (1215301258, 1215301262)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1215301258n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint32_uint32( - encryptedAmount.handles[0], - 1215301262n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, uint32) => ebool test 3 (1215301262, 1215301262)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1215301262n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint32_uint32( - encryptedAmount.handles[0], - 1215301262n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint32, uint32) => ebool test 4 (1215301262, 1215301258)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1215301262n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint32_uint32( - encryptedAmount.handles[0], - 1215301258n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (uint32, euint32) => ebool test 1 (1873209457, 524803703)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(524803703n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_uint32_euint32( - 1873209457n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (uint32, euint32) => ebool test 2 (1215301258, 1215301262)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1215301262n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_uint32_euint32( - 1215301258n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (uint32, euint32) => ebool test 3 (1215301262, 1215301262)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1215301262n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_uint32_euint32( - 1215301262n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (uint32, euint32) => ebool test 4 (1215301262, 1215301258)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1215301258n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_uint32_euint32( - 1215301262n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint32, uint32) => ebool test 1 (597865082, 459499324)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(597865082n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint32_uint32( - encryptedAmount.handles[0], - 459499324n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint32, uint32) => ebool test 2 (597865078, 597865082)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(597865078n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint32_uint32( - encryptedAmount.handles[0], - 597865082n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint32, uint32) => ebool test 3 (597865082, 597865082)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(597865082n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint32_uint32( - encryptedAmount.handles[0], - 597865082n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint32, uint32) => ebool test 4 (597865082, 597865078)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(597865082n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint32_uint32( - encryptedAmount.handles[0], - 597865078n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (uint32, euint32) => ebool test 1 (4239340674, 459499324)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(459499324n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_uint32_euint32( - 4239340674n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (uint32, euint32) => ebool test 2 (597865078, 597865082)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(597865082n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_uint32_euint32( - 597865078n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (uint32, euint32) => ebool test 3 (597865082, 597865082)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(597865082n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_uint32_euint32( - 597865082n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (uint32, euint32) => ebool test 4 (597865082, 597865078)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(597865078n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_uint32_euint32( - 597865082n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint32, uint32) => euint32 test 1 (3167993396, 1826176221)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3167993396n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint32_uint32( - encryptedAmount.handles[0], - 1826176221n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1826176221n); - }); - - it('test operator "min" overload (euint32, uint32) => euint32 test 2 (3167993392, 3167993396)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3167993392n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint32_uint32( - encryptedAmount.handles[0], - 3167993396n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(3167993392n); - }); - - it('test operator "min" overload (euint32, uint32) => euint32 test 3 (3167993396, 3167993396)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3167993396n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint32_uint32( - encryptedAmount.handles[0], - 3167993396n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(3167993396n); - }); - - it('test operator "min" overload (euint32, uint32) => euint32 test 4 (3167993396, 3167993392)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(3167993396n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint32_uint32( - encryptedAmount.handles[0], - 3167993392n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(3167993392n); - }); - - it('test operator "min" overload (uint32, euint32) => euint32 test 1 (591129059, 1826176221)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1826176221n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_uint32_euint32( - 591129059n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(591129059n); - }); - - it('test operator "min" overload (uint32, euint32) => euint32 test 2 (3167993392, 3167993396)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(3167993396n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_uint32_euint32( - 3167993392n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(3167993392n); - }); - - it('test operator "min" overload (uint32, euint32) => euint32 test 3 (3167993396, 3167993396)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(3167993396n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_uint32_euint32( - 3167993396n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(3167993396n); - }); - - it('test operator "min" overload (uint32, euint32) => euint32 test 4 (3167993396, 3167993392)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(3167993392n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_uint32_euint32( - 3167993396n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(3167993392n); - }); - - it('test operator "max" overload (euint32, uint32) => euint32 test 1 (1310408559, 1676413628)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1310408559n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint32_uint32( - encryptedAmount.handles[0], - 1676413628n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1676413628n); - }); - - it('test operator "max" overload (euint32, uint32) => euint32 test 2 (1310408555, 1310408559)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1310408555n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint32_uint32( - encryptedAmount.handles[0], - 1310408559n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1310408559n); - }); - - it('test operator "max" overload (euint32, uint32) => euint32 test 3 (1310408559, 1310408559)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1310408559n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint32_uint32( - encryptedAmount.handles[0], - 1310408559n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1310408559n); - }); - - it('test operator "max" overload (euint32, uint32) => euint32 test 4 (1310408559, 1310408555)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add32(1310408559n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint32_uint32( - encryptedAmount.handles[0], - 1310408555n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1310408559n); - }); - - it('test operator "max" overload (uint32, euint32) => euint32 test 1 (870136392, 1676413628)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1676413628n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_uint32_euint32( - 870136392n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1676413628n); - }); - - it('test operator "max" overload (uint32, euint32) => euint32 test 2 (1310408555, 1310408559)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1310408559n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_uint32_euint32( - 1310408555n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1310408559n); - }); - - it('test operator "max" overload (uint32, euint32) => euint32 test 3 (1310408559, 1310408559)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1310408559n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_uint32_euint32( - 1310408559n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1310408559n); - }); - - it('test operator "max" overload (uint32, euint32) => euint32 test 4 (1310408559, 1310408555)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - - input.add32(1310408555n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_uint32_euint32( - 1310408559n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt32(await this.contract6.res32()); - expect(res).to.equal(1310408559n); - }); - - it('test operator "add" overload (euint64, euint4) => euint64 test 1 (9, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(9n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(11n); - }); - - it('test operator "add" overload (euint64, euint4) => euint64 test 2 (5, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(5n); - input.add4(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(12n); - }); - - it('test operator "add" overload (euint64, euint4) => euint64 test 3 (7, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(7n); - input.add4(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(14n); - }); - - it('test operator "add" overload (euint64, euint4) => euint64 test 4 (7, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(7n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(12n); - }); - - it('test operator "sub" overload (euint64, euint4) => euint64 test 1 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.sub_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint64, euint4) => euint64 test 2 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.sub_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint64, euint4) => euint64 test 1 (5, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(5n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(10n); - }); - - it('test operator "mul" overload (euint64, euint4) => euint64 test 2 (3, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(3n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(15n); - }); - - it('test operator "mul" overload (euint64, euint4) => euint64 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(3n); - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(9n); - }); - - it('test operator "mul" overload (euint64, euint4) => euint64 test 4 (5, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(5n); - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(15n); - }); - - it('test operator "and" overload (euint64, euint4) => euint64 test 1 (18438614995227733505, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18438614995227733505n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "and" overload (euint64, euint4) => euint64 test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(10n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(10n); - }); - - it('test operator "and" overload (euint64, euint4) => euint64 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(14n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(14n); - }); - - it('test operator "and" overload (euint64, euint4) => euint64 test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(14n); - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(10n); - }); - - it('test operator "or" overload (euint64, euint4) => euint64 test 1 (18443718017569117131, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18443718017569117131n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(18443718017569117131n); - }); - - it('test operator "or" overload (euint64, euint4) => euint64 test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(5n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(13n); - }); - - it('test operator "or" overload (euint64, euint4) => euint64 test 3 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(9n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(9n); - }); - - it('test operator "or" overload (euint64, euint4) => euint64 test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(9n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(13n); - }); - - it('test operator "xor" overload (euint64, euint4) => euint64 test 1 (18442021950386427623, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18442021950386427623n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(18442021950386427631n); - }); - - it('test operator "xor" overload (euint64, euint4) => euint64 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint64, euint4) => euint64 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint64, euint4) => euint64 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(12n); - }); - - it('test operator "eq" overload (euint64, euint4) => ebool test 1 (18439903646396993533, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18439903646396993533n); - input.add4(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint64, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint64, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint64, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint64, euint4) => ebool test 1 (18443746789087798257, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18443746789087798257n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint64, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint64, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint64, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, euint4) => ebool test 1 (18438015014584183031, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18438015014584183031n); - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, euint4) => ebool test 2 (7, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(7n); - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint64, euint4) => ebool test 3 (11, 11)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(11n); - input.add4(11n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, euint4) => ebool test 4 (11, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(11n); - input.add4(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint64, euint4) => ebool test 1 (18445379539074122583, 7)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18445379539074122583n); - input.add4(7n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint64, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint64, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint64, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint4) => ebool test 1 (18443622047758317419, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18443622047758317419n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint64, euint4) => ebool test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(9n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint4) => ebool test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(13n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint4) => ebool test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(13n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, euint4) => ebool test 1 (18444247959988442675, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18444247959988442675n); - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, euint4) => ebool test 2 (6, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(6n); - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint64, euint4) => ebool test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(10n); - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, euint4) => ebool test 4 (10, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(10n); - input.add4(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint64, euint4) => euint64 test 1 (18440660497360576819, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18440660497360576819n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(14n); - }); - - it('test operator "min" overload (euint64, euint4) => euint64 test 2 (10, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(10n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(10n); - }); - - it('test operator "min" overload (euint64, euint4) => euint64 test 3 (14, 14)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(14n); - input.add4(14n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(14n); - }); - - it('test operator "min" overload (euint64, euint4) => euint64 test 4 (14, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(14n); - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(10n); - }); - - it('test operator "max" overload (euint64, euint4) => euint64 test 1 (18446600326518934469, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18446600326518934469n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(18446600326518934469n); - }); - - it('test operator "max" overload (euint64, euint4) => euint64 test 2 (8, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(8n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(12n); - }); - - it('test operator "max" overload (euint64, euint4) => euint64 test 3 (12, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(12n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(12n); - }); - - it('test operator "max" overload (euint64, euint4) => euint64 test 4 (12, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(12n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint64_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(12n); - }); - - it('test operator "add" overload (euint64, euint8) => euint64 test 1 (129, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(129n); - input.add8(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(131n); - }); - - it('test operator "add" overload (euint64, euint8) => euint64 test 2 (66, 70)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(66n); - input.add8(70n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(136n); - }); - - it('test operator "add" overload (euint64, euint8) => euint64 test 3 (70, 70)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(70n); - input.add8(70n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(140n); - }); - - it('test operator "add" overload (euint64, euint8) => euint64 test 4 (70, 66)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(70n); - input.add8(66n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.add_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(136n); - }); - - it('test operator "sub" overload (euint64, euint8) => euint64 test 1 (117, 117)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(117n); - input.add8(117n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.sub_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint64, euint8) => euint64 test 2 (117, 113)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(117n); - input.add8(113n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.sub_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint64, euint8) => euint64 test 1 (65, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(65n); - input.add8(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(130n); - }); - - it('test operator "mul" overload (euint64, euint8) => euint64 test 2 (12, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(12n); - input.add8(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(156n); - }); - - it('test operator "mul" overload (euint64, euint8) => euint64 test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(13n); - input.add8(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(169n); - }); - - it('test operator "mul" overload (euint64, euint8) => euint64 test 4 (13, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(13n); - input.add8(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.mul_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(156n); - }); - - it('test operator "and" overload (euint64, euint8) => euint64 test 1 (18443952274371967793, 221)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18443952274371967793n); - input.add8(221n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(17n); - }); - - it('test operator "and" overload (euint64, euint8) => euint64 test 2 (217, 221)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(217n); - input.add8(221n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(217n); - }); - - it('test operator "and" overload (euint64, euint8) => euint64 test 3 (221, 221)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(221n); - input.add8(221n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(221n); - }); - - it('test operator "and" overload (euint64, euint8) => euint64 test 4 (221, 217)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(221n); - input.add8(217n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.and_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(217n); - }); - - it('test operator "or" overload (euint64, euint8) => euint64 test 1 (18442034297780989323, 254)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18442034297780989323n); - input.add8(254n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(18442034297780989439n); - }); - - it('test operator "or" overload (euint64, euint8) => euint64 test 2 (250, 254)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(250n); - input.add8(254n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(254n); - }); - - it('test operator "or" overload (euint64, euint8) => euint64 test 3 (254, 254)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(254n); - input.add8(254n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(254n); - }); - - it('test operator "or" overload (euint64, euint8) => euint64 test 4 (254, 250)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(254n); - input.add8(250n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.or_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(254n); - }); - - it('test operator "xor" overload (euint64, euint8) => euint64 test 1 (18439050232368801565, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18439050232368801565n); - input.add8(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(18439050232368801553n); - }); - - it('test operator "xor" overload (euint64, euint8) => euint64 test 2 (8, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(8n); - input.add8(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint64, euint8) => euint64 test 3 (12, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(12n); - input.add8(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint64, euint8) => euint64 test 4 (12, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(12n); - input.add8(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.xor_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint64, euint8) => ebool test 1 (18439031766765231937, 63)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18439031766765231937n); - input.add8(63n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint64, euint8) => ebool test 2 (59, 63)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(59n); - input.add8(63n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint64, euint8) => ebool test 3 (63, 63)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(63n); - input.add8(63n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint64, euint8) => ebool test 4 (63, 59)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(63n); - input.add8(59n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.eq_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint64, euint8) => ebool test 1 (18443274666908974803, 120)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18443274666908974803n); - input.add8(120n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint64, euint8) => ebool test 2 (116, 120)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(116n); - input.add8(120n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint64, euint8) => ebool test 3 (120, 120)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(120n); - input.add8(120n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint64, euint8) => ebool test 4 (120, 116)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(120n); - input.add8(116n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ne_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, euint8) => ebool test 1 (18444176095713623219, 248)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18444176095713623219n); - input.add8(248n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, euint8) => ebool test 2 (244, 248)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(244n); - input.add8(248n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint64, euint8) => ebool test 3 (248, 248)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(248n); - input.add8(248n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, euint8) => ebool test 4 (248, 244)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(248n); - input.add8(244n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.ge_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint64, euint8) => ebool test 1 (18445625176027562117, 124)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18445625176027562117n); - input.add8(124n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint64, euint8) => ebool test 2 (120, 124)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(120n); - input.add8(124n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint64, euint8) => ebool test 3 (124, 124)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(124n); - input.add8(124n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint64, euint8) => ebool test 4 (124, 120)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(124n); - input.add8(120n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.gt_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint8) => ebool test 1 (18443904556846943161, 36)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18443904556846943161n); - input.add8(36n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint64, euint8) => ebool test 2 (32, 36)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(32n); - input.add8(36n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint8) => ebool test 3 (36, 36)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(36n); - input.add8(36n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint8) => ebool test 4 (36, 32)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(36n); - input.add8(32n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.le_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, euint8) => ebool test 1 (18444886637718481993, 57)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18444886637718481993n); - input.add8(57n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, euint8) => ebool test 2 (53, 57)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(53n); - input.add8(57n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint64, euint8) => ebool test 3 (57, 57)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(57n); - input.add8(57n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, euint8) => ebool test 4 (57, 53)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(57n); - input.add8(53n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.lt_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract6.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint64, euint8) => euint64 test 1 (18442702391560231447, 64)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18442702391560231447n); - input.add8(64n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(64n); - }); - - it('test operator "min" overload (euint64, euint8) => euint64 test 2 (60, 64)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(60n); - input.add8(64n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(60n); - }); - - it('test operator "min" overload (euint64, euint8) => euint64 test 3 (64, 64)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(64n); - input.add8(64n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(64n); - }); - - it('test operator "min" overload (euint64, euint8) => euint64 test 4 (64, 60)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(64n); - input.add8(60n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.min_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(60n); - }); - - it('test operator "max" overload (euint64, euint8) => euint64 test 1 (18437818308322976495, 86)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(18437818308322976495n); - input.add8(86n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(18437818308322976495n); - }); - - it('test operator "max" overload (euint64, euint8) => euint64 test 2 (82, 86)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(82n); - input.add8(86n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(86n); - }); - - it('test operator "max" overload (euint64, euint8) => euint64 test 3 (86, 86)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(86n); - input.add8(86n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(86n); - }); - - it('test operator "max" overload (euint64, euint8) => euint64 test 4 (86, 82)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract6Address, this.signers.alice.address); - input.add64(86n); - input.add8(82n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract6.max_euint64_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract6.res64()); - expect(res).to.equal(86n); - }); - - it('test operator "add" overload (euint64, euint16) => euint64 test 1 (65532, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(65532n); - input.add16(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(65534n); - }); - - it('test operator "add" overload (euint64, euint16) => euint64 test 2 (23004, 23006)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(23004n); - input.add16(23006n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(46010n); - }); - - it('test operator "add" overload (euint64, euint16) => euint64 test 3 (23006, 23006)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(23006n); - input.add16(23006n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(46012n); - }); - - it('test operator "add" overload (euint64, euint16) => euint64 test 4 (23006, 23004)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(23006n); - input.add16(23004n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(46010n); - }); - - it('test operator "sub" overload (euint64, euint16) => euint64 test 1 (54317, 54317)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(54317n); - input.add16(54317n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.sub_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint64, euint16) => euint64 test 2 (54317, 54313)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(54317n); - input.add16(54313n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.sub_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint64, euint16) => euint64 test 1 (32754, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(32754n); - input.add16(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(65508n); - }); - - it('test operator "mul" overload (euint64, euint16) => euint64 test 2 (191, 191)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(191n); - input.add16(191n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(36481n); - }); - - it('test operator "mul" overload (euint64, euint16) => euint64 test 3 (191, 191)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(191n); - input.add16(191n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(36481n); - }); - - it('test operator "mul" overload (euint64, euint16) => euint64 test 4 (191, 191)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(191n); - input.add16(191n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(36481n); - }); - - it('test operator "and" overload (euint64, euint16) => euint64 test 1 (18443322659758757933, 48184)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443322659758757933n); - input.add16(48184n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(6184n); - }); - - it('test operator "and" overload (euint64, euint16) => euint64 test 2 (48180, 48184)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(48180n); - input.add16(48184n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(48176n); - }); - - it('test operator "and" overload (euint64, euint16) => euint64 test 3 (48184, 48184)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(48184n); - input.add16(48184n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(48184n); - }); - - it('test operator "and" overload (euint64, euint16) => euint64 test 4 (48184, 48180)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(48184n); - input.add16(48180n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(48176n); - }); - - it('test operator "or" overload (euint64, euint16) => euint64 test 1 (18445256696814040973, 63476)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18445256696814040973n); - input.add16(63476n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18445256696814041085n); - }); - - it('test operator "or" overload (euint64, euint16) => euint64 test 2 (63472, 63476)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(63472n); - input.add16(63476n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(63476n); - }); - - it('test operator "or" overload (euint64, euint16) => euint64 test 3 (63476, 63476)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(63476n); - input.add16(63476n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(63476n); - }); - - it('test operator "or" overload (euint64, euint16) => euint64 test 4 (63476, 63472)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(63476n); - input.add16(63472n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(63476n); - }); - - it('test operator "xor" overload (euint64, euint16) => euint64 test 1 (18446196219353056271, 45319)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18446196219353056271n); - input.add16(45319n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18446196219353101576n); - }); - - it('test operator "xor" overload (euint64, euint16) => euint64 test 2 (45315, 45319)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(45315n); - input.add16(45319n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint64, euint16) => euint64 test 3 (45319, 45319)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(45319n); - input.add16(45319n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint64, euint16) => euint64 test 4 (45319, 45315)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(45319n); - input.add16(45315n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint64, euint16) => ebool test 1 (18445593277781135549, 65299)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18445593277781135549n); - input.add16(65299n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint64, euint16) => ebool test 2 (65295, 65299)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(65295n); - input.add16(65299n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint64, euint16) => ebool test 3 (65299, 65299)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(65299n); - input.add16(65299n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint64, euint16) => ebool test 4 (65299, 65295)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(65299n); - input.add16(65295n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint64, euint16) => ebool test 1 (18446683880931020495, 9122)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18446683880931020495n); - input.add16(9122n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint64, euint16) => ebool test 2 (9118, 9122)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(9118n); - input.add16(9122n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint64, euint16) => ebool test 3 (9122, 9122)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(9122n); - input.add16(9122n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint64, euint16) => ebool test 4 (9122, 9118)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(9122n); - input.add16(9118n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, euint16) => ebool test 1 (18445173411231141809, 29055)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18445173411231141809n); - input.add16(29055n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, euint16) => ebool test 2 (29051, 29055)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(29051n); - input.add16(29055n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint64, euint16) => ebool test 3 (29055, 29055)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(29055n); - input.add16(29055n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, euint16) => ebool test 4 (29055, 29051)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(29055n); - input.add16(29051n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint64, euint16) => ebool test 1 (18444002964571998281, 52124)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444002964571998281n); - input.add16(52124n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.gt_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint64, euint16) => ebool test 2 (52120, 52124)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(52120n); - input.add16(52124n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.gt_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint64, euint16) => ebool test 3 (52124, 52124)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(52124n); - input.add16(52124n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.gt_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint64, euint16) => ebool test 4 (52124, 52120)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(52124n); - input.add16(52120n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.gt_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint16) => ebool test 1 (18437883313011515679, 51774)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18437883313011515679n); - input.add16(51774n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.le_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint64, euint16) => ebool test 2 (51770, 51774)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(51770n); - input.add16(51774n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.le_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint16) => ebool test 3 (51774, 51774)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(51774n); - input.add16(51774n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.le_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint16) => ebool test 4 (51774, 51770)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(51774n); - input.add16(51770n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.le_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, euint16) => ebool test 1 (18440546263819960189, 42672)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440546263819960189n); - input.add16(42672n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.lt_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, euint16) => ebool test 2 (42668, 42672)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(42668n); - input.add16(42672n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.lt_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint64, euint16) => ebool test 3 (42672, 42672)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(42672n); - input.add16(42672n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.lt_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, euint16) => ebool test 4 (42672, 42668)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(42672n); - input.add16(42668n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.lt_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint64, euint16) => euint64 test 1 (18440389921895932333, 42816)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440389921895932333n); - input.add16(42816n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.min_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(42816n); - }); - - it('test operator "min" overload (euint64, euint16) => euint64 test 2 (42812, 42816)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(42812n); - input.add16(42816n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.min_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(42812n); - }); - - it('test operator "min" overload (euint64, euint16) => euint64 test 3 (42816, 42816)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(42816n); - input.add16(42816n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.min_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(42816n); - }); - - it('test operator "min" overload (euint64, euint16) => euint64 test 4 (42816, 42812)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(42816n); - input.add16(42812n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.min_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(42812n); - }); - - it('test operator "max" overload (euint64, euint16) => euint64 test 1 (18446109140882718991, 19434)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18446109140882718991n); - input.add16(19434n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.max_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18446109140882718991n); - }); - - it('test operator "max" overload (euint64, euint16) => euint64 test 2 (19430, 19434)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(19430n); - input.add16(19434n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.max_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(19434n); - }); - - it('test operator "max" overload (euint64, euint16) => euint64 test 3 (19434, 19434)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(19434n); - input.add16(19434n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.max_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(19434n); - }); - - it('test operator "max" overload (euint64, euint16) => euint64 test 4 (19434, 19430)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(19434n); - input.add16(19430n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.max_euint64_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(19434n); - }); - - it('test operator "add" overload (euint64, euint32) => euint64 test 1 (4294529095, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(4294529095n); - input.add32(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(4294529097n); - }); - - it('test operator "add" overload (euint64, euint32) => euint64 test 2 (1772669097, 1772669099)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1772669097n); - input.add32(1772669099n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(3545338196n); - }); - - it('test operator "add" overload (euint64, euint32) => euint64 test 3 (1772669099, 1772669099)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1772669099n); - input.add32(1772669099n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(3545338198n); - }); - - it('test operator "add" overload (euint64, euint32) => euint64 test 4 (1772669099, 1772669097)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1772669099n); - input.add32(1772669097n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(3545338196n); - }); - - it('test operator "sub" overload (euint64, euint32) => euint64 test 1 (148706478, 148706478)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(148706478n); - input.add32(148706478n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.sub_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint64, euint32) => euint64 test 2 (148706478, 148706474)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(148706478n); - input.add32(148706474n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.sub_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint64, euint32) => euint64 test 1 (2147463302, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(2147463302n); - input.add32(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(4294926604n); - }); - - it('test operator "mul" overload (euint64, euint32) => euint64 test 2 (62313, 62313)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(62313n); - input.add32(62313n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(3882909969n); - }); - - it('test operator "mul" overload (euint64, euint32) => euint64 test 3 (62313, 62313)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(62313n); - input.add32(62313n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(3882909969n); - }); - - it('test operator "mul" overload (euint64, euint32) => euint64 test 4 (62313, 62313)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(62313n); - input.add32(62313n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(3882909969n); - }); - - it('test operator "and" overload (euint64, euint32) => euint64 test 1 (18439406521573141853, 840706883)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18439406521573141853n); - input.add32(840706883n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(33564993n); - }); - - it('test operator "and" overload (euint64, euint32) => euint64 test 2 (840706879, 840706883)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(840706879n); - input.add32(840706883n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(840706819n); - }); - - it('test operator "and" overload (euint64, euint32) => euint64 test 3 (840706883, 840706883)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(840706883n); - input.add32(840706883n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(840706883n); - }); - - it('test operator "and" overload (euint64, euint32) => euint64 test 4 (840706883, 840706879)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(840706883n); - input.add32(840706879n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(840706819n); - }); - - it('test operator "or" overload (euint64, euint32) => euint64 test 1 (18441305633946386479, 1651927522)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18441305633946386479n); - input.add32(1651927522n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18441305635594103279n); - }); - - it('test operator "or" overload (euint64, euint32) => euint64 test 2 (1651927518, 1651927522)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1651927518n); - input.add32(1651927522n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(1651927550n); - }); - - it('test operator "or" overload (euint64, euint32) => euint64 test 3 (1651927522, 1651927522)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1651927522n); - input.add32(1651927522n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(1651927522n); - }); - - it('test operator "or" overload (euint64, euint32) => euint64 test 4 (1651927522, 1651927518)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1651927522n); - input.add32(1651927518n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(1651927550n); - }); - - it('test operator "xor" overload (euint64, euint32) => euint64 test 1 (18440012895744339301, 1085979490)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440012895744339301n); - input.add32(1085979490n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18440012896823678471n); - }); - - it('test operator "xor" overload (euint64, euint32) => euint64 test 2 (1085979486, 1085979490)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1085979486n); - input.add32(1085979490n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(60n); - }); - - it('test operator "xor" overload (euint64, euint32) => euint64 test 3 (1085979490, 1085979490)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1085979490n); - input.add32(1085979490n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint64, euint32) => euint64 test 4 (1085979490, 1085979486)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1085979490n); - input.add32(1085979486n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(60n); - }); -}); diff --git a/contracts/test/tfheOperations/tfheOperations8.ts b/contracts/test/tfheOperations/tfheOperations8.ts deleted file mode 100644 index 4b38a2ec..00000000 --- a/contracts/test/tfheOperations/tfheOperations8.ts +++ /dev/null @@ -1,4851 +0,0 @@ -import { expect } from 'chai'; -import { ethers } from 'hardhat'; - -import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1'; -import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2'; -import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'; -import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4'; -import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5'; -import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6'; -import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7'; -import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8'; -import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9'; -import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10'; -import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11'; -import { - createInstances, - decrypt4, - decrypt8, - decrypt16, - decrypt32, - decrypt64, - decrypt128, - decrypt256, - decryptBool, -} from '../instance'; -import { getSigners, initSigners } from '../signers'; - -async function deployTfheTestFixture1(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture2(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture3(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture4(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture5(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture6(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture7(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite7'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture8(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite8'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture9(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite9'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture10(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite10'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture11(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite11'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -describe('TFHE operations 8', function () { - before(async function () { - await initSigners(1); - this.signers = await getSigners(); - - const contract1 = await deployTfheTestFixture1(); - this.contract1Address = await contract1.getAddress(); - this.contract1 = contract1; - - const contract2 = await deployTfheTestFixture2(); - this.contract2Address = await contract2.getAddress(); - this.contract2 = contract2; - - const contract3 = await deployTfheTestFixture3(); - this.contract3Address = await contract3.getAddress(); - this.contract3 = contract3; - - const contract4 = await deployTfheTestFixture4(); - this.contract4Address = await contract4.getAddress(); - this.contract4 = contract4; - - const contract5 = await deployTfheTestFixture5(); - this.contract5Address = await contract5.getAddress(); - this.contract5 = contract5; - - const contract6 = await deployTfheTestFixture6(); - this.contract6Address = await contract6.getAddress(); - this.contract6 = contract6; - - const contract7 = await deployTfheTestFixture7(); - this.contract7Address = await contract7.getAddress(); - this.contract7 = contract7; - - const contract8 = await deployTfheTestFixture8(); - this.contract8Address = await contract8.getAddress(); - this.contract8 = contract8; - - const contract9 = await deployTfheTestFixture9(); - this.contract9Address = await contract9.getAddress(); - this.contract9 = contract9; - - const contract10 = await deployTfheTestFixture10(); - this.contract10Address = await contract10.getAddress(); - this.contract10 = contract10; - - const contract11 = await deployTfheTestFixture11(); - this.contract11Address = await contract11.getAddress(); - this.contract11 = contract11; - - const instances = await createInstances(this.signers); - this.instances = instances; - }); - - it('test operator "eq" overload (euint64, euint32) => ebool test 1 (18443073273307378367, 1540281447)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443073273307378367n); - input.add32(1540281447n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint64, euint32) => ebool test 2 (1540281443, 1540281447)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1540281443n); - input.add32(1540281447n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint64, euint32) => ebool test 3 (1540281447, 1540281447)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1540281447n); - input.add32(1540281447n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint64, euint32) => ebool test 4 (1540281447, 1540281443)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1540281447n); - input.add32(1540281443n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint64, euint32) => ebool test 1 (18443424543399945811, 2475089443)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443424543399945811n); - input.add32(2475089443n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint64, euint32) => ebool test 2 (2475089439, 2475089443)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(2475089439n); - input.add32(2475089443n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint64, euint32) => ebool test 3 (2475089443, 2475089443)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(2475089443n); - input.add32(2475089443n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint64, euint32) => ebool test 4 (2475089443, 2475089439)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(2475089443n); - input.add32(2475089439n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, euint32) => ebool test 1 (18439654895803536359, 1948462184)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18439654895803536359n); - input.add32(1948462184n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, euint32) => ebool test 2 (1948462180, 1948462184)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1948462180n); - input.add32(1948462184n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint64, euint32) => ebool test 3 (1948462184, 1948462184)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1948462184n); - input.add32(1948462184n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, euint32) => ebool test 4 (1948462184, 1948462180)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1948462184n); - input.add32(1948462180n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint64, euint32) => ebool test 1 (18445739090666652013, 2575338339)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18445739090666652013n); - input.add32(2575338339n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.gt_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint64, euint32) => ebool test 2 (2575338335, 2575338339)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(2575338335n); - input.add32(2575338339n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.gt_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint64, euint32) => ebool test 3 (2575338339, 2575338339)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(2575338339n); - input.add32(2575338339n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.gt_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint64, euint32) => ebool test 4 (2575338339, 2575338335)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(2575338339n); - input.add32(2575338335n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.gt_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint32) => ebool test 1 (18442023388952183851, 1762835382)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18442023388952183851n); - input.add32(1762835382n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.le_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint64, euint32) => ebool test 2 (1762835378, 1762835382)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1762835378n); - input.add32(1762835382n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.le_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint32) => ebool test 3 (1762835382, 1762835382)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1762835382n); - input.add32(1762835382n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.le_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint32) => ebool test 4 (1762835382, 1762835378)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1762835382n); - input.add32(1762835378n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.le_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, euint32) => ebool test 1 (18441377707016357467, 2876988629)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18441377707016357467n); - input.add32(2876988629n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.lt_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, euint32) => ebool test 2 (2876988625, 2876988629)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(2876988625n); - input.add32(2876988629n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.lt_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint64, euint32) => ebool test 3 (2876988629, 2876988629)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(2876988629n); - input.add32(2876988629n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.lt_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, euint32) => ebool test 4 (2876988629, 2876988625)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(2876988629n); - input.add32(2876988625n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.lt_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint64, euint32) => euint64 test 1 (18439611592084278651, 1078993829)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18439611592084278651n); - input.add32(1078993829n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.min_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(1078993829n); - }); - - it('test operator "min" overload (euint64, euint32) => euint64 test 2 (1078993825, 1078993829)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1078993825n); - input.add32(1078993829n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.min_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(1078993825n); - }); - - it('test operator "min" overload (euint64, euint32) => euint64 test 3 (1078993829, 1078993829)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1078993829n); - input.add32(1078993829n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.min_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(1078993829n); - }); - - it('test operator "min" overload (euint64, euint32) => euint64 test 4 (1078993829, 1078993825)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(1078993829n); - input.add32(1078993825n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.min_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(1078993825n); - }); - - it('test operator "max" overload (euint64, euint32) => euint64 test 1 (18438142521959169981, 4265760124)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18438142521959169981n); - input.add32(4265760124n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.max_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18438142521959169981n); - }); - - it('test operator "max" overload (euint64, euint32) => euint64 test 2 (4265760120, 4265760124)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(4265760120n); - input.add32(4265760124n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.max_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(4265760124n); - }); - - it('test operator "max" overload (euint64, euint32) => euint64 test 3 (4265760124, 4265760124)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(4265760124n); - input.add32(4265760124n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.max_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(4265760124n); - }); - - it('test operator "max" overload (euint64, euint32) => euint64 test 4 (4265760124, 4265760120)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(4265760124n); - input.add32(4265760120n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.max_euint64_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(4265760124n); - }); - - it('test operator "add" overload (euint64, euint64) => euint64 test 1 (9222005500490563257, 9222323180954998973)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(9222005500490563257n); - input.add64(9222323180954998973n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18444328681445562230n); - }); - - it('test operator "add" overload (euint64, euint64) => euint64 test 2 (9222005500490563255, 9222005500490563257)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(9222005500490563255n); - input.add64(9222005500490563257n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18444011000981126512n); - }); - - it('test operator "add" overload (euint64, euint64) => euint64 test 3 (9222005500490563257, 9222005500490563257)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(9222005500490563257n); - input.add64(9222005500490563257n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18444011000981126514n); - }); - - it('test operator "add" overload (euint64, euint64) => euint64 test 4 (9222005500490563257, 9222005500490563255)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(9222005500490563257n); - input.add64(9222005500490563255n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18444011000981126512n); - }); - - it('test operator "sub" overload (euint64, euint64) => euint64 test 1 (18440691834306324731, 18440691834306324731)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440691834306324731n); - input.add64(18440691834306324731n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.sub_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint64, euint64) => euint64 test 2 (18440691834306324731, 18440691834306324727)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440691834306324731n); - input.add64(18440691834306324727n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.sub_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint64, euint64) => euint64 test 1 (4294482875, 4294789499)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(4294482875n); - input.add64(4294789499n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18443899955185329625n); - }); - - it('test operator "mul" overload (euint64, euint64) => euint64 test 2 (4294482875, 4294482875)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(4294482875n); - input.add64(4294482875n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18442583163668265625n); - }); - - it('test operator "mul" overload (euint64, euint64) => euint64 test 3 (4294482875, 4294482875)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(4294482875n); - input.add64(4294482875n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18442583163668265625n); - }); - - it('test operator "mul" overload (euint64, euint64) => euint64 test 4 (4294482875, 4294482875)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(4294482875n); - input.add64(4294482875n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18442583163668265625n); - }); - - it('test operator "and" overload (euint64, euint64) => euint64 test 1 (18444124970074897317, 18442657213736743287)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444124970074897317n); - input.add64(18442657213736743287n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18442294351260348709n); - }); - - it('test operator "and" overload (euint64, euint64) => euint64 test 2 (18442657213736743283, 18442657213736743287)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18442657213736743283n); - input.add64(18442657213736743287n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18442657213736743283n); - }); - - it('test operator "and" overload (euint64, euint64) => euint64 test 3 (18442657213736743287, 18442657213736743287)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18442657213736743287n); - input.add64(18442657213736743287n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18442657213736743287n); - }); - - it('test operator "and" overload (euint64, euint64) => euint64 test 4 (18442657213736743287, 18442657213736743283)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18442657213736743287n); - input.add64(18442657213736743283n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18442657213736743283n); - }); - - it('test operator "or" overload (euint64, euint64) => euint64 test 1 (18445851190683093315, 18440297605680046453)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18445851190683093315n); - input.add64(18440297605680046453n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18446141532670781815n); - }); - - it('test operator "or" overload (euint64, euint64) => euint64 test 2 (18440297605680046449, 18440297605680046453)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440297605680046449n); - input.add64(18440297605680046453n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18440297605680046453n); - }); - - it('test operator "or" overload (euint64, euint64) => euint64 test 3 (18440297605680046453, 18440297605680046453)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440297605680046453n); - input.add64(18440297605680046453n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18440297605680046453n); - }); - - it('test operator "or" overload (euint64, euint64) => euint64 test 4 (18440297605680046453, 18440297605680046449)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440297605680046453n); - input.add64(18440297605680046449n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18440297605680046453n); - }); - - it('test operator "xor" overload (euint64, euint64) => euint64 test 1 (18439520894560746701, 18440669858368892063)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18439520894560746701n); - input.add64(18440669858368892063n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(3444795783188562n); - }); - - it('test operator "xor" overload (euint64, euint64) => euint64 test 2 (18439520894560746697, 18439520894560746701)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18439520894560746697n); - input.add64(18439520894560746701n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint64, euint64) => euint64 test 3 (18439520894560746701, 18439520894560746701)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18439520894560746701n); - input.add64(18439520894560746701n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint64, euint64) => euint64 test 4 (18439520894560746701, 18439520894560746697)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18439520894560746701n); - input.add64(18439520894560746697n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint64, euint64) => ebool test 1 (18443282870504090991, 18446028700927461615)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443282870504090991n); - input.add64(18446028700927461615n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint64, euint64) => ebool test 2 (18443282870504090987, 18443282870504090991)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443282870504090987n); - input.add64(18443282870504090991n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint64, euint64) => ebool test 3 (18443282870504090991, 18443282870504090991)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443282870504090991n); - input.add64(18443282870504090991n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint64, euint64) => ebool test 4 (18443282870504090991, 18443282870504090987)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443282870504090991n); - input.add64(18443282870504090987n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint64, euint64) => ebool test 1 (18445289136242885897, 18441860560804132295)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18445289136242885897n); - input.add64(18441860560804132295n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint64, euint64) => ebool test 2 (18441860560804132291, 18441860560804132295)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18441860560804132291n); - input.add64(18441860560804132295n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint64, euint64) => ebool test 3 (18441860560804132295, 18441860560804132295)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18441860560804132295n); - input.add64(18441860560804132295n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint64, euint64) => ebool test 4 (18441860560804132295, 18441860560804132291)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18441860560804132295n); - input.add64(18441860560804132291n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, euint64) => ebool test 1 (18444613618003912273, 18441817383047397973)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444613618003912273n); - input.add64(18441817383047397973n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, euint64) => ebool test 2 (18441817383047397969, 18441817383047397973)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18441817383047397969n); - input.add64(18441817383047397973n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint64, euint64) => ebool test 3 (18441817383047397973, 18441817383047397973)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18441817383047397973n); - input.add64(18441817383047397973n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, euint64) => ebool test 4 (18441817383047397973, 18441817383047397969)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18441817383047397973n); - input.add64(18441817383047397969n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint64, euint64) => ebool test 1 (18444129545450155179, 18438304556640407461)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444129545450155179n); - input.add64(18438304556640407461n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.gt_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint64, euint64) => ebool test 2 (18438304556640407457, 18438304556640407461)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18438304556640407457n); - input.add64(18438304556640407461n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.gt_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint64, euint64) => ebool test 3 (18438304556640407461, 18438304556640407461)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18438304556640407461n); - input.add64(18438304556640407461n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.gt_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint64, euint64) => ebool test 4 (18438304556640407461, 18438304556640407457)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18438304556640407461n); - input.add64(18438304556640407457n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.gt_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint64) => ebool test 1 (18440402951089431437, 18444684457474043493)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440402951089431437n); - input.add64(18444684457474043493n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.le_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint64) => ebool test 2 (18440402951089431433, 18440402951089431437)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440402951089431433n); - input.add64(18440402951089431437n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.le_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint64) => ebool test 3 (18440402951089431437, 18440402951089431437)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440402951089431437n); - input.add64(18440402951089431437n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.le_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint64) => ebool test 4 (18440402951089431437, 18440402951089431433)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440402951089431437n); - input.add64(18440402951089431433n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.le_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, euint64) => ebool test 1 (18443308354694945505, 18438494040818835505)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443308354694945505n); - input.add64(18438494040818835505n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.lt_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, euint64) => ebool test 2 (18438494040818835501, 18438494040818835505)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18438494040818835501n); - input.add64(18438494040818835505n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.lt_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint64, euint64) => ebool test 3 (18438494040818835505, 18438494040818835505)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18438494040818835505n); - input.add64(18438494040818835505n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.lt_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, euint64) => ebool test 4 (18438494040818835505, 18438494040818835501)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18438494040818835505n); - input.add64(18438494040818835501n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.lt_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint64, euint64) => euint64 test 1 (18438422972288340001, 18441615262395055283)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18438422972288340001n); - input.add64(18441615262395055283n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.min_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18438422972288340001n); - }); - - it('test operator "min" overload (euint64, euint64) => euint64 test 2 (18438422972288339997, 18438422972288340001)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18438422972288339997n); - input.add64(18438422972288340001n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.min_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18438422972288339997n); - }); - - it('test operator "min" overload (euint64, euint64) => euint64 test 3 (18438422972288340001, 18438422972288340001)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18438422972288340001n); - input.add64(18438422972288340001n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.min_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18438422972288340001n); - }); - - it('test operator "min" overload (euint64, euint64) => euint64 test 4 (18438422972288340001, 18438422972288339997)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18438422972288340001n); - input.add64(18438422972288339997n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.min_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18438422972288339997n); - }); - - it('test operator "max" overload (euint64, euint64) => euint64 test 1 (18445852065991763771, 18440937538047974893)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18445852065991763771n); - input.add64(18440937538047974893n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.max_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18445852065991763771n); - }); - - it('test operator "max" overload (euint64, euint64) => euint64 test 2 (18440937538047974889, 18440937538047974893)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440937538047974889n); - input.add64(18440937538047974893n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.max_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18440937538047974893n); - }); - - it('test operator "max" overload (euint64, euint64) => euint64 test 3 (18440937538047974893, 18440937538047974893)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440937538047974893n); - input.add64(18440937538047974893n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.max_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18440937538047974893n); - }); - - it('test operator "max" overload (euint64, euint64) => euint64 test 4 (18440937538047974893, 18440937538047974889)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440937538047974893n); - input.add64(18440937538047974889n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.max_euint64_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18440937538047974893n); - }); - - it('test operator "add" overload (euint64, euint128) => euint128 test 1 (2, 9223372036854775809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(2n); - input.add128(9223372036854775809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(9223372036854775811n); - }); - - it('test operator "add" overload (euint64, euint128) => euint128 test 2 (9220019285142748118, 9220019285142748120)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(9220019285142748118n); - input.add128(9220019285142748120n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(18440038570285496238n); - }); - - it('test operator "add" overload (euint64, euint128) => euint128 test 3 (9220019285142748120, 9220019285142748120)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(9220019285142748120n); - input.add128(9220019285142748120n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(18440038570285496240n); - }); - - it('test operator "add" overload (euint64, euint128) => euint128 test 4 (9220019285142748120, 9220019285142748118)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(9220019285142748120n); - input.add128(9220019285142748118n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(18440038570285496238n); - }); - - it('test operator "sub" overload (euint64, euint128) => euint128 test 1 (18445847707614326699, 18445847707614326699)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18445847707614326699n); - input.add128(18445847707614326699n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.sub_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint64, euint128) => euint128 test 2 (18445847707614326699, 18445847707614326695)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18445847707614326699n); - input.add128(18445847707614326695n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.sub_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint64, euint128) => euint128 test 1 (2, 4611686018427387905)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(2n); - input.add128(4611686018427387905n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(9223372036854775810n); - }); - - it('test operator "mul" overload (euint64, euint128) => euint128 test 2 (4293652736, 4293652736)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(4293652736n); - input.add128(4293652736n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(18435453817360285696n); - }); - - it('test operator "mul" overload (euint64, euint128) => euint128 test 3 (4293652736, 4293652736)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(4293652736n); - input.add128(4293652736n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(18435453817360285696n); - }); - - it('test operator "mul" overload (euint64, euint128) => euint128 test 4 (4293652736, 4293652736)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(4293652736n); - input.add128(4293652736n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(18435453817360285696n); - }); - - it('test operator "and" overload (euint64, euint128) => euint128 test 1 (18438964653643998977, 340282366920938463463371580179294281733)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18438964653643998977n); - input.add128(340282366920938463463371580179294281733n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(18438894284827860993n); - }); - - it('test operator "and" overload (euint64, euint128) => euint128 test 2 (18438964653643998973, 18438964653643998977)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18438964653643998973n); - input.add128(18438964653643998977n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(18438964653643998721n); - }); - - it('test operator "and" overload (euint64, euint128) => euint128 test 3 (18438964653643998977, 18438964653643998977)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18438964653643998977n); - input.add128(18438964653643998977n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(18438964653643998977n); - }); - - it('test operator "and" overload (euint64, euint128) => euint128 test 4 (18438964653643998977, 18438964653643998973)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18438964653643998977n); - input.add128(18438964653643998973n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(18438964653643998721n); - }); - - it('test operator "or" overload (euint64, euint128) => euint128 test 1 (18444253937643069461, 340282366920938463463369573351070308735)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444253937643069461n); - input.add128(340282366920938463463369573351070308735n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(340282366920938463463374396049659246975n); - }); - - it('test operator "or" overload (euint64, euint128) => euint128 test 2 (18444253937643069457, 18444253937643069461)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444253937643069457n); - input.add128(18444253937643069461n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(18444253937643069461n); - }); - - it('test operator "or" overload (euint64, euint128) => euint128 test 3 (18444253937643069461, 18444253937643069461)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444253937643069461n); - input.add128(18444253937643069461n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(18444253937643069461n); - }); - - it('test operator "or" overload (euint64, euint128) => euint128 test 4 (18444253937643069461, 18444253937643069457)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444253937643069461n); - input.add128(18444253937643069457n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(18444253937643069461n); - }); - - it('test operator "xor" overload (euint64, euint128) => euint128 test 1 (18445744178466976977, 340282366920938463463371486789808692655)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18445744178466976977n); - input.add128(340282366920938463463371486789808692655n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(340282366920938463444930285940062611838n); - }); - - it('test operator "xor" overload (euint64, euint128) => euint128 test 2 (18445744178466976973, 18445744178466976977)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18445744178466976973n); - input.add128(18445744178466976977n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(28n); - }); - - it('test operator "xor" overload (euint64, euint128) => euint128 test 3 (18445744178466976977, 18445744178466976977)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18445744178466976977n); - input.add128(18445744178466976977n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint64, euint128) => euint128 test 4 (18445744178466976977, 18445744178466976973)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18445744178466976977n); - input.add128(18445744178466976973n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(28n); - }); - - it('test operator "eq" overload (euint64, euint128) => ebool test 1 (18440180042915486669, 340282366920938463463371210059252201113)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440180042915486669n); - input.add128(340282366920938463463371210059252201113n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint64, euint128) => ebool test 2 (18440180042915486665, 18440180042915486669)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440180042915486665n); - input.add128(18440180042915486669n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint64, euint128) => ebool test 3 (18440180042915486669, 18440180042915486669)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440180042915486669n); - input.add128(18440180042915486669n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint64, euint128) => ebool test 4 (18440180042915486669, 18440180042915486665)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440180042915486669n); - input.add128(18440180042915486665n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint64, euint128) => ebool test 1 (18439484097328106945, 340282366920938463463374251414120336649)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18439484097328106945n); - input.add128(340282366920938463463374251414120336649n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint64, euint128) => ebool test 2 (18439484097328106941, 18439484097328106945)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18439484097328106941n); - input.add128(18439484097328106945n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint64, euint128) => ebool test 3 (18439484097328106945, 18439484097328106945)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18439484097328106945n); - input.add128(18439484097328106945n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint64, euint128) => ebool test 4 (18439484097328106945, 18439484097328106941)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18439484097328106945n); - input.add128(18439484097328106941n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, euint128) => ebool test 1 (18442500358670120549, 340282366920938463463373603431929658391)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18442500358670120549n); - input.add128(340282366920938463463373603431929658391n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint64, euint128) => ebool test 2 (18442500358670120545, 18442500358670120549)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18442500358670120545n); - input.add128(18442500358670120549n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint64, euint128) => ebool test 3 (18442500358670120549, 18442500358670120549)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18442500358670120549n); - input.add128(18442500358670120549n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, euint128) => ebool test 4 (18442500358670120549, 18442500358670120545)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18442500358670120549n); - input.add128(18442500358670120545n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint64, euint128) => ebool test 1 (18440808032965074109, 340282366920938463463365853534758019559)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440808032965074109n); - input.add128(340282366920938463463365853534758019559n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.gt_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint64, euint128) => ebool test 2 (18440808032965074105, 18440808032965074109)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440808032965074105n); - input.add128(18440808032965074109n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.gt_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint64, euint128) => ebool test 3 (18440808032965074109, 18440808032965074109)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440808032965074109n); - input.add128(18440808032965074109n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.gt_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint64, euint128) => ebool test 4 (18440808032965074109, 18440808032965074105)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440808032965074109n); - input.add128(18440808032965074105n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.gt_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint128) => ebool test 1 (18443662339869468477, 340282366920938463463371042076884293495)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443662339869468477n); - input.add128(340282366920938463463371042076884293495n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.le_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint128) => ebool test 2 (18443662339869468473, 18443662339869468477)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443662339869468473n); - input.add128(18443662339869468477n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.le_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint128) => ebool test 3 (18443662339869468477, 18443662339869468477)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443662339869468477n); - input.add128(18443662339869468477n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.le_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint128) => ebool test 4 (18443662339869468477, 18443662339869468473)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443662339869468477n); - input.add128(18443662339869468473n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.le_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, euint128) => ebool test 1 (18444814117403628673, 340282366920938463463365637360413874149)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444814117403628673n); - input.add128(340282366920938463463365637360413874149n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.lt_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint64, euint128) => ebool test 2 (18444814117403628669, 18444814117403628673)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444814117403628669n); - input.add128(18444814117403628673n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.lt_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint64, euint128) => ebool test 3 (18444814117403628673, 18444814117403628673)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444814117403628673n); - input.add128(18444814117403628673n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.lt_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, euint128) => ebool test 4 (18444814117403628673, 18444814117403628669)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444814117403628673n); - input.add128(18444814117403628669n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.lt_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint64, euint128) => euint128 test 1 (18444900314492723695, 340282366920938463463367540489775579127)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444900314492723695n); - input.add128(340282366920938463463367540489775579127n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.min_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(18444900314492723695n); - }); - - it('test operator "min" overload (euint64, euint128) => euint128 test 2 (18444900314492723691, 18444900314492723695)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444900314492723691n); - input.add128(18444900314492723695n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.min_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(18444900314492723691n); - }); - - it('test operator "min" overload (euint64, euint128) => euint128 test 3 (18444900314492723695, 18444900314492723695)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444900314492723695n); - input.add128(18444900314492723695n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.min_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(18444900314492723695n); - }); - - it('test operator "min" overload (euint64, euint128) => euint128 test 4 (18444900314492723695, 18444900314492723691)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444900314492723695n); - input.add128(18444900314492723691n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.min_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(18444900314492723691n); - }); - - it('test operator "max" overload (euint64, euint128) => euint128 test 1 (18444589551829336117, 340282366920938463463371310064926977589)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444589551829336117n); - input.add128(340282366920938463463371310064926977589n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.max_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(340282366920938463463371310064926977589n); - }); - - it('test operator "max" overload (euint64, euint128) => euint128 test 2 (18444589551829336113, 18444589551829336117)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444589551829336113n); - input.add128(18444589551829336117n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.max_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(18444589551829336117n); - }); - - it('test operator "max" overload (euint64, euint128) => euint128 test 3 (18444589551829336117, 18444589551829336117)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444589551829336117n); - input.add128(18444589551829336117n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.max_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(18444589551829336117n); - }); - - it('test operator "max" overload (euint64, euint128) => euint128 test 4 (18444589551829336117, 18444589551829336113)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444589551829336117n); - input.add128(18444589551829336113n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.max_euint64_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract7.res128()); - expect(res).to.equal(18444589551829336117n); - }); - - it('test operator "add" overload (euint64, euint256) => euint256 test 1 (2, 9223372036854775809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(2n); - input.add256(9223372036854775809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(9223372036854775811n); - }); - - it('test operator "add" overload (euint64, euint256) => euint256 test 2 (9223002406300982591, 9223002406300982593)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(9223002406300982591n); - input.add256(9223002406300982593n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(18446004812601965184n); - }); - - it('test operator "add" overload (euint64, euint256) => euint256 test 3 (9223002406300982593, 9223002406300982593)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(9223002406300982593n); - input.add256(9223002406300982593n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(18446004812601965186n); - }); - - it('test operator "add" overload (euint64, euint256) => euint256 test 4 (9223002406300982593, 9223002406300982591)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(9223002406300982593n); - input.add256(9223002406300982591n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(18446004812601965184n); - }); - - it('test operator "sub" overload (euint64, euint256) => euint256 test 1 (18445224051732608013, 18445224051732608013)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18445224051732608013n); - input.add256(18445224051732608013n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.sub_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint64, euint256) => euint256 test 2 (18445224051732608013, 18445224051732608009)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18445224051732608013n); - input.add256(18445224051732608009n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.sub_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint64, euint256) => euint256 test 1 (2, 4611686018427387905)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(2n); - input.add256(4611686018427387905n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(9223372036854775810n); - }); - - it('test operator "mul" overload (euint64, euint256) => euint256 test 2 (4292932541, 4292932541)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(4292932541n); - input.add256(4292932541n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(18429269801576716681n); - }); - - it('test operator "mul" overload (euint64, euint256) => euint256 test 3 (4292932541, 4292932541)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(4292932541n); - input.add256(4292932541n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(18429269801576716681n); - }); - - it('test operator "mul" overload (euint64, euint256) => euint256 test 4 (4292932541, 4292932541)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(4292932541n); - input.add256(4292932541n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(18429269801576716681n); - }); - - it('test operator "and" overload (euint64, euint256) => euint256 test 1 (18443960605514453875, 115792089237316195423570985008687907853269984665640564039457575145704576396421)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443960605514453875n); - input.add256(115792089237316195423570985008687907853269984665640564039457575145704576396421n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(18437737227820728321n); - }); - - it('test operator "and" overload (euint64, euint256) => euint256 test 2 (18443960605514453871, 18443960605514453875)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443960605514453871n); - input.add256(18443960605514453875n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(18443960605514453859n); - }); - - it('test operator "and" overload (euint64, euint256) => euint256 test 3 (18443960605514453875, 18443960605514453875)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443960605514453875n); - input.add256(18443960605514453875n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(18443960605514453875n); - }); - - it('test operator "and" overload (euint64, euint256) => euint256 test 4 (18443960605514453875, 18443960605514453871)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443960605514453875n); - input.add256(18443960605514453871n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(18443960605514453859n); - }); - - it('test operator "or" overload (euint64, euint256) => euint256 test 1 (18444891827197945405, 115792089237316195423570985008687907853269984665640564039457581376324451236725)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444891827197945405n); - input.add256(115792089237316195423570985008687907853269984665640564039457581376324451236725n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457583990276981260157n); - }); - - it('test operator "or" overload (euint64, euint256) => euint256 test 2 (18444891827197945401, 18444891827197945405)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444891827197945401n); - input.add256(18444891827197945405n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(18444891827197945405n); - }); - - it('test operator "or" overload (euint64, euint256) => euint256 test 3 (18444891827197945405, 18444891827197945405)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444891827197945405n); - input.add256(18444891827197945405n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(18444891827197945405n); - }); - - it('test operator "or" overload (euint64, euint256) => euint256 test 4 (18444891827197945405, 18444891827197945401)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444891827197945405n); - input.add256(18444891827197945401n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(18444891827197945405n); - }); - - it('test operator "xor" overload (euint64, euint256) => euint256 test 1 (18438921176678700429, 115792089237316195423570985008687907853269984665640564039457575984328616481271)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18438921176678700429n); - input.add256(115792089237316195423570985008687907853269984665640564039457575984328616481271n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039439139317222450136186n); - }); - - it('test operator "xor" overload (euint64, euint256) => euint256 test 2 (18438921176678700425, 18438921176678700429)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18438921176678700425n); - input.add256(18438921176678700429n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint64, euint256) => euint256 test 3 (18438921176678700429, 18438921176678700429)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18438921176678700429n); - input.add256(18438921176678700429n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint64, euint256) => euint256 test 4 (18438921176678700429, 18438921176678700425)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18438921176678700429n); - input.add256(18438921176678700425n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint64, euint256) => ebool test 1 (18443851863635995939, 115792089237316195423570985008687907853269984665640564039457575030888379042775)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443851863635995939n); - input.add256(115792089237316195423570985008687907853269984665640564039457575030888379042775n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint64, euint256) => ebool test 2 (18443851863635995935, 18443851863635995939)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443851863635995935n); - input.add256(18443851863635995939n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint64, euint256) => ebool test 3 (18443851863635995939, 18443851863635995939)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443851863635995939n); - input.add256(18443851863635995939n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint64, euint256) => ebool test 4 (18443851863635995939, 18443851863635995935)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443851863635995939n); - input.add256(18443851863635995935n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint64, euint256) => ebool test 1 (18446211817960475589, 115792089237316195423570985008687907853269984665640564039457576433191959532665)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18446211817960475589n); - input.add256(115792089237316195423570985008687907853269984665640564039457576433191959532665n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint64, euint256) => ebool test 2 (18446211817960475585, 18446211817960475589)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18446211817960475585n); - input.add256(18446211817960475589n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint64, euint256) => ebool test 3 (18446211817960475589, 18446211817960475589)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18446211817960475589n); - input.add256(18446211817960475589n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint64, euint256) => ebool test 4 (18446211817960475589, 18446211817960475585)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18446211817960475589n); - input.add256(18446211817960475585n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, euint256) => ebool test 1 (18444770112796649545, 115792089237316195423570985008687907853269984665640564039457581281801379635505)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444770112796649545n); - input.add256(115792089237316195423570985008687907853269984665640564039457581281801379635505n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint64, euint256) => ebool test 2 (18444770112796649541, 18444770112796649545)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444770112796649541n); - input.add256(18444770112796649545n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint64, euint256) => ebool test 3 (18444770112796649545, 18444770112796649545)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444770112796649545n); - input.add256(18444770112796649545n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, euint256) => ebool test 4 (18444770112796649545, 18444770112796649541)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444770112796649545n); - input.add256(18444770112796649541n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint64, euint256) => ebool test 1 (18443327594956328675, 115792089237316195423570985008687907853269984665640564039457581268418001741927)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443327594956328675n); - input.add256(115792089237316195423570985008687907853269984665640564039457581268418001741927n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.gt_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint64, euint256) => ebool test 2 (18443327594956328671, 18443327594956328675)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443327594956328671n); - input.add256(18443327594956328675n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.gt_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint64, euint256) => ebool test 3 (18443327594956328675, 18443327594956328675)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443327594956328675n); - input.add256(18443327594956328675n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.gt_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint64, euint256) => ebool test 4 (18443327594956328675, 18443327594956328671)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443327594956328675n); - input.add256(18443327594956328671n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.gt_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint256) => ebool test 1 (18443803742985479181, 115792089237316195423570985008687907853269984665640564039457581800529684723115)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443803742985479181n); - input.add256(115792089237316195423570985008687907853269984665640564039457581800529684723115n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.le_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint256) => ebool test 2 (18443803742985479177, 18443803742985479181)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443803742985479177n); - input.add256(18443803742985479181n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.le_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint256) => ebool test 3 (18443803742985479181, 18443803742985479181)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443803742985479181n); - input.add256(18443803742985479181n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.le_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, euint256) => ebool test 4 (18443803742985479181, 18443803742985479177)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443803742985479181n); - input.add256(18443803742985479177n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.le_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, euint256) => ebool test 1 (18440844601726997069, 115792089237316195423570985008687907853269984665640564039457578884493044868087)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440844601726997069n); - input.add256(115792089237316195423570985008687907853269984665640564039457578884493044868087n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.lt_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint64, euint256) => ebool test 2 (18440844601726997065, 18440844601726997069)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440844601726997065n); - input.add256(18440844601726997069n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.lt_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint64, euint256) => ebool test 3 (18440844601726997069, 18440844601726997069)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440844601726997069n); - input.add256(18440844601726997069n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.lt_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, euint256) => ebool test 4 (18440844601726997069, 18440844601726997065)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440844601726997069n); - input.add256(18440844601726997065n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.lt_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint64, euint256) => euint256 test 1 (18446426094775234589, 115792089237316195423570985008687907853269984665640564039457578688132986416989)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18446426094775234589n); - input.add256(115792089237316195423570985008687907853269984665640564039457578688132986416989n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.min_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(18446426094775234589n); - }); - - it('test operator "min" overload (euint64, euint256) => euint256 test 2 (18446426094775234585, 18446426094775234589)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18446426094775234585n); - input.add256(18446426094775234589n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.min_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(18446426094775234585n); - }); - - it('test operator "min" overload (euint64, euint256) => euint256 test 3 (18446426094775234589, 18446426094775234589)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18446426094775234589n); - input.add256(18446426094775234589n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.min_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(18446426094775234589n); - }); - - it('test operator "min" overload (euint64, euint256) => euint256 test 4 (18446426094775234589, 18446426094775234585)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18446426094775234589n); - input.add256(18446426094775234585n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.min_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(18446426094775234585n); - }); - - it('test operator "max" overload (euint64, euint256) => euint256 test 1 (18437962634473522913, 115792089237316195423570985008687907853269984665640564039457582464243297466475)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18437962634473522913n); - input.add256(115792089237316195423570985008687907853269984665640564039457582464243297466475n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.max_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(115792089237316195423570985008687907853269984665640564039457582464243297466475n); - }); - - it('test operator "max" overload (euint64, euint256) => euint256 test 2 (18437962634473522909, 18437962634473522913)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18437962634473522909n); - input.add256(18437962634473522913n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.max_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(18437962634473522913n); - }); - - it('test operator "max" overload (euint64, euint256) => euint256 test 3 (18437962634473522913, 18437962634473522913)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18437962634473522913n); - input.add256(18437962634473522913n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.max_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(18437962634473522913n); - }); - - it('test operator "max" overload (euint64, euint256) => euint256 test 4 (18437962634473522913, 18437962634473522909)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18437962634473522913n); - input.add256(18437962634473522909n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.max_euint64_euint256( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt256(await this.contract7.res256()); - expect(res).to.equal(18437962634473522913n); - }); - - it('test operator "add" overload (euint64, uint64) => euint64 test 1 (9222005500490563257, 9221821229831123671)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(9222005500490563257n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_uint64( - encryptedAmount.handles[0], - 9221821229831123671n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18443826730321686928n); - }); - - it('test operator "add" overload (euint64, uint64) => euint64 test 2 (9222005500490563255, 9222005500490563257)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(9222005500490563255n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_uint64( - encryptedAmount.handles[0], - 9222005500490563257n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18444011000981126512n); - }); - - it('test operator "add" overload (euint64, uint64) => euint64 test 3 (9222005500490563257, 9222005500490563257)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(9222005500490563257n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_uint64( - encryptedAmount.handles[0], - 9222005500490563257n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18444011000981126514n); - }); - - it('test operator "add" overload (euint64, uint64) => euint64 test 4 (9222005500490563257, 9222005500490563255)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(9222005500490563257n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_euint64_uint64( - encryptedAmount.handles[0], - 9222005500490563255n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18444011000981126512n); - }); - - it('test operator "add" overload (uint64, euint64) => euint64 test 1 (9221960957990697049, 9221821229831123671)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(9221821229831123671n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_uint64_euint64( - 9221960957990697049n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18443782187821820720n); - }); - - it('test operator "add" overload (uint64, euint64) => euint64 test 2 (9222005500490563255, 9222005500490563257)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(9222005500490563257n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_uint64_euint64( - 9222005500490563255n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18444011000981126512n); - }); - - it('test operator "add" overload (uint64, euint64) => euint64 test 3 (9222005500490563257, 9222005500490563257)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(9222005500490563257n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_uint64_euint64( - 9222005500490563257n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18444011000981126514n); - }); - - it('test operator "add" overload (uint64, euint64) => euint64 test 4 (9222005500490563257, 9222005500490563255)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(9222005500490563255n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.add_uint64_euint64( - 9222005500490563257n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18444011000981126512n); - }); - - it('test operator "sub" overload (euint64, uint64) => euint64 test 1 (18440691834306324731, 18440691834306324731)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440691834306324731n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.sub_euint64_uint64( - encryptedAmount.handles[0], - 18440691834306324731n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint64, uint64) => euint64 test 2 (18440691834306324731, 18440691834306324727)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440691834306324731n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.sub_euint64_uint64( - encryptedAmount.handles[0], - 18440691834306324727n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "sub" overload (uint64, euint64) => euint64 test 1 (18440691834306324731, 18440691834306324731)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18440691834306324731n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.sub_uint64_euint64( - 18440691834306324731n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (uint64, euint64) => euint64 test 2 (18440691834306324731, 18440691834306324727)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18440691834306324727n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.sub_uint64_euint64( - 18440691834306324731n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint64, uint64) => euint64 test 1 (4294482875, 4294108167)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(4294482875n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_uint64( - encryptedAmount.handles[0], - 4294108167n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18440973986579140125n); - }); - - it('test operator "mul" overload (euint64, uint64) => euint64 test 2 (4294482875, 4294482875)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(4294482875n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_uint64( - encryptedAmount.handles[0], - 4294482875n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18442583163668265625n); - }); - - it('test operator "mul" overload (euint64, uint64) => euint64 test 3 (4294482875, 4294482875)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(4294482875n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_uint64( - encryptedAmount.handles[0], - 4294482875n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18442583163668265625n); - }); - - it('test operator "mul" overload (euint64, uint64) => euint64 test 4 (4294482875, 4294482875)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(4294482875n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_euint64_uint64( - encryptedAmount.handles[0], - 4294482875n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18442583163668265625n); - }); - - it('test operator "mul" overload (uint64, euint64) => euint64 test 1 (4293014414, 4294108167)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(4294108167n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_uint64_euint64( - 4293014414n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18434668256206119138n); - }); - - it('test operator "mul" overload (uint64, euint64) => euint64 test 2 (4294482875, 4294482875)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(4294482875n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_uint64_euint64( - 4294482875n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18442583163668265625n); - }); - - it('test operator "mul" overload (uint64, euint64) => euint64 test 3 (4294482875, 4294482875)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(4294482875n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_uint64_euint64( - 4294482875n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18442583163668265625n); - }); - - it('test operator "mul" overload (uint64, euint64) => euint64 test 4 (4294482875, 4294482875)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(4294482875n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.mul_uint64_euint64( - 4294482875n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18442583163668265625n); - }); - - it('test operator "div" overload (euint64, uint64) => euint64 test 1 (18444804438871636581, 18440669978814863107)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444804438871636581n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.div_euint64_uint64( - encryptedAmount.handles[0], - 18440669978814863107n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(1n); - }); - - it('test operator "div" overload (euint64, uint64) => euint64 test 2 (18444804438871636577, 18444804438871636581)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444804438871636577n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.div_euint64_uint64( - encryptedAmount.handles[0], - 18444804438871636581n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "div" overload (euint64, uint64) => euint64 test 3 (18444804438871636581, 18444804438871636581)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444804438871636581n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.div_euint64_uint64( - encryptedAmount.handles[0], - 18444804438871636581n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(1n); - }); - - it('test operator "div" overload (euint64, uint64) => euint64 test 4 (18444804438871636581, 18444804438871636577)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444804438871636581n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.div_euint64_uint64( - encryptedAmount.handles[0], - 18444804438871636577n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(1n); - }); - - it('test operator "rem" overload (euint64, uint64) => euint64 test 1 (18446008186519174615, 18445049964172995155)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18446008186519174615n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.rem_euint64_uint64( - encryptedAmount.handles[0], - 18445049964172995155n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(958222346179460n); - }); - - it('test operator "rem" overload (euint64, uint64) => euint64 test 2 (18443920463081385689, 18443920463081385693)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443920463081385689n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.rem_euint64_uint64( - encryptedAmount.handles[0], - 18443920463081385693n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18443920463081385689n); - }); - - it('test operator "rem" overload (euint64, uint64) => euint64 test 3 (18443920463081385693, 18443920463081385693)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443920463081385693n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.rem_euint64_uint64( - encryptedAmount.handles[0], - 18443920463081385693n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "rem" overload (euint64, uint64) => euint64 test 4 (18443920463081385693, 18443920463081385689)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443920463081385693n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.rem_euint64_uint64( - encryptedAmount.handles[0], - 18443920463081385689n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "and" overload (euint64, uint64) => euint64 test 1 (18444124970074897317, 18444452212053822561)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444124970074897317n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_uint64( - encryptedAmount.handles[0], - 18444452212053822561n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18444089373216524321n); - }); - - it('test operator "and" overload (euint64, uint64) => euint64 test 2 (18442657213736743283, 18442657213736743287)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18442657213736743283n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_uint64( - encryptedAmount.handles[0], - 18442657213736743287n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18442657213736743283n); - }); - - it('test operator "and" overload (euint64, uint64) => euint64 test 3 (18442657213736743287, 18442657213736743287)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18442657213736743287n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_uint64( - encryptedAmount.handles[0], - 18442657213736743287n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18442657213736743287n); - }); - - it('test operator "and" overload (euint64, uint64) => euint64 test 4 (18442657213736743287, 18442657213736743283)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18442657213736743287n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_euint64_uint64( - encryptedAmount.handles[0], - 18442657213736743283n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18442657213736743283n); - }); - - it('test operator "and" overload (uint64, euint64) => euint64 test 1 (18445812436048048525, 18444452212053822561)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18444452212053822561n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_uint64_euint64( - 18445812436048048525n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18443525253958221825n); - }); - - it('test operator "and" overload (uint64, euint64) => euint64 test 2 (18442657213736743283, 18442657213736743287)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18442657213736743287n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_uint64_euint64( - 18442657213736743283n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18442657213736743283n); - }); - - it('test operator "and" overload (uint64, euint64) => euint64 test 3 (18442657213736743287, 18442657213736743287)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18442657213736743287n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_uint64_euint64( - 18442657213736743287n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18442657213736743287n); - }); - - it('test operator "and" overload (uint64, euint64) => euint64 test 4 (18442657213736743287, 18442657213736743283)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18442657213736743283n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.and_uint64_euint64( - 18442657213736743287n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18442657213736743283n); - }); - - it('test operator "or" overload (euint64, uint64) => euint64 test 1 (18445851190683093315, 18441158928097514419)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18445851190683093315n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_uint64( - encryptedAmount.handles[0], - 18441158928097514419n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18445895250664217587n); - }); - - it('test operator "or" overload (euint64, uint64) => euint64 test 2 (18440297605680046449, 18440297605680046453)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440297605680046449n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_uint64( - encryptedAmount.handles[0], - 18440297605680046453n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18440297605680046453n); - }); - - it('test operator "or" overload (euint64, uint64) => euint64 test 3 (18440297605680046453, 18440297605680046453)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440297605680046453n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_uint64( - encryptedAmount.handles[0], - 18440297605680046453n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18440297605680046453n); - }); - - it('test operator "or" overload (euint64, uint64) => euint64 test 4 (18440297605680046453, 18440297605680046449)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18440297605680046453n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_euint64_uint64( - encryptedAmount.handles[0], - 18440297605680046449n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18440297605680046453n); - }); - - it('test operator "or" overload (uint64, euint64) => euint64 test 1 (18444816838000851275, 18441158928097514419)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18441158928097514419n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_uint64_euint64( - 18444816838000851275n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18445951836858858491n); - }); - - it('test operator "or" overload (uint64, euint64) => euint64 test 2 (18440297605680046449, 18440297605680046453)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18440297605680046453n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_uint64_euint64( - 18440297605680046449n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18440297605680046453n); - }); - - it('test operator "or" overload (uint64, euint64) => euint64 test 3 (18440297605680046453, 18440297605680046453)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18440297605680046453n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_uint64_euint64( - 18440297605680046453n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18440297605680046453n); - }); - - it('test operator "or" overload (uint64, euint64) => euint64 test 4 (18440297605680046453, 18440297605680046449)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18440297605680046449n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.or_uint64_euint64( - 18440297605680046453n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(18440297605680046453n); - }); - - it('test operator "xor" overload (euint64, uint64) => euint64 test 1 (18439520894560746701, 18445914762272407037)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18439520894560746701n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_uint64( - encryptedAmount.handles[0], - 18445914762272407037n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(7700087946789168n); - }); - - it('test operator "xor" overload (euint64, uint64) => euint64 test 2 (18439520894560746697, 18439520894560746701)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18439520894560746697n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_uint64( - encryptedAmount.handles[0], - 18439520894560746701n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint64, uint64) => euint64 test 3 (18439520894560746701, 18439520894560746701)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18439520894560746701n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_uint64( - encryptedAmount.handles[0], - 18439520894560746701n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint64, uint64) => euint64 test 4 (18439520894560746701, 18439520894560746697)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18439520894560746701n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_euint64_uint64( - encryptedAmount.handles[0], - 18439520894560746697n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (uint64, euint64) => euint64 test 1 (18446426713533628951, 18445914762272407037)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18445914762272407037n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_uint64_euint64( - 18446426713533628951n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(1076293857951722n); - }); - - it('test operator "xor" overload (uint64, euint64) => euint64 test 2 (18439520894560746697, 18439520894560746701)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18439520894560746701n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_uint64_euint64( - 18439520894560746697n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (uint64, euint64) => euint64 test 3 (18439520894560746701, 18439520894560746701)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18439520894560746701n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_uint64_euint64( - 18439520894560746701n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (uint64, euint64) => euint64 test 4 (18439520894560746701, 18439520894560746697)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18439520894560746697n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.xor_uint64_euint64( - 18439520894560746701n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract7.res64()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint64, uint64) => ebool test 1 (18443282870504090991, 18439130415590833625)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443282870504090991n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_uint64( - encryptedAmount.handles[0], - 18439130415590833625n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint64, uint64) => ebool test 2 (18443282870504090987, 18443282870504090991)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443282870504090987n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_uint64( - encryptedAmount.handles[0], - 18443282870504090991n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint64, uint64) => ebool test 3 (18443282870504090991, 18443282870504090991)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443282870504090991n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_uint64( - encryptedAmount.handles[0], - 18443282870504090991n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint64, uint64) => ebool test 4 (18443282870504090991, 18443282870504090987)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18443282870504090991n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_euint64_uint64( - encryptedAmount.handles[0], - 18443282870504090987n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint64, euint64) => ebool test 1 (18442875587397628573, 18439130415590833625)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18439130415590833625n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_uint64_euint64( - 18442875587397628573n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint64, euint64) => ebool test 2 (18443282870504090987, 18443282870504090991)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18443282870504090991n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_uint64_euint64( - 18443282870504090987n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (uint64, euint64) => ebool test 3 (18443282870504090991, 18443282870504090991)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18443282870504090991n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_uint64_euint64( - 18443282870504090991n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (uint64, euint64) => ebool test 4 (18443282870504090991, 18443282870504090987)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18443282870504090987n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.eq_uint64_euint64( - 18443282870504090991n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint64, uint64) => ebool test 1 (18445289136242885897, 18440743017590143725)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18445289136242885897n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_uint64( - encryptedAmount.handles[0], - 18440743017590143725n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint64, uint64) => ebool test 2 (18441860560804132291, 18441860560804132295)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18441860560804132291n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_uint64( - encryptedAmount.handles[0], - 18441860560804132295n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint64, uint64) => ebool test 3 (18441860560804132295, 18441860560804132295)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18441860560804132295n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_uint64( - encryptedAmount.handles[0], - 18441860560804132295n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint64, uint64) => ebool test 4 (18441860560804132295, 18441860560804132291)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18441860560804132295n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_euint64_uint64( - encryptedAmount.handles[0], - 18441860560804132291n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint64, euint64) => ebool test 1 (18442171622930650065, 18440743017590143725)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18440743017590143725n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_uint64_euint64( - 18442171622930650065n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint64, euint64) => ebool test 2 (18441860560804132291, 18441860560804132295)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18441860560804132295n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_uint64_euint64( - 18441860560804132291n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (uint64, euint64) => ebool test 3 (18441860560804132295, 18441860560804132295)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18441860560804132295n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_uint64_euint64( - 18441860560804132295n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (uint64, euint64) => ebool test 4 (18441860560804132295, 18441860560804132291)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18441860560804132291n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ne_uint64_euint64( - 18441860560804132295n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, uint64) => ebool test 1 (18444613618003912273, 18444784193665775113)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18444613618003912273n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_uint64( - encryptedAmount.handles[0], - 18444784193665775113n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint64, uint64) => ebool test 2 (18441817383047397969, 18441817383047397973)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18441817383047397969n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_uint64( - encryptedAmount.handles[0], - 18441817383047397973n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint64, uint64) => ebool test 3 (18441817383047397973, 18441817383047397973)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18441817383047397973n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_uint64( - encryptedAmount.handles[0], - 18441817383047397973n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint64, uint64) => ebool test 4 (18441817383047397973, 18441817383047397969)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - input.add64(18441817383047397973n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_euint64_uint64( - encryptedAmount.handles[0], - 18441817383047397969n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (uint64, euint64) => ebool test 1 (18439321097396363619, 18444784193665775113)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18444784193665775113n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_uint64_euint64( - 18439321097396363619n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (uint64, euint64) => ebool test 2 (18441817383047397969, 18441817383047397973)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18441817383047397973n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_uint64_euint64( - 18441817383047397969n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (uint64, euint64) => ebool test 3 (18441817383047397973, 18441817383047397973)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18441817383047397973n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_uint64_euint64( - 18441817383047397973n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (uint64, euint64) => ebool test 4 (18441817383047397973, 18441817383047397969)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract7Address, this.signers.alice.address); - - input.add64(18441817383047397969n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract7.ge_uint64_euint64( - 18441817383047397973n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract7.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint64, uint64) => ebool test 1 (18444129545450155179, 18441052996137337147)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add64(18444129545450155179n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint64_uint64( - encryptedAmount.handles[0], - 18441052996137337147n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint64, uint64) => ebool test 2 (18438304556640407457, 18438304556640407461)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add64(18438304556640407457n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint64_uint64( - encryptedAmount.handles[0], - 18438304556640407461n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint64, uint64) => ebool test 3 (18438304556640407461, 18438304556640407461)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add64(18438304556640407461n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint64_uint64( - encryptedAmount.handles[0], - 18438304556640407461n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint64, uint64) => ebool test 4 (18438304556640407461, 18438304556640407457)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add64(18438304556640407461n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint64_uint64( - encryptedAmount.handles[0], - 18438304556640407457n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (uint64, euint64) => ebool test 1 (18440314139404889003, 18441052996137337147)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - - input.add64(18441052996137337147n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_uint64_euint64( - 18440314139404889003n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (uint64, euint64) => ebool test 2 (18438304556640407457, 18438304556640407461)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - - input.add64(18438304556640407461n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_uint64_euint64( - 18438304556640407457n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (uint64, euint64) => ebool test 3 (18438304556640407461, 18438304556640407461)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - - input.add64(18438304556640407461n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_uint64_euint64( - 18438304556640407461n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (uint64, euint64) => ebool test 4 (18438304556640407461, 18438304556640407457)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - - input.add64(18438304556640407457n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_uint64_euint64( - 18438304556640407461n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, uint64) => ebool test 1 (18440402951089431437, 18443808705297812893)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add64(18440402951089431437n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint64_uint64( - encryptedAmount.handles[0], - 18443808705297812893n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, uint64) => ebool test 2 (18440402951089431433, 18440402951089431437)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add64(18440402951089431433n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint64_uint64( - encryptedAmount.handles[0], - 18440402951089431437n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, uint64) => ebool test 3 (18440402951089431437, 18440402951089431437)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add64(18440402951089431437n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint64_uint64( - encryptedAmount.handles[0], - 18440402951089431437n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint64, uint64) => ebool test 4 (18440402951089431437, 18440402951089431433)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add64(18440402951089431437n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint64_uint64( - encryptedAmount.handles[0], - 18440402951089431433n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (uint64, euint64) => ebool test 1 (18443941229431137849, 18443808705297812893)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - - input.add64(18443808705297812893n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_uint64_euint64( - 18443941229431137849n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (uint64, euint64) => ebool test 2 (18440402951089431433, 18440402951089431437)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - - input.add64(18440402951089431437n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_uint64_euint64( - 18440402951089431433n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (uint64, euint64) => ebool test 3 (18440402951089431437, 18440402951089431437)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - - input.add64(18440402951089431437n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_uint64_euint64( - 18440402951089431437n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (uint64, euint64) => ebool test 4 (18440402951089431437, 18440402951089431433)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - - input.add64(18440402951089431433n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_uint64_euint64( - 18440402951089431437n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, uint64) => ebool test 1 (18443308354694945505, 18438426856220799235)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add64(18443308354694945505n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint64_uint64( - encryptedAmount.handles[0], - 18438426856220799235n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, uint64) => ebool test 2 (18438494040818835501, 18438494040818835505)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add64(18438494040818835501n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint64_uint64( - encryptedAmount.handles[0], - 18438494040818835505n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint64, uint64) => ebool test 3 (18438494040818835505, 18438494040818835505)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add64(18438494040818835505n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint64_uint64( - encryptedAmount.handles[0], - 18438494040818835505n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint64, uint64) => ebool test 4 (18438494040818835505, 18438494040818835501)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add64(18438494040818835505n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint64_uint64( - encryptedAmount.handles[0], - 18438494040818835501n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (uint64, euint64) => ebool test 1 (18444682732892858227, 18438426856220799235)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - - input.add64(18438426856220799235n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_uint64_euint64( - 18444682732892858227n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (uint64, euint64) => ebool test 2 (18438494040818835501, 18438494040818835505)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - - input.add64(18438494040818835505n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_uint64_euint64( - 18438494040818835501n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (uint64, euint64) => ebool test 3 (18438494040818835505, 18438494040818835505)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - - input.add64(18438494040818835505n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_uint64_euint64( - 18438494040818835505n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (uint64, euint64) => ebool test 4 (18438494040818835505, 18438494040818835501)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - - input.add64(18438494040818835501n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_uint64_euint64( - 18438494040818835505n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint64, uint64) => euint64 test 1 (18438422972288340001, 18439986643027034037)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add64(18438422972288340001n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint64_uint64( - encryptedAmount.handles[0], - 18439986643027034037n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract8.res64()); - expect(res).to.equal(18438422972288340001n); - }); - - it('test operator "min" overload (euint64, uint64) => euint64 test 2 (18438422972288339997, 18438422972288340001)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add64(18438422972288339997n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint64_uint64( - encryptedAmount.handles[0], - 18438422972288340001n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract8.res64()); - expect(res).to.equal(18438422972288339997n); - }); - - it('test operator "min" overload (euint64, uint64) => euint64 test 3 (18438422972288340001, 18438422972288340001)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add64(18438422972288340001n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint64_uint64( - encryptedAmount.handles[0], - 18438422972288340001n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract8.res64()); - expect(res).to.equal(18438422972288340001n); - }); - - it('test operator "min" overload (euint64, uint64) => euint64 test 4 (18438422972288340001, 18438422972288339997)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add64(18438422972288340001n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint64_uint64( - encryptedAmount.handles[0], - 18438422972288339997n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract8.res64()); - expect(res).to.equal(18438422972288339997n); - }); - - it('test operator "min" overload (uint64, euint64) => euint64 test 1 (18443338893508802671, 18439986643027034037)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - - input.add64(18439986643027034037n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_uint64_euint64( - 18443338893508802671n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract8.res64()); - expect(res).to.equal(18439986643027034037n); - }); - - it('test operator "min" overload (uint64, euint64) => euint64 test 2 (18438422972288339997, 18438422972288340001)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - - input.add64(18438422972288340001n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_uint64_euint64( - 18438422972288339997n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract8.res64()); - expect(res).to.equal(18438422972288339997n); - }); - - it('test operator "min" overload (uint64, euint64) => euint64 test 3 (18438422972288340001, 18438422972288340001)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - - input.add64(18438422972288340001n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_uint64_euint64( - 18438422972288340001n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract8.res64()); - expect(res).to.equal(18438422972288340001n); - }); - - it('test operator "min" overload (uint64, euint64) => euint64 test 4 (18438422972288340001, 18438422972288339997)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - - input.add64(18438422972288339997n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_uint64_euint64( - 18438422972288340001n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract8.res64()); - expect(res).to.equal(18438422972288339997n); - }); - - it('test operator "max" overload (euint64, uint64) => euint64 test 1 (18445852065991763771, 18440623444591001569)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add64(18445852065991763771n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint64_uint64( - encryptedAmount.handles[0], - 18440623444591001569n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract8.res64()); - expect(res).to.equal(18445852065991763771n); - }); - - it('test operator "max" overload (euint64, uint64) => euint64 test 2 (18440937538047974889, 18440937538047974893)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add64(18440937538047974889n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint64_uint64( - encryptedAmount.handles[0], - 18440937538047974893n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract8.res64()); - expect(res).to.equal(18440937538047974893n); - }); - - it('test operator "max" overload (euint64, uint64) => euint64 test 3 (18440937538047974893, 18440937538047974893)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add64(18440937538047974893n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint64_uint64( - encryptedAmount.handles[0], - 18440937538047974893n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract8.res64()); - expect(res).to.equal(18440937538047974893n); - }); - - it('test operator "max" overload (euint64, uint64) => euint64 test 4 (18440937538047974893, 18440937538047974889)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add64(18440937538047974893n); - - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint64_uint64( - encryptedAmount.handles[0], - 18440937538047974889n, - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract8.res64()); - expect(res).to.equal(18440937538047974893n); - }); - - it('test operator "max" overload (uint64, euint64) => euint64 test 1 (18444013465281910433, 18440623444591001569)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - - input.add64(18440623444591001569n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_uint64_euint64( - 18444013465281910433n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract8.res64()); - expect(res).to.equal(18444013465281910433n); - }); - - it('test operator "max" overload (uint64, euint64) => euint64 test 2 (18440937538047974889, 18440937538047974893)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - - input.add64(18440937538047974893n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_uint64_euint64( - 18440937538047974889n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract8.res64()); - expect(res).to.equal(18440937538047974893n); - }); - - it('test operator "max" overload (uint64, euint64) => euint64 test 3 (18440937538047974893, 18440937538047974893)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - - input.add64(18440937538047974893n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_uint64_euint64( - 18440937538047974893n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract8.res64()); - expect(res).to.equal(18440937538047974893n); - }); - - it('test operator "max" overload (uint64, euint64) => euint64 test 4 (18440937538047974893, 18440937538047974889)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - - input.add64(18440937538047974889n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_uint64_euint64( - 18440937538047974893n, - encryptedAmount.handles[0], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt64(await this.contract8.res64()); - expect(res).to.equal(18440937538047974893n); - }); -}); diff --git a/contracts/test/tfheOperations/tfheOperations9.ts b/contracts/test/tfheOperations/tfheOperations9.ts deleted file mode 100644 index 4ab60160..00000000 --- a/contracts/test/tfheOperations/tfheOperations9.ts +++ /dev/null @@ -1,4821 +0,0 @@ -import { expect } from 'chai'; -import { ethers } from 'hardhat'; - -import type { TFHETestSuite1 } from '../../types/contracts/tests/TFHETestSuite1'; -import type { TFHETestSuite2 } from '../../types/contracts/tests/TFHETestSuite2'; -import type { TFHETestSuite3 } from '../../types/contracts/tests/TFHETestSuite3'; -import type { TFHETestSuite4 } from '../../types/contracts/tests/TFHETestSuite4'; -import type { TFHETestSuite5 } from '../../types/contracts/tests/TFHETestSuite5'; -import type { TFHETestSuite6 } from '../../types/contracts/tests/TFHETestSuite6'; -import type { TFHETestSuite7 } from '../../types/contracts/tests/TFHETestSuite7'; -import type { TFHETestSuite8 } from '../../types/contracts/tests/TFHETestSuite8'; -import type { TFHETestSuite9 } from '../../types/contracts/tests/TFHETestSuite9'; -import type { TFHETestSuite10 } from '../../types/contracts/tests/TFHETestSuite10'; -import type { TFHETestSuite11 } from '../../types/contracts/tests/TFHETestSuite11'; -import { - createInstances, - decrypt4, - decrypt8, - decrypt16, - decrypt32, - decrypt64, - decrypt128, - decrypt256, - decryptBool, -} from '../instance'; -import { getSigners, initSigners } from '../signers'; - -async function deployTfheTestFixture1(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite1'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture2(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite2'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture3(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite3'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture4(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite4'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture5(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite5'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture6(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite6'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture7(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite7'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture8(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite8'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture9(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite9'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture10(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite10'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -async function deployTfheTestFixture11(): Promise { - const signers = await getSigners(); - const admin = signers.alice; - - const contractFactory = await ethers.getContractFactory('TFHETestSuite11'); - const contract = await contractFactory.connect(admin).deploy(); - await contract.waitForDeployment(); - - return contract; -} - -describe('TFHE operations 9', function () { - before(async function () { - await initSigners(1); - this.signers = await getSigners(); - - const contract1 = await deployTfheTestFixture1(); - this.contract1Address = await contract1.getAddress(); - this.contract1 = contract1; - - const contract2 = await deployTfheTestFixture2(); - this.contract2Address = await contract2.getAddress(); - this.contract2 = contract2; - - const contract3 = await deployTfheTestFixture3(); - this.contract3Address = await contract3.getAddress(); - this.contract3 = contract3; - - const contract4 = await deployTfheTestFixture4(); - this.contract4Address = await contract4.getAddress(); - this.contract4 = contract4; - - const contract5 = await deployTfheTestFixture5(); - this.contract5Address = await contract5.getAddress(); - this.contract5 = contract5; - - const contract6 = await deployTfheTestFixture6(); - this.contract6Address = await contract6.getAddress(); - this.contract6 = contract6; - - const contract7 = await deployTfheTestFixture7(); - this.contract7Address = await contract7.getAddress(); - this.contract7 = contract7; - - const contract8 = await deployTfheTestFixture8(); - this.contract8Address = await contract8.getAddress(); - this.contract8 = contract8; - - const contract9 = await deployTfheTestFixture9(); - this.contract9Address = await contract9.getAddress(); - this.contract9 = contract9; - - const contract10 = await deployTfheTestFixture10(); - this.contract10Address = await contract10.getAddress(); - this.contract10 = contract10; - - const contract11 = await deployTfheTestFixture11(); - this.contract11Address = await contract11.getAddress(); - this.contract11 = contract11; - - const instances = await createInstances(this.signers); - this.instances = instances; - }); - - it('test operator "add" overload (euint128, euint4) => euint128 test 1 (9, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(9n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(11n); - }); - - it('test operator "add" overload (euint128, euint4) => euint128 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(12n); - }); - - it('test operator "add" overload (euint128, euint4) => euint128 test 3 (5, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(5n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(10n); - }); - - it('test operator "add" overload (euint128, euint4) => euint128 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(12n); - }); - - it('test operator "sub" overload (euint128, euint4) => euint128 test 1 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.sub_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint128, euint4) => euint128 test 2 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.sub_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint128, euint4) => euint128 test 1 (5, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(5n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(10n); - }); - - it('test operator "mul" overload (euint128, euint4) => euint128 test 2 (3, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(3n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(12n); - }); - - it('test operator "mul" overload (euint128, euint4) => euint128 test 3 (3, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(3n); - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(9n); - }); - - it('test operator "mul" overload (euint128, euint4) => euint128 test 4 (4, 3)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(4n); - input.add4(3n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(12n); - }); - - it('test operator "and" overload (euint128, euint4) => euint128 test 1 (340282366920938463463372547368360839357, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463372547368360839357n); - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(8n); - }); - - it('test operator "and" overload (euint128, euint4) => euint128 test 2 (6, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(6n); - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(2n); - }); - - it('test operator "and" overload (euint128, euint4) => euint128 test 3 (10, 10)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(10n); - input.add4(10n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(10n); - }); - - it('test operator "and" overload (euint128, euint4) => euint128 test 4 (10, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(10n); - input.add4(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(2n); - }); - - it('test operator "or" overload (euint128, euint4) => euint128 test 1 (340282366920938463463366694641055128577, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463366694641055128577n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463366694641055128589n); - }); - - it('test operator "or" overload (euint128, euint4) => euint128 test 2 (8, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(8n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(12n); - }); - - it('test operator "or" overload (euint128, euint4) => euint128 test 3 (12, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(12n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(12n); - }); - - it('test operator "or" overload (euint128, euint4) => euint128 test 4 (12, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(12n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint128, euint4) => euint128 test 1 (340282366920938463463370996799476031467, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463370996799476031467n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463370996799476031462n); - }); - - it('test operator "xor" overload (euint128, euint4) => euint128 test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(9n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint128, euint4) => euint128 test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(13n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint128, euint4) => euint128 test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(13n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint128, euint4) => ebool test 1 (340282366920938463463369794780094019941, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463369794780094019941n); - input.add4(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint128, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint128, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint128, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint128, euint4) => ebool test 1 (340282366920938463463371595006609590711, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463371595006609590711n); - input.add4(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint128, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint128, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint128, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, euint4) => ebool test 1 (340282366920938463463366351520407667333, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463366351520407667333n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, euint4) => ebool test 2 (8, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(8n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint128, euint4) => ebool test 3 (12, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(12n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, euint4) => ebool test 4 (12, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(12n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint128, euint4) => ebool test 1 (340282366920938463463367426041495203879, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463367426041495203879n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint128, euint4) => ebool test 2 (9, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(9n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint128, euint4) => ebool test 3 (13, 13)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(13n); - input.add4(13n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint128, euint4) => ebool test 4 (13, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(13n); - input.add4(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint4) => ebool test 1 (340282366920938463463373221658110991435, 1)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463373221658110991435n); - input.add4(1n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint128, euint4) => ebool test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint4) => ebool test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint4) => ebool test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, euint4) => ebool test 1 (340282366920938463463368530671945258801, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463368530671945258801n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, euint4) => ebool test 2 (8, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(8n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint128, euint4) => ebool test 3 (12, 12)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(12n); - input.add4(12n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, euint4) => ebool test 4 (12, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(12n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint128, euint4) => euint128 test 1 (340282366920938463463373617043976262819, 6)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463373617043976262819n); - input.add4(6n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(6n); - }); - - it('test operator "min" overload (euint128, euint4) => euint128 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "min" overload (euint128, euint4) => euint128 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(8n); - }); - - it('test operator "min" overload (euint128, euint4) => euint128 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "max" overload (euint128, euint4) => euint128 test 1 (340282366920938463463368883145053125641, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463368883145053125641n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463368883145053125641n); - }); - - it('test operator "max" overload (euint128, euint4) => euint128 test 2 (4, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(4n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(8n); - }); - - it('test operator "max" overload (euint128, euint4) => euint128 test 3 (8, 8)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(8n); - input.add4(8n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(8n); - }); - - it('test operator "max" overload (euint128, euint4) => euint128 test 4 (8, 4)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(8n); - input.add4(4n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint128_euint4( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(8n); - }); - - it('test operator "add" overload (euint128, euint8) => euint128 test 1 (129, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(129n); - input.add8(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(131n); - }); - - it('test operator "add" overload (euint128, euint8) => euint128 test 2 (118, 120)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(118n); - input.add8(120n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(238n); - }); - - it('test operator "add" overload (euint128, euint8) => euint128 test 3 (120, 120)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(120n); - input.add8(120n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(240n); - }); - - it('test operator "add" overload (euint128, euint8) => euint128 test 4 (120, 118)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(120n); - input.add8(118n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(238n); - }); - - it('test operator "sub" overload (euint128, euint8) => euint128 test 1 (232, 232)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(232n); - input.add8(232n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.sub_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint128, euint8) => euint128 test 2 (232, 228)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(232n); - input.add8(228n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.sub_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint128, euint8) => euint128 test 1 (65, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(65n); - input.add8(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(130n); - }); - - it('test operator "mul" overload (euint128, euint8) => euint128 test 2 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(9n); - input.add8(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(81n); - }); - - it('test operator "mul" overload (euint128, euint8) => euint128 test 3 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(9n); - input.add8(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(81n); - }); - - it('test operator "mul" overload (euint128, euint8) => euint128 test 4 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(9n); - input.add8(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(81n); - }); - - it('test operator "and" overload (euint128, euint8) => euint128 test 1 (340282366920938463463366313789187731763, 114)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463366313789187731763n); - input.add8(114n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(50n); - }); - - it('test operator "and" overload (euint128, euint8) => euint128 test 2 (110, 114)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(110n); - input.add8(114n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(98n); - }); - - it('test operator "and" overload (euint128, euint8) => euint128 test 3 (114, 114)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(114n); - input.add8(114n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(114n); - }); - - it('test operator "and" overload (euint128, euint8) => euint128 test 4 (114, 110)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(114n); - input.add8(110n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(98n); - }); - - it('test operator "or" overload (euint128, euint8) => euint128 test 1 (340282366920938463463374227521343598445, 112)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463374227521343598445n); - input.add8(112n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463374227521343598461n); - }); - - it('test operator "or" overload (euint128, euint8) => euint128 test 2 (108, 112)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(108n); - input.add8(112n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(124n); - }); - - it('test operator "or" overload (euint128, euint8) => euint128 test 3 (112, 112)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(112n); - input.add8(112n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(112n); - }); - - it('test operator "or" overload (euint128, euint8) => euint128 test 4 (112, 108)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(112n); - input.add8(108n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(124n); - }); - - it('test operator "xor" overload (euint128, euint8) => euint128 test 1 (340282366920938463463373857001835170765, 82)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463373857001835170765n); - input.add8(82n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463373857001835170719n); - }); - - it('test operator "xor" overload (euint128, euint8) => euint128 test 2 (78, 82)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(78n); - input.add8(82n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(28n); - }); - - it('test operator "xor" overload (euint128, euint8) => euint128 test 3 (82, 82)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(82n); - input.add8(82n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint128, euint8) => euint128 test 4 (82, 78)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(82n); - input.add8(78n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(28n); - }); - - it('test operator "eq" overload (euint128, euint8) => ebool test 1 (340282366920938463463368012116669397375, 111)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463368012116669397375n); - input.add8(111n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint128, euint8) => ebool test 2 (107, 111)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(107n); - input.add8(111n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint128, euint8) => ebool test 3 (111, 111)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(111n); - input.add8(111n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint128, euint8) => ebool test 4 (111, 107)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(111n); - input.add8(107n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint128, euint8) => ebool test 1 (340282366920938463463374264796523764465, 244)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463374264796523764465n); - input.add8(244n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint128, euint8) => ebool test 2 (240, 244)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(240n); - input.add8(244n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint128, euint8) => ebool test 3 (244, 244)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(244n); - input.add8(244n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint128, euint8) => ebool test 4 (244, 240)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(244n); - input.add8(240n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, euint8) => ebool test 1 (340282366920938463463365913686345200467, 55)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463365913686345200467n); - input.add8(55n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, euint8) => ebool test 2 (51, 55)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(51n); - input.add8(55n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint128, euint8) => ebool test 3 (55, 55)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(55n); - input.add8(55n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, euint8) => ebool test 4 (55, 51)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(55n); - input.add8(51n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint128, euint8) => ebool test 1 (340282366920938463463373004399886925283, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463373004399886925283n); - input.add8(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint128, euint8) => ebool test 2 (5, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(5n); - input.add8(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint128, euint8) => ebool test 3 (9, 9)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(9n); - input.add8(9n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint128, euint8) => ebool test 4 (9, 5)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(9n); - input.add8(5n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint8) => ebool test 1 (340282366920938463463373663014854424779, 48)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463373663014854424779n); - input.add8(48n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint128, euint8) => ebool test 2 (44, 48)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(44n); - input.add8(48n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint8) => ebool test 3 (48, 48)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(48n); - input.add8(48n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint8) => ebool test 4 (48, 44)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(48n); - input.add8(44n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, euint8) => ebool test 1 (340282366920938463463371295793146087759, 46)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463371295793146087759n); - input.add8(46n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, euint8) => ebool test 2 (42, 46)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(42n); - input.add8(46n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint128, euint8) => ebool test 3 (46, 46)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(46n); - input.add8(46n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, euint8) => ebool test 4 (46, 42)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(46n); - input.add8(42n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint128, euint8) => euint128 test 1 (340282366920938463463366071622027178861, 33)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463366071622027178861n); - input.add8(33n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(33n); - }); - - it('test operator "min" overload (euint128, euint8) => euint128 test 2 (29, 33)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(29n); - input.add8(33n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(29n); - }); - - it('test operator "min" overload (euint128, euint8) => euint128 test 3 (33, 33)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(33n); - input.add8(33n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(33n); - }); - - it('test operator "min" overload (euint128, euint8) => euint128 test 4 (33, 29)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(33n); - input.add8(29n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(29n); - }); - - it('test operator "max" overload (euint128, euint8) => euint128 test 1 (340282366920938463463369691386082749829, 49)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463369691386082749829n); - input.add8(49n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463369691386082749829n); - }); - - it('test operator "max" overload (euint128, euint8) => euint128 test 2 (45, 49)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(45n); - input.add8(49n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(49n); - }); - - it('test operator "max" overload (euint128, euint8) => euint128 test 3 (49, 49)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(49n); - input.add8(49n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(49n); - }); - - it('test operator "max" overload (euint128, euint8) => euint128 test 4 (49, 45)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(49n); - input.add8(45n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint128_euint8( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(49n); - }); - - it('test operator "add" overload (euint128, euint16) => euint128 test 1 (32769, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(32769n); - input.add16(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(32771n); - }); - - it('test operator "add" overload (euint128, euint16) => euint128 test 2 (31253, 31255)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(31253n); - input.add16(31255n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(62508n); - }); - - it('test operator "add" overload (euint128, euint16) => euint128 test 3 (31255, 31255)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(31255n); - input.add16(31255n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(62510n); - }); - - it('test operator "add" overload (euint128, euint16) => euint128 test 4 (31255, 31253)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(31255n); - input.add16(31253n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(62508n); - }); - - it('test operator "sub" overload (euint128, euint16) => euint128 test 1 (25392, 25392)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(25392n); - input.add16(25392n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.sub_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint128, euint16) => euint128 test 2 (25392, 25388)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(25392n); - input.add16(25388n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.sub_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint128, euint16) => euint128 test 1 (16385, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(16385n); - input.add16(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(32770n); - }); - - it('test operator "mul" overload (euint128, euint16) => euint128 test 2 (233, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(233n); - input.add16(233n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(54289n); - }); - - it('test operator "mul" overload (euint128, euint16) => euint128 test 3 (233, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(233n); - input.add16(233n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(54289n); - }); - - it('test operator "mul" overload (euint128, euint16) => euint128 test 4 (233, 233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(233n); - input.add16(233n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(54289n); - }); - - it('test operator "and" overload (euint128, euint16) => euint128 test 1 (340282366920938463463371274545487982339, 11460)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463371274545487982339n); - input.add16(11460n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(11264n); - }); - - it('test operator "and" overload (euint128, euint16) => euint128 test 2 (11456, 11460)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(11456n); - input.add16(11460n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(11456n); - }); - - it('test operator "and" overload (euint128, euint16) => euint128 test 3 (11460, 11460)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(11460n); - input.add16(11460n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(11460n); - }); - - it('test operator "and" overload (euint128, euint16) => euint128 test 4 (11460, 11456)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(11460n); - input.add16(11456n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(11456n); - }); - - it('test operator "or" overload (euint128, euint16) => euint128 test 1 (340282366920938463463366623321205018087, 7136)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463366623321205018087n); - input.add16(7136n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463366623321205022695n); - }); - - it('test operator "or" overload (euint128, euint16) => euint128 test 2 (7132, 7136)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(7132n); - input.add16(7136n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(7164n); - }); - - it('test operator "or" overload (euint128, euint16) => euint128 test 3 (7136, 7136)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(7136n); - input.add16(7136n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(7136n); - }); - - it('test operator "or" overload (euint128, euint16) => euint128 test 4 (7136, 7132)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(7136n); - input.add16(7132n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(7164n); - }); - - it('test operator "xor" overload (euint128, euint16) => euint128 test 1 (340282366920938463463371581047560381685, 64364)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463371581047560381685n); - input.add16(64364n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463371581047560363929n); - }); - - it('test operator "xor" overload (euint128, euint16) => euint128 test 2 (64360, 64364)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(64360n); - input.add16(64364n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint128, euint16) => euint128 test 3 (64364, 64364)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(64364n); - input.add16(64364n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint128, euint16) => euint128 test 4 (64364, 64360)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(64364n); - input.add16(64360n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint128, euint16) => ebool test 1 (340282366920938463463365947218770561253, 63555)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463365947218770561253n); - input.add16(63555n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint128, euint16) => ebool test 2 (63551, 63555)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(63551n); - input.add16(63555n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint128, euint16) => ebool test 3 (63555, 63555)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(63555n); - input.add16(63555n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint128, euint16) => ebool test 4 (63555, 63551)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(63555n); - input.add16(63551n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint128, euint16) => ebool test 1 (340282366920938463463370265865713339199, 54670)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463370265865713339199n); - input.add16(54670n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint128, euint16) => ebool test 2 (54666, 54670)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(54666n); - input.add16(54670n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint128, euint16) => ebool test 3 (54670, 54670)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(54670n); - input.add16(54670n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint128, euint16) => ebool test 4 (54670, 54666)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(54670n); - input.add16(54666n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, euint16) => ebool test 1 (340282366920938463463373250379836355353, 44459)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463373250379836355353n); - input.add16(44459n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, euint16) => ebool test 2 (44455, 44459)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(44455n); - input.add16(44459n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint128, euint16) => ebool test 3 (44459, 44459)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(44459n); - input.add16(44459n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, euint16) => ebool test 4 (44459, 44455)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(44459n); - input.add16(44455n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint128, euint16) => ebool test 1 (340282366920938463463368543313259159187, 51225)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463368543313259159187n); - input.add16(51225n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint128, euint16) => ebool test 2 (51221, 51225)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(51221n); - input.add16(51225n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint128, euint16) => ebool test 3 (51225, 51225)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(51225n); - input.add16(51225n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint128, euint16) => ebool test 4 (51225, 51221)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(51225n); - input.add16(51221n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint16) => ebool test 1 (340282366920938463463371412966556965647, 54237)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463371412966556965647n); - input.add16(54237n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint128, euint16) => ebool test 2 (54233, 54237)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(54233n); - input.add16(54237n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint16) => ebool test 3 (54237, 54237)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(54237n); - input.add16(54237n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint16) => ebool test 4 (54237, 54233)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(54237n); - input.add16(54233n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, euint16) => ebool test 1 (340282366920938463463374223690909641239, 37855)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463374223690909641239n); - input.add16(37855n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, euint16) => ebool test 2 (37851, 37855)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(37851n); - input.add16(37855n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint128, euint16) => ebool test 3 (37855, 37855)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(37855n); - input.add16(37855n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, euint16) => ebool test 4 (37855, 37851)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(37855n); - input.add16(37851n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint128, euint16) => euint128 test 1 (340282366920938463463368542801038101753, 9714)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463368542801038101753n); - input.add16(9714n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(9714n); - }); - - it('test operator "min" overload (euint128, euint16) => euint128 test 2 (9710, 9714)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(9710n); - input.add16(9714n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(9710n); - }); - - it('test operator "min" overload (euint128, euint16) => euint128 test 3 (9714, 9714)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(9714n); - input.add16(9714n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(9714n); - }); - - it('test operator "min" overload (euint128, euint16) => euint128 test 4 (9714, 9710)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(9714n); - input.add16(9710n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(9710n); - }); - - it('test operator "max" overload (euint128, euint16) => euint128 test 1 (340282366920938463463370317782456018271, 38332)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463370317782456018271n); - input.add16(38332n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463370317782456018271n); - }); - - it('test operator "max" overload (euint128, euint16) => euint128 test 2 (38328, 38332)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(38328n); - input.add16(38332n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(38332n); - }); - - it('test operator "max" overload (euint128, euint16) => euint128 test 3 (38332, 38332)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(38332n); - input.add16(38332n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(38332n); - }); - - it('test operator "max" overload (euint128, euint16) => euint128 test 4 (38332, 38328)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(38332n); - input.add16(38328n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint128_euint16( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(38332n); - }); - - it('test operator "add" overload (euint128, euint32) => euint128 test 1 (2147483649, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(2147483649n); - input.add32(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(2147483651n); - }); - - it('test operator "add" overload (euint128, euint32) => euint128 test 2 (417384794, 417384798)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(417384794n); - input.add32(417384798n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(834769592n); - }); - - it('test operator "add" overload (euint128, euint32) => euint128 test 3 (417384798, 417384798)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(417384798n); - input.add32(417384798n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(834769596n); - }); - - it('test operator "add" overload (euint128, euint32) => euint128 test 4 (417384798, 417384794)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(417384798n); - input.add32(417384794n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(834769592n); - }); - - it('test operator "sub" overload (euint128, euint32) => euint128 test 1 (373346389, 373346389)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(373346389n); - input.add32(373346389n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.sub_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint128, euint32) => euint128 test 2 (373346389, 373346385)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(373346389n); - input.add32(373346385n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.sub_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint128, euint32) => euint128 test 1 (1073741825, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(1073741825n); - input.add32(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(2147483650n); - }); - - it('test operator "mul" overload (euint128, euint32) => euint128 test 2 (46331, 46331)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(46331n); - input.add32(46331n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(2146561561n); - }); - - it('test operator "mul" overload (euint128, euint32) => euint128 test 3 (46331, 46331)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(46331n); - input.add32(46331n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(2146561561n); - }); - - it('test operator "mul" overload (euint128, euint32) => euint128 test 4 (46331, 46331)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(46331n); - input.add32(46331n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(2146561561n); - }); - - it('test operator "and" overload (euint128, euint32) => euint128 test 1 (340282366920938463463372796408614652419, 1038177724)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463372796408614652419n); - input.add32(1038177724n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(272629760n); - }); - - it('test operator "and" overload (euint128, euint32) => euint128 test 2 (1038177720, 1038177724)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(1038177720n); - input.add32(1038177724n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(1038177720n); - }); - - it('test operator "and" overload (euint128, euint32) => euint128 test 3 (1038177724, 1038177724)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(1038177724n); - input.add32(1038177724n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(1038177724n); - }); - - it('test operator "and" overload (euint128, euint32) => euint128 test 4 (1038177724, 1038177720)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(1038177724n); - input.add32(1038177720n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(1038177720n); - }); - - it('test operator "or" overload (euint128, euint32) => euint128 test 1 (340282366920938463463370714852003960045, 1823556556)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463370714852003960045n); - input.add32(1823556556n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463370714853213034477n); - }); - - it('test operator "or" overload (euint128, euint32) => euint128 test 2 (1823556552, 1823556556)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(1823556552n); - input.add32(1823556556n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(1823556556n); - }); - - it('test operator "or" overload (euint128, euint32) => euint128 test 3 (1823556556, 1823556556)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(1823556556n); - input.add32(1823556556n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(1823556556n); - }); - - it('test operator "or" overload (euint128, euint32) => euint128 test 4 (1823556556, 1823556552)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(1823556556n); - input.add32(1823556552n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(1823556556n); - }); - - it('test operator "xor" overload (euint128, euint32) => euint128 test 1 (340282366920938463463372336872535218607, 2309231003)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463372336872535218607n); - input.add32(2309231003n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463372336874538256436n); - }); - - it('test operator "xor" overload (euint128, euint32) => euint128 test 2 (2309230999, 2309231003)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(2309230999n); - input.add32(2309231003n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(12n); - }); - - it('test operator "xor" overload (euint128, euint32) => euint128 test 3 (2309231003, 2309231003)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(2309231003n); - input.add32(2309231003n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint128, euint32) => euint128 test 4 (2309231003, 2309230999)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(2309231003n); - input.add32(2309230999n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(12n); - }); - - it('test operator "eq" overload (euint128, euint32) => ebool test 1 (340282366920938463463365905779679562131, 1923235589)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463365905779679562131n); - input.add32(1923235589n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint128, euint32) => ebool test 2 (1923235585, 1923235589)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(1923235585n); - input.add32(1923235589n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint128, euint32) => ebool test 3 (1923235589, 1923235589)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(1923235589n); - input.add32(1923235589n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint128, euint32) => ebool test 4 (1923235589, 1923235585)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(1923235589n); - input.add32(1923235585n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint128, euint32) => ebool test 1 (340282366920938463463374155295872552931, 1145053382)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463374155295872552931n); - input.add32(1145053382n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint128, euint32) => ebool test 2 (1145053378, 1145053382)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(1145053378n); - input.add32(1145053382n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint128, euint32) => ebool test 3 (1145053382, 1145053382)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(1145053382n); - input.add32(1145053382n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint128, euint32) => ebool test 4 (1145053382, 1145053378)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(1145053382n); - input.add32(1145053378n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, euint32) => ebool test 1 (340282366920938463463370684518045415615, 2276077429)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463370684518045415615n); - input.add32(2276077429n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, euint32) => ebool test 2 (2276077425, 2276077429)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(2276077425n); - input.add32(2276077429n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint128, euint32) => ebool test 3 (2276077429, 2276077429)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(2276077429n); - input.add32(2276077429n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, euint32) => ebool test 4 (2276077429, 2276077425)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(2276077429n); - input.add32(2276077425n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint128, euint32) => ebool test 1 (340282366920938463463371084318415272059, 235874492)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463371084318415272059n); - input.add32(235874492n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint128, euint32) => ebool test 2 (235874488, 235874492)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(235874488n); - input.add32(235874492n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint128, euint32) => ebool test 3 (235874492, 235874492)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(235874492n); - input.add32(235874492n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint128, euint32) => ebool test 4 (235874492, 235874488)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(235874492n); - input.add32(235874488n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint32) => ebool test 1 (340282366920938463463372847665266392859, 623901814)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463372847665266392859n); - input.add32(623901814n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint128, euint32) => ebool test 2 (623901810, 623901814)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(623901810n); - input.add32(623901814n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint32) => ebool test 3 (623901814, 623901814)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(623901814n); - input.add32(623901814n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint32) => ebool test 4 (623901814, 623901810)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(623901814n); - input.add32(623901810n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, euint32) => ebool test 1 (340282366920938463463373212421821063067, 1708404829)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463373212421821063067n); - input.add32(1708404829n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, euint32) => ebool test 2 (1708404825, 1708404829)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(1708404825n); - input.add32(1708404829n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint128, euint32) => ebool test 3 (1708404829, 1708404829)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(1708404829n); - input.add32(1708404829n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, euint32) => ebool test 4 (1708404829, 1708404825)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(1708404829n); - input.add32(1708404825n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint128, euint32) => euint128 test 1 (340282366920938463463373948652081205153, 4076998775)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463373948652081205153n); - input.add32(4076998775n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(4076998775n); - }); - - it('test operator "min" overload (euint128, euint32) => euint128 test 2 (4076998771, 4076998775)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(4076998771n); - input.add32(4076998775n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(4076998771n); - }); - - it('test operator "min" overload (euint128, euint32) => euint128 test 3 (4076998775, 4076998775)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(4076998775n); - input.add32(4076998775n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(4076998775n); - }); - - it('test operator "min" overload (euint128, euint32) => euint128 test 4 (4076998775, 4076998771)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(4076998775n); - input.add32(4076998771n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(4076998771n); - }); - - it('test operator "max" overload (euint128, euint32) => euint128 test 1 (340282366920938463463374411933353920761, 2226263511)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463374411933353920761n); - input.add32(2226263511n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463374411933353920761n); - }); - - it('test operator "max" overload (euint128, euint32) => euint128 test 2 (2226263507, 2226263511)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(2226263507n); - input.add32(2226263511n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(2226263511n); - }); - - it('test operator "max" overload (euint128, euint32) => euint128 test 3 (2226263511, 2226263511)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(2226263511n); - input.add32(2226263511n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(2226263511n); - }); - - it('test operator "max" overload (euint128, euint32) => euint128 test 4 (2226263511, 2226263507)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(2226263511n); - input.add32(2226263507n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint128_euint32( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(2226263511n); - }); - - it('test operator "add" overload (euint128, euint64) => euint128 test 1 (9223372036854775809, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(9223372036854775809n); - input.add64(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(9223372036854775811n); - }); - - it('test operator "add" overload (euint128, euint64) => euint128 test 2 (9219789077213425563, 9219789077213425565)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(9219789077213425563n); - input.add64(9219789077213425565n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(18439578154426851128n); - }); - - it('test operator "add" overload (euint128, euint64) => euint128 test 3 (9219789077213425565, 9219789077213425565)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(9219789077213425565n); - input.add64(9219789077213425565n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(18439578154426851130n); - }); - - it('test operator "add" overload (euint128, euint64) => euint128 test 4 (9219789077213425565, 9219789077213425563)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(9219789077213425565n); - input.add64(9219789077213425563n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(18439578154426851128n); - }); - - it('test operator "sub" overload (euint128, euint64) => euint128 test 1 (18441111603467904997, 18441111603467904997)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18441111603467904997n); - input.add64(18441111603467904997n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.sub_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint128, euint64) => euint128 test 2 (18441111603467904997, 18441111603467904993)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18441111603467904997n); - input.add64(18441111603467904993n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.sub_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint128, euint64) => euint128 test 1 (4611686018427387905, 2)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(4611686018427387905n); - input.add64(2n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(9223372036854775810n); - }); - - it('test operator "mul" overload (euint128, euint64) => euint128 test 2 (4294304633, 4294304633)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(4294304633n); - input.add64(4294304633n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(18441052281005264689n); - }); - - it('test operator "mul" overload (euint128, euint64) => euint128 test 3 (4294304633, 4294304633)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(4294304633n); - input.add64(4294304633n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(18441052281005264689n); - }); - - it('test operator "mul" overload (euint128, euint64) => euint128 test 4 (4294304633, 4294304633)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(4294304633n); - input.add64(4294304633n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(18441052281005264689n); - }); - - it('test operator "and" overload (euint128, euint64) => euint128 test 1 (340282366920938463463368706571541146173, 18442558600081086197)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463368706571541146173n); - input.add64(18442558600081086197n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(18438019519441568309n); - }); - - it('test operator "and" overload (euint128, euint64) => euint128 test 2 (18442558600081086193, 18442558600081086197)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18442558600081086193n); - input.add64(18442558600081086197n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(18442558600081086193n); - }); - - it('test operator "and" overload (euint128, euint64) => euint128 test 3 (18442558600081086197, 18442558600081086197)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18442558600081086197n); - input.add64(18442558600081086197n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(18442558600081086197n); - }); - - it('test operator "and" overload (euint128, euint64) => euint128 test 4 (18442558600081086197, 18442558600081086193)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18442558600081086197n); - input.add64(18442558600081086193n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(18442558600081086193n); - }); - - it('test operator "or" overload (euint128, euint64) => euint128 test 1 (340282366920938463463370949519145006273, 18439052795332501691)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463370949519145006273n); - input.add64(18439052795332501691n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463372265437599364347n); - }); - - it('test operator "or" overload (euint128, euint64) => euint128 test 2 (18439052795332501687, 18439052795332501691)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18439052795332501687n); - input.add64(18439052795332501691n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(18439052795332501695n); - }); - - it('test operator "or" overload (euint128, euint64) => euint128 test 3 (18439052795332501691, 18439052795332501691)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18439052795332501691n); - input.add64(18439052795332501691n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(18439052795332501691n); - }); - - it('test operator "or" overload (euint128, euint64) => euint128 test 4 (18439052795332501691, 18439052795332501687)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18439052795332501691n); - input.add64(18439052795332501687n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(18439052795332501695n); - }); - - it('test operator "xor" overload (euint128, euint64) => euint128 test 1 (340282366920938463463368977308831072123, 18442960701720483125)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463368977308831072123n); - input.add64(18442960701720483125n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463444935023814972271182n); - }); - - it('test operator "xor" overload (euint128, euint64) => euint128 test 2 (18442960701720483121, 18442960701720483125)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18442960701720483121n); - input.add64(18442960701720483125n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "xor" overload (euint128, euint64) => euint128 test 3 (18442960701720483125, 18442960701720483125)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18442960701720483125n); - input.add64(18442960701720483125n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint128, euint64) => euint128 test 4 (18442960701720483125, 18442960701720483121)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18442960701720483125n); - input.add64(18442960701720483121n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "eq" overload (euint128, euint64) => ebool test 1 (340282366920938463463373700954879453501, 18443047059286955551)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463373700954879453501n); - input.add64(18443047059286955551n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint128, euint64) => ebool test 2 (18443047059286955547, 18443047059286955551)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18443047059286955547n); - input.add64(18443047059286955551n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint128, euint64) => ebool test 3 (18443047059286955551, 18443047059286955551)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18443047059286955551n); - input.add64(18443047059286955551n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint128, euint64) => ebool test 4 (18443047059286955551, 18443047059286955547)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18443047059286955551n); - input.add64(18443047059286955547n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint128, euint64) => ebool test 1 (340282366920938463463367381041406724807, 18441880962783858343)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463367381041406724807n); - input.add64(18441880962783858343n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint128, euint64) => ebool test 2 (18441880962783858339, 18441880962783858343)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18441880962783858339n); - input.add64(18441880962783858343n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint128, euint64) => ebool test 3 (18441880962783858343, 18441880962783858343)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18441880962783858343n); - input.add64(18441880962783858343n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint128, euint64) => ebool test 4 (18441880962783858343, 18441880962783858339)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18441880962783858343n); - input.add64(18441880962783858339n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, euint64) => ebool test 1 (340282366920938463463371033714627819917, 18439188692806479297)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463371033714627819917n); - input.add64(18439188692806479297n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, euint64) => ebool test 2 (18439188692806479293, 18439188692806479297)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18439188692806479293n); - input.add64(18439188692806479297n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint128, euint64) => ebool test 3 (18439188692806479297, 18439188692806479297)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18439188692806479297n); - input.add64(18439188692806479297n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, euint64) => ebool test 4 (18439188692806479297, 18439188692806479293)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18439188692806479297n); - input.add64(18439188692806479293n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint128, euint64) => ebool test 1 (340282366920938463463366930376033772101, 18439752237470295949)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463366930376033772101n); - input.add64(18439752237470295949n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint128, euint64) => ebool test 2 (18439752237470295945, 18439752237470295949)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18439752237470295945n); - input.add64(18439752237470295949n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint128, euint64) => ebool test 3 (18439752237470295949, 18439752237470295949)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18439752237470295949n); - input.add64(18439752237470295949n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint128, euint64) => ebool test 4 (18439752237470295949, 18439752237470295945)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18439752237470295949n); - input.add64(18439752237470295945n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint64) => ebool test 1 (340282366920938463463366067679463384359, 18440549964651513569)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463366067679463384359n); - input.add64(18440549964651513569n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "le" overload (euint128, euint64) => ebool test 2 (18440549964651513565, 18440549964651513569)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18440549964651513565n); - input.add64(18440549964651513569n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint64) => ebool test 3 (18440549964651513569, 18440549964651513569)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18440549964651513569n); - input.add64(18440549964651513569n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "le" overload (euint128, euint64) => ebool test 4 (18440549964651513569, 18440549964651513565)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18440549964651513569n); - input.add64(18440549964651513565n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.le_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, euint64) => ebool test 1 (340282366920938463463369469329980440219, 18446437448475645327)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463369469329980440219n); - input.add64(18446437448475645327n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, euint64) => ebool test 2 (18446437448475645323, 18446437448475645327)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18446437448475645323n); - input.add64(18446437448475645327n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "lt" overload (euint128, euint64) => ebool test 3 (18446437448475645327, 18446437448475645327)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18446437448475645327n); - input.add64(18446437448475645327n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "lt" overload (euint128, euint64) => ebool test 4 (18446437448475645327, 18446437448475645323)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18446437448475645327n); - input.add64(18446437448475645323n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.lt_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "min" overload (euint128, euint64) => euint128 test 1 (340282366920938463463372700048433567093, 18437970528445398453)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463372700048433567093n); - input.add64(18437970528445398453n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(18437970528445398453n); - }); - - it('test operator "min" overload (euint128, euint64) => euint128 test 2 (18437970528445398449, 18437970528445398453)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18437970528445398449n); - input.add64(18437970528445398453n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(18437970528445398449n); - }); - - it('test operator "min" overload (euint128, euint64) => euint128 test 3 (18437970528445398453, 18437970528445398453)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18437970528445398453n); - input.add64(18437970528445398453n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(18437970528445398453n); - }); - - it('test operator "min" overload (euint128, euint64) => euint128 test 4 (18437970528445398453, 18437970528445398449)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18437970528445398453n); - input.add64(18437970528445398449n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.min_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(18437970528445398449n); - }); - - it('test operator "max" overload (euint128, euint64) => euint128 test 1 (340282366920938463463373867307519267223, 18442144243272238465)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463373867307519267223n); - input.add64(18442144243272238465n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463373867307519267223n); - }); - - it('test operator "max" overload (euint128, euint64) => euint128 test 2 (18442144243272238461, 18442144243272238465)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18442144243272238461n); - input.add64(18442144243272238465n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(18442144243272238465n); - }); - - it('test operator "max" overload (euint128, euint64) => euint128 test 3 (18442144243272238465, 18442144243272238465)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18442144243272238465n); - input.add64(18442144243272238465n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(18442144243272238465n); - }); - - it('test operator "max" overload (euint128, euint64) => euint128 test 4 (18442144243272238465, 18442144243272238461)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(18442144243272238465n); - input.add64(18442144243272238461n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.max_euint128_euint64( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(18442144243272238465n); - }); - - it('test operator "add" overload (euint128, euint128) => euint128 test 1 (170141183460469231731685489259224150459, 170141183460469231731686328709125723252)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(170141183460469231731685489259224150459n); - input.add128(170141183460469231731686328709125723252n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463371817968349873711n); - }); - - it('test operator "add" overload (euint128, euint128) => euint128 test 2 (170141183460469231731685489259224150457, 170141183460469231731685489259224150459)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(170141183460469231731685489259224150457n); - input.add128(170141183460469231731685489259224150459n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463370978518448300916n); - }); - - it('test operator "add" overload (euint128, euint128) => euint128 test 3 (170141183460469231731685489259224150459, 170141183460469231731685489259224150459)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(170141183460469231731685489259224150459n); - input.add128(170141183460469231731685489259224150459n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463370978518448300918n); - }); - - it('test operator "add" overload (euint128, euint128) => euint128 test 4 (170141183460469231731685489259224150459, 170141183460469231731685489259224150457)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(170141183460469231731685489259224150459n); - input.add128(170141183460469231731685489259224150457n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.add_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463370978518448300916n); - }); - - it('test operator "sub" overload (euint128, euint128) => euint128 test 1 (340282366920938463463366688248127833841, 340282366920938463463366688248127833841)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463366688248127833841n); - input.add128(340282366920938463463366688248127833841n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.sub_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "sub" overload (euint128, euint128) => euint128 test 2 (340282366920938463463366688248127833841, 340282366920938463463366688248127833837)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463366688248127833841n); - input.add128(340282366920938463463366688248127833837n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.sub_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(4n); - }); - - it('test operator "mul" overload (euint128, euint128) => euint128 test 1 (9223372036854775809, 9223372036854775809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(9223372036854775809n); - input.add128(9223372036854775809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(85070591730234615884290395931651604481n); - }); - - it('test operator "mul" overload (euint128, euint128) => euint128 test 2 (9223372036854775809, 9223372036854775809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(9223372036854775809n); - input.add128(9223372036854775809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(85070591730234615884290395931651604481n); - }); - - it('test operator "mul" overload (euint128, euint128) => euint128 test 3 (9223372036854775809, 9223372036854775809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(9223372036854775809n); - input.add128(9223372036854775809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(85070591730234615884290395931651604481n); - }); - - it('test operator "mul" overload (euint128, euint128) => euint128 test 4 (9223372036854775809, 9223372036854775809)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(9223372036854775809n); - input.add128(9223372036854775809n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.mul_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(85070591730234615884290395931651604481n); - }); - - it('test operator "and" overload (euint128, euint128) => euint128 test 1 (340282366920938463463365754576278416105, 340282366920938463463366665489173165177)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463365754576278416105n); - input.add128(340282366920938463463366665489173165177n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463365750145734418537n); - }); - - it('test operator "and" overload (euint128, euint128) => euint128 test 2 (340282366920938463463365754576278416101, 340282366920938463463365754576278416105)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463365754576278416101n); - input.add128(340282366920938463463365754576278416105n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463365754576278416097n); - }); - - it('test operator "and" overload (euint128, euint128) => euint128 test 3 (340282366920938463463365754576278416105, 340282366920938463463365754576278416105)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463365754576278416105n); - input.add128(340282366920938463463365754576278416105n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463365754576278416105n); - }); - - it('test operator "and" overload (euint128, euint128) => euint128 test 4 (340282366920938463463365754576278416105, 340282366920938463463365754576278416101)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463365754576278416105n); - input.add128(340282366920938463463365754576278416101n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.and_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463365754576278416097n); - }); - - it('test operator "or" overload (euint128, euint128) => euint128 test 1 (340282366920938463463367655063545859643, 340282366920938463463373469661379852713)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463367655063545859643n); - input.add128(340282366920938463463373469661379852713n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463374605231434923963n); - }); - - it('test operator "or" overload (euint128, euint128) => euint128 test 2 (340282366920938463463367655063545859639, 340282366920938463463367655063545859643)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463367655063545859639n); - input.add128(340282366920938463463367655063545859643n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463367655063545859647n); - }); - - it('test operator "or" overload (euint128, euint128) => euint128 test 3 (340282366920938463463367655063545859643, 340282366920938463463367655063545859643)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463367655063545859643n); - input.add128(340282366920938463463367655063545859643n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463367655063545859643n); - }); - - it('test operator "or" overload (euint128, euint128) => euint128 test 4 (340282366920938463463367655063545859643, 340282366920938463463367655063545859639)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463367655063545859643n); - input.add128(340282366920938463463367655063545859639n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.or_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(340282366920938463463367655063545859647n); - }); - - it('test operator "xor" overload (euint128, euint128) => euint128 test 1 (340282366920938463463372080691181989981, 340282366920938463463368941059346865329)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463372080691181989981n); - input.add128(340282366920938463463368941059346865329n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(8122674366786796n); - }); - - it('test operator "xor" overload (euint128, euint128) => euint128 test 2 (340282366920938463463368941059346865325, 340282366920938463463368941059346865329)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463368941059346865325n); - input.add128(340282366920938463463368941059346865329n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(28n); - }); - - it('test operator "xor" overload (euint128, euint128) => euint128 test 3 (340282366920938463463368941059346865329, 340282366920938463463368941059346865329)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463368941059346865329n); - input.add128(340282366920938463463368941059346865329n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(0n); - }); - - it('test operator "xor" overload (euint128, euint128) => euint128 test 4 (340282366920938463463368941059346865329, 340282366920938463463368941059346865325)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463368941059346865329n); - input.add128(340282366920938463463368941059346865325n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.xor_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decrypt128(await this.contract8.res128()); - expect(res).to.equal(28n); - }); - - it('test operator "eq" overload (euint128, euint128) => ebool test 1 (340282366920938463463371368021216956093, 340282366920938463463370243874611927705)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463371368021216956093n); - input.add128(340282366920938463463370243874611927705n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint128, euint128) => ebool test 2 (340282366920938463463370243874611927701, 340282366920938463463370243874611927705)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463370243874611927701n); - input.add128(340282366920938463463370243874611927705n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "eq" overload (euint128, euint128) => ebool test 3 (340282366920938463463370243874611927705, 340282366920938463463370243874611927705)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463370243874611927705n); - input.add128(340282366920938463463370243874611927705n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "eq" overload (euint128, euint128) => ebool test 4 (340282366920938463463370243874611927705, 340282366920938463463370243874611927701)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463370243874611927705n); - input.add128(340282366920938463463370243874611927701n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.eq_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint128, euint128) => ebool test 1 (340282366920938463463366690564024700303, 340282366920938463463366105643215363065)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463366690564024700303n); - input.add128(340282366920938463463366105643215363065n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint128, euint128) => ebool test 2 (340282366920938463463366105643215363061, 340282366920938463463366105643215363065)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463366105643215363061n); - input.add128(340282366920938463463366105643215363065n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ne" overload (euint128, euint128) => ebool test 3 (340282366920938463463366105643215363065, 340282366920938463463366105643215363065)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463366105643215363065n); - input.add128(340282366920938463463366105643215363065n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ne" overload (euint128, euint128) => ebool test 4 (340282366920938463463366105643215363065, 340282366920938463463366105643215363061)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463366105643215363065n); - input.add128(340282366920938463463366105643215363061n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ne_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, euint128) => ebool test 1 (340282366920938463463369991167430665173, 340282366920938463463367243418798341499)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463369991167430665173n); - input.add128(340282366920938463463367243418798341499n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, euint128) => ebool test 2 (340282366920938463463367243418798341495, 340282366920938463463367243418798341499)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463367243418798341495n); - input.add128(340282366920938463463367243418798341499n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "ge" overload (euint128, euint128) => ebool test 3 (340282366920938463463367243418798341499, 340282366920938463463367243418798341499)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463367243418798341499n); - input.add128(340282366920938463463367243418798341499n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "ge" overload (euint128, euint128) => ebool test 4 (340282366920938463463367243418798341499, 340282366920938463463367243418798341495)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463367243418798341499n); - input.add128(340282366920938463463367243418798341495n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.ge_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); - - it('test operator "gt" overload (euint128, euint128) => ebool test 1 (340282366920938463463367714696589499231, 340282366920938463463372280163710625125)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463367714696589499231n); - input.add128(340282366920938463463372280163710625125n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint128, euint128) => ebool test 2 (340282366920938463463367714696589499227, 340282366920938463463367714696589499231)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463367714696589499227n); - input.add128(340282366920938463463367714696589499231n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint128, euint128) => ebool test 3 (340282366920938463463367714696589499231, 340282366920938463463367714696589499231)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463367714696589499231n); - input.add128(340282366920938463463367714696589499231n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(false); - }); - - it('test operator "gt" overload (euint128, euint128) => ebool test 4 (340282366920938463463367714696589499231, 340282366920938463463367714696589499227)', async function () { - const input = this.instances.alice.createEncryptedInput(this.contract8Address, this.signers.alice.address); - input.add128(340282366920938463463367714696589499231n); - input.add128(340282366920938463463367714696589499227n); - const encryptedAmount = await input.encrypt(); - const tx = await this.contract8.gt_euint128_euint128( - encryptedAmount.handles[0], - encryptedAmount.handles[1], - encryptedAmount.inputProof, - ); - await tx.wait(); - const res = await decryptBool(await this.contract8.resb()); - expect(res).to.equal(true); - }); -}); diff --git a/contracts/test/upgrades/upgrades.ts b/contracts/test/upgrades/upgrades.ts index b3ad9e64..07fc08a2 100644 --- a/contracts/test/upgrades/upgrades.ts +++ b/contracts/test/upgrades/upgrades.ts @@ -3,6 +3,7 @@ import dotenv from 'dotenv'; import fs from 'fs'; import { ethers, upgrades } from 'hardhat'; +import { ACL, ACLUpgradedExample } from '../../types'; import { getSigners, initSigners } from '../signers'; describe('Upgrades', function () { @@ -14,8 +15,8 @@ describe('Upgrades', function () { this.aclFactoryUpgraded = await ethers.getContractFactory('ACLUpgradedExample'); this.kmsFactory = await ethers.getContractFactory('KMSVerifier'); this.kmsFactoryUpgraded = await ethers.getContractFactory('KMSVerifierUpgradedExample'); - this.executorFactory = await ethers.getContractFactory('contracts/TFHEExecutor.sol:TFHEExecutor'); - this.executorFactoryUpgraded = await ethers.getContractFactory('TFHEExecutorUpgradedExample'); + this.executorFactory = await ethers.getContractFactory('contracts/HTTPZExecutor.sol:HTTPZExecutor'); + this.executorFactoryUpgraded = await ethers.getContractFactory('HTTPZExecutorUpgradedExample'); this.paymentFactory = await ethers.getContractFactory('FHEGasLimit'); this.paymentFactoryUpgraded = await ethers.getContractFactory('FHEGasLimitUpgradedExample'); this.decryptionOracleFactory = await ethers.getContractFactory('DecryptionOracle'); @@ -57,17 +58,17 @@ describe('Upgrades', function () { expect(await kms2.getVersion()).to.equal('KMSVerifier v0.2.0'); }); - it('deploy upgradable TFHEExecutor', async function () { + it('deploy upgradable HTTPZExecutor', async function () { const emptyUUPS = await upgrades.deployProxy(this.emptyUUPSFactory, [this.signers.alice.address], { initializer: 'initialize', kind: 'uups', }); const executor = await upgrades.upgradeProxy(emptyUUPS, this.executorFactory); await executor.waitForDeployment(); - expect(await executor.getVersion()).to.equal('TFHEExecutor v0.1.0'); + expect(await executor.getVersion()).to.equal('HTTPZExecutor v0.1.0'); const executor2 = await upgrades.upgradeProxy(executor, this.executorFactoryUpgraded); await executor2.waitForDeployment(); - expect(await executor2.getVersion()).to.equal('TFHEExecutor v0.2.0'); + expect(await executor2.getVersion()).to.equal('HTTPZExecutor v0.2.0'); }); it('deploy upgradable FHEGasLimit', async function () { @@ -99,10 +100,10 @@ describe('Upgrades', function () { it('original owner upgrades the original ACL and transfer ownership', async function () { const origACLAdd = dotenv.parse(fs.readFileSync('addresses/.env.acl')).ACL_CONTRACT_ADDRESS; const deployer = new ethers.Wallet(process.env.DEPLOYER_PRIVATE_KEY!).connect(ethers.provider); - const acl = await this.aclFactory.attach(origACLAdd, deployer); + const acl = (await this.aclFactory.attach(origACLAdd, deployer)) as ACL; expect(await acl.getVersion()).to.equal('ACL v0.1.0'); const newaclFactoryUpgraded = await ethers.getContractFactory('ACLUpgradedExample', deployer); - const acl2 = await upgrades.upgradeProxy(acl, newaclFactoryUpgraded); + const acl2 = (await upgrades.upgradeProxy(acl, newaclFactoryUpgraded)) as unknown as ACLUpgradedExample; await acl2.waitForDeployment(); expect(await acl2.getVersion()).to.equal('ACL v0.2.0'); expect(await acl2.getAddress()).to.equal(origACLAdd); diff --git a/docs/fundamentals/fhevm/contracts.md b/docs/fundamentals/fhevm/contracts.md index 159136cf..07fcd51b 100644 --- a/docs/fundamentals/fhevm/contracts.md +++ b/docs/fundamentals/fhevm/contracts.md @@ -6,13 +6,13 @@ The fhEVM employs symbolic execution - essentially, inputs to FHE operations are symbolic values (also called handles) that refer to ciphertexts. We check constraints on these handles, but ignore their actual values. -Inside the Executor (in fhEVM-native) and inside the Coprocessor, we actually execute the FHE operations on the ciphertexts the handles refer to. If a new ciphertext is generated as a result of an FHE operation, it is inserted into the blockchain for fhEVM-native (into the ciphertext storage contract, see [Storage](native/storage.md)) or into the DB and DA for Coprocessor under a handle that is deterministically generated by the TFHEExecutor contract. +Inside the Executor (in fhEVM-native) and inside the Coprocessor, we actually execute the FHE operations on the ciphertexts the handles refer to. If a new ciphertext is generated as a result of an FHE operation, it is inserted into the blockchain for fhEVM-native (into the ciphertext storage contract, see [Storage](native/storage.md)) or into the DB and DA for Coprocessor under a handle that is deterministically generated by the HTTPZExecutor contract. _Note_: All those contracts are initially deployed behind UUPS proxies, so could be upgraded by their owner at any time. Unless if the owner renounces ownership, after which the protocol could be considered imumutable. -## TFHEExecutor Contract +## HTTPZExecutor Contract -Symbolic execution on the blockchain is implemented via the [TFHEExecutor](../../../contracts/contracts/TFHEExecutor.sol) contract. One of its main responsibilites is to deterministically generate ciphertext handles. For this, we hash the FHE operation requested and the inputs to produce the result handle H: +Symbolic execution on the blockchain is implemented via the [HTTPZExecutor](../../../contracts/contracts/HTTPZExecutor.sol) contract. One of its main responsibilites is to deterministically generate ciphertext handles. For this, we hash the FHE operation requested and the inputs to produce the result handle H: ``` H = keccak256(fheOperation, input1, input2, ..., inputN) diff --git a/docs/fundamentals/fhevm/coprocessor/fhe_computation.md b/docs/fundamentals/fhevm/coprocessor/fhe_computation.md index d3d69050..c8126b2a 100644 --- a/docs/fundamentals/fhevm/coprocessor/fhe_computation.md +++ b/docs/fundamentals/fhevm/coprocessor/fhe_computation.md @@ -1,10 +1,11 @@ # FHE Computation Block execution in fhEVM-coprocessor is split into two parts: - * Symbolic Execution (onchain) - * FHE Computation (offchain) -Symbolic execution happens onchain, inside the [TFHEExecutor](../../../../contracts/contracts/TFHEExecutor.sol) contract (inside the EVM). Essentially, the EVM accumulates all requested FHE operations in a block with their input handles and the corresponding result handles. Then, at the end of block execution, it sends an `AsyncCompute` request to the coprocessor such that FHE computation can be done **eventually**. Note that FHE computation can be done at a future point in time, after the block has been committed on the host blockchain. We can do that, symbolic execution only needs handles and doesn't actual FHE ciphertexts. Actual FHE ciphertexts are needed only on **decryption** and **reencryption**, i.e. when a user wants to see the plaintext value. +- Symbolic Execution (onchain) +- FHE Computation (offchain) + +Symbolic execution happens onchain, inside the [HTTPZExecutor](../../../../contracts/contracts/HTTPZExecutor.sol) contract (inside the EVM). Essentially, the EVM accumulates all requested FHE operations in a block with their input handles and the corresponding result handles. Then, at the end of block execution, it sends an `AsyncCompute` request to the coprocessor such that FHE computation can be done **eventually**. Note that FHE computation can be done at a future point in time, after the block has been committed on the host blockchain. We can do that, symbolic execution only needs handles and doesn't actual FHE ciphertexts. Actual FHE ciphertexts are needed only on **decryption** and **reencryption**, i.e. when a user wants to see the plaintext value. ```mermaid sequenceDiagram diff --git a/docs/fundamentals/fhevm/inputs.md b/docs/fundamentals/fhevm/inputs.md index a36ec0c1..3398e7ec 100644 --- a/docs/fundamentals/fhevm/inputs.md +++ b/docs/fundamentals/fhevm/inputs.md @@ -3,20 +3,22 @@ When we talk about inputs, we refer to encrypted data users send to an fhEVM-native blockchain or an fhEVM-coprocessor. Data is in the form of FHE ciphertexts. An example would be the amount to be transferred when calling an ERC20 transfer function. ## ZKPoK + It is important that confidential data sent by users cannot be seen by anyone. Without measures, there are multiple ways that could happen, for example: - * anyone decrypting the ciphertext - * anyone doing arbitrary computations via the ciphertext (e.g. adding 0 to it), producing a new ciphertext that itself is decrypted (including malicious actors using ciphertexts of other users) - * using the ciphertext in a malicious contract that leads to decryption + +- anyone decrypting the ciphertext +- anyone doing arbitrary computations via the ciphertext (e.g. adding 0 to it), producing a new ciphertext that itself is decrypted (including malicious actors using ciphertexts of other users) +- using the ciphertext in a malicious contract that leads to decryption Furthermore, if users are allowed to send arbitrary ciphertexts (including malformed ones or maliciously-crafted ones), that could lead to revealing data about the FHE secret key. Therefore, we employ zero-knowledge proofs of knowledge (ZKPoK) of input FHE ciphertexts that guarantee: -* ciphertext is well-formed (i.e. encryption has been done correctly) -* the user knows the plaintext value -* the input ciphertext can only be used in a particular smart contract +- ciphertext is well-formed (i.e. encryption has been done correctly) +- the user knows the plaintext value +- the input ciphertext can only be used in a particular smart contract -The ZKPoK is verified by the KMS which delivers a signature (KMS_S) to the user. When the input byte array is passed to an `TFHE.asEuintXX()` function to convert from a ciphertext to a handle that can be used in smart contracts for FHE operations, the KMS_S is verified. +The ZKPoK is verified by the KMS which delivers a signature (KMS_S) to the user. When the input byte array is passed to an `HTTPZ.asEuintXX()` function to convert from a ciphertext to a handle that can be used in smart contracts for FHE operations, the KMS_S is verified. ## Compact Input Lists @@ -29,36 +31,35 @@ We define the `einput` type that refers to a particular ciphertext in the list. pragma solidity ^0.8.24; -import "fhevm/lib/TFHE.sol"; +import "fhevm/lib/HTTPZ.sol"; contract Adder { euint32 result; function add(einput inputA, einput inputB, bytes calldata inputProof) public { - euint32 a = TFHE.asEuint32(inputA, inputProof); - euint32 b = TFHE.asEuint32(inputB, inputProof); - result = TFHE.add(a, b); - TFHE.allow(result, address(this)); + euint32 a = HTTPZ.asEuint32(inputA, inputProof); + euint32 b = HTTPZ.asEuint32(inputB, inputProof); + result = HTTPZ.add(a, b); + HTTPZ.allow(result, address(this)); } } ``` Note that `inputProof` also contains the ZKPoK. - ## Overview of the input mechanism -Handling inputs requires a few steps. The first one is for the user to retrieve public key material from the Gateway. The second is to encrypt plaintext inputs and compute the associated ZKPoK. Last step is to use inputs as "usual" inputs in a smart contract. +Handling inputs requires a few steps. The first one is for the user to retrieve public key material from the Gateway. The second is to encrypt plaintext inputs and compute the associated ZKPoK. Last step is to use inputs as "usual" inputs in a smart contract. ### Public key material and CRS retrieval -The first step to generate an encrypted input is to retrieve the blockchain related FHE public key material. The Gateway is the component the user queries to get that material. +The first step to generate an encrypted input is to retrieve the blockchain related FHE public key material. The Gateway is the component the user queries to get that material. The Gateway is exposing a `/keys` endpoint that returns the FHE public key and CRS alongside a signature. Users are able to verify them using KMSVerifier smart contract. ### Encryption phase -In this phase, the user encrypts the plaintext input with the FHE public key to get ciphertext `C` and compute the proof `ZkPoK`. `C` +In this phase, the user encrypts the plaintext input with the FHE public key to get ciphertext `C` and compute the proof `ZkPoK`. `C` is bounded to be used with a `contractAddress` and by a `callerAddress`. The goal is for `C` to be signed the KMS to enable the usage of the input within smart contracts later. @@ -68,7 +69,7 @@ ZKPoK == Zero-Knowledge Proof of Knowledvge - Computed on the user side eInput == type + index -S == Signature +S == Signature struct CVerificationStructForKMS { address contractAddress; @@ -76,7 +77,6 @@ S == Signature address callerAddress; } - ```mermaid sequenceDiagram participant User @@ -97,8 +97,8 @@ sequenceDiagram ### Usage -When the user receives the KMS signature, it means that the ZKPoK has been verified by the KMS and the input could be used within fhEVM. -This is quite useful because on the fhEVM only the KMS signature will be verified and that is faster than verifying a ZkPoK. +When the user receives the KMS signature, it means that the ZKPoK has been verified by the KMS and the input could be used within fhEVM. +This is quite useful because on the fhEVM only the KMS signature will be verified and that is faster than verifying a ZkPoK. ```mermaid sequenceDiagram @@ -110,4 +110,4 @@ sequenceDiagram Note over fhEVM: Verify KMS_S -``` \ No newline at end of file +``` diff --git a/docs/fundamentals/fhevm/native/fhe_computation.md b/docs/fundamentals/fhevm/native/fhe_computation.md index 0d3955f6..cb171cc7 100644 --- a/docs/fundamentals/fhevm/native/fhe_computation.md +++ b/docs/fundamentals/fhevm/native/fhe_computation.md @@ -1,10 +1,11 @@ # FHE Computation Block execution in fhEVM-native is split into two parts: - * Symbolic Execution - * FHE Computation -Symbolic execution happens onchain, inside the [TFHEExecutor](../../../../contracts/contracts/TFHEExecutor.sol) contract (inside the EVM). Essentially, the EVM accumulates all requested FHE operations in a block with their input handles and the corresponding result handles. It also remembers which result handles are stored via the SSTORE opcode. No FHE computations are done inside the EVM itself. +- Symbolic Execution +- FHE Computation + +Symbolic execution happens onchain, inside the [HTTPZExecutor](../../../../contracts/contracts/HTTPZExecutor.sol) contract (inside the EVM). Essentially, the EVM accumulates all requested FHE operations in a block with their input handles and the corresponding result handles. It also remembers which result handles are stored via the SSTORE opcode. No FHE computations are done inside the EVM itself. For more on symbolic execution, please see [Symbolic Execution](../symbolic_execution.md). @@ -35,9 +36,9 @@ sequenceDiagram Note over Node: Commit Block ``` -## Interaction with the TFHEExecutor Contract +## Interaction with the HTTPZExecutor Contract -The [TFHEExecutor](../../../../contracts/contracts/TFHEExecutor.sol) contract is deployed when the chain is created and is at a well-known address that is also known by blockchain nodes. When a node (validator or full node) detects a call to this address (a CALL or STATICCALL opcode), the EVM running in the node looks at the function signature and determines which FHE computation is being requested. The result handle is the result of this particular call to the TFHEExecutor contract and the EVM can accumulate it in the computations list for the block. +The [HTTPZExecutor](../../../../contracts/contracts/HTTPZExecutor.sol) contract is deployed when the chain is created and is at a well-known address that is also known by blockchain nodes. When a node (validator or full node) detects a call to this address (a CALL or STATICCALL opcode), the EVM running in the node looks at the function signature and determines which FHE computation is being requested. The result handle is the result of this particular call to the HTTPZExecutor contract and the EVM can accumulate it in the computations list for the block. ## Scheduling Policies diff --git a/docs/fundamentals/fhevm/symbolic_execution.md b/docs/fundamentals/fhevm/symbolic_execution.md index 24e15f81..950f5bbf 100644 --- a/docs/fundamentals/fhevm/symbolic_execution.md +++ b/docs/fundamentals/fhevm/symbolic_execution.md @@ -2,7 +2,7 @@ Symbolic execution is a method of constructing a computational graph of FHE operations without actually doing the FHE computation. It works by utilizing what we call a ciphertext **handle**. The handle could be thought of as an unique "pointer" to a given FHE ciphertext.and is implemented as a 32-byte value that is a result of applying a hash function to either an FHE ciphertext or other handles. Symbolic execution also checks constraints on input handles (e.g. the access control list, whether types match, etc.). -Symbolic execution onchain is implemented via the [TFHEExecutor](../../../contracts/contracts/TFHEExecutor.sol) contract. One of its main responsibilites is to deterministically generate ciphertext handles. For this, we hash the FHE operation requested and the inputs to produce the result handle H: +Symbolic execution onchain is implemented via the [HTTPZExecutor](../../../contracts/contracts/HTTPZExecutor.sol) contract. One of its main responsibilites is to deterministically generate ciphertext handles. For this, we hash the FHE operation requested and the inputs to produce the result handle H: ``` H = keccak256(fheOperation, input1, input2, ..., inputN) @@ -12,7 +12,7 @@ Inputs can either be other handles or plaintext values. ## FHE Computation Data Dependencies -Note that fhEVM-native and fhEVM-coprocessor send both input handles and result handles for FHE computation. It is able to do that, because result handles are computed symbolically in the TFHEExecutor contract. That allows for parallel FHE computation by analysing which computations are independent. +Note that fhEVM-native and fhEVM-coprocessor send both input handles and result handles for FHE computation. It is able to do that, because result handles are computed symbolically in the HTTPZExecutor contract. That allows for parallel FHE computation by analysing which computations are independent. The Executor or Coprocessor can detect a conflict if an output of computation A (or the output of another computation depending on the output of A) is also used as an input in a subsequent computation B. We call these computations `dependent` and we need to execute them in order. diff --git a/docs/getting_started/fhevm/coprocessor/contracts.md b/docs/getting_started/fhevm/coprocessor/contracts.md index aee19c82..f24110aa 100644 --- a/docs/getting_started/fhevm/coprocessor/contracts.md +++ b/docs/getting_started/fhevm/coprocessor/contracts.md @@ -27,10 +27,10 @@ For the `SEPOLIA_RPC_URL` env variable, you can either get one from a service pr **Important** : the `PRIVATE_KEY_FHEVM_DEPLOYER` and `PRIVATE_KEY_GATEWAY_DEPLOYER` are expected to have a nonce of `0` initially (i.e never sent any tx before with those) for the deployment scripts to succeed later. If you have [foundry](https://book.getfoundry.sh/getting-started/installation) installed, you can generate fresh Ethereum private key / address pairs locally with this command: `cast wallet new`. -2/ Then run the precomputing contract addresses script [`./precompute-addresses.sh`](https://github.com/zama-ai/fhevm/blob/v0.6.0-0/precompute-addresses.sh) -> this will write on disk the correct contract addresses needed to launch the modified Geth node (`TFHEExecutor` address) and the Gateway service (`GatewayContract` one) and the `ACL` and `KMSVerifier` addresses which would be needed to setup some values inside the ASC contract on KMS chain. The precomputed addresses for the core contracts are located inside: +2/ Then run the precomputing contract addresses script [`./precompute-addresses.sh`](https://github.com/zama-ai/fhevm/blob/v0.6.0-0/precompute-addresses.sh) -> this will write on disk the correct contract addresses needed to launch the modified Geth node (`HTTPZExecutor` address) and the Gateway service (`GatewayContract` one) and the `ACL` and `KMSVerifier` addresses which would be needed to setup some values inside the ASC contract on KMS chain. The precomputed addresses for the core contracts are located inside: - `node_modules/fhevm-core-contracts/addresses/.env.acl` for ACL address -- `node_modules/fhevm-core-contracts/addresses/.env.exec` for TFHEExecutor address +- `node_modules/fhevm-core-contracts/addresses/.env.exec` for HTTPZExecutor address - `node_modules/fhevm-core-contracts/addresses/.env.kmsverifier` for KMSVerifier address - `node_modules/fhevm-core-contracts/addresses/.env.inputverifier` for InputVerifier address - `node_modules/fhevm-core-contracts/addresses/.env.fhegaslimit` for FHEGasLimit address @@ -47,7 +47,7 @@ PRIVATE_KEY_FHEVM_DEPLOYER=$(grep PRIVATE_KEY_FHEVM_DEPLOYER .env | cut -d '"' - npx hardhat task:computeGatewayAddress --private-key "$PRIVATE_KEY_GATEWAY_DEPLOYER" npx hardhat task:computeACLAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" -npx hardhat task:computeTFHEExecutorAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" +npx hardhat task:computeHTTPZExecutorAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" npx hardhat task:computeKMSVerifierAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" npx hardhat task:computeInputVerifierAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --use-address true npx hardhat task:computeFHEGasLimitAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" @@ -86,7 +86,7 @@ npx hardhat compile:specific --contract lib npx hardhat compile:specific --contract gateway npx hardhat task:deployACL --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia -npx hardhat task:deployTFHEExecutor --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia +npx hardhat task:deployHTTPZExecutor --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia npx hardhat task:deployKMSVerifier --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia npx hardhat task:deployInputVerifier --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia npx hardhat task:deployFHEGasLimit --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia @@ -98,7 +98,7 @@ npx hardhat task:launchFhevm --skip-get-coin true --use-address true --network s echo "Waiting 2 minutes before contract verification... Please wait..." sleep 120 # makes sure that contracts bytescode propagates on Etherscan, otherwise contracts verification might fail in next step npx hardhat task:verifyACL --network sepolia -npx hardhat task:verifyTFHEExecutor --network sepolia +npx hardhat task:verifyHTTPZExecutor --network sepolia npx hardhat task:verifyKMSVerifier --network sepolia npx hardhat task:verifyInputVerifier --network sepolia npx hardhat task:verifyFHEGasLimit --network sepolia @@ -153,7 +153,7 @@ You can use similar commands for any contracts that you wish to upgrade, just us ``` task:upgradeACL -task:upgradeTFHEExecutor +task:upgradeHTTPZExecutor task:upgradeKMSVerifier task:upgradeInputVerifier task:upgradeFHEGasLimit diff --git a/fhevm-engine/Cargo.lock b/fhevm-engine/Cargo.lock index 455866fe..f99890dc 100644 --- a/fhevm-engine/Cargo.lock +++ b/fhevm-engine/Cargo.lock @@ -3212,6 +3212,7 @@ dependencies = [ "clap", "fhevm-engine-common", "foundry-compilers", + "foundry-compilers-artifacts", "futures-util", "semver 1.0.26", "serde", diff --git a/fhevm-engine/coprocessor/.sqlx/query-3e503f864bfa8ad18f1a2c6f788abc4c5c5cf1ea40998f502930e018138f1975.json b/fhevm-engine/coprocessor/.sqlx/query-3e503f864bfa8ad18f1a2c6f788abc4c5c5cf1ea40998f502930e018138f1975.json new file mode 100644 index 00000000..52133bbc --- /dev/null +++ b/fhevm-engine/coprocessor/.sqlx/query-3e503f864bfa8ad18f1a2c6f788abc4c5c5cf1ea40998f502930e018138f1975.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO allowed_handles(tenant_id, handle, account_address) VALUES($1, $2, $3)\n ON CONFLICT DO NOTHING;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Bytea", + "Text" + ] + }, + "nullable": [] + }, + "hash": "3e503f864bfa8ad18f1a2c6f788abc4c5c5cf1ea40998f502930e018138f1975" +} diff --git a/fhevm-engine/coprocessor/.sqlx/query-416ef65e70058585ce4cec14ef80330cd688076d02e375486d7ab07fab628280.json b/fhevm-engine/coprocessor/.sqlx/query-416ef65e70058585ce4cec14ef80330cd688076d02e375486d7ab07fab628280.json new file mode 100644 index 00000000..23e15bca --- /dev/null +++ b/fhevm-engine/coprocessor/.sqlx/query-416ef65e70058585ce4cec14ef80330cd688076d02e375486d7ab07fab628280.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO blocks_valid (chain_id, block_hash, block_number, listener_tfhe)\n VALUES ($1, $2, $3, true)\n ON CONFLICT (chain_id, block_hash) DO UPDATE SET listener_tfhe = true;\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Bytea", + "Int8" + ] + }, + "nullable": [] + }, + "hash": "416ef65e70058585ce4cec14ef80330cd688076d02e375486d7ab07fab628280" +} diff --git a/fhevm-engine/coprocessor/.sqlx/query-50b9fc9ced7a19e87d388cf8fafb57be13e814aba868bf25f7ecdbf84a75bab1.json b/fhevm-engine/coprocessor/.sqlx/query-50b9fc9ced7a19e87d388cf8fafb57be13e814aba868bf25f7ecdbf84a75bab1.json new file mode 100644 index 00000000..a5b95228 --- /dev/null +++ b/fhevm-engine/coprocessor/.sqlx/query-50b9fc9ced7a19e87d388cf8fafb57be13e814aba868bf25f7ecdbf84a75bab1.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO tenants(tenant_api_key, chain_id, acl_contract_address, verifying_contract_address, pks_key, sks_key, public_params, cks_key)\n VALUES (\n 'a1503fb6-d79b-4e9e-826d-44cf262f3e05',\n 12345,\n '0x339EcE85B9E11a3A3AA557582784a15d7F82AAf2',\n '0x69dE3158643e738a0724418b21a35FAA20CBb1c5',\n $1,\n $2,\n $3,\n $4\n )\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Bytea", + "Bytea", + "Bytea", + "Bytea" + ] + }, + "nullable": [] + }, + "hash": "50b9fc9ced7a19e87d388cf8fafb57be13e814aba868bf25f7ecdbf84a75bab1" +} diff --git a/fhevm-engine/coprocessor/.sqlx/query-69eea32069c04ab351856d18f4b53d059e01468778eea9588aff3f8aee6171a7.json b/fhevm-engine/coprocessor/.sqlx/query-69eea32069c04ab351856d18f4b53d059e01468778eea9588aff3f8aee6171a7.json new file mode 100644 index 00000000..c5e79af5 --- /dev/null +++ b/fhevm-engine/coprocessor/.sqlx/query-69eea32069c04ab351856d18f4b53d059e01468778eea9588aff3f8aee6171a7.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT block_number FROM blocks_valid WHERE chain_id = $1 ORDER BY block_number DESC LIMIT 1;\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "block_number", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "69eea32069c04ab351856d18f4b53d059e01468778eea9588aff3f8aee6171a7" +} diff --git a/fhevm-engine/coprocessor/.sqlx/query-6f6d350d7e3d78ea2b9a9d2f87ef372582be43b3a34071ec73423c369dbad371.json b/fhevm-engine/coprocessor/.sqlx/query-6f6d350d7e3d78ea2b9a9d2f87ef372582be43b3a34071ec73423c369dbad371.json new file mode 100644 index 00000000..ca0f6476 --- /dev/null +++ b/fhevm-engine/coprocessor/.sqlx/query-6f6d350d7e3d78ea2b9a9d2f87ef372582be43b3a34071ec73423c369dbad371.json @@ -0,0 +1,36 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT ciphertext, ciphertext_type, handle\n FROM ciphertexts\n WHERE tenant_id = $1\n AND handle = ANY($2::BYTEA[])\n AND ciphertext_version = $3\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "ciphertext", + "type_info": "Bytea" + }, + { + "ordinal": 1, + "name": "ciphertext_type", + "type_info": "Int2" + }, + { + "ordinal": 2, + "name": "handle", + "type_info": "Bytea" + } + ], + "parameters": { + "Left": [ + "Int4", + "ByteaArray", + "Int2" + ] + }, + "nullable": [ + false, + false, + false + ] + }, + "hash": "6f6d350d7e3d78ea2b9a9d2f87ef372582be43b3a34071ec73423c369dbad371" +} diff --git a/fhevm-engine/coprocessor/.sqlx/query-78a2670fabfffa3f6fd187cd0288b86b13b401468cabe15089d75a08c5d919c0.json b/fhevm-engine/coprocessor/.sqlx/query-78a2670fabfffa3f6fd187cd0288b86b13b401468cabe15089d75a08c5d919c0.json new file mode 100644 index 00000000..ee77874e --- /dev/null +++ b/fhevm-engine/coprocessor/.sqlx/query-78a2670fabfffa3f6fd187cd0288b86b13b401468cabe15089d75a08c5d919c0.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO pbs_computations(tenant_id, handle) VALUES($1, $2) \n ON CONFLICT DO NOTHING;", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Bytea" + ] + }, + "nullable": [] + }, + "hash": "78a2670fabfffa3f6fd187cd0288b86b13b401468cabe15089d75a08c5d919c0" +} diff --git a/fhevm-engine/coprocessor/.sqlx/query-48b4b72956ffe769833233606ef487674eeccfedd5f8660e64662077421ea43c.json b/fhevm-engine/coprocessor/.sqlx/query-9d7dd33f60a053cf0f7e9a480d32ae6aaf684011580f0534afb25e0dd39d50a9.json similarity index 78% rename from fhevm-engine/coprocessor/.sqlx/query-48b4b72956ffe769833233606ef487674eeccfedd5f8660e64662077421ea43c.json rename to fhevm-engine/coprocessor/.sqlx/query-9d7dd33f60a053cf0f7e9a480d32ae6aaf684011580f0534afb25e0dd39d50a9.json index 498d552c..75c3f790 100644 --- a/fhevm-engine/coprocessor/.sqlx/query-48b4b72956ffe769833233606ef487674eeccfedd5f8660e64662077421ea43c.json +++ b/fhevm-engine/coprocessor/.sqlx/query-9d7dd33f60a053cf0f7e9a480d32ae6aaf684011580f0534afb25e0dd39d50a9.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n WITH RECURSIVE dependent_computations(tenant_id, output_handle, dependencies, fhe_operation, is_scalar, produced_handles) AS (\n SELECT c.tenant_id, c.output_handle, c.dependencies, c.fhe_operation, c.is_scalar, ARRAY[ROW(c.tenant_id, c.output_handle)]\n FROM computations c\n WHERE is_completed = false\n AND is_error = false\n AND NOT EXISTS (\n SELECT 1\n FROM unnest(c.dependencies) WITH ORDINALITY AS elems(v, dep_index)\n WHERE (c.tenant_id, elems.v) NOT IN ( SELECT tenant_id, handle FROM ciphertexts )\n -- don't select scalar operands\n AND (\n NOT c.is_scalar\n OR c.is_scalar AND NOT elems.dep_index = 2\n )\n -- ignore fhe random, trivial encrypt operations, all inputs are scalars\n AND NOT c.fhe_operation = ANY(ARRAY[24, 26, 27])\n )\n UNION ALL\n SELECT c.tenant_id, c.output_handle, c.dependencies, c.fhe_operation, c.is_scalar, dc.produced_handles || ROW(c.tenant_id, c.output_handle)\n FROM dependent_computations dc, computations c\n WHERE is_completed = false\n AND is_error = false\n AND NOT EXISTS (\n SELECT 1\n FROM unnest(c.dependencies) WITH ORDINALITY AS elems(v, dep_index)\n WHERE (c.tenant_id, elems.v) NOT IN ( SELECT tenant_id, handle FROM ciphertexts )\n AND NOT ROW(c.tenant_id, elems.v) = ANY(dc.produced_handles)\n -- don't select scalar operands\n AND (\n NOT c.is_scalar\n OR c.is_scalar AND NOT elems.dep_index = 2\n )\n -- ignore fhe random, trivial encrypt operations, all inputs are scalars\n AND NOT c.fhe_operation = ANY(ARRAY[24, 26, 27])\n )\n AND dc.output_handle = ANY(c.dependencies)\n AND dc.tenant_id = c.tenant_id\n ) SEARCH DEPTH FIRST BY output_handle SET computation_order,\n limited_computations AS (\n SELECT tenant_id, output_handle\n FROM dependent_computations\n GROUP BY tenant_id, output_handle\n ORDER BY min(computation_order)\n LIMIT $1\n )\n SELECT tenant_id, output_handle, dependencies, fhe_operation, is_scalar\n FROM computations\n WHERE (tenant_id, output_handle) IN (\n SELECT tenant_id, output_handle FROM limited_computations\n )\n FOR UPDATE SKIP LOCKED\n ", + "query": "\n WITH RECURSIVE dependent_computations(tenant_id, output_handle, dependencies, fhe_operation, is_scalar, produced_handles) AS (\n SELECT c.tenant_id, c.output_handle, c.dependencies, c.fhe_operation, c.is_scalar, ARRAY[ROW(c.tenant_id, c.output_handle)]\n FROM computations c\n WHERE is_completed = false\n AND is_error = false\n AND NOT EXISTS (\n SELECT 1\n FROM unnest(c.dependencies) WITH ORDINALITY AS elems(v, dep_index)\n WHERE (c.tenant_id, elems.v) NOT IN ( SELECT tenant_id, handle FROM ciphertexts )\n -- don't select scalar operands\n AND (\n NOT c.is_scalar\n OR c.is_scalar AND NOT elems.dep_index = 2\n )\n -- ignore fhe random, trivial encrypt operations, all inputs are scalars\n AND NOT c.fhe_operation = ANY(ARRAY[24, 26, 27])\n )\n UNION ALL\n SELECT c.tenant_id, c.output_handle, c.dependencies, c.fhe_operation, c.is_scalar, dc.produced_handles || ROW(c.tenant_id, c.output_handle)\n FROM dependent_computations dc, computations c\n WHERE is_completed = false\n AND is_error = false\n AND NOT EXISTS (\n SELECT 1\n FROM unnest(c.dependencies) WITH ORDINALITY AS elems(v, dep_index)\n WHERE (c.tenant_id, elems.v) NOT IN ( SELECT tenant_id, handle FROM ciphertexts )\n AND NOT ROW(c.tenant_id, elems.v) = ANY(dc.produced_handles)\n -- don't select scalar operands\n AND (\n NOT c.is_scalar\n OR c.is_scalar AND NOT elems.dep_index = 2\n )\n -- ignore fhe random, trivial encrypt operations, all inputs are scalars\n AND NOT c.fhe_operation = ANY(ARRAY[24, 26, 27])\n )\n AND dc.output_handle = ANY(c.dependencies)\n AND dc.tenant_id = c.tenant_id\n AND NOT ROW(c.tenant_id, c.output_handle) = ANY(dc.produced_handles)\n ) SEARCH DEPTH FIRST BY output_handle SET computation_order,\n limited_computations AS (\n SELECT tenant_id, output_handle\n FROM dependent_computations\n GROUP BY tenant_id, output_handle\n ORDER BY min(computation_order)\n LIMIT $1\n )\n SELECT tenant_id, output_handle, dependencies, fhe_operation, is_scalar\n FROM computations\n WHERE (tenant_id, output_handle) IN (\n SELECT tenant_id, output_handle FROM limited_computations\n )\n FOR UPDATE SKIP LOCKED\n ", "describe": { "columns": [ { @@ -42,5 +42,5 @@ false ] }, - "hash": "48b4b72956ffe769833233606ef487674eeccfedd5f8660e64662077421ea43c" + "hash": "9d7dd33f60a053cf0f7e9a480d32ae6aaf684011580f0534afb25e0dd39d50a9" } diff --git a/fhevm-engine/coprocessor/.sqlx/query-a0955b53c0d2f427a6d9a18a4f35c88fffad3be4f38e3175e14b3c6c4f312d38.json b/fhevm-engine/coprocessor/.sqlx/query-a0955b53c0d2f427a6d9a18a4f35c88fffad3be4f38e3175e14b3c6c4f312d38.json new file mode 100644 index 00000000..d6e4269d --- /dev/null +++ b/fhevm-engine/coprocessor/.sqlx/query-a0955b53c0d2f427a6d9a18a4f35c88fffad3be4f38e3175e14b3c6c4f312d38.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT count(*) FROM computations WHERE NOT is_completed", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "count", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + null + ] + }, + "hash": "a0955b53c0d2f427a6d9a18a4f35c88fffad3be4f38e3175e14b3c6c4f312d38" +} diff --git a/fhevm-engine/coprocessor/.sqlx/query-a7838d6f2de6991666bcb67b180efc6a3acb0bb3394c0174e7ea9277a376b60a.json b/fhevm-engine/coprocessor/.sqlx/query-a7838d6f2de6991666bcb67b180efc6a3acb0bb3394c0174e7ea9277a376b60a.json new file mode 100644 index 00000000..4da4be48 --- /dev/null +++ b/fhevm-engine/coprocessor/.sqlx/query-a7838d6f2de6991666bcb67b180efc6a3acb0bb3394c0174e7ea9277a376b60a.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT cks_key, sks_key\n FROM tenants\n WHERE tenant_id = $1\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "cks_key", + "type_info": "Bytea" + }, + { + "ordinal": 1, + "name": "sks_key", + "type_info": "Bytea" + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + true, + false + ] + }, + "hash": "a7838d6f2de6991666bcb67b180efc6a3acb0bb3394c0174e7ea9277a376b60a" +} diff --git a/fhevm-engine/coprocessor/.sqlx/query-b7d5ed966527dfc500ce529e0249d96c058a06c18a02ed117ad2f4140fbc470f.json b/fhevm-engine/coprocessor/.sqlx/query-b7d5ed966527dfc500ce529e0249d96c058a06c18a02ed117ad2f4140fbc470f.json new file mode 100644 index 00000000..94283bb8 --- /dev/null +++ b/fhevm-engine/coprocessor/.sqlx/query-b7d5ed966527dfc500ce529e0249d96c058a06c18a02ed117ad2f4140fbc470f.json @@ -0,0 +1,12 @@ +{ + "db_name": "PostgreSQL", + "query": "CREATE DATABASE coprocessor;", + "describe": { + "columns": [], + "parameters": { + "Left": [] + }, + "nullable": [] + }, + "hash": "b7d5ed966527dfc500ce529e0249d96c058a06c18a02ed117ad2f4140fbc470f" +} diff --git a/fhevm-engine/coprocessor/.sqlx/query-b88e9d81c24c47b7df985acf83fdab453de438a41d388eadfe2628d2ba4e1aed.json b/fhevm-engine/coprocessor/.sqlx/query-b88e9d81c24c47b7df985acf83fdab453de438a41d388eadfe2628d2ba4e1aed.json new file mode 100644 index 00000000..b8f1f378 --- /dev/null +++ b/fhevm-engine/coprocessor/.sqlx/query-b88e9d81c24c47b7df985acf83fdab453de438a41d388eadfe2628d2ba4e1aed.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO computations (\n tenant_id,\n output_handle,\n dependencies,\n fhe_operation,\n is_scalar\n )\n VALUES ($1, $2, $3, $4, $5)\n ON CONFLICT (tenant_id, output_handle) DO NOTHING\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Bytea", + "ByteaArray", + "Int2", + "Bool" + ] + }, + "nullable": [] + }, + "hash": "b88e9d81c24c47b7df985acf83fdab453de438a41d388eadfe2628d2ba4e1aed" +} diff --git a/fhevm-engine/coprocessor/Dockerfile b/fhevm-engine/coprocessor/Dockerfile index 10e15824..ea756180 100644 --- a/fhevm-engine/coprocessor/Dockerfile +++ b/fhevm-engine/coprocessor/Dockerfile @@ -8,6 +8,7 @@ RUN apt-get update && \ apt-get install -y --no-install-recommends protobuf-compiler && \ rm -rf /var/lib/apt/lists/* +COPY ./contracts/artifacts/contracts/ ./contracts/artifacts/contracts/ COPY ./fhevm-engine/ ./fhevm-engine/ COPY ./proto/ ./proto/ diff --git a/fhevm-engine/coprocessor/src/tests/operators_from_events.rs b/fhevm-engine/coprocessor/src/tests/operators_from_events.rs index a66f9ba2..50521313 100644 --- a/fhevm-engine/coprocessor/src/tests/operators_from_events.rs +++ b/fhevm-engine/coprocessor/src/tests/operators_from_events.rs @@ -3,9 +3,8 @@ use bigdecimal::num_bigint::BigInt; use fhevm_listener::contracts::TfheContract; use fhevm_listener::contracts::TfheContract::TfheContractEvents; -use fhevm_listener::database::tfhe_event_propagate::{ - Database as ListenerDatabase, Handle, ToType, -}; +use fhevm_listener::database::tfhe_event_propagate::{ClearConst, Database as ListenerDatabase, Handle, ToType}; + use crate::tests::operators::{generate_binary_test_cases, generate_unary_test_cases}; use crate::tests::utils::{decrypt_ciphertexts, wait_until_all_ciphertexts_computed}; @@ -29,9 +28,23 @@ fn tfhe_event(data: TfheContractEvents) -> Log { Log:: { address, data } } -fn as_scalar(big_int: &BigInt) -> Handle { +fn as_handle(big_int: &BigInt) -> Handle { + let (_, bytes) = big_int.to_bytes_be(); + Handle::right_padding_from(&bytes) +} + +fn as_scalar_handle(big_int: &BigInt) -> Handle { + let (_, mut bytes) = big_int.to_bytes_le(); + while bytes.len() < 32 { + bytes.push(0_u8) + } + bytes.reverse(); + Handle::from_slice(&bytes) +} + +fn as_scalar_uint(big_int: &BigInt) -> ClearConst { let (_, bytes) = big_int.to_bytes_be(); - Handle::from_be_slice(&bytes) + ClearConst::from_be_slice(&bytes) } fn to_bytes(big_int: &BigInt) -> Bytes { @@ -64,7 +77,7 @@ fn binary_op_to_event( let use_bytes_when_avail = op.is_scalar && op.bits > 256; let rhs_bytes = to_bytes(r_scalar); let rhs = if op.is_scalar && op.bits <= 256 { - as_scalar(r_scalar) + as_scalar_handle(r_scalar) } else { *rhs }; @@ -242,7 +255,7 @@ fn next_handle() -> Handle { #[allow(non_upper_case_globals)] static count: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(1); let v = count.fetch_add(1, std::sync::atomic::Ordering::Relaxed); - Handle::from_limbs([1, 2, 3, v]) + as_handle(&BigInt::from(v)) } async fn listener_event_to_db(app: &TestInstance) -> ListenerDatabase { @@ -318,7 +331,7 @@ async fn test_fhe_binary_operands_events() -> Result<(), Box Result<(), Box Result<(), Box .await?; listener_event_to_db.notify_scheduler().await; wait_until_all_ciphertexts_computed(&app).await?; - let decrypt_request = vec![output_handle.to_be_bytes_vec()]; + let decrypt_request = vec![output_handle.to_vec()]; let resp = decrypt_ciphertexts(&pool, 1, decrypt_request).await?; let decr_response = &resp[0]; println!( @@ -615,7 +628,7 @@ async fn test_fhe_cast_events() -> Result<(), Box> { listener_event_to_db.notify_scheduler().await; wait_until_all_ciphertexts_computed(&app).await?; - let decrypt_request = vec![output_handle.to_be_bytes_vec()]; + let decrypt_request = vec![output_handle.to_vec()]; let resp = decrypt_ciphertexts(&pool, 1, decrypt_request).await?; let decr_response = &resp[0]; @@ -689,7 +702,7 @@ async fn test_fhe_rand_events() -> Result<(), Box> { .insert_tfhe_event(&tfhe_event(TfheContractEvents::FheRandBounded( TfheContract::FheRandBounded { caller, - upperBound: as_scalar(&BigInt::from(1)), + upperBound: as_scalar_uint(&BigInt::from(1)), randType: to_ty(rand_type), seed: FixedBytes::from([ 1u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, @@ -704,9 +717,9 @@ async fn test_fhe_rand_events() -> Result<(), Box> { wait_until_all_ciphertexts_computed(&app).await?; let decrypt_request = vec![ - output1_handle.to_be_bytes_vec(), - output2_handle.to_be_bytes_vec(), - output3_handle.to_be_bytes_vec(), + output1_handle.to_vec(), + output2_handle.to_vec(), + output3_handle.to_vec(), ]; let resp = decrypt_ciphertexts(&pool, 1, decrypt_request).await?; assert_eq!(resp[0].output_type, rand_type as i16); diff --git a/fhevm-engine/coprocessor/src/tfhe_worker.rs b/fhevm-engine/coprocessor/src/tfhe_worker.rs index 89f7901a..f06e2ae6 100644 --- a/fhevm-engine/coprocessor/src/tfhe_worker.rs +++ b/fhevm-engine/coprocessor/src/tfhe_worker.rs @@ -144,6 +144,7 @@ async fn tfhe_worker_cycle( ) AND dc.output_handle = ANY(c.dependencies) AND dc.tenant_id = c.tenant_id + AND NOT ROW(c.tenant_id, c.output_handle) = ANY(dc.produced_handles) ) SEARCH DEPTH FIRST BY output_handle SET computation_order, limited_computations AS ( SELECT tenant_id, output_handle diff --git a/fhevm-engine/fhevm-listener/.sqlx/query-92861105312c170ae6f1a6ceeb0f8e40b627d41ee71285397a242a134f399c27.json b/fhevm-engine/fhevm-listener/.sqlx/query-92861105312c170ae6f1a6ceeb0f8e40b627d41ee71285397a242a134f399c27.json new file mode 100644 index 00000000..03863b00 --- /dev/null +++ b/fhevm-engine/fhevm-listener/.sqlx/query-92861105312c170ae6f1a6ceeb0f8e40b627d41ee71285397a242a134f399c27.json @@ -0,0 +1,12 @@ +{ + "db_name": "PostgreSQL", + "query": "TRUNCATE computations", + "describe": { + "columns": [], + "parameters": { + "Left": [] + }, + "nullable": [] + }, + "hash": "92861105312c170ae6f1a6ceeb0f8e40b627d41ee71285397a242a134f399c27" +} diff --git a/fhevm-engine/fhevm-listener/.sqlx/query-b973ff4880b83c2ebfae9f16c44e5567e10cf61e9743fd35f37fa491b03f6f14.json b/fhevm-engine/fhevm-listener/.sqlx/query-b973ff4880b83c2ebfae9f16c44e5567e10cf61e9743fd35f37fa491b03f6f14.json new file mode 100644 index 00000000..3a445d33 --- /dev/null +++ b/fhevm-engine/fhevm-listener/.sqlx/query-b973ff4880b83c2ebfae9f16c44e5567e10cf61e9743fd35f37fa491b03f6f14.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT COUNT(*) FROM computations", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "count", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + null + ] + }, + "hash": "b973ff4880b83c2ebfae9f16c44e5567e10cf61e9743fd35f37fa491b03f6f14" +} diff --git a/fhevm-engine/fhevm-listener/.sqlx/query-cc364a07542f42ecad4922c266fd2017ebfd50d9d7be4faad8e9f971a6d016ec.json b/fhevm-engine/fhevm-listener/.sqlx/query-cc364a07542f42ecad4922c266fd2017ebfd50d9d7be4faad8e9f971a6d016ec.json new file mode 100644 index 00000000..48d4a42e --- /dev/null +++ b/fhevm-engine/fhevm-listener/.sqlx/query-cc364a07542f42ecad4922c266fd2017ebfd50d9d7be4faad8e9f971a6d016ec.json @@ -0,0 +1,12 @@ +{ + "db_name": "PostgreSQL", + "query": "TRUNCATE blocks_valid", + "describe": { + "columns": [], + "parameters": { + "Left": [] + }, + "nullable": [] + }, + "hash": "cc364a07542f42ecad4922c266fd2017ebfd50d9d7be4faad8e9f971a6d016ec" +} diff --git a/fhevm-engine/fhevm-listener/.sqlx/query-d1ae9f2e4654d7a9bdd8a24533f4b59c16f327ea5686439e42359f14be8ac7a5.json b/fhevm-engine/fhevm-listener/.sqlx/query-d1ae9f2e4654d7a9bdd8a24533f4b59c16f327ea5686439e42359f14be8ac7a5.json new file mode 100644 index 00000000..b1db5dad --- /dev/null +++ b/fhevm-engine/fhevm-listener/.sqlx/query-d1ae9f2e4654d7a9bdd8a24533f4b59c16f327ea5686439e42359f14be8ac7a5.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT tenant_api_key FROM tenants LIMIT 1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "tenant_api_key", + "type_info": "Uuid" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false + ] + }, + "hash": "d1ae9f2e4654d7a9bdd8a24533f4b59c16f327ea5686439e42359f14be8ac7a5" +} diff --git a/fhevm-engine/fhevm-listener/Cargo.toml b/fhevm-engine/fhevm-listener/Cargo.toml index 28f50774..250dcd96 100644 --- a/fhevm-engine/fhevm-listener/Cargo.toml +++ b/fhevm-engine/fhevm-listener/Cargo.toml @@ -33,5 +33,6 @@ anyhow = { workspace = true } serial_test = "3.2.0" [build-dependencies] -foundry-compilers = { version = "0.13.0", features = ["svm-solc"] } +foundry-compilers = { version = "=0.13.5", features = ["svm-solc"] } +foundry-compilers-artifacts = "=0.13.5" semver = "1.0.26" diff --git a/fhevm-engine/fhevm-listener/README.md b/fhevm-engine/fhevm-listener/README.md index 707eed99..fd6f76b5 100644 --- a/fhevm-engine/fhevm-listener/README.md +++ b/fhevm-engine/fhevm-listener/README.md @@ -9,11 +9,13 @@ Our contracts actively emits events that forms the trace of a symbolic execution ## Command-line If already compiled you can just call the binary directly: + ``` ../target/debug/listen -coprocessor-api-key 00000000000000000000000000000000 ``` If you have no coprocessor-api-key, for local tests, you can do + ``` psql postgres=# insert into tenants values (13, '00000000000000000000000000000000', 0, 'contract verify', 'contract acl', '0'::bytea, '0'::bytea, '0'::bytea); @@ -31,29 +33,35 @@ By default the listener propagate TFHE operation events to the database. You can change the database url using --database-url, it defaults to a local test database url. If you want to disable TFHE operation events propagation, you can provide an empty database-url. -## Events in FHEVM +## Events in HTTPZ ### Blockchain Events + > Status: in progress -Blockchain events are used export the symbolic execution of TFHE operations from a blockchain node configured to accept pubsub requests. -A listener subscribe to the blockchain node and converts the events to a TFHE workload in a database. +> Blockchain events are used export the symbolic execution of TFHE operations from a blockchain node configured to accept pubsub requests. +> A listener subscribe to the blockchain node and converts the events to a TFHE workload in a database. There are 3 types of events related to: + - TFHE operations - ACL, can be used to preprocess ciphertext for certain use case - Public and User Decryption ### Database Events + > Status: proposal -Database events are used to hint the scheduler to dispath workload and to notice workload completion. +> Database events are used to hint the scheduler to dispath workload and to notice workload completion. > https://stackoverflow.com/questions/56747634/how-do-i-use-the-postgres-crate-to-receive-table-modification-events-from-postgr ### Decryption Events + > Status: in progress ### Overview FHEVM -> **_NOTE:_** Listener and scheduler could be in the same service.** + +> **_NOTE:_** Listener and scheduler could be in the same service.\*\* + ```mermaid sequenceDiagram participant BC App Node @@ -67,7 +75,7 @@ sequenceDiagram loop Block Execution - Symbolic Operations Note over BC App Node: Solidity traces a Symbolic Sequence - Note over BC App Node: TFHEExecutor contract + Note over BC App Node: HTTPZExecutor contract Note over BC App Node: ACL contract end @@ -117,4 +125,3 @@ sequenceDiagram DB-)Scheduler: Notice TFHE Operations Status
(proposal) Scheduler-)Relayer: Notice Ciphertext ready for decryption ``` - diff --git a/fhevm-engine/fhevm-listener/contracts/ACLTest.sol b/fhevm-engine/fhevm-listener/contracts/ACLTest.sol new file mode 100644 index 00000000..144f5123 --- /dev/null +++ b/fhevm-engine/fhevm-listener/contracts/ACLTest.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +pragma solidity ^0.8.24; + +contract ACL { + event Allowed(address indexed caller, address indexed account, bytes32 handle); + event AllowedForDecryption(address indexed caller, bytes32[] handlesList); + event NewDelegation(address indexed caller, address indexed delegatee, address[] contractAddresses); + event RevokedDelegation(address indexed caller, address indexed delegatee, address[] contractAddresses); + + function allow(bytes32 handle, address account) public { + emit Allowed(msg.sender, account, handle); + } + +} \ No newline at end of file diff --git a/fhevm-engine/fhevm-listener/contracts/HTTPZExecutorTest.sol b/fhevm-engine/fhevm-listener/contracts/HTTPZExecutorTest.sol new file mode 100644 index 00000000..995951e7 --- /dev/null +++ b/fhevm-engine/fhevm-listener/contracts/HTTPZExecutorTest.sol @@ -0,0 +1,265 @@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +pragma solidity ^0.8.24; + +enum FheType { + Bool, + Uint4, + Uint8, + Uint16, + Uint32, + Uint64, + Uint128, + Uint160, + Uint256, + Uint512, + Uint1024, + Uint2048, + Uint2, + Uint6, + Uint10, + Uint12, + Uint14, + Int2, + Int4, + Int6, + Int8, + Int10, + Int12, + Int14, + Int16, + Int32, + Int64, + Int128, + Int160, + Int256, + AsciiString, + Int512, + Int1024, + Int2048, + Uint24, + Uint40, + Uint48, + Uint56, + Uint72, + Uint80, + Uint88, + Uint96, + Uint104, + Uint112, + Uint120, + Uint136, + Uint144, + Uint152, + Uint168, + Uint176, + Uint184, + Uint192, + Uint200, + Uint208, + Uint216, + Uint224, + Uint232, + Uint240, + Uint248, + Int24, + Int40, + Int48, + Int56, + Int72, + Int80, + Int88, + Int96, + Int104, + Int112, + Int120, + Int136, + Int144, + Int152, + Int168, + Int176, + Int184, + Int192, + Int200, + Int208, + Int216, + Int224, + Int232, + Int240, + Int248 +} + +contract HTTPZExecutorTest { + event FheAdd(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); + event FheSub(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); + event FheMul(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); + event FheDiv(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); + event FheRem(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); + event FheBitAnd(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); + event FheBitOr(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); + event FheBitXor(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); + event FheShl(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); + event FheShr(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); + event FheRotl(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); + event FheRotr(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); + event FheEq(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); + event FheEqBytes(address indexed caller, bytes32 lhs, bytes rhs, bytes1 scalarByte, bytes32 result); + event FheNe(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); + event FheNeBytes(address indexed caller, bytes32 lhs, bytes rhs, bytes1 scalarByte, bytes32 result); + event FheGe(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); + event FheGt(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); + event FheLe(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); + event FheLt(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); + event FheMin(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); + event FheMax(address indexed caller, bytes32 lhs, bytes32 rhs, bytes1 scalarByte, bytes32 result); + event FheNeg(address indexed caller, bytes32 ct, bytes32 result); + event FheNot(address indexed caller, bytes32 ct, bytes32 result); + event VerifyCiphertext( + address indexed caller, + bytes32 inputHandle, + address userAddress, + bytes inputProof, + bytes1 inputType, + bytes32 result + ); + event Cast(address indexed caller, bytes32 ct, FheType toType, bytes32 result); + event TrivialEncrypt(address indexed caller, uint256 pt, FheType toType, bytes32 result); + event TrivialEncryptBytes(address indexed caller, bytes pt, FheType toType, bytes32 result); + event FheIfThenElse(address indexed caller, bytes32 control, bytes32 ifTrue, bytes32 ifFalse, bytes32 result); + event FheRand(address indexed caller, bytes1 randType, bytes16 seed, bytes32 result); + event FheRandBounded(address indexed caller, uint256 upperBound, bytes1 randType, bytes16 seed, bytes32 result); + + function fheAdd(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheAdd", lhs, rhs, scalarByte))); + emit FheAdd(msg.sender, lhs, rhs, scalarByte, result); + } + function fheSub(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheSub", lhs, rhs, scalarByte))); + emit FheSub(msg.sender, lhs, rhs, scalarByte, result); + } + function fheMul(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheMul", lhs, rhs, scalarByte))); + emit FheMul(msg.sender, lhs, rhs, scalarByte, result); + } + function fheDiv(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheDiv", lhs, rhs, scalarByte))); + emit FheDiv(msg.sender, lhs, rhs, scalarByte, result); + } + function fheRem(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheRem", lhs, rhs, scalarByte))); + emit FheRem(msg.sender, lhs, rhs, scalarByte, result); + } + function fheBitAnd(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheBitAnd", lhs, rhs, scalarByte))); + emit FheBitAnd(msg.sender, lhs, rhs, scalarByte, result); + } + function fheBitOr(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheBitOr", lhs, rhs, scalarByte))); + emit FheBitOr(msg.sender, lhs, rhs, scalarByte, result); + } + function fheBitXor(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheBitXor", lhs, rhs, scalarByte))); + emit FheBitXor(msg.sender, lhs, rhs, scalarByte, result); + } + function fheShl(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheShl", lhs, rhs, scalarByte))); + emit FheShl(msg.sender, lhs, rhs, scalarByte, result); + } + function fheShr(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheShr", lhs, rhs, scalarByte))); + emit FheShr(msg.sender, lhs, rhs, scalarByte, result); + } + function fheRotl(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheRotl", lhs, rhs, scalarByte))); + emit FheRotl(msg.sender, lhs, rhs, scalarByte, result); + } + function fheRotr(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheRotr", lhs, rhs, scalarByte))); + emit FheRotr(msg.sender, lhs, rhs, scalarByte, result); + } + function fheEq(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheEq", lhs, rhs, scalarByte))); + emit FheEq(msg.sender, lhs, rhs, scalarByte, result); + } + function fheEq(bytes32 lhs, bytes memory rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheEqBytes", lhs, rhs, scalarByte))); + emit FheEqBytes(msg.sender, lhs, rhs, scalarByte, result); + } + function fheNe(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheNe", lhs, rhs, scalarByte))); + emit FheNe(msg.sender, lhs, rhs, scalarByte, result); + } + function fheNe(bytes32 lhs, bytes memory rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheNeBytes", lhs, rhs, scalarByte))); + emit FheNeBytes(msg.sender, lhs, rhs, scalarByte, result); + } + function fheGe(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheGe", lhs, rhs, scalarByte))); + emit FheGe(msg.sender, lhs, rhs, scalarByte, result); + } + function fheGt(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheGt", lhs, rhs, scalarByte))); + emit FheGt(msg.sender, lhs, rhs, scalarByte, result); + } + function fheLe(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheLe", lhs, rhs, scalarByte))); + emit FheLe(msg.sender, lhs, rhs, scalarByte, result); + } + function fheLt(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheLt", lhs, rhs, scalarByte))); + emit FheLt(msg.sender, lhs, rhs, scalarByte, result); + } + function fheMin(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheMin", lhs, rhs, scalarByte))); + emit FheMin(msg.sender, lhs, rhs, scalarByte, result); + } + function fheMax(bytes32 lhs, bytes32 rhs, bytes1 scalarByte) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheMax", lhs, rhs, scalarByte))); + emit FheMax(msg.sender, lhs, rhs, scalarByte, result); + } + function fheNeg(bytes32 ct) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheNeg", ct))); + emit FheNeg(msg.sender, ct, result); + } + function fheNot(bytes32 ct) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheNot", ct))); + emit FheNot(msg.sender, ct, result); + } + function fheIfThenElse(bytes32 control, bytes32 ifTrue, bytes32 ifFalse) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("fheIfThenElse", control, ifTrue, ifFalse))); + emit FheIfThenElse(msg.sender, control, ifTrue, ifFalse, result); + } + function fheRand(bytes1 randType) public { + bytes16 seed = bytes16(keccak256(abi.encodePacked(block.timestamp))); + bytes32 result = bytes32(keccak256(abi.encodePacked("fheRand", randType, seed))); + emit FheRand(msg.sender, randType, seed, result); + } + function fheRandBounded(uint256 upperBound, bytes1 randType) public { + bytes16 seed = bytes16(keccak256(abi.encodePacked(block.timestamp))); + bytes32 result = bytes32(keccak256(abi.encodePacked("fheRandBounded", upperBound, randType, seed))); + emit FheRandBounded(msg.sender, upperBound, randType, seed, result); + } + function cast(bytes32 ct, FheType toType) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("cast", ct, toType))); + emit Cast(msg.sender, ct, toType, result); + } + + function trivialEncrypt(uint256 pt, FheType toType) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("trivialEncrypt", pt, toType))); + emit TrivialEncrypt(msg.sender, pt, toType, result); + } + + function trivialEncrypt(bytes memory pt, FheType toType) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("trivialEncryptBytes", pt, toType))); + emit TrivialEncryptBytes(msg.sender, pt, toType, result); + } + + function verifyCiphertext( + bytes32 inputHandle, + address userAddress, + bytes memory inputProof, + bytes1 inputType + ) public { + bytes32 result = bytes32(keccak256(abi.encodePacked("verifyCiphertext", inputHandle, userAddress, inputProof, inputType))); + emit VerifyCiphertext(msg.sender, inputHandle, userAddress, inputProof, inputType, result); + } +} diff --git a/fhevm-engine/fhevm-listener/contracts/TFHEExecutorTest.sol b/fhevm-engine/fhevm-listener/contracts/TFHEExecutorTest.sol deleted file mode 100644 index 29e71191..00000000 --- a/fhevm-engine/fhevm-listener/contracts/TFHEExecutorTest.sol +++ /dev/null @@ -1,178 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause-Clear -pragma solidity ^0.8.24; - -contract TFHEExecutorTest { - event FheAdd(address indexed caller, uint256 lhs, uint256 rhs, bytes1 scalarByte, uint256 result); - event FheSub(address indexed caller, uint256 lhs, uint256 rhs, bytes1 scalarByte, uint256 result); - event FheMul(address indexed caller, uint256 lhs, uint256 rhs, bytes1 scalarByte, uint256 result); - event FheDiv(address indexed caller, uint256 lhs, uint256 rhs, bytes1 scalarByte, uint256 result); - event FheRem(address indexed caller, uint256 lhs, uint256 rhs, bytes1 scalarByte, uint256 result); - event FheBitAnd(address indexed caller, uint256 lhs, uint256 rhs, bytes1 scalarByte, uint256 result); - event FheBitOr(address indexed caller, uint256 lhs, uint256 rhs, bytes1 scalarByte, uint256 result); - event FheBitXor(address indexed caller, uint256 lhs, uint256 rhs, bytes1 scalarByte, uint256 result); - event FheShl(address indexed caller, uint256 lhs, uint256 rhs, bytes1 scalarByte, uint256 result); - event FheShr(address indexed caller, uint256 lhs, uint256 rhs, bytes1 scalarByte, uint256 result); - event FheRotl(address indexed caller, uint256 lhs, uint256 rhs, bytes1 scalarByte, uint256 result); - event FheRotr(address indexed caller, uint256 lhs, uint256 rhs, bytes1 scalarByte, uint256 result); - event FheEq(address indexed caller, uint256 lhs, uint256 rhs, bytes1 scalarByte, uint256 result); - event FheEqBytes(address indexed caller, uint256 lhs, bytes rhs, bytes1 scalarByte, uint256 result); - event FheNe(address indexed caller, uint256 lhs, uint256 rhs, bytes1 scalarByte, uint256 result); - event FheNeBytes(address indexed caller, uint256 lhs, bytes rhs, bytes1 scalarByte, uint256 result); - event FheGe(address indexed caller, uint256 lhs, uint256 rhs, bytes1 scalarByte, uint256 result); - event FheGt(address indexed caller, uint256 lhs, uint256 rhs, bytes1 scalarByte, uint256 result); - event FheLe(address indexed caller, uint256 lhs, uint256 rhs, bytes1 scalarByte, uint256 result); - event FheLt(address indexed caller, uint256 lhs, uint256 rhs, bytes1 scalarByte, uint256 result); - event FheMin(address indexed caller, uint256 lhs, uint256 rhs, bytes1 scalarByte, uint256 result); - event FheMax(address indexed caller, uint256 lhs, uint256 rhs, bytes1 scalarByte, uint256 result); - event FheNeg(address indexed caller, uint256 ct, uint256 result); - event FheNot(address indexed caller, uint256 ct, uint256 result); - event VerifyCiphertext( - address indexed caller, - bytes32 inputHandle, - address userAddress, - bytes inputProof, - bytes1 inputType, - uint256 result - ); - event Cast(address indexed caller, uint256 ct, bytes1 toType, uint256 result); - event TrivialEncrypt(address indexed caller, uint256 pt, bytes1 toType, uint256 result); - event TrivialEncryptBytes(address indexed caller, bytes pt, bytes1 toType, uint256 result); - event FheIfThenElse(address indexed caller, uint256 control, uint256 ifTrue, uint256 ifFalse, uint256 result); - event FheRand(address indexed caller, bytes1 randType, bytes16 seed, uint256 result); - event FheRandBounded(address indexed caller, uint256 upperBound, bytes1 randType, bytes16 seed, uint256 result); - - function fheAdd(uint256 lhs, uint256 rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheAdd", lhs, rhs, scalarByte))); - emit FheAdd(msg.sender, lhs, rhs, scalarByte, result); - } - function fheSub(uint256 lhs, uint256 rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheSub", lhs, rhs, scalarByte))); - emit FheSub(msg.sender, lhs, rhs, scalarByte, result); - } - function fheMul(uint256 lhs, uint256 rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheMul", lhs, rhs, scalarByte))); - emit FheMul(msg.sender, lhs, rhs, scalarByte, result); - } - function fheDiv(uint256 lhs, uint256 rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheDiv", lhs, rhs, scalarByte))); - emit FheDiv(msg.sender, lhs, rhs, scalarByte, result); - } - function fheRem(uint256 lhs, uint256 rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheRem", lhs, rhs, scalarByte))); - emit FheRem(msg.sender, lhs, rhs, scalarByte, result); - } - function fheBitAnd(uint256 lhs, uint256 rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheBitAnd", lhs, rhs, scalarByte))); - emit FheBitAnd(msg.sender, lhs, rhs, scalarByte, result); - } - function fheBitOr(uint256 lhs, uint256 rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheBitOr", lhs, rhs, scalarByte))); - emit FheBitOr(msg.sender, lhs, rhs, scalarByte, result); - } - function fheBitXor(uint256 lhs, uint256 rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheBitXor", lhs, rhs, scalarByte))); - emit FheBitXor(msg.sender, lhs, rhs, scalarByte, result); - } - function fheShl(uint256 lhs, uint256 rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheShl", lhs, rhs, scalarByte))); - emit FheShl(msg.sender, lhs, rhs, scalarByte, result); - } - function fheShr(uint256 lhs, uint256 rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheShr", lhs, rhs, scalarByte))); - emit FheShr(msg.sender, lhs, rhs, scalarByte, result); - } - function fheRotl(uint256 lhs, uint256 rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheRotl", lhs, rhs, scalarByte))); - emit FheRotl(msg.sender, lhs, rhs, scalarByte, result); - } - function fheRotr(uint256 lhs, uint256 rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheRotr", lhs, rhs, scalarByte))); - emit FheRotr(msg.sender, lhs, rhs, scalarByte, result); - } - function fheEq(uint256 lhs, uint256 rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheEq", lhs, rhs, scalarByte))); - emit FheEq(msg.sender, lhs, rhs, scalarByte, result); - } - function fheEq(uint256 lhs, bytes memory rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheEqBytes", lhs, rhs, scalarByte))); - emit FheEqBytes(msg.sender, lhs, rhs, scalarByte, result); - } - function fheNe(uint256 lhs, uint256 rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheNe", lhs, rhs, scalarByte))); - emit FheNe(msg.sender, lhs, rhs, scalarByte, result); - } - function fheNe(uint256 lhs, bytes memory rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheNeBytes", lhs, rhs, scalarByte))); - emit FheNeBytes(msg.sender, lhs, rhs, scalarByte, result); - } - function fheGe(uint256 lhs, uint256 rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheGe", lhs, rhs, scalarByte))); - emit FheGe(msg.sender, lhs, rhs, scalarByte, result); - } - function fheGt(uint256 lhs, uint256 rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheGt", lhs, rhs, scalarByte))); - emit FheGt(msg.sender, lhs, rhs, scalarByte, result); - } - function fheLe(uint256 lhs, uint256 rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheLe", lhs, rhs, scalarByte))); - emit FheLe(msg.sender, lhs, rhs, scalarByte, result); - } - function fheLt(uint256 lhs, uint256 rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheLt", lhs, rhs, scalarByte))); - emit FheLt(msg.sender, lhs, rhs, scalarByte, result); - } - function fheMin(uint256 lhs, uint256 rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheMin", lhs, rhs, scalarByte))); - emit FheMin(msg.sender, lhs, rhs, scalarByte, result); - } - function fheMax(uint256 lhs, uint256 rhs, bytes1 scalarByte) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheMax", lhs, rhs, scalarByte))); - emit FheMax(msg.sender, lhs, rhs, scalarByte, result); - } - function fheNeg(uint256 ct) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheNeg", ct))); - emit FheNeg(msg.sender, ct, result); - } - function fheNot(uint256 ct) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheNot", ct))); - emit FheNot(msg.sender, ct, result); - } - function fheIfThenElse(uint256 control, uint256 ifTrue, uint256 ifFalse) public { - uint256 result = uint256(keccak256(abi.encodePacked("fheIfThenElse", control, ifTrue, ifFalse))); - emit FheIfThenElse(msg.sender, control, ifTrue, ifFalse, result); - } - function fheRand(bytes1 randType) public { - bytes16 seed = bytes16(keccak256(abi.encodePacked(block.timestamp))); - uint256 result = uint256(keccak256(abi.encodePacked("fheRand", randType, seed))); - emit FheRand(msg.sender, randType, seed, result); - } - function fheRandBounded(uint256 upperBound, bytes1 randType) public { - bytes16 seed = bytes16(keccak256(abi.encodePacked(block.timestamp))); - uint256 result = uint256(keccak256(abi.encodePacked("fheRandBounded", upperBound, randType, seed))); - emit FheRandBounded(msg.sender, upperBound, randType, seed, result); - } - function cast(uint256 ct, bytes1 toType) public { - uint256 result = uint256(keccak256(abi.encodePacked("cast", ct, toType))); - emit Cast(msg.sender, ct, toType, result); - } - - function trivialEncrypt(uint256 pt, bytes1 toType) public { - uint256 result = uint256(keccak256(abi.encodePacked("trivialEncrypt", pt, toType))); - emit TrivialEncrypt(msg.sender, pt, toType, result); - } - - function trivialEncrypt(bytes memory pt, bytes1 toType) public { - uint256 result = uint256(keccak256(abi.encodePacked("trivialEncryptBytes", pt, toType))); - emit TrivialEncryptBytes(msg.sender, pt, toType, result); - } - - function verifyCiphertext( - bytes32 inputHandle, - address userAddress, - bytes memory inputProof, - bytes1 inputType - ) public { - uint256 result = uint256(keccak256(abi.encodePacked("verifyCiphertext", inputHandle, userAddress, inputProof, inputType))); - emit VerifyCiphertext(msg.sender, inputHandle, userAddress, inputProof, inputType, result); - } -} diff --git a/fhevm-engine/fhevm-listener/src/contracts/ACL.json.abi b/fhevm-engine/fhevm-listener/src/contracts/ACL.json.abi deleted file mode 100644 index 8f4b2ed6..00000000 --- a/fhevm-engine/fhevm-listener/src/contracts/ACL.json.abi +++ /dev/null @@ -1,663 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "ACL", - "sourceName": "contracts/ACL.sol", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "AddressEmptyCode", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "delegatee", - "type": "address" - }, - { - "internalType": "address", - "name": "contractAddress", - "type": "address" - } - ], - "name": "AlreadyDelegated", - "type": "error" - }, - { - "inputs": [], - "name": "ContractAddressesIsEmpty", - "type": "error" - }, - { - "inputs": [], - "name": "ContractAddressesMaxLengthExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ERC1967InvalidImplementation", - "type": "error" - }, - { - "inputs": [], - "name": "ERC1967NonPayable", - "type": "error" - }, - { - "inputs": [], - "name": "FailedCall", - "type": "error" - }, - { - "inputs": [], - "name": "HandlesListIsEmpty", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInitialization", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "delegatee", - "type": "address" - }, - { - "internalType": "address", - "name": "contractAddress", - "type": "address" - } - ], - "name": "NotDelegatedYet", - "type": "error" - }, - { - "inputs": [], - "name": "NotInitializing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "OwnableInvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "OwnableUnauthorizedAccount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "contractAddress", - "type": "address" - } - ], - "name": "SenderCannotBeContractAddress", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "SenderNotAllowed", - "type": "error" - }, - { - "inputs": [], - "name": "UUPSUnauthorizedCallContext", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "slot", - "type": "bytes32" - } - ], - "name": "UUPSUnsupportedProxiableUUID", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "handle", - "type": "uint256" - } - ], - "name": "Allowed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "handlesList", - "type": "uint256[]" - } - ], - "name": "AllowedForDecryption", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "version", - "type": "uint64" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "delegatee", - "type": "address" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "contractAddresses", - "type": "address[]" - } - ], - "name": "NewDelegation", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferStarted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "delegatee", - "type": "address" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "contractAddresses", - "type": "address[]" - } - ], - "name": "RevokedDelegation", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "inputs": [], - "name": "UPGRADE_INTERFACE_VERSION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "handle", - "type": "uint256" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "allow", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "handlesList", - "type": "uint256[]" - } - ], - "name": "allowForDecryption", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "handle", - "type": "uint256" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "allowTransient", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "delegatee", - "type": "address" - }, - { - "internalType": "uint256", - "name": "handle", - "type": "uint256" - }, - { - "internalType": "address", - "name": "contractAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "allowedOnBehalf", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "handle", - "type": "uint256" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "allowedTransient", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "cleanTransientStorage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "delegatee", - "type": "address" - }, - { - "internalType": "address[]", - "name": "contractAddresses", - "type": "address[]" - } - ], - "name": "delegateAccount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getTFHEExecutorAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVersion", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "handle", - "type": "uint256" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "isAllowed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "handle", - "type": "uint256" - } - ], - "name": "isAllowedForDecryption", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "handle", - "type": "uint256" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "persistAllowed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proxiableUUID", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "delegatee", - "type": "address" - }, - { - "internalType": "address[]", - "name": "contractAddresses", - "type": "address[]" - } - ], - "name": "revokeDelegation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - } - ], - "bytecode": "0x60a060405230608052348015610013575f80fd5b5061001c610021565b6100d3565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100715760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100d05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b60805161191b6100f95f395f8181610f0d01528181610f36015261109b015261191b5ff3fe608060405260043610610162575f3560e01c806365d0509c116100c65780638da5cb5b1161007c578063ccd9a7cd11610057578063ccd9a7cd14610436578063e30c397814610455578063f2fde38b14610469575f80fd5b80638da5cb5b1461039c578063a90cd91d146103c8578063ad3cb1cc146103ee575f80fd5b806379ba5097116100ac57806379ba50971461034a5780637a9a598e1461035e5780638d9c9c921461037d575f80fd5b806365d0509c14610317578063715018a614610336575f80fd5b806352d1902d1161011b578063557e100411610101578063557e10041461028c5780635faa299a146102ab5780636330a709146102ca575f80fd5b806352d1902d1461024b578063531efc921461026d575f80fd5b806335334c231161014b57806335334c23146101b157806337e6b44f146101c55780634f1ef28614610238575f80fd5b8063088563e8146101665780630d8e6e2c14610187575b5f80fd5b348015610171575f80fd5b506101856101803660046114f9565b610488565b005b348015610192575f80fd5b5061019b610655565b6040516101a891906115c6565b60405180910390f35b3480156101bc575f80fd5b506101856106b6565b3480156101d0575f80fd5b506102286101df3660046115f8565b5f9182527fa688f31953c2015baaf8c0a488ee1ee22eb0e05273cc1fd31ea4cbee42febc00602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60405190151581526020016101a8565b610185610246366004611622565b6106e0565b348015610256575f80fd5b5061025f6106ff565b6040519081526020016101a8565b348015610278575f80fd5b506101856102873660046114f9565b61072d565b348015610297575f80fd5b506101856102a63660046116c2565b61097c565b3480156102b6575f80fd5b506102286102c53660046115f8565b610a78565b3480156102d5575f80fd5b506102286102e436600461174e565b5f9081527fa688f31953c2015baaf8c0a488ee1ee22eb0e05273cc1fd31ea4cbee42febc01602052604090205460ff1690565b348015610322575f80fd5b506101856103313660046115f8565b610ad5565b348015610341575f80fd5b50610185610b81565b348015610355575f80fd5b50610185610b94565b348015610369575f80fd5b506102286103783660046115f8565b610bdc565b348015610388575f80fd5b506101856103973660046115f8565b610c2f565b3480156103a7575f80fd5b506103b0610ccf565b6040516001600160a01b0390911681526020016101a8565b3480156103d3575f80fd5b50734e142887e3dc6e414a9b260a1034d20c9b4eb11f6103b0565b3480156103f9575f80fd5b5061019b6040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b348015610441575f80fd5b50610228610450366004611765565b610d03565b348015610460575f80fd5b506103b0610db8565b348015610474575f80fd5b506101856104833660046117af565b610de0565b80515f8190036104ab576040516317d7ad0760e21b815260040160405180910390fd5b7fa688f31953c2015baaf8c0a488ee1ee22eb0e05273cc1fd31ea4cbee42febc005f5b8281101561060357335f90815260028301602090815260408083206001600160a01b038916845290915281208551909190869084908110610511576105116117c8565b6020908102919091018101516001600160a01b031682528101919091526040015f205460ff1615610590578484828151811061054f5761054f6117c8565b6020026020010151604051632210106160e01b81526004016105879291906001600160a01b0392831681529116602082015260400190565b60405180910390fd5b335f90815260028301602090815260408083206001600160a01b03891684529091528120855182908790859081106105ca576105ca6117c8565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff19169115159190911790556001016104ce565b50836001600160a01b0316336001600160a01b03167f7c0a18a6132447b7c9f34ae509fec1dba0cb0ff0bdd1704b99779a1c744a138e8560405161064791906117dc565b60405180910390a350505050565b6060604051806040016040528060038152602001621050d360ea1b81525061067c5f610e65565b6106866001610e65565b61068f5f610e65565b6040516020016106a29493929190611828565b604051602081830303815290604052905090565b5f5c5f805d600190810190805b828110156106db57805c5f825d5f815d5081016106c3565b505050565b6106e8610f02565b6106f182610fb9565b6106fb8282610fc1565b5050565b5f610708611090565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b80515f819003610750576040516317d7ad0760e21b815260040160405180910390fd5b600a811115610772576040516365ac366b60e11b815260040160405180910390fd5b7fa688f31953c2015baaf8c0a488ee1ee22eb0e05273cc1fd31ea4cbee42febc005f5b8281101561093857336001600160a01b03168482815181106107b9576107b96117c8565b60200260200101516001600160a01b031603610812578381815181106107e1576107e16117c8565b6020026020010151604051630c24836b60e31b815260040161058791906001600160a01b0391909116815260200190565b335f90815260028301602090815260408083206001600160a01b03891684529091528120855190919086908490811061084d5761084d6117c8565b6020908102919091018101516001600160a01b031682528101919091526040015f205460ff16156108c3578484828151811061088b5761088b6117c8565b6020026020010151604051633e39e40f60e21b81526004016105879291906001600160a01b0392831681529116602082015260400190565b335f90815260028301602090815260408083206001600160a01b038916845290915281208551600192908790859081106108ff576108ff6117c8565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff1916911515919091179055600101610795565b50836001600160a01b0316336001600160a01b03167f6ac533ce8df9b9d2a4842715e991ef317c4a8148d2dbc0a5109ce6979de353e58560405161064791906117dc565b80515f81900361099f5760405163385e8ccb60e11b815260040160405180910390fd5b7fa688f31953c2015baaf8c0a488ee1ee22eb0e05273cc1fd31ea4cbee42febc005f5b82811015610a31575f8482815181106109dd576109dd6117c8565b602002602001015190506109f18133610a78565b610a10576040516368692cbb60e11b8152336004820152602401610587565b5f90815260018381016020526040909120805460ff191682179055016109c2565b50336001600160a01b03167f9e815ea370c1c2a5e7343bc18af3aa404bcb8eb2a8421cba4d11cb810032008784604051610a6b91906118a5565b60405180910390a2505050565b5f610a838383610bdc565b80610ace57505f8381527fa688f31953c2015baaf8c0a488ee1ee22eb0e05273cc1fd31ea4cbee42febc00602090815260408083206001600160a01b038616845290915290205460ff165b9392505050565b7fa688f31953c2015baaf8c0a488ee1ee22eb0e05273cc1fd31ea4cbee42febc00610b008333610a78565b610b1f576040516368692cbb60e11b8152336004820152602401610587565b5f838152602082815260408083206001600160a01b03861680855290835292819020805460ff191660011790555185815233917e1184123078cd58061e15db3b045089949811fe5ca4206cf0eab78f30f58b1b910160405180910390a3505050565b610b896110d9565b610b925f61110b565b565b3380610b9e610db8565b6001600160a01b031614610bd05760405163118cdaa760e01b81526001600160a01b0382166004820152602401610587565b610bd98161110b565b50565b5f805f8484604051602001610c0d92919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b60408051808303601f1901815291905280516020909101205c95945050505050565b33734e142887e3dc6e414a9b260a1034d20c9b4eb11f14610c7357610c548233610a78565b610c73576040516368692cbb60e11b8152336004820152602401610587565b5f8282604051602001610ca292919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b6040516020818303038152906040528051906020012090506001815d60015f5c0181815d805f5d50505050565b5f807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b5f8381527fa688f31953c2015baaf8c0a488ee1ee22eb0e05273cc1fd31ea4cbee42febc00602081815260408084206001600160a01b038616855290915282205460ff168015610d7257505f858152602082815260408083206001600160a01b038816845290915290205460ff165b8015610dae57506001600160a01b038084165f90815260028301602090815260408083208a8516845282528083209388168352929052205460ff165b9695505050505050565b5f807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610cf3565b610de86110d9565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b0383169081178255610e2c610ccf565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b60605f610e7183611143565b60010190505f8167ffffffffffffffff811115610e9057610e90611491565b6040519080825280601f01601f191660200182016040528015610eba576020820181803683370190505b5090508181016020015b5f19017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8504945084610ec457509392505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610f9b57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610f8f7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614155b15610b925760405163703e46dd60e11b815260040160405180910390fd5b610bd96110d9565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561101b575060408051601f3d908101601f19168201909252611018918101906118dc565b60015b61104357604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610587565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc811461108657604051632a87526960e21b815260048101829052602401610587565b6106db8383611225565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b925760405163703e46dd60e11b815260040160405180910390fd5b336110e2610ccf565b6001600160a01b031614610b925760405163118cdaa760e01b8152336004820152602401610587565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b03191681556106fb8261127a565b5f807a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000831061118b577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106111b7576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106111d557662386f26fc10000830492506010015b6305f5e10083106111ed576305f5e100830492506008015b612710831061120157612710830492506004015b60648310611213576064830492506002015b600a831061121f576001015b92915050565b61122e826112ea565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a2805115611272576106db8282611360565b6106fb6113d2565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b806001600160a01b03163b5f0361131f57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610587565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b03168460405161137c91906118f3565b5f60405180830381855af49150503d805f81146113b4576040519150601f19603f3d011682016040523d82523d5f602084013e6113b9565b606091505b50915091506113c98583836113f1565b95945050505050565b3415610b925760405163b398979f60e01b815260040160405180910390fd5b606082611406576114018261144d565b610ace565b815115801561141d57506001600160a01b0384163b155b1561144657604051639996b31560e01b81526001600160a01b0385166004820152602401610587565b5092915050565b80511561145d5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160a01b038116811461148c575f80fd5b919050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff811182821017156114ce576114ce611491565b604052919050565b5f67ffffffffffffffff8211156114ef576114ef611491565b5060051b60200190565b5f806040838503121561150a575f80fd5b61151383611476565b915060208084013567ffffffffffffffff81111561152f575f80fd5b8401601f8101861361153f575f80fd5b803561155261154d826114d6565b6114a5565b81815260059190911b82018301908381019088831115611570575f80fd5b928401925b828410156115955761158684611476565b82529284019290840190611575565b80955050505050509250929050565b5f5b838110156115be5781810151838201526020016115a6565b50505f910152565b602081525f82518060208401526115e48160408501602087016115a4565b601f01601f19169190910160400192915050565b5f8060408385031215611609575f80fd5b8235915061161960208401611476565b90509250929050565b5f8060408385031215611633575f80fd5b61163c83611476565b915060208084013567ffffffffffffffff80821115611659575f80fd5b818601915086601f83011261166c575f80fd5b81358181111561167e5761167e611491565b611690601f8201601f191685016114a5565b915080825287848285010111156116a5575f80fd5b80848401858401375f848284010152508093505050509250929050565b5f60208083850312156116d3575f80fd5b823567ffffffffffffffff8111156116e9575f80fd5b8301601f810185136116f9575f80fd5b803561170761154d826114d6565b81815260059190911b82018301908381019087831115611725575f80fd5b928401925b828410156117435783358252928401929084019061172a565b979650505050505050565b5f6020828403121561175e575f80fd5b5035919050565b5f805f8060808587031215611778575f80fd5b61178185611476565b93506020850135925061179660408601611476565b91506117a460608601611476565b905092959194509250565b5f602082840312156117bf575f80fd5b610ace82611476565b634e487b7160e01b5f52603260045260245ffd5b602080825282518282018190525f9190848201906040850190845b8181101561181c5783516001600160a01b0316835292840192918401916001016117f7565b50909695505050505050565b5f8551611839818460208a016115a4565b61103b60f11b9083019081528551611858816002840160208a016115a4565b808201915050601760f91b806002830152855161187c816003850160208a016115a4565b600392019182015283516118978160048401602088016115a4565b016004019695505050505050565b602080825282518282018190525f9190848201906040850190845b8181101561181c578351835292840192918401916001016118c0565b5f602082840312156118ec575f80fd5b5051919050565b5f82516119048184602087016115a4565b919091019291505056fea164736f6c6343000818000a", - "deployedBytecode": "0x608060405260043610610162575f3560e01c806365d0509c116100c65780638da5cb5b1161007c578063ccd9a7cd11610057578063ccd9a7cd14610436578063e30c397814610455578063f2fde38b14610469575f80fd5b80638da5cb5b1461039c578063a90cd91d146103c8578063ad3cb1cc146103ee575f80fd5b806379ba5097116100ac57806379ba50971461034a5780637a9a598e1461035e5780638d9c9c921461037d575f80fd5b806365d0509c14610317578063715018a614610336575f80fd5b806352d1902d1161011b578063557e100411610101578063557e10041461028c5780635faa299a146102ab5780636330a709146102ca575f80fd5b806352d1902d1461024b578063531efc921461026d575f80fd5b806335334c231161014b57806335334c23146101b157806337e6b44f146101c55780634f1ef28614610238575f80fd5b8063088563e8146101665780630d8e6e2c14610187575b5f80fd5b348015610171575f80fd5b506101856101803660046114f9565b610488565b005b348015610192575f80fd5b5061019b610655565b6040516101a891906115c6565b60405180910390f35b3480156101bc575f80fd5b506101856106b6565b3480156101d0575f80fd5b506102286101df3660046115f8565b5f9182527fa688f31953c2015baaf8c0a488ee1ee22eb0e05273cc1fd31ea4cbee42febc00602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60405190151581526020016101a8565b610185610246366004611622565b6106e0565b348015610256575f80fd5b5061025f6106ff565b6040519081526020016101a8565b348015610278575f80fd5b506101856102873660046114f9565b61072d565b348015610297575f80fd5b506101856102a63660046116c2565b61097c565b3480156102b6575f80fd5b506102286102c53660046115f8565b610a78565b3480156102d5575f80fd5b506102286102e436600461174e565b5f9081527fa688f31953c2015baaf8c0a488ee1ee22eb0e05273cc1fd31ea4cbee42febc01602052604090205460ff1690565b348015610322575f80fd5b506101856103313660046115f8565b610ad5565b348015610341575f80fd5b50610185610b81565b348015610355575f80fd5b50610185610b94565b348015610369575f80fd5b506102286103783660046115f8565b610bdc565b348015610388575f80fd5b506101856103973660046115f8565b610c2f565b3480156103a7575f80fd5b506103b0610ccf565b6040516001600160a01b0390911681526020016101a8565b3480156103d3575f80fd5b50734e142887e3dc6e414a9b260a1034d20c9b4eb11f6103b0565b3480156103f9575f80fd5b5061019b6040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b348015610441575f80fd5b50610228610450366004611765565b610d03565b348015610460575f80fd5b506103b0610db8565b348015610474575f80fd5b506101856104833660046117af565b610de0565b80515f8190036104ab576040516317d7ad0760e21b815260040160405180910390fd5b7fa688f31953c2015baaf8c0a488ee1ee22eb0e05273cc1fd31ea4cbee42febc005f5b8281101561060357335f90815260028301602090815260408083206001600160a01b038916845290915281208551909190869084908110610511576105116117c8565b6020908102919091018101516001600160a01b031682528101919091526040015f205460ff1615610590578484828151811061054f5761054f6117c8565b6020026020010151604051632210106160e01b81526004016105879291906001600160a01b0392831681529116602082015260400190565b60405180910390fd5b335f90815260028301602090815260408083206001600160a01b03891684529091528120855182908790859081106105ca576105ca6117c8565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff19169115159190911790556001016104ce565b50836001600160a01b0316336001600160a01b03167f7c0a18a6132447b7c9f34ae509fec1dba0cb0ff0bdd1704b99779a1c744a138e8560405161064791906117dc565b60405180910390a350505050565b6060604051806040016040528060038152602001621050d360ea1b81525061067c5f610e65565b6106866001610e65565b61068f5f610e65565b6040516020016106a29493929190611828565b604051602081830303815290604052905090565b5f5c5f805d600190810190805b828110156106db57805c5f825d5f815d5081016106c3565b505050565b6106e8610f02565b6106f182610fb9565b6106fb8282610fc1565b5050565b5f610708611090565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b80515f819003610750576040516317d7ad0760e21b815260040160405180910390fd5b600a811115610772576040516365ac366b60e11b815260040160405180910390fd5b7fa688f31953c2015baaf8c0a488ee1ee22eb0e05273cc1fd31ea4cbee42febc005f5b8281101561093857336001600160a01b03168482815181106107b9576107b96117c8565b60200260200101516001600160a01b031603610812578381815181106107e1576107e16117c8565b6020026020010151604051630c24836b60e31b815260040161058791906001600160a01b0391909116815260200190565b335f90815260028301602090815260408083206001600160a01b03891684529091528120855190919086908490811061084d5761084d6117c8565b6020908102919091018101516001600160a01b031682528101919091526040015f205460ff16156108c3578484828151811061088b5761088b6117c8565b6020026020010151604051633e39e40f60e21b81526004016105879291906001600160a01b0392831681529116602082015260400190565b335f90815260028301602090815260408083206001600160a01b038916845290915281208551600192908790859081106108ff576108ff6117c8565b6020908102919091018101516001600160a01b031682528101919091526040015f20805460ff1916911515919091179055600101610795565b50836001600160a01b0316336001600160a01b03167f6ac533ce8df9b9d2a4842715e991ef317c4a8148d2dbc0a5109ce6979de353e58560405161064791906117dc565b80515f81900361099f5760405163385e8ccb60e11b815260040160405180910390fd5b7fa688f31953c2015baaf8c0a488ee1ee22eb0e05273cc1fd31ea4cbee42febc005f5b82811015610a31575f8482815181106109dd576109dd6117c8565b602002602001015190506109f18133610a78565b610a10576040516368692cbb60e11b8152336004820152602401610587565b5f90815260018381016020526040909120805460ff191682179055016109c2565b50336001600160a01b03167f9e815ea370c1c2a5e7343bc18af3aa404bcb8eb2a8421cba4d11cb810032008784604051610a6b91906118a5565b60405180910390a2505050565b5f610a838383610bdc565b80610ace57505f8381527fa688f31953c2015baaf8c0a488ee1ee22eb0e05273cc1fd31ea4cbee42febc00602090815260408083206001600160a01b038616845290915290205460ff165b9392505050565b7fa688f31953c2015baaf8c0a488ee1ee22eb0e05273cc1fd31ea4cbee42febc00610b008333610a78565b610b1f576040516368692cbb60e11b8152336004820152602401610587565b5f838152602082815260408083206001600160a01b03861680855290835292819020805460ff191660011790555185815233917e1184123078cd58061e15db3b045089949811fe5ca4206cf0eab78f30f58b1b910160405180910390a3505050565b610b896110d9565b610b925f61110b565b565b3380610b9e610db8565b6001600160a01b031614610bd05760405163118cdaa760e01b81526001600160a01b0382166004820152602401610587565b610bd98161110b565b50565b5f805f8484604051602001610c0d92919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b60408051808303601f1901815291905280516020909101205c95945050505050565b33734e142887e3dc6e414a9b260a1034d20c9b4eb11f14610c7357610c548233610a78565b610c73576040516368692cbb60e11b8152336004820152602401610587565b5f8282604051602001610ca292919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b6040516020818303038152906040528051906020012090506001815d60015f5c0181815d805f5d50505050565b5f807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b5f8381527fa688f31953c2015baaf8c0a488ee1ee22eb0e05273cc1fd31ea4cbee42febc00602081815260408084206001600160a01b038616855290915282205460ff168015610d7257505f858152602082815260408083206001600160a01b038816845290915290205460ff165b8015610dae57506001600160a01b038084165f90815260028301602090815260408083208a8516845282528083209388168352929052205460ff165b9695505050505050565b5f807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00610cf3565b610de86110d9565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b0383169081178255610e2c610ccf565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b60605f610e7183611143565b60010190505f8167ffffffffffffffff811115610e9057610e90611491565b6040519080825280601f01601f191660200182016040528015610eba576020820181803683370190505b5090508181016020015b5f19017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8504945084610ec457509392505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610f9b57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610f8f7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614155b15610b925760405163703e46dd60e11b815260040160405180910390fd5b610bd96110d9565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561101b575060408051601f3d908101601f19168201909252611018918101906118dc565b60015b61104357604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610587565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc811461108657604051632a87526960e21b815260048101829052602401610587565b6106db8383611225565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b925760405163703e46dd60e11b815260040160405180910390fd5b336110e2610ccf565b6001600160a01b031614610b925760405163118cdaa760e01b8152336004820152602401610587565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b03191681556106fb8261127a565b5f807a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000831061118b577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106111b7576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106111d557662386f26fc10000830492506010015b6305f5e10083106111ed576305f5e100830492506008015b612710831061120157612710830492506004015b60648310611213576064830492506002015b600a831061121f576001015b92915050565b61122e826112ea565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a2805115611272576106db8282611360565b6106fb6113d2565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b806001600160a01b03163b5f0361131f57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610587565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b03168460405161137c91906118f3565b5f60405180830381855af49150503d805f81146113b4576040519150601f19603f3d011682016040523d82523d5f602084013e6113b9565b606091505b50915091506113c98583836113f1565b95945050505050565b3415610b925760405163b398979f60e01b815260040160405180910390fd5b606082611406576114018261144d565b610ace565b815115801561141d57506001600160a01b0384163b155b1561144657604051639996b31560e01b81526001600160a01b0385166004820152602401610587565b5092915050565b80511561145d5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160a01b038116811461148c575f80fd5b919050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff811182821017156114ce576114ce611491565b604052919050565b5f67ffffffffffffffff8211156114ef576114ef611491565b5060051b60200190565b5f806040838503121561150a575f80fd5b61151383611476565b915060208084013567ffffffffffffffff81111561152f575f80fd5b8401601f8101861361153f575f80fd5b803561155261154d826114d6565b6114a5565b81815260059190911b82018301908381019088831115611570575f80fd5b928401925b828410156115955761158684611476565b82529284019290840190611575565b80955050505050509250929050565b5f5b838110156115be5781810151838201526020016115a6565b50505f910152565b602081525f82518060208401526115e48160408501602087016115a4565b601f01601f19169190910160400192915050565b5f8060408385031215611609575f80fd5b8235915061161960208401611476565b90509250929050565b5f8060408385031215611633575f80fd5b61163c83611476565b915060208084013567ffffffffffffffff80821115611659575f80fd5b818601915086601f83011261166c575f80fd5b81358181111561167e5761167e611491565b611690601f8201601f191685016114a5565b915080825287848285010111156116a5575f80fd5b80848401858401375f848284010152508093505050509250929050565b5f60208083850312156116d3575f80fd5b823567ffffffffffffffff8111156116e9575f80fd5b8301601f810185136116f9575f80fd5b803561170761154d826114d6565b81815260059190911b82018301908381019087831115611725575f80fd5b928401925b828410156117435783358252928401929084019061172a565b979650505050505050565b5f6020828403121561175e575f80fd5b5035919050565b5f805f8060808587031215611778575f80fd5b61178185611476565b93506020850135925061179660408601611476565b91506117a460608601611476565b905092959194509250565b5f602082840312156117bf575f80fd5b610ace82611476565b634e487b7160e01b5f52603260045260245ffd5b602080825282518282018190525f9190848201906040850190845b8181101561181c5783516001600160a01b0316835292840192918401916001016117f7565b50909695505050505050565b5f8551611839818460208a016115a4565b61103b60f11b9083019081528551611858816002840160208a016115a4565b808201915050601760f91b806002830152855161187c816003850160208a016115a4565b600392019182015283516118978160048401602088016115a4565b016004019695505050505050565b602080825282518282018190525f9190848201906040850190845b8181101561181c578351835292840192918401916001016118c0565b5f602082840312156118ec575f80fd5b5051919050565b5f82516119048184602087016115a4565b919091019291505056fea164736f6c6343000818000a", - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/fhevm-engine/fhevm-listener/src/contracts/TFHEExecutor.json.abi b/fhevm-engine/fhevm-listener/src/contracts/TFHEExecutor.json.abi deleted file mode 100644 index b8f41267..00000000 --- a/fhevm-engine/fhevm-listener/src/contracts/TFHEExecutor.json.abi +++ /dev/null @@ -1,2353 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "TFHEExecutor", - "sourceName": "contracts/TFHEExecutor.sol", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "handle", - "type": "uint256" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "ACLNotAllowed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "AddressEmptyCode", - "type": "error" - }, - { - "inputs": [], - "name": "DivisionByZero", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "ERC1967InvalidImplementation", - "type": "error" - }, - { - "inputs": [], - "name": "ERC1967NonPayable", - "type": "error" - }, - { - "inputs": [], - "name": "FailedCall", - "type": "error" - }, - { - "inputs": [], - "name": "IncompatibleTypes", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "typeOf", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "length", - "type": "uint256" - } - ], - "name": "InvalidByteLength", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInitialization", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidType", - "type": "error" - }, - { - "inputs": [], - "name": "IsNotScalar", - "type": "error" - }, - { - "inputs": [], - "name": "IsScalar", - "type": "error" - }, - { - "inputs": [], - "name": "NotInitializing", - "type": "error" - }, - { - "inputs": [], - "name": "NotPowerOfTwo", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "OwnableInvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "OwnableUnauthorizedAccount", - "type": "error" - }, - { - "inputs": [], - "name": "SecondOperandIsNotScalar", - "type": "error" - }, - { - "inputs": [], - "name": "UUPSUnauthorizedCallContext", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "slot", - "type": "bytes32" - } - ], - "name": "UUPSUnsupportedProxiableUUID", - "type": "error" - }, - { - "inputs": [], - "name": "UnsupportedType", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "ct", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "toType", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "Cast", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheAdd", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheBitAnd", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheBitOr", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheBitXor", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheDiv", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheEq", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "rhs", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheEqBytes", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheGe", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheGt", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "control", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "ifTrue", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "ifFalse", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheIfThenElse", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheLe", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheLt", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheMax", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheMin", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheMul", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheNe", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "rhs", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheNeBytes", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "ct", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheNeg", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "ct", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheNot", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "randType", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "bytes16", - "name": "seed", - "type": "bytes16" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheRand", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "upperBound", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "randType", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "bytes16", - "name": "seed", - "type": "bytes16" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheRandBounded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheRem", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheRotl", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheRotr", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheShl", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheShr", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "FheSub", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "version", - "type": "uint64" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferStarted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "pt", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "toType", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "TrivialEncrypt", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "pt", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "toType", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "TrivialEncryptBytes", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "inputHandle", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "userAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "inputProof", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "bytes1", - "name": "inputType", - "type": "bytes1" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "name": "VerifyCiphertext", - "type": "event" - }, - { - "inputs": [], - "name": "HANDLE_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "UPGRADE_INTERFACE_VERSION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "ct", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "toType", - "type": "bytes1" - } - ], - "name": "cast", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheAdd", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheBitAnd", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheBitOr", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheBitXor", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheDiv", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheEq", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "rhs", - "type": "bytes" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheEq", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheGe", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheGt", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "control", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ifTrue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ifFalse", - "type": "uint256" - } - ], - "name": "fheIfThenElse", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheLe", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheLt", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheMax", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheMin", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheMul", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "rhs", - "type": "bytes" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheNe", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheNe", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "ct", - "type": "uint256" - } - ], - "name": "fheNeg", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "ct", - "type": "uint256" - } - ], - "name": "fheNot", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes1", - "name": "randType", - "type": "bytes1" - } - ], - "name": "fheRand", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "upperBound", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "randType", - "type": "bytes1" - } - ], - "name": "fheRandBounded", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheRem", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheRotl", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheRotr", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheShl", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheShr", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "lhs", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rhs", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "scalarByte", - "type": "bytes1" - } - ], - "name": "fheSub", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getACLAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getFHEGasLimitAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getInputVerifierAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVersion", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proxiableUUID", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "pt", - "type": "bytes" - }, - { - "internalType": "bytes1", - "name": "toType", - "type": "bytes1" - } - ], - "name": "trivialEncrypt", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "pt", - "type": "uint256" - }, - { - "internalType": "bytes1", - "name": "toType", - "type": "bytes1" - } - ], - "name": "trivialEncrypt", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "inputHandle", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "userAddress", - "type": "address" - }, - { - "internalType": "bytes", - "name": "inputProof", - "type": "bytes" - }, - { - "internalType": "bytes1", - "name": "inputType", - "type": "bytes1" - } - ], - "name": "verifyCiphertext", - "outputs": [ - { - "internalType": "uint256", - "name": "result", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x60a06040523060805234801562000014575f80fd5b506200001f6200002f565b620000296200002f565b620000e3565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff1615620000805760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b0390811614620000e05780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b60805161461e6200010a5f395f81816121a1015281816121ca0152612334015261461e5ff3fe6080604052600436106102d7575f3560e01c806389a4314b1161017b578063cb3b9407116100d1578063ec4057dc11610087578063f6859bdc11610062578063f6859bdc146107f0578063f953e42714610816578063fa33b7af14610835575f80fd5b8063ec4057dc14610793578063eee1833c146107b2578063f2fde38b146107d1575f80fd5b8063e0c5cbb3116100b7578063e0c5cbb314610741578063e30c397814610760578063e71746b814610774575f80fd5b8063cb3b940714610703578063e0c516ae14610722575f80fd5b8063a86e9de511610131578063a8c7c2c11161010c578063a8c7c2c114610676578063ad3cb1cc1461069c578063bc47139a146106e4575f80fd5b8063a86e9de514610619578063a87deac414610638578063a8b42a8914610657575f80fd5b80638da5cb5b116101615780638da5cb5b146105c7578063900d294e146105db5780639675211f146105fa575f80fd5b806389a4314b146105895780638c14cc21146105a8575f80fd5b80634be68d2011610230578063694daf72116101e6578063715018a6116101c1578063715018a61461054257806379ba509714610556578063816d57d31461056a575f80fd5b8063694daf72146104df5780636a8c8eb4146104fe5780636be3175814610523575f80fd5b806352d1902d1161021657806352d1902d14610479578063601303d11461048d578063666a3588146104c0575f80fd5b80634be68d20146104455780634f1ef28614610464575f80fd5b8063192710811161029057806336cdd31b1161026b57806336cdd31b146103e85780633e63c50a1461040757806344ae9c5c14610426575f80fd5b8063192710811461038b5780632c7d67b7146103aa5780632e817ff0146103c9575f80fd5b80630b90dfc3116102c05780630b90dfc31461032c5780630d8e6e2c1461034b57806313801ffa1461036c575f80fd5b8063052896f1146102db578063059073431461030d575b5f80fd5b3480156102e6575f80fd5b506102fa6102f5366004613e5c565b610854565b6040519081526020015b60405180910390f35b348015610318575f80fd5b506102fa610327366004613e5c565b6108c1565b348015610337575f80fd5b506102fa610346366004613f2b565b610923565b348015610356575f80fd5b5061035f610970565b6040516103049190613fc2565b348015610377575f80fd5b506102fa610386366004613fd4565b6109eb565b348015610396575f80fd5b506102fa6103a5366004613e5c565b610a39565b3480156103b5575f80fd5b506102fa6103c4366004613e5c565b610a9b565b3480156103d4575f80fd5b506102fa6103e3366004614001565b610afd565b3480156103f3575f80fd5b506102fa610402366004613e5c565b610b5d565b348015610412575f80fd5b506102fa610421366004613e5c565b610bbf565b348015610431575f80fd5b506102fa610440366004613e5c565b610c21565b348015610450575f80fd5b506102fa61045f366004614065565b610c83565b61047761047236600461408f565b610ce4565b005b348015610484575f80fd5b506102fa610d03565b348015610498575f80fd5b505f805160206145f28339815191525b6040516001600160a01b039091168152602001610304565b3480156104cb575f80fd5b506102fa6104da366004613e5c565b610d31565b3480156104ea575f80fd5b506102fa6104f9366004613e5c565b610d93565b348015610509575f80fd5b506105115f81565b60405160ff9091168152602001610304565b34801561052e575f80fd5b506102fa61053d366004613e5c565b610df5565b34801561054d575f80fd5b50610477610e57565b348015610561575f80fd5b50610477610e6a565b348015610575575f80fd5b506102fa610584366004613e5c565b610eb7565b348015610594575f80fd5b506102fa6105a3366004613e5c565b610f19565b3480156105b3575f80fd5b506102fa6105c2366004613e5c565b610f7b565b3480156105d2575f80fd5b506104a8610fdd565b3480156105e6575f80fd5b506102fa6105f53660046140da565b611011565b348015610605575f80fd5b506102fa610614366004613e5c565b61108f565b348015610624575f80fd5b506102fa610633366004613e5c565b6110f1565b348015610643575f80fd5b506102fa610652366004613e5c565b611153565b348015610662575f80fd5b506102fa610671366004613fd4565b6111b5565b348015610681575f80fd5b507359aad6dc3c909aeed1916937cc310fbfbb118c8c6104a8565b3480156106a7575f80fd5b5061035f6040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b3480156106ef575f80fd5b506102fa6106fe366004613f2b565b6111fa565b34801561070e575f80fd5b506102fa61071d3660046140f3565b611247565b34801561072d575f80fd5b506102fa61073c366004613e5c565b61129d565b34801561074c575f80fd5b506102fa61075b36600461411c565b6112ff565b34801561076b575f80fd5b506104a8611349565b34801561077f575f80fd5b506102fa61078e366004614065565b611371565b34801561079e575f80fd5b506102fa6107ad366004613e5c565b6113c8565b3480156107bd575f80fd5b506102fa6107cc366004613e5c565b61142a565b3480156107dc575f80fd5b506104776107eb36600461415e565b61148c565b3480156107fb575f80fd5b507374c085a069fafd4f264b5200847edb1ade82b3c06104a8565b348015610821575f80fd5b506102fa610830366004613e5c565b611511565b348015610840575f80fd5b506102fa61084f366004614065565b611573565b5f6108608484846115f8565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f07305072f94f1a0b168f31b63591b41f1cac5ba64014969410b6ceb606538ead906080015b60405180910390a29392505050565b5f6108cd848484611696565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f922410bc7a9d7326d875cdb9349f57cea73e4bb0b465d9d4675d5288ad8be22c906080016108b2565b5f61092f848484611729565b9050336001600160a01b03167f05b83108d217815a3573f69c82e0c26569d4c410780a147d494af52f6e008410858585856040516108b29493929190614177565b60606040518060400160405280600c81526020017f544648454578656375746f7200000000000000000000000000000000000000008152506109b15f611943565b6109bb6001611943565b6109c45f611943565b6040516020016109d794939291906141ac565b604051602081830303815290604052905090565b5f6109f5826119e0565b604080518481526020810183905291925033917f3dc0f0d4d45d9ff119f66df01d3e2d7a73493aae1eae33775b16b07789aafac391015b60405180910390a2919050565b5f610a45848484611a6a565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f3a0c714dad01280382b89beba9f8177783d66b696481415e929f1b02e328a541906080016108b2565b5f610aa7848484611b36565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907ffa4f6ace03749e024df9221c74694ef1e8c3066def6f40520e26e59708dd7056906080016108b2565b5f610b0a85858585611bc9565b9050336001600160a01b03167f0bb6dd385f84cff601e6e660e5e80ef8739b5935079f721f0cee8964491046ca8686868686604051610b4d959493929190614229565b60405180910390a2949350505050565b5f610b69848484611d25565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f92096614ef9cbda0318055bda767c14fb22206cc2cb5dcddf7b38eba7d6b2d29906080016108b2565b5f610bcb848484611dfe565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f46d5de07bfd63ec01cfb961ff5c91ce53698eb8bc8fe08079508daa3d5eadf89906080016108b2565b5f610c2d848484611e91565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fbf560b43a62ae4c9590fa5e029ed029e1710d290f9f8ece6f36108e4ed312e3e906080016108b2565b5f610c8e8383611f24565b604080518581526001600160f81b03198516602082015290810182905290915033907f2150548fbe9722e60d7871549c9870872d4d877ac58a4c1b8bc055f73446b523906060015b60405180910390a292915050565b610cec612196565b610cf58261224d565b610cff8282612255565b5050565b5f610d0c612329565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b5f610d3d848484612372565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f7ff8e1723ca2cb3d4048fe755a5a185dd3e34d5344276f68c124fd5d5571059a906080016108b2565b5f610d9f848484612405565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f0f80e720ac1dd11637d38469506987006a996cb767478e0ee4357bf1ce12bb19906080016108b2565b5f610e01848484612498565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f9cfba8fc76d24936bdc857fe511b746cbc99a2425215d19ec72275bbc5a8f0f4906080016108b2565b610e5f612564565b610e685f612596565b565b3380610e74611349565b6001600160a01b031614610eab5760405163118cdaa760e01b81526001600160a01b03821660048201526024015b60405180910390fd5b610eb481612596565b50565b5f610ec38484846125ce565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f60a2b12ffdd4220bac10a5ed2cdd52d3ce4371b5262968193ab0e747db797c6a906080016108b2565b5f610f25848484612661565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f34c152a238a9c7a14b92def6b25511a8ac6cdf8f78dd60fbb476ca5fb1f0fd63906080016108b2565b5f610f878484846126f4565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f7f5c7ffaaf8e3391055dd5d55363f280b389861e2c9e4fb14ba861c803dd49ec906080016108b2565b5f807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b5f8061101b612787565b9050611027838261283b565b604080516001600160f81b0319861681526fffffffffffffffffffffffffffffffff198416602082015290810182905290925033907f50b413a0e3940d2f18ab88ad84adbaa5d72cc8d82e72efe97cd34c4ad3677f639060600160405180910390a250919050565b5f61109b848484612974565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fd8fd6601045cf1d0a0ab28a28526e5596d7cce32b35ad44de08d1e9969441aa2906080016108b2565b5f6110fd848484612a07565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f910b9089d67acb16e2833d86b8c100363cfae1bdcbd4fd228b45dde3dc4d0a9a906080016108b2565b5f61115f848484612a9a565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fad57799587312c4dec422afa3c1d721b88fb0d452cd5ed15a52c9b04f1225da3906080016108b2565b5f6111bf82612b2d565b604080518481526020810183905291925033917f2a54b047132067554c36d8d9aecc226f5518ab5af9a1e19b4e4d1cb401a56e909101610a2c565b5f611206848484612baf565b9050336001600160a01b03167f2e29e32638d6cfd749496bf7782fd284e2ce4782d0a0ea61a8f76ccfa0d06988858585856040516108b29493929190614177565b5f611253848484612d36565b60408051868152602081018690529081018490526060810182905290915033907f12e2bc1a29195780b5f5a0d2e773b1d343263d80b3cb9dcb051034bac5732b43906080016108b2565b5f6112a9848484612dc4565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907ffccefc29052f5ba36b6c1adc1432c30d32af11ff8796c6a5549da52fbd7d5de7906080016108b2565b5f61130a8383612e9d565b9050336001600160a01b03167f90e8a043ed9e0580c961b547a98e518f1cd95fc4feb95f716eb8d9ea27e18b02848484604051610cd69392919061426e565b5f807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00611001565b5f61137c8383612f5f565b604080518581526001600160f81b03198516602082015290810182905290915033907f96e65db2c6b1d30ffc84b4d5dc25fec064352ac89ff65a4463b4ed9bc4b6b70390606001610cd6565b5f6113d4848484613016565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f11cbf38d5137daf232c3d7dcc267c99b6e9a3c47f523eb64edce18490e26572a906080016108b2565b5f6114368484846130a9565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fa8c1a660b3b8efbeb115d6d6b0d7b2dafe6e16c58a60b54b04620ebfddd0ad68906080016108b2565b611494612564565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556114d8610fdd565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b5f61151d84848461313c565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f9d4485ee9ce87c267c409bdb9b696a82a89c995903092b84553de8edc2592625906080016108b2565b5f8061157d612787565b905061158a8484836131ce565b604080518681526001600160f81b0319861660208201526fffffffffffffffffffffffffffffffff1984168183015260608101839052905191935033917fc413adc84697f5254550ac298a61ed4e3ab3e6bc78d472f61e5322f974bc933b9181900360800190a25092915050565b5f61017e6116068582613331565b5f6116118660081c90565b60405163f1ec4e3d60e01b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f28339815191529063f1ec4e3d906044015f604051808303815f87803b158015611667575f80fd5b505af1158015611679573d5f803e3d5ffd5b5050505061168b600e8888845f613366565b979650505050505050565b5f61017e6116a48582613331565b5f6116af8660081c90565b60405163d52059c160e01b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f28339815191529063d52059c1906044015f604051808303815f87803b158015611705575f80fd5b505af1158015611717573d5f803e3d5ffd5b5050505061168b600a88888486613366565b5f610e006117378582613331565b5f6117428660081c90565b9050600160f81b80851690811461176c576040516309bbc1b360e31b815260040160405180910390fd5b604051633b470ee160e01b815260ff831660048201526001600160f81b0319821660248201525f805160206145f283398151915290633b470ee1906044015f604051808303815f87803b1580156117c1575f80fd5b505af11580156117d3573d5f803e3d5ffd5b5050604051632fd514cd60e11b8152600481018a90523360248201527374c085a069fafd4f264b5200847edb1ade82b3c09250635faa299a9150604401602060405180830381865afa15801561182b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061184f919061429c565b6118755760405163268989cf60e11b815260048101889052336024820152604401610ea2565b6118808651836135c3565b600d8787837374c085a069fafd4f264b5200847edb1ade82b3c0466040516020016118b0969594939291906142de565b60408051601f198184030181529190528051602090910120935061ffff1984166040516346ce4e4960e11b8152600481018290523360248201529094507374c085a069fafd4f264b5200847edb1ade82b3c090638d9c9c92906044015f604051808303815f87803b158015611923575f80fd5b505af1158015611935573d5f803e3d5ffd5b505050505050509392505050565b60605f61194f83613661565b60010190505f8167ffffffffffffffff81111561196e5761196e613e8e565b6040519080825280601f01601f191660200182016040528015611998576020820181803683370190505b5090508181016020015b5f19017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846119a257509392505050565b5f61017f6119ee8382613331565b5f6119f98460081c90565b6040516322f1ff5160e11b815260ff821660048201529091505f805160206145f2833981519152906345e3fea2906024015f604051808303815f87803b158015611a41575f80fd5b505af1158015611a53573d5f803e3d5ffd5b50505050611a62601585613743565b949350505050565b5f610fff611a788582613331565b5f611a838660081c90565b9050600160f81b8085169081148015611a9f575060088260ff16115b15611abd5760405163dac55bcd60e01b815260040160405180910390fd5b604051633b470ee160e01b815260ff831660048201526001600160f81b0319821660248201525f805160206145f283398151915290633b470ee1906044015f604051808303815f87803b158015611b12575f80fd5b505af1158015611b24573d5f803e3d5ffd5b5050505061168b600d8888845f613366565b5f61017f611b448582613331565b5f611b4f8660081c90565b604051632f891e1b60e01b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f283398151915290632f891e1b906044015f604051808303815f87803b158015611ba5575f80fd5b505af1158015611bb7573d5f803e3d5ffd5b5050505061168b600788888486613366565b604080516060810182527374c085a069fafd4f264b5200847edb1ade82b3c081526001600160a01b038516602082015233918101919091525f9081611c0e8760081c90565b905060f884901c60ff821614611c375760405163b968846160e01b815260040160405180910390fd5b604051634d52c10760e01b81527359aad6dc3c909aeed1916937cc310fbfbb118c8c90634d52c10790611c729085908b908a90600401614346565b6020604051808303815f875af1158015611c8e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611cb29190614388565b6040516346ce4e4960e11b8152600481018290523360248201529093507374c085a069fafd4f264b5200847edb1ade82b3c090638d9c9c92906044015f604051808303815f87803b158015611d05575f80fd5b505af1158015611d17573d5f803e3d5ffd5b505050505050949350505050565b5f600160f81b80831614611d4c57604051634f224e5360e01b815260040160405180910390fd5b825f03611d6c576040516323d359a360e01b815260040160405180910390fd5b61017e611d798582613331565b5f611d848660081c90565b60405163293d01a360e21b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f28339815191529063a4f4068c906044015f604051808303815f87803b158015611dda575f80fd5b505af1158015611dec573d5f803e3d5ffd5b5050505061168b600388888486613366565b5f61017e611e0c8582613331565b5f611e178660081c90565b604051633941d74360e21b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f28339815191529063e5075d0c906044015f604051808303815f87803b158015611e6d575f80fd5b505af1158015611e7f573d5f803e3d5ffd5b5050505061168b600f8888845f613366565b5f61017e611e9f8582613331565b5f611eaa8660081c90565b604051636b053d1d60e11b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f28339815191529063d60a7a3a906044015f604051808303815f87803b158015611f00575f80fd5b505af1158015611f12573d5f803e3d5ffd5b5050505061168b600b88888486613366565b604051632fd514cd60e11b8152600481018390523360248201525f907374c085a069fafd4f264b5200847edb1ade82b3c090635faa299a90604401602060405180830381865afa158015611f7a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f9e919061429c565b611fc45760405163268989cf60e11b815260048101849052336024820152604401610ea2565b61017f611fd18482613331565b61017e600160f885901c1b81165f03611ffd5760405163636f233560e11b815260040160405180910390fd5b5f6120088660081c90565b9050847effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168160f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036120715760405163b968846160e01b815260040160405180910390fd5b604051630abfbaad60e31b815260ff821660048201525f805160206145f2833981519152906355fdd568906024015f604051808303815f87803b1580156120b6575f80fd5b505af11580156120c8573d5f803e3d5ffd5b50505050601786867374c085a069fafd4f264b5200847edb1ade82b3c0466040516020016120fa95949392919061439f565b60408051601f198184030181529190528051602090910120935061ffff19841660f086901c61ff0016176040516346ce4e4960e11b8152600481018290523360248201529094507374c085a069fafd4f264b5200847edb1ade82b3c090638d9c9c92906044015f604051808303815f87803b158015612177575f80fd5b505af1158015612189573d5f803e3d5ffd5b5050505050505092915050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061222f57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166122237f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614155b15610e685760405163703e46dd60e11b815260040160405180910390fd5b610eb4612564565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156122af575060408051601f3d908101601f191682019092526122ac91810190614388565b60015b6122d757604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610ea2565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc811461231a57604051632a87526960e21b815260048101829052602401610ea2565b61232483836138b5565b505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610e685760405163703e46dd60e11b815260040160405180910390fd5b5f61017f6123808582613331565b5f61238b8660081c90565b6040516330cd786560e11b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f28339815191529063619af0ca906044015f604051808303815f87803b1580156123e1575f80fd5b505af11580156123f3573d5f803e3d5ffd5b5050505061168b600588888486613366565b5f61017e6124138582613331565b5f61241e8660081c90565b604051630b171ff760e01b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f283398151915290630b171ff7906044015f604051808303815f87803b158015612474575f80fd5b505af1158015612486573d5f803e3d5ffd5b5050505061168b60108888845f613366565b5f610fff6124a68582613331565b5f6124b18660081c90565b9050600160f81b80851690811480156124cd575060088260ff16115b156124eb5760405163dac55bcd60e01b815260040160405180910390fd5b6040516308194a5360e41b815260ff831660048201526001600160f81b0319821660248201525f805160206145f283398151915290638194a530906044015f604051808303815f87803b158015612540575f80fd5b505af1158015612552573d5f803e3d5ffd5b5050505061168b600c8888845f613366565b3361256d610fdd565b6001600160a01b031614610e685760405163118cdaa760e01b8152336004820152602401610ea2565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319168155610cff8261390a565b5f61017e6125dc8582613331565b5f6125e78660081c90565b604051630bf4df3b60e11b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f2833981519152906317e9be76906044015f604051808303815f87803b15801561263d575f80fd5b505af115801561264f573d5f803e3d5ffd5b5050505061168b600288888486613366565b5f61017e61266f8582613331565b5f61267a8660081c90565b60405163061b95e560e21b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f28339815191529063186e5794906044015f604051808303815f87803b1580156126d0575f80fd5b505af11580156126e2573d5f803e3d5ffd5b5050505061168b600888888486613366565b5f61017e6127028582613331565b5f61270d8660081c90565b604051630144371760e41b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f2833981519152906314437170906044015f604051808303815f87803b158015612763575f80fd5b505af1158015612775573d5f803e3d5ffd5b5050505061168b600188888486613366565b7fa436a06f0efce5ea38c956a21e24202a59b3b746d48a23fb52b4a5bc33fe3e0080545f91907374c085a069fafd4f264b5200847edb1ade82b3c0466127ce6001436143fb565b60408051602081019590955260609390931b6bffffffffffffffffffffffff191692840192909252605483015240607482015242609482015260b40160408051601f1981840301815291905280516020909101208154909250815f6128328361440e565b91905055505090565b5f610f7f60f884901c6001811b821683036128695760405163636f233560e11b815260040160405180910390fd5b60405162d435d160e31b815260ff821660048201525f805160206145f2833981519152906306a1ae88906024015f604051808303815f87803b1580156128ad575f80fd5b505af11580156128bf573d5f803e3d5ffd5b50505050601a85856040516020016128d993929190614426565b60408051601f198184030181529190528051602090910120925061ffff198316600882901b61ff0016176040516346ce4e4960e11b8152600481018290523360248201529093507374c085a069fafd4f264b5200847edb1ade82b3c090638d9c9c92906044015f604051808303815f87803b158015612956575f80fd5b505af1158015612968573d5f803e3d5ffd5b50505050505092915050565b5f61017e6129828582613331565b5f61298d8660081c90565b604051630b20432b60e21b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f283398151915290632c810cac906044015f604051808303815f87803b1580156129e3575f80fd5b505af11580156129f5573d5f803e3d5ffd5b5050505061168b60118888845f613366565b5f61017e612a158582613331565b5f612a208660081c90565b60405163fced972760e01b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f28339815191529063fced9727906044015f604051808303815f87803b158015612a76575f80fd5b505af1158015612a88573d5f803e3d5ffd5b5050505061168b601388888486613366565b5f61017e612aa88582613331565b5f612ab38660081c90565b60405163801ec40160e01b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f28339815191529063801ec401906044015f604051808303815f87803b158015612b09575f80fd5b505af1158015612b1b573d5f803e3d5ffd5b5050505061168b601288888486613366565b5f61017e612b3b8382613331565b5f612b468460081c90565b6040516333becb3b60e01b815260ff821660048201529091505f805160206145f2833981519152906333becb3b906024015f604051808303815f87803b158015612b8e575f80fd5b505af1158015612ba0573d5f803e3d5ffd5b50505050611a62601485613743565b5f610e00612bbd8582613331565b5f612bc88660081c90565b9050600160f81b808516908114612bf2576040516309bbc1b360e31b815260040160405180910390fd5b6040516308194a5360e41b815260ff831660048201526001600160f81b0319821660248201525f805160206145f283398151915290638194a530906044015f604051808303815f87803b158015612c47575f80fd5b505af1158015612c59573d5f803e3d5ffd5b5050604051632fd514cd60e11b8152600481018a90523360248201527374c085a069fafd4f264b5200847edb1ade82b3c09250635faa299a9150604401602060405180830381865afa158015612cb1573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612cd5919061429c565b612cfb5760405163268989cf60e11b815260048101889052336024820152604401610ea2565b612d068651836135c3565b600c8787837374c085a069fafd4f264b5200847edb1ade82b3c0466040516020016118b0969594939291906142de565b5f610fff612d448482613331565b5f612d4f8560081c90565b60405163e7b5afe360e01b815260ff821660048201529091505f805160206145f28339815191529063e7b5afe3906024015f604051808303815f87803b158015612d97575f80fd5b505af1158015612da9573d5f803e3d5ffd5b50505050612dba601987878761397a565b9695505050505050565b5f600160f81b80831614612deb57604051634f224e5360e01b815260040160405180910390fd5b825f03612e0b576040516323d359a360e01b815260040160405180910390fd5b61017e612e188582613331565b5f612e238660081c90565b604051634bf5249160e11b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f2833981519152906397ea4922906044015f604051808303815f87803b158015612e79575f80fd5b505af1158015612e8b573d5f803e3d5ffd5b5050505061168b600488888486613366565b5f610e0060f883901c6001811b82168303612ecb5760405163636f233560e11b815260040160405180910390fd5b6040516328c6831160e21b815260ff821660048201525f805160206145f28339815191529063a31a0c44906024015f604051808303815f87803b158015612f10575f80fd5b505af1158015612f22573d5f803e3d5ffd5b50505050612f318551826135c3565b601885857374c085a069fafd4f264b5200847edb1ade82b3c0466040516020016128d9959493929190614462565b5f6101ff60f883901c6001811b82168303612f8d5760405163636f233560e11b815260040160405180910390fd5b6040516328c6831160e21b815260ff821660048201525f805160206145f28339815191529063a31a0c44906024015f604051808303815f87803b158015612fd2575f80fd5b505af1158015612fe4573d5f803e3d5ffd5b50505050601885857374c085a069fafd4f264b5200847edb1ade82b3c0466040516020016128d995949392919061439f565b5f61017f6130248582613331565b5f61302f8660081c90565b604051630585a0d560e11b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f283398151915290630b0b41aa906044015f604051808303815f87803b158015613085575f80fd5b505af1158015613097573d5f803e3d5ffd5b5050505061168b600688888486613366565b5f61017e6130b78582613331565b5f6130c28660081c90565b604051630ae767b360e01b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f283398151915290630ae767b3906044015f604051808303815f87803b158015613118575f80fd5b505af115801561312a573d5f803e3d5ffd5b5050505061168b600988888486613366565b5f61017e61314a8582613331565b5f6131558660081c90565b604051639ec9108760e01b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f283398151915290639ec91087906044015f604051808303815f87803b1580156131ab575f80fd5b505af11580156131bd573d5f803e3d5ffd5b5050505061168b5f88888486613366565b5f61017e60f884901c6001811b821683036131fc5760405163636f233560e11b815260040160405180910390fd5b61320586613c92565b6132225760405163127473a160e11b815260040160405180910390fd5b604051633d5e922160e11b815260ff821660048201525f805160206145f283398151915290637abd2442906024015f604051808303815f87803b158015613267575f80fd5b505af1158015613279573d5f803e3d5ffd5b50505050601b86868660405160200161329594939291906144c3565b60408051601f198184030181529190528051602090910120925061ffff198316600882901b61ff0016176040516346ce4e4960e11b8152600481018290523360248201529093507374c085a069fafd4f264b5200847edb1ade82b3c090638d9c9c92906044015f604051808303815f87803b158015613312575f80fd5b505af1158015613324573d5f803e3d5ffd5b5050505050509392505050565b5f61333c8360081c90565b9050600160ff82161b82165f036123245760405163636f233560e11b815260040160405180910390fd5b604051632fd514cd60e11b8152600481018590523360248201525f907374c085a069fafd4f264b5200847edb1ade82b3c090635faa299a90604401602060405180830381865afa1580156133bc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906133e0919061429c565b6134065760405163268989cf60e11b815260048101869052336024820152604401610ea2565b6001600160f81b031983165f036134f857604051632fd514cd60e11b8152600481018590523360248201527374c085a069fafd4f264b5200847edb1ade82b3c090635faa299a90604401602060405180830381865afa15801561346b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061348f919061429c565b6134b55760405163268989cf60e11b815260048101859052336024820152604401610ea2565b5f6134c08560081c90565b90505f6134cd8760081c90565b90508160ff168160ff16146134f557604051631f3158c760e01b815260040160405180910390fd5b50505b858585857374c085a069fafd4f264b5200847edb1ade82b3c04660405160200161352796959493929190614507565b60408051601f198184030181529190528051602090910120905061ffff198116600883901b61ff0016176040516346ce4e4960e11b8152600481018290523360248201529091507374c085a069fafd4f264b5200847edb1ade82b3c090638d9c9c92906044015f604051808303815f87803b1580156135a4575f80fd5b505af11580156135b6573d5f803e3d5ffd5b5050505095945050505050565b8060ff166009036135fb5781604014610cff5760405163b30c0c5760e01b815260ff8216600482015260248101839052604401610ea2565b8060ff16600a036136335781608014610cff5760405163b30c0c5760e01b815260ff8216600482015260248101839052604401610ea2565b8161010014610cff5760405163b30c0c5760e01b815260ff8216600482015260248101839052604401610ea2565b5f807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106136a9577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106136d5576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106136f357662386f26fc10000830492506010015b6305f5e100831061370b576305f5e100830492506008015b612710831061371f57612710830492506004015b60648310613731576064830492506002015b600a831061373d576001015b92915050565b604051632fd514cd60e11b8152600481018290523360248201525f907374c085a069fafd4f264b5200847edb1ade82b3c090635faa299a90604401602060405180830381865afa158015613799573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906137bd919061429c565b6137e35760405163268989cf60e11b815260048101839052336024820152604401610ea2565b82827374c085a069fafd4f264b5200847edb1ade82b3c04660405160200161380e9493929190614557565b604051602081830303815290604052805190602001205f1c90505f6138338360081c90565b905061ffff198216600882901b61ff0016176040516346ce4e4960e11b8152600481018290523360248201529092507374c085a069fafd4f264b5200847edb1ade82b3c090638d9c9c92906044015f604051808303815f87803b158015613898575f80fd5b505af11580156138aa573d5f803e3d5ffd5b505050505092915050565b6138be82613cb1565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a2805115613902576123248282613d27565b610cff613d99565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b604051632fd514cd60e11b8152600481018490523360248201525f907374c085a069fafd4f264b5200847edb1ade82b3c090635faa299a90604401602060405180830381865afa1580156139d0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906139f4919061429c565b613a1a5760405163268989cf60e11b815260048101859052336024820152604401610ea2565b604051632fd514cd60e11b8152600481018490523360248201527374c085a069fafd4f264b5200847edb1ade82b3c090635faa299a90604401602060405180830381865afa158015613a6e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613a92919061429c565b613ab85760405163268989cf60e11b815260048101849052336024820152604401610ea2565b604051632fd514cd60e11b8152600481018390523360248201527374c085a069fafd4f264b5200847edb1ade82b3c090635faa299a90604401602060405180830381865afa158015613b0c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613b30919061429c565b613b565760405163268989cf60e11b815260048101839052336024820152604401610ea2565b5f613b618560081c90565b90505f613b6e8560081c90565b90505f613b7b8560081c90565b905060ff831615613b9f5760405163636f233560e11b815260040160405180910390fd5b8060ff168260ff1614613bc557604051631f3158c760e01b815260040160405180910390fd5b878787877374c085a069fafd4f264b5200847edb1ade82b3c046604051602001613bf496959493929190614590565b60408051601f198184030181529190528051602090910120935061ffff198416600883901b61ff0016176040516346ce4e4960e11b8152600481018290523360248201529094507374c085a069fafd4f264b5200847edb1ade82b3c090638d9c9c92906044015f604051808303815f87803b158015613c71575f80fd5b505af1158015613c83573d5f803e3d5ffd5b50505050505050949350505050565b5f808211801561373d5750613ca86001836143fb565b82161592915050565b806001600160a01b03163b5f03613ce657604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610ea2565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b031684604051613d4391906145d6565b5f60405180830381855af49150503d805f8114613d7b576040519150601f19603f3d011682016040523d82523d5f602084013e613d80565b606091505b5091509150613d90858383613db8565b95945050505050565b3415610e685760405163b398979f60e01b815260040160405180910390fd5b606082613dcd57613dc882613e17565b613e10565b8151158015613de457506001600160a01b0384163b155b15613e0d57604051639996b31560e01b81526001600160a01b0385166004820152602401610ea2565b50805b9392505050565b805115613e275780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160f81b031981168114613e57575f80fd5b919050565b5f805f60608486031215613e6e575f80fd5b8335925060208401359150613e8560408501613e40565b90509250925092565b634e487b7160e01b5f52604160045260245ffd5b5f82601f830112613eb1575f80fd5b813567ffffffffffffffff80821115613ecc57613ecc613e8e565b604051601f8301601f19908116603f01168101908282118183101715613ef457613ef4613e8e565b81604052838152866020858801011115613f0c575f80fd5b836020870160208301375f602085830101528094505050505092915050565b5f805f60608486031215613f3d575f80fd5b83359250602084013567ffffffffffffffff811115613f5a575f80fd5b613f6686828701613ea2565b925050613e8560408501613e40565b5f5b83811015613f8f578181015183820152602001613f77565b50505f910152565b5f8151808452613fae816020860160208601613f75565b601f01601f19169290920160200192915050565b602081525f613e106020830184613f97565b5f60208284031215613fe4575f80fd5b5035919050565b80356001600160a01b0381168114613e57575f80fd5b5f805f8060808587031215614014575f80fd5b8435935061402460208601613feb565b9250604085013567ffffffffffffffff81111561403f575f80fd5b61404b87828801613ea2565b92505061405a60608601613e40565b905092959194509250565b5f8060408385031215614076575f80fd5b8235915061408660208401613e40565b90509250929050565b5f80604083850312156140a0575f80fd5b6140a983613feb565b9150602083013567ffffffffffffffff8111156140c4575f80fd5b6140d085828601613ea2565b9150509250929050565b5f602082840312156140ea575f80fd5b613e1082613e40565b5f805f60608486031215614105575f80fd5b505081359360208301359350604090920135919050565b5f806040838503121561412d575f80fd5b823567ffffffffffffffff811115614143575f80fd5b61414f85828601613ea2565b92505061408660208401613e40565b5f6020828403121561416e575f80fd5b613e1082613feb565b848152608060208201525f61418f6080830186613f97565b6001600160f81b0319949094166040830152506060015292915050565b5f85516141bd818460208a01613f75565b61103b60f11b90830190815285516141dc816002840160208a01613f75565b808201915050601760f91b8060028301528551614200816003850160208a01613f75565b6003920191820152835161421b816004840160208801613f75565b016004019695505050505050565b8581526001600160a01b038516602082015260a060408201525f61425060a0830186613f97565b6001600160f81b031994909416606083015250608001529392505050565b606081525f6142806060830186613f97565b6001600160f81b03199490941660208301525060400152919050565b5f602082840312156142ac575f80fd5b81518015158114613e10575f80fd5b601c81106142d757634e487b7160e01b5f52602160045260245ffd5b60f81b9052565b6142e881886142bb565b8560018201525f8551614302816021850160208a01613f75565b6001600160f81b0319959095166021929095019182019490945260609290921b6bffffffffffffffffffffffff191660228301526036820152605601949350505050565b5f6001600160a01b038086511683528060208701511660208401528060408701511660408401525083606083015260a06080830152613d9060a0830184613f97565b5f60208284031215614398575f80fd5b5051919050565b6143a981876142bb565b60018101949094526001600160f81b031992909216602184015260601b6bffffffffffffffffffffffff191660228301526036820152605601919050565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561373d5761373d6143e7565b5f6001820161441f5761441f6143e7565b5060010190565b61443081856142bb565b6001600160f81b03199290921660018301526fffffffffffffffffffffffffffffffff19166002820152601201919050565b61446c81876142bb565b5f8551614480816001850160208a01613f75565b6001600160f81b0319959095166001929095019182019490945260609290921b6bffffffffffffffffffffffff1916600283015260168201526036019392505050565b6144cd81866142bb565b60018101939093526001600160f81b03199190911660218301526fffffffffffffffffffffffffffffffff19166022820152603201919050565b61451181886142bb565b600181019590955260218501939093526001600160f81b031991909116604184015260601b6bffffffffffffffffffffffff191660428301526056820152607601919050565b61456181866142bb565b600181019390935260609190911b6bffffffffffffffffffffffff191660218301526035820152605501919050565b61459a81886142bb565b60018101959095526021850193909352604184019190915260601b6bffffffffffffffffffffffff191660618301526075820152609501919050565b5f82516145e7818460208701613f75565b919091019291505056fe0000000000000000000000002ea4b09a56bf59437c99293af54f8e39e11a68baa164736f6c6343000818000a", - "deployedBytecode": "0x6080604052600436106102d7575f3560e01c806389a4314b1161017b578063cb3b9407116100d1578063ec4057dc11610087578063f6859bdc11610062578063f6859bdc146107f0578063f953e42714610816578063fa33b7af14610835575f80fd5b8063ec4057dc14610793578063eee1833c146107b2578063f2fde38b146107d1575f80fd5b8063e0c5cbb3116100b7578063e0c5cbb314610741578063e30c397814610760578063e71746b814610774575f80fd5b8063cb3b940714610703578063e0c516ae14610722575f80fd5b8063a86e9de511610131578063a8c7c2c11161010c578063a8c7c2c114610676578063ad3cb1cc1461069c578063bc47139a146106e4575f80fd5b8063a86e9de514610619578063a87deac414610638578063a8b42a8914610657575f80fd5b80638da5cb5b116101615780638da5cb5b146105c7578063900d294e146105db5780639675211f146105fa575f80fd5b806389a4314b146105895780638c14cc21146105a8575f80fd5b80634be68d2011610230578063694daf72116101e6578063715018a6116101c1578063715018a61461054257806379ba509714610556578063816d57d31461056a575f80fd5b8063694daf72146104df5780636a8c8eb4146104fe5780636be3175814610523575f80fd5b806352d1902d1161021657806352d1902d14610479578063601303d11461048d578063666a3588146104c0575f80fd5b80634be68d20146104455780634f1ef28614610464575f80fd5b8063192710811161029057806336cdd31b1161026b57806336cdd31b146103e85780633e63c50a1461040757806344ae9c5c14610426575f80fd5b8063192710811461038b5780632c7d67b7146103aa5780632e817ff0146103c9575f80fd5b80630b90dfc3116102c05780630b90dfc31461032c5780630d8e6e2c1461034b57806313801ffa1461036c575f80fd5b8063052896f1146102db578063059073431461030d575b5f80fd5b3480156102e6575f80fd5b506102fa6102f5366004613e5c565b610854565b6040519081526020015b60405180910390f35b348015610318575f80fd5b506102fa610327366004613e5c565b6108c1565b348015610337575f80fd5b506102fa610346366004613f2b565b610923565b348015610356575f80fd5b5061035f610970565b6040516103049190613fc2565b348015610377575f80fd5b506102fa610386366004613fd4565b6109eb565b348015610396575f80fd5b506102fa6103a5366004613e5c565b610a39565b3480156103b5575f80fd5b506102fa6103c4366004613e5c565b610a9b565b3480156103d4575f80fd5b506102fa6103e3366004614001565b610afd565b3480156103f3575f80fd5b506102fa610402366004613e5c565b610b5d565b348015610412575f80fd5b506102fa610421366004613e5c565b610bbf565b348015610431575f80fd5b506102fa610440366004613e5c565b610c21565b348015610450575f80fd5b506102fa61045f366004614065565b610c83565b61047761047236600461408f565b610ce4565b005b348015610484575f80fd5b506102fa610d03565b348015610498575f80fd5b505f805160206145f28339815191525b6040516001600160a01b039091168152602001610304565b3480156104cb575f80fd5b506102fa6104da366004613e5c565b610d31565b3480156104ea575f80fd5b506102fa6104f9366004613e5c565b610d93565b348015610509575f80fd5b506105115f81565b60405160ff9091168152602001610304565b34801561052e575f80fd5b506102fa61053d366004613e5c565b610df5565b34801561054d575f80fd5b50610477610e57565b348015610561575f80fd5b50610477610e6a565b348015610575575f80fd5b506102fa610584366004613e5c565b610eb7565b348015610594575f80fd5b506102fa6105a3366004613e5c565b610f19565b3480156105b3575f80fd5b506102fa6105c2366004613e5c565b610f7b565b3480156105d2575f80fd5b506104a8610fdd565b3480156105e6575f80fd5b506102fa6105f53660046140da565b611011565b348015610605575f80fd5b506102fa610614366004613e5c565b61108f565b348015610624575f80fd5b506102fa610633366004613e5c565b6110f1565b348015610643575f80fd5b506102fa610652366004613e5c565b611153565b348015610662575f80fd5b506102fa610671366004613fd4565b6111b5565b348015610681575f80fd5b507359aad6dc3c909aeed1916937cc310fbfbb118c8c6104a8565b3480156106a7575f80fd5b5061035f6040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b3480156106ef575f80fd5b506102fa6106fe366004613f2b565b6111fa565b34801561070e575f80fd5b506102fa61071d3660046140f3565b611247565b34801561072d575f80fd5b506102fa61073c366004613e5c565b61129d565b34801561074c575f80fd5b506102fa61075b36600461411c565b6112ff565b34801561076b575f80fd5b506104a8611349565b34801561077f575f80fd5b506102fa61078e366004614065565b611371565b34801561079e575f80fd5b506102fa6107ad366004613e5c565b6113c8565b3480156107bd575f80fd5b506102fa6107cc366004613e5c565b61142a565b3480156107dc575f80fd5b506104776107eb36600461415e565b61148c565b3480156107fb575f80fd5b507374c085a069fafd4f264b5200847edb1ade82b3c06104a8565b348015610821575f80fd5b506102fa610830366004613e5c565b611511565b348015610840575f80fd5b506102fa61084f366004614065565b611573565b5f6108608484846115f8565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f07305072f94f1a0b168f31b63591b41f1cac5ba64014969410b6ceb606538ead906080015b60405180910390a29392505050565b5f6108cd848484611696565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f922410bc7a9d7326d875cdb9349f57cea73e4bb0b465d9d4675d5288ad8be22c906080016108b2565b5f61092f848484611729565b9050336001600160a01b03167f05b83108d217815a3573f69c82e0c26569d4c410780a147d494af52f6e008410858585856040516108b29493929190614177565b60606040518060400160405280600c81526020017f544648454578656375746f7200000000000000000000000000000000000000008152506109b15f611943565b6109bb6001611943565b6109c45f611943565b6040516020016109d794939291906141ac565b604051602081830303815290604052905090565b5f6109f5826119e0565b604080518481526020810183905291925033917f3dc0f0d4d45d9ff119f66df01d3e2d7a73493aae1eae33775b16b07789aafac391015b60405180910390a2919050565b5f610a45848484611a6a565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f3a0c714dad01280382b89beba9f8177783d66b696481415e929f1b02e328a541906080016108b2565b5f610aa7848484611b36565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907ffa4f6ace03749e024df9221c74694ef1e8c3066def6f40520e26e59708dd7056906080016108b2565b5f610b0a85858585611bc9565b9050336001600160a01b03167f0bb6dd385f84cff601e6e660e5e80ef8739b5935079f721f0cee8964491046ca8686868686604051610b4d959493929190614229565b60405180910390a2949350505050565b5f610b69848484611d25565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f92096614ef9cbda0318055bda767c14fb22206cc2cb5dcddf7b38eba7d6b2d29906080016108b2565b5f610bcb848484611dfe565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f46d5de07bfd63ec01cfb961ff5c91ce53698eb8bc8fe08079508daa3d5eadf89906080016108b2565b5f610c2d848484611e91565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fbf560b43a62ae4c9590fa5e029ed029e1710d290f9f8ece6f36108e4ed312e3e906080016108b2565b5f610c8e8383611f24565b604080518581526001600160f81b03198516602082015290810182905290915033907f2150548fbe9722e60d7871549c9870872d4d877ac58a4c1b8bc055f73446b523906060015b60405180910390a292915050565b610cec612196565b610cf58261224d565b610cff8282612255565b5050565b5f610d0c612329565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b5f610d3d848484612372565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f7ff8e1723ca2cb3d4048fe755a5a185dd3e34d5344276f68c124fd5d5571059a906080016108b2565b5f610d9f848484612405565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f0f80e720ac1dd11637d38469506987006a996cb767478e0ee4357bf1ce12bb19906080016108b2565b5f610e01848484612498565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f9cfba8fc76d24936bdc857fe511b746cbc99a2425215d19ec72275bbc5a8f0f4906080016108b2565b610e5f612564565b610e685f612596565b565b3380610e74611349565b6001600160a01b031614610eab5760405163118cdaa760e01b81526001600160a01b03821660048201526024015b60405180910390fd5b610eb481612596565b50565b5f610ec38484846125ce565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f60a2b12ffdd4220bac10a5ed2cdd52d3ce4371b5262968193ab0e747db797c6a906080016108b2565b5f610f25848484612661565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f34c152a238a9c7a14b92def6b25511a8ac6cdf8f78dd60fbb476ca5fb1f0fd63906080016108b2565b5f610f878484846126f4565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f7f5c7ffaaf8e3391055dd5d55363f280b389861e2c9e4fb14ba861c803dd49ec906080016108b2565b5f807f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c1993005b546001600160a01b031692915050565b5f8061101b612787565b9050611027838261283b565b604080516001600160f81b0319861681526fffffffffffffffffffffffffffffffff198416602082015290810182905290925033907f50b413a0e3940d2f18ab88ad84adbaa5d72cc8d82e72efe97cd34c4ad3677f639060600160405180910390a250919050565b5f61109b848484612974565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fd8fd6601045cf1d0a0ab28a28526e5596d7cce32b35ad44de08d1e9969441aa2906080016108b2565b5f6110fd848484612a07565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f910b9089d67acb16e2833d86b8c100363cfae1bdcbd4fd228b45dde3dc4d0a9a906080016108b2565b5f61115f848484612a9a565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fad57799587312c4dec422afa3c1d721b88fb0d452cd5ed15a52c9b04f1225da3906080016108b2565b5f6111bf82612b2d565b604080518481526020810183905291925033917f2a54b047132067554c36d8d9aecc226f5518ab5af9a1e19b4e4d1cb401a56e909101610a2c565b5f611206848484612baf565b9050336001600160a01b03167f2e29e32638d6cfd749496bf7782fd284e2ce4782d0a0ea61a8f76ccfa0d06988858585856040516108b29493929190614177565b5f611253848484612d36565b60408051868152602081018690529081018490526060810182905290915033907f12e2bc1a29195780b5f5a0d2e773b1d343263d80b3cb9dcb051034bac5732b43906080016108b2565b5f6112a9848484612dc4565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907ffccefc29052f5ba36b6c1adc1432c30d32af11ff8796c6a5549da52fbd7d5de7906080016108b2565b5f61130a8383612e9d565b9050336001600160a01b03167f90e8a043ed9e0580c961b547a98e518f1cd95fc4feb95f716eb8d9ea27e18b02848484604051610cd69392919061426e565b5f807f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00611001565b5f61137c8383612f5f565b604080518581526001600160f81b03198516602082015290810182905290915033907f96e65db2c6b1d30ffc84b4d5dc25fec064352ac89ff65a4463b4ed9bc4b6b70390606001610cd6565b5f6113d4848484613016565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f11cbf38d5137daf232c3d7dcc267c99b6e9a3c47f523eb64edce18490e26572a906080016108b2565b5f6114368484846130a9565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907fa8c1a660b3b8efbeb115d6d6b0d7b2dafe6e16c58a60b54b04620ebfddd0ad68906080016108b2565b611494612564565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319166001600160a01b03831690811782556114d8610fdd565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a35050565b5f61151d84848461313c565b60408051868152602081018690526001600160f81b03198516918101919091526060810182905290915033907f9d4485ee9ce87c267c409bdb9b696a82a89c995903092b84553de8edc2592625906080016108b2565b5f8061157d612787565b905061158a8484836131ce565b604080518681526001600160f81b0319861660208201526fffffffffffffffffffffffffffffffff1984168183015260608101839052905191935033917fc413adc84697f5254550ac298a61ed4e3ab3e6bc78d472f61e5322f974bc933b9181900360800190a25092915050565b5f61017e6116068582613331565b5f6116118660081c90565b60405163f1ec4e3d60e01b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f28339815191529063f1ec4e3d906044015f604051808303815f87803b158015611667575f80fd5b505af1158015611679573d5f803e3d5ffd5b5050505061168b600e8888845f613366565b979650505050505050565b5f61017e6116a48582613331565b5f6116af8660081c90565b60405163d52059c160e01b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f28339815191529063d52059c1906044015f604051808303815f87803b158015611705575f80fd5b505af1158015611717573d5f803e3d5ffd5b5050505061168b600a88888486613366565b5f610e006117378582613331565b5f6117428660081c90565b9050600160f81b80851690811461176c576040516309bbc1b360e31b815260040160405180910390fd5b604051633b470ee160e01b815260ff831660048201526001600160f81b0319821660248201525f805160206145f283398151915290633b470ee1906044015f604051808303815f87803b1580156117c1575f80fd5b505af11580156117d3573d5f803e3d5ffd5b5050604051632fd514cd60e11b8152600481018a90523360248201527374c085a069fafd4f264b5200847edb1ade82b3c09250635faa299a9150604401602060405180830381865afa15801561182b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061184f919061429c565b6118755760405163268989cf60e11b815260048101889052336024820152604401610ea2565b6118808651836135c3565b600d8787837374c085a069fafd4f264b5200847edb1ade82b3c0466040516020016118b0969594939291906142de565b60408051601f198184030181529190528051602090910120935061ffff1984166040516346ce4e4960e11b8152600481018290523360248201529094507374c085a069fafd4f264b5200847edb1ade82b3c090638d9c9c92906044015f604051808303815f87803b158015611923575f80fd5b505af1158015611935573d5f803e3d5ffd5b505050505050509392505050565b60605f61194f83613661565b60010190505f8167ffffffffffffffff81111561196e5761196e613e8e565b6040519080825280601f01601f191660200182016040528015611998576020820181803683370190505b5090508181016020015b5f19017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846119a257509392505050565b5f61017f6119ee8382613331565b5f6119f98460081c90565b6040516322f1ff5160e11b815260ff821660048201529091505f805160206145f2833981519152906345e3fea2906024015f604051808303815f87803b158015611a41575f80fd5b505af1158015611a53573d5f803e3d5ffd5b50505050611a62601585613743565b949350505050565b5f610fff611a788582613331565b5f611a838660081c90565b9050600160f81b8085169081148015611a9f575060088260ff16115b15611abd5760405163dac55bcd60e01b815260040160405180910390fd5b604051633b470ee160e01b815260ff831660048201526001600160f81b0319821660248201525f805160206145f283398151915290633b470ee1906044015f604051808303815f87803b158015611b12575f80fd5b505af1158015611b24573d5f803e3d5ffd5b5050505061168b600d8888845f613366565b5f61017f611b448582613331565b5f611b4f8660081c90565b604051632f891e1b60e01b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f283398151915290632f891e1b906044015f604051808303815f87803b158015611ba5575f80fd5b505af1158015611bb7573d5f803e3d5ffd5b5050505061168b600788888486613366565b604080516060810182527374c085a069fafd4f264b5200847edb1ade82b3c081526001600160a01b038516602082015233918101919091525f9081611c0e8760081c90565b905060f884901c60ff821614611c375760405163b968846160e01b815260040160405180910390fd5b604051634d52c10760e01b81527359aad6dc3c909aeed1916937cc310fbfbb118c8c90634d52c10790611c729085908b908a90600401614346565b6020604051808303815f875af1158015611c8e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611cb29190614388565b6040516346ce4e4960e11b8152600481018290523360248201529093507374c085a069fafd4f264b5200847edb1ade82b3c090638d9c9c92906044015f604051808303815f87803b158015611d05575f80fd5b505af1158015611d17573d5f803e3d5ffd5b505050505050949350505050565b5f600160f81b80831614611d4c57604051634f224e5360e01b815260040160405180910390fd5b825f03611d6c576040516323d359a360e01b815260040160405180910390fd5b61017e611d798582613331565b5f611d848660081c90565b60405163293d01a360e21b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f28339815191529063a4f4068c906044015f604051808303815f87803b158015611dda575f80fd5b505af1158015611dec573d5f803e3d5ffd5b5050505061168b600388888486613366565b5f61017e611e0c8582613331565b5f611e178660081c90565b604051633941d74360e21b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f28339815191529063e5075d0c906044015f604051808303815f87803b158015611e6d575f80fd5b505af1158015611e7f573d5f803e3d5ffd5b5050505061168b600f8888845f613366565b5f61017e611e9f8582613331565b5f611eaa8660081c90565b604051636b053d1d60e11b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f28339815191529063d60a7a3a906044015f604051808303815f87803b158015611f00575f80fd5b505af1158015611f12573d5f803e3d5ffd5b5050505061168b600b88888486613366565b604051632fd514cd60e11b8152600481018390523360248201525f907374c085a069fafd4f264b5200847edb1ade82b3c090635faa299a90604401602060405180830381865afa158015611f7a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f9e919061429c565b611fc45760405163268989cf60e11b815260048101849052336024820152604401610ea2565b61017f611fd18482613331565b61017e600160f885901c1b81165f03611ffd5760405163636f233560e11b815260040160405180910390fd5b5f6120088660081c90565b9050847effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19168160f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916036120715760405163b968846160e01b815260040160405180910390fd5b604051630abfbaad60e31b815260ff821660048201525f805160206145f2833981519152906355fdd568906024015f604051808303815f87803b1580156120b6575f80fd5b505af11580156120c8573d5f803e3d5ffd5b50505050601786867374c085a069fafd4f264b5200847edb1ade82b3c0466040516020016120fa95949392919061439f565b60408051601f198184030181529190528051602090910120935061ffff19841660f086901c61ff0016176040516346ce4e4960e11b8152600481018290523360248201529094507374c085a069fafd4f264b5200847edb1ade82b3c090638d9c9c92906044015f604051808303815f87803b158015612177575f80fd5b505af1158015612189573d5f803e3d5ffd5b5050505050505092915050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061222f57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166122237f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b6001600160a01b031614155b15610e685760405163703e46dd60e11b815260040160405180910390fd5b610eb4612564565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156122af575060408051601f3d908101601f191682019092526122ac91810190614388565b60015b6122d757604051634c9c8ce360e01b81526001600160a01b0383166004820152602401610ea2565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc811461231a57604051632a87526960e21b815260048101829052602401610ea2565b61232483836138b5565b505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610e685760405163703e46dd60e11b815260040160405180910390fd5b5f61017f6123808582613331565b5f61238b8660081c90565b6040516330cd786560e11b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f28339815191529063619af0ca906044015f604051808303815f87803b1580156123e1575f80fd5b505af11580156123f3573d5f803e3d5ffd5b5050505061168b600588888486613366565b5f61017e6124138582613331565b5f61241e8660081c90565b604051630b171ff760e01b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f283398151915290630b171ff7906044015f604051808303815f87803b158015612474575f80fd5b505af1158015612486573d5f803e3d5ffd5b5050505061168b60108888845f613366565b5f610fff6124a68582613331565b5f6124b18660081c90565b9050600160f81b80851690811480156124cd575060088260ff16115b156124eb5760405163dac55bcd60e01b815260040160405180910390fd5b6040516308194a5360e41b815260ff831660048201526001600160f81b0319821660248201525f805160206145f283398151915290638194a530906044015f604051808303815f87803b158015612540575f80fd5b505af1158015612552573d5f803e3d5ffd5b5050505061168b600c8888845f613366565b3361256d610fdd565b6001600160a01b031614610e685760405163118cdaa760e01b8152336004820152602401610ea2565b7f237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c0080546001600160a01b0319168155610cff8261390a565b5f61017e6125dc8582613331565b5f6125e78660081c90565b604051630bf4df3b60e11b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f2833981519152906317e9be76906044015f604051808303815f87803b15801561263d575f80fd5b505af115801561264f573d5f803e3d5ffd5b5050505061168b600288888486613366565b5f61017e61266f8582613331565b5f61267a8660081c90565b60405163061b95e560e21b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f28339815191529063186e5794906044015f604051808303815f87803b1580156126d0575f80fd5b505af11580156126e2573d5f803e3d5ffd5b5050505061168b600888888486613366565b5f61017e6127028582613331565b5f61270d8660081c90565b604051630144371760e41b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f2833981519152906314437170906044015f604051808303815f87803b158015612763575f80fd5b505af1158015612775573d5f803e3d5ffd5b5050505061168b600188888486613366565b7fa436a06f0efce5ea38c956a21e24202a59b3b746d48a23fb52b4a5bc33fe3e0080545f91907374c085a069fafd4f264b5200847edb1ade82b3c0466127ce6001436143fb565b60408051602081019590955260609390931b6bffffffffffffffffffffffff191692840192909252605483015240607482015242609482015260b40160408051601f1981840301815291905280516020909101208154909250815f6128328361440e565b91905055505090565b5f610f7f60f884901c6001811b821683036128695760405163636f233560e11b815260040160405180910390fd5b60405162d435d160e31b815260ff821660048201525f805160206145f2833981519152906306a1ae88906024015f604051808303815f87803b1580156128ad575f80fd5b505af11580156128bf573d5f803e3d5ffd5b50505050601a85856040516020016128d993929190614426565b60408051601f198184030181529190528051602090910120925061ffff198316600882901b61ff0016176040516346ce4e4960e11b8152600481018290523360248201529093507374c085a069fafd4f264b5200847edb1ade82b3c090638d9c9c92906044015f604051808303815f87803b158015612956575f80fd5b505af1158015612968573d5f803e3d5ffd5b50505050505092915050565b5f61017e6129828582613331565b5f61298d8660081c90565b604051630b20432b60e21b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f283398151915290632c810cac906044015f604051808303815f87803b1580156129e3575f80fd5b505af11580156129f5573d5f803e3d5ffd5b5050505061168b60118888845f613366565b5f61017e612a158582613331565b5f612a208660081c90565b60405163fced972760e01b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f28339815191529063fced9727906044015f604051808303815f87803b158015612a76575f80fd5b505af1158015612a88573d5f803e3d5ffd5b5050505061168b601388888486613366565b5f61017e612aa88582613331565b5f612ab38660081c90565b60405163801ec40160e01b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f28339815191529063801ec401906044015f604051808303815f87803b158015612b09575f80fd5b505af1158015612b1b573d5f803e3d5ffd5b5050505061168b601288888486613366565b5f61017e612b3b8382613331565b5f612b468460081c90565b6040516333becb3b60e01b815260ff821660048201529091505f805160206145f2833981519152906333becb3b906024015f604051808303815f87803b158015612b8e575f80fd5b505af1158015612ba0573d5f803e3d5ffd5b50505050611a62601485613743565b5f610e00612bbd8582613331565b5f612bc88660081c90565b9050600160f81b808516908114612bf2576040516309bbc1b360e31b815260040160405180910390fd5b6040516308194a5360e41b815260ff831660048201526001600160f81b0319821660248201525f805160206145f283398151915290638194a530906044015f604051808303815f87803b158015612c47575f80fd5b505af1158015612c59573d5f803e3d5ffd5b5050604051632fd514cd60e11b8152600481018a90523360248201527374c085a069fafd4f264b5200847edb1ade82b3c09250635faa299a9150604401602060405180830381865afa158015612cb1573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612cd5919061429c565b612cfb5760405163268989cf60e11b815260048101889052336024820152604401610ea2565b612d068651836135c3565b600c8787837374c085a069fafd4f264b5200847edb1ade82b3c0466040516020016118b0969594939291906142de565b5f610fff612d448482613331565b5f612d4f8560081c90565b60405163e7b5afe360e01b815260ff821660048201529091505f805160206145f28339815191529063e7b5afe3906024015f604051808303815f87803b158015612d97575f80fd5b505af1158015612da9573d5f803e3d5ffd5b50505050612dba601987878761397a565b9695505050505050565b5f600160f81b80831614612deb57604051634f224e5360e01b815260040160405180910390fd5b825f03612e0b576040516323d359a360e01b815260040160405180910390fd5b61017e612e188582613331565b5f612e238660081c90565b604051634bf5249160e11b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f2833981519152906397ea4922906044015f604051808303815f87803b158015612e79575f80fd5b505af1158015612e8b573d5f803e3d5ffd5b5050505061168b600488888486613366565b5f610e0060f883901c6001811b82168303612ecb5760405163636f233560e11b815260040160405180910390fd5b6040516328c6831160e21b815260ff821660048201525f805160206145f28339815191529063a31a0c44906024015f604051808303815f87803b158015612f10575f80fd5b505af1158015612f22573d5f803e3d5ffd5b50505050612f318551826135c3565b601885857374c085a069fafd4f264b5200847edb1ade82b3c0466040516020016128d9959493929190614462565b5f6101ff60f883901c6001811b82168303612f8d5760405163636f233560e11b815260040160405180910390fd5b6040516328c6831160e21b815260ff821660048201525f805160206145f28339815191529063a31a0c44906024015f604051808303815f87803b158015612fd2575f80fd5b505af1158015612fe4573d5f803e3d5ffd5b50505050601885857374c085a069fafd4f264b5200847edb1ade82b3c0466040516020016128d995949392919061439f565b5f61017f6130248582613331565b5f61302f8660081c90565b604051630585a0d560e11b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f283398151915290630b0b41aa906044015f604051808303815f87803b158015613085575f80fd5b505af1158015613097573d5f803e3d5ffd5b5050505061168b600688888486613366565b5f61017e6130b78582613331565b5f6130c28660081c90565b604051630ae767b360e01b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f283398151915290630ae767b3906044015f604051808303815f87803b158015613118575f80fd5b505af115801561312a573d5f803e3d5ffd5b5050505061168b600988888486613366565b5f61017e61314a8582613331565b5f6131558660081c90565b604051639ec9108760e01b815260ff82166004820152600160f81b8616602482018190529192505f805160206145f283398151915290639ec91087906044015f604051808303815f87803b1580156131ab575f80fd5b505af11580156131bd573d5f803e3d5ffd5b5050505061168b5f88888486613366565b5f61017e60f884901c6001811b821683036131fc5760405163636f233560e11b815260040160405180910390fd5b61320586613c92565b6132225760405163127473a160e11b815260040160405180910390fd5b604051633d5e922160e11b815260ff821660048201525f805160206145f283398151915290637abd2442906024015f604051808303815f87803b158015613267575f80fd5b505af1158015613279573d5f803e3d5ffd5b50505050601b86868660405160200161329594939291906144c3565b60408051601f198184030181529190528051602090910120925061ffff198316600882901b61ff0016176040516346ce4e4960e11b8152600481018290523360248201529093507374c085a069fafd4f264b5200847edb1ade82b3c090638d9c9c92906044015f604051808303815f87803b158015613312575f80fd5b505af1158015613324573d5f803e3d5ffd5b5050505050509392505050565b5f61333c8360081c90565b9050600160ff82161b82165f036123245760405163636f233560e11b815260040160405180910390fd5b604051632fd514cd60e11b8152600481018590523360248201525f907374c085a069fafd4f264b5200847edb1ade82b3c090635faa299a90604401602060405180830381865afa1580156133bc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906133e0919061429c565b6134065760405163268989cf60e11b815260048101869052336024820152604401610ea2565b6001600160f81b031983165f036134f857604051632fd514cd60e11b8152600481018590523360248201527374c085a069fafd4f264b5200847edb1ade82b3c090635faa299a90604401602060405180830381865afa15801561346b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061348f919061429c565b6134b55760405163268989cf60e11b815260048101859052336024820152604401610ea2565b5f6134c08560081c90565b90505f6134cd8760081c90565b90508160ff168160ff16146134f557604051631f3158c760e01b815260040160405180910390fd5b50505b858585857374c085a069fafd4f264b5200847edb1ade82b3c04660405160200161352796959493929190614507565b60408051601f198184030181529190528051602090910120905061ffff198116600883901b61ff0016176040516346ce4e4960e11b8152600481018290523360248201529091507374c085a069fafd4f264b5200847edb1ade82b3c090638d9c9c92906044015f604051808303815f87803b1580156135a4575f80fd5b505af11580156135b6573d5f803e3d5ffd5b5050505095945050505050565b8060ff166009036135fb5781604014610cff5760405163b30c0c5760e01b815260ff8216600482015260248101839052604401610ea2565b8060ff16600a036136335781608014610cff5760405163b30c0c5760e01b815260ff8216600482015260248101839052604401610ea2565b8161010014610cff5760405163b30c0c5760e01b815260ff8216600482015260248101839052604401610ea2565b5f807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106136a9577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106136d5576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106136f357662386f26fc10000830492506010015b6305f5e100831061370b576305f5e100830492506008015b612710831061371f57612710830492506004015b60648310613731576064830492506002015b600a831061373d576001015b92915050565b604051632fd514cd60e11b8152600481018290523360248201525f907374c085a069fafd4f264b5200847edb1ade82b3c090635faa299a90604401602060405180830381865afa158015613799573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906137bd919061429c565b6137e35760405163268989cf60e11b815260048101839052336024820152604401610ea2565b82827374c085a069fafd4f264b5200847edb1ade82b3c04660405160200161380e9493929190614557565b604051602081830303815290604052805190602001205f1c90505f6138338360081c90565b905061ffff198216600882901b61ff0016176040516346ce4e4960e11b8152600481018290523360248201529092507374c085a069fafd4f264b5200847edb1ade82b3c090638d9c9c92906044015f604051808303815f87803b158015613898575f80fd5b505af11580156138aa573d5f803e3d5ffd5b505050505092915050565b6138be82613cb1565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a2805115613902576123248282613d27565b610cff613d99565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b604051632fd514cd60e11b8152600481018490523360248201525f907374c085a069fafd4f264b5200847edb1ade82b3c090635faa299a90604401602060405180830381865afa1580156139d0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906139f4919061429c565b613a1a5760405163268989cf60e11b815260048101859052336024820152604401610ea2565b604051632fd514cd60e11b8152600481018490523360248201527374c085a069fafd4f264b5200847edb1ade82b3c090635faa299a90604401602060405180830381865afa158015613a6e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613a92919061429c565b613ab85760405163268989cf60e11b815260048101849052336024820152604401610ea2565b604051632fd514cd60e11b8152600481018390523360248201527374c085a069fafd4f264b5200847edb1ade82b3c090635faa299a90604401602060405180830381865afa158015613b0c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613b30919061429c565b613b565760405163268989cf60e11b815260048101839052336024820152604401610ea2565b5f613b618560081c90565b90505f613b6e8560081c90565b90505f613b7b8560081c90565b905060ff831615613b9f5760405163636f233560e11b815260040160405180910390fd5b8060ff168260ff1614613bc557604051631f3158c760e01b815260040160405180910390fd5b878787877374c085a069fafd4f264b5200847edb1ade82b3c046604051602001613bf496959493929190614590565b60408051601f198184030181529190528051602090910120935061ffff198416600883901b61ff0016176040516346ce4e4960e11b8152600481018290523360248201529094507374c085a069fafd4f264b5200847edb1ade82b3c090638d9c9c92906044015f604051808303815f87803b158015613c71575f80fd5b505af1158015613c83573d5f803e3d5ffd5b50505050505050949350505050565b5f808211801561373d5750613ca86001836143fb565b82161592915050565b806001600160a01b03163b5f03613ce657604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610ea2565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b031684604051613d4391906145d6565b5f60405180830381855af49150503d805f8114613d7b576040519150601f19603f3d011682016040523d82523d5f602084013e613d80565b606091505b5091509150613d90858383613db8565b95945050505050565b3415610e685760405163b398979f60e01b815260040160405180910390fd5b606082613dcd57613dc882613e17565b613e10565b8151158015613de457506001600160a01b0384163b155b15613e0d57604051639996b31560e01b81526001600160a01b0385166004820152602401610ea2565b50805b9392505050565b805115613e275780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b80356001600160f81b031981168114613e57575f80fd5b919050565b5f805f60608486031215613e6e575f80fd5b8335925060208401359150613e8560408501613e40565b90509250925092565b634e487b7160e01b5f52604160045260245ffd5b5f82601f830112613eb1575f80fd5b813567ffffffffffffffff80821115613ecc57613ecc613e8e565b604051601f8301601f19908116603f01168101908282118183101715613ef457613ef4613e8e565b81604052838152866020858801011115613f0c575f80fd5b836020870160208301375f602085830101528094505050505092915050565b5f805f60608486031215613f3d575f80fd5b83359250602084013567ffffffffffffffff811115613f5a575f80fd5b613f6686828701613ea2565b925050613e8560408501613e40565b5f5b83811015613f8f578181015183820152602001613f77565b50505f910152565b5f8151808452613fae816020860160208601613f75565b601f01601f19169290920160200192915050565b602081525f613e106020830184613f97565b5f60208284031215613fe4575f80fd5b5035919050565b80356001600160a01b0381168114613e57575f80fd5b5f805f8060808587031215614014575f80fd5b8435935061402460208601613feb565b9250604085013567ffffffffffffffff81111561403f575f80fd5b61404b87828801613ea2565b92505061405a60608601613e40565b905092959194509250565b5f8060408385031215614076575f80fd5b8235915061408660208401613e40565b90509250929050565b5f80604083850312156140a0575f80fd5b6140a983613feb565b9150602083013567ffffffffffffffff8111156140c4575f80fd5b6140d085828601613ea2565b9150509250929050565b5f602082840312156140ea575f80fd5b613e1082613e40565b5f805f60608486031215614105575f80fd5b505081359360208301359350604090920135919050565b5f806040838503121561412d575f80fd5b823567ffffffffffffffff811115614143575f80fd5b61414f85828601613ea2565b92505061408660208401613e40565b5f6020828403121561416e575f80fd5b613e1082613feb565b848152608060208201525f61418f6080830186613f97565b6001600160f81b0319949094166040830152506060015292915050565b5f85516141bd818460208a01613f75565b61103b60f11b90830190815285516141dc816002840160208a01613f75565b808201915050601760f91b8060028301528551614200816003850160208a01613f75565b6003920191820152835161421b816004840160208801613f75565b016004019695505050505050565b8581526001600160a01b038516602082015260a060408201525f61425060a0830186613f97565b6001600160f81b031994909416606083015250608001529392505050565b606081525f6142806060830186613f97565b6001600160f81b03199490941660208301525060400152919050565b5f602082840312156142ac575f80fd5b81518015158114613e10575f80fd5b601c81106142d757634e487b7160e01b5f52602160045260245ffd5b60f81b9052565b6142e881886142bb565b8560018201525f8551614302816021850160208a01613f75565b6001600160f81b0319959095166021929095019182019490945260609290921b6bffffffffffffffffffffffff191660228301526036820152605601949350505050565b5f6001600160a01b038086511683528060208701511660208401528060408701511660408401525083606083015260a06080830152613d9060a0830184613f97565b5f60208284031215614398575f80fd5b5051919050565b6143a981876142bb565b60018101949094526001600160f81b031992909216602184015260601b6bffffffffffffffffffffffff191660228301526036820152605601919050565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561373d5761373d6143e7565b5f6001820161441f5761441f6143e7565b5060010190565b61443081856142bb565b6001600160f81b03199290921660018301526fffffffffffffffffffffffffffffffff19166002820152601201919050565b61446c81876142bb565b5f8551614480816001850160208a01613f75565b6001600160f81b0319959095166001929095019182019490945260609290921b6bffffffffffffffffffffffff1916600283015260168201526036019392505050565b6144cd81866142bb565b60018101939093526001600160f81b03199190911660218301526fffffffffffffffffffffffffffffffff19166022820152603201919050565b61451181886142bb565b600181019590955260218501939093526001600160f81b031991909116604184015260601b6bffffffffffffffffffffffff191660428301526056820152607601919050565b61456181866142bb565b600181019390935260609190911b6bffffffffffffffffffffffff191660218301526035820152605501919050565b61459a81886142bb565b60018101959095526021850193909352604184019190915260601b6bffffffffffffffffffffffff191660618301526075820152609501919050565b5f82516145e7818460208701613f75565b919091019291505056fe0000000000000000000000002ea4b09a56bf59437c99293af54f8e39e11a68baa164736f6c6343000818000a", - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/fhevm-engine/fhevm-listener/src/contracts/mod.rs b/fhevm-engine/fhevm-listener/src/contracts/mod.rs index 2c064a8e..69965ce1 100644 --- a/fhevm-engine/fhevm-listener/src/contracts/mod.rs +++ b/fhevm-engine/fhevm-listener/src/contracts/mod.rs @@ -8,7 +8,7 @@ sol!( #[sol(rpc)] #[derive(Debug, serde::Serialize, serde::Deserialize)] AclContract, - "src/contracts/ACL.json.abi" + "../../contracts/artifacts/contracts/ACL.sol/ACL.json" ); sol!( @@ -16,5 +16,5 @@ sol!( #[sol(rpc)] #[derive(Debug, serde::Serialize, serde::Deserialize)] TfheContract, - "src/contracts/TFHEExecutor.json.abi" + "../../contracts/artifacts/contracts/HTTPZExecutor.sol/HTTPZExecutor.json" ); diff --git a/fhevm-engine/fhevm-listener/src/database/tfhe_event_propagate.rs b/fhevm-engine/fhevm-listener/src/database/tfhe_event_propagate.rs index b1044e63..a3832d12 100644 --- a/fhevm-engine/fhevm-listener/src/database/tfhe_event_propagate.rs +++ b/fhevm-engine/fhevm-listener/src/database/tfhe_event_propagate.rs @@ -18,11 +18,12 @@ use crate::contracts::TfheContract::TfheContractEvents; type CoprocessorApiKey = Uuid; type FheOperation = i32; -pub type Handle = Uint<256, 4>; +pub type Handle = FixedBytes<32>; pub type TenantId = i32; pub type ChainId = u64; -pub type ToType = FixedBytes<1>; +pub type ToType = u8; pub type ScalarByte = FixedBytes<1>; +pub type ClearConst = Uint<256, 4>; const MAX_RETRIES_FOR_NOTIFY: usize = 5; pub const EVENT_PBS_COMPUTATIONS: &str = "event_pbs_computations"; @@ -136,7 +137,7 @@ impl Database { ) -> Result<(), SqlxError> { let dependencies_handles = dependencies_handles .iter() - .map(|d| d.to_be_bytes_vec()) + .map(|d| d.to_vec()) .collect::>(); let dependencies = [&dependencies_handles, dependencies_bytes].concat(); self.insert_computation_inner( @@ -157,10 +158,8 @@ impl Database { fhe_operation: FheOperation, scalar_byte: &FixedBytes<1>, ) -> Result<(), SqlxError> { - let dependencies = dependencies - .iter() - .map(|d| d.to_be_bytes_vec()) - .collect::>(); + let dependencies = + dependencies.iter().map(|d| d.to_vec()).collect::>(); self.insert_computation_inner( tenant_id, result, @@ -180,7 +179,7 @@ impl Database { scalar_byte: &FixedBytes<1>, ) -> Result<(), SqlxError> { let is_scalar = !scalar_byte.is_zero(); - let output_handle = result.to_be_bytes_vec(); + let output_handle = result.to_vec(); let query = || { sqlx::query!( r#" @@ -229,8 +228,8 @@ impl Database { const HAS_SCALAR : FixedBytes::<1> = FixedBytes([1]); // if any dependency is a scalar. const NO_SCALAR : FixedBytes::<1> = FixedBytes([0]); // if all dependencies are handles. // ciphertext type - let ty = |to_type: &ToType| vec![to_type[0]]; - let as_bytes = |x: &Handle| x.to_be_bytes_vec(); + let ty = |to_type: &ToType| vec![*to_type]; + let as_bytes = |x: &ClearConst| x.to_be_bytes_vec(); let tenant_id = self.tenant_id; let fhe_operation = event_to_op_int(event); match &event.data { @@ -280,7 +279,7 @@ impl Database { => self.insert_computation_bytes(tenant_id, result, &[], &[seed.to_vec(), as_bytes(upperBound), ty(randType)], fhe_operation, &HAS_SCALAR).await, | E::TrivialEncrypt(C::TrivialEncrypt {pt, toType, result, ..}) - => self.insert_computation_bytes(tenant_id, result, &[pt], &[ty(toType)], fhe_operation, &HAS_SCALAR).await, + => self.insert_computation_bytes(tenant_id, result, &[], &[as_bytes(pt), ty(toType)], fhe_operation, &HAS_SCALAR).await, | E::TrivialEncryptBytes(C::TrivialEncryptBytes {pt, toType, result, ..}) => self.insert_computation_bytes(tenant_id, result, &[], &[pt.to_vec(), ty(toType)], fhe_operation, &HAS_SCALAR).await, @@ -388,7 +387,7 @@ impl Database { match data { AclContractEvents::Allowed(allowed) => { - let handle = allowed.handle.to_be_bytes_vec(); + let handle = allowed.handle.to_vec(); self.insert_allowed_handle( handle.clone(), @@ -403,7 +402,7 @@ impl Database { let handles = allowed_for_decryption .handlesList .iter() - .map(|h| h.to_be_bytes_vec()) + .map(|h| h.to_vec()) .collect::>(); for handle in handles.clone() { diff --git a/fhevm-engine/fhevm-listener/tests/integration_test.rs b/fhevm-engine/fhevm-listener/tests/integration_test.rs index 32dcdde4..c232de4b 100644 --- a/fhevm-engine/fhevm-listener/tests/integration_test.rs +++ b/fhevm-engine/fhevm-listener/tests/integration_test.rs @@ -21,18 +21,18 @@ use fhevm_listener::database::tfhe_event_propagate::{Database, ToType}; sol!( #[sol(rpc)] #[derive(Debug, serde::Serialize, serde::Deserialize)] - TFHEExecutorTest, - "artifacts/TFHEExecutorTest.sol/TFHEExecutorTest.json" + HTTPZExecutorTest, + "artifacts/HTTPZExecutorTest.sol/HTTPZExecutorTest.json" ); -use crate::TFHEExecutorTest::TFHEExecutorTestInstance; +use crate::HTTPZExecutorTest::HTTPZExecutorTestInstance; const NB_EVENTS_PER_WALLET: i64 = 400; async fn emit_events( wallets: &[EthereumWallet], url: &String, - tfhe_contract: TFHEExecutorTestInstance<(), P, N>, + tfhe_contract: HTTPZExecutorTestInstance<(), P, N>, ) where P: Clone + alloy_provider::Provider + 'static, N: Clone @@ -56,7 +56,7 @@ async fn emit_events( let provider = provider.clone(); let thread = tokio::spawn(async move { for _ in 1..=NB_EVENTS_PER_WALLET { - let to_type = ToType::from_slice(&[4]); + let to_type: ToType = 4_u8; let pt = U256::from(UNIQUE_INT.fetch_add(1, Ordering::SeqCst)); let txn_req = tfhe_contract .trivialEncrypt_1(pt.clone(), to_type.clone()) @@ -65,6 +65,7 @@ async fn emit_events( let pending_txn = provider.send_transaction(txn_req).await.unwrap(); let receipt = pending_txn.get_receipt().await.unwrap(); + assert!(receipt.status()); } }); threads.push(thread); @@ -125,7 +126,7 @@ async fn test_listener_restart() -> Result<(), anyhow::Error> { .wallet(wallets[0].clone()) .on_ws(WsConnect::new(url.clone())) .await?; - let tfhe_contract = TFHEExecutorTest::deploy(provider.clone()).await?; + let tfhe_contract = HTTPZExecutorTest::deploy(provider.clone()).await?; let args = Args { url: url.clone(), ignore_tfhe_events: false, diff --git a/fhevm-engine/transaction-sender/contracts/ACLManager.sol b/fhevm-engine/transaction-sender/contracts/ACLManager.sol index 68945746..a951909e 100644 --- a/fhevm-engine/transaction-sender/contracts/ACLManager.sol +++ b/fhevm-engine/transaction-sender/contracts/ACLManager.sol @@ -5,14 +5,7 @@ pragma solidity ^0.8.24; /// @dev source: github.com/zama-ai/gateway-l2/blob/main/contracts/ACLManager.sol /// @notice This contract is a mock of the ACLManager contract from L2. contract ACLManager { - function allowAccount( - uint256 chainId, - uint256 ctHandle, - address accountAddress - ) public {} + function allowAccount(bytes32 ctHandle, address accountAddress) public {} - function allowPublicDecrypt( - uint256 chainId, - uint256 ctHandle - ) public {} + function allowPublicDecrypt(bytes32 ctHandle) public {} } diff --git a/fhevm-engine/transaction-sender/contracts/CiphertextManager.sol b/fhevm-engine/transaction-sender/contracts/CiphertextManager.sol index 262fa0a5..b3be1aae 100644 --- a/fhevm-engine/transaction-sender/contracts/CiphertextManager.sol +++ b/fhevm-engine/transaction-sender/contracts/CiphertextManager.sol @@ -5,9 +5,8 @@ pragma solidity ^0.8.24; /// source: github.com/zama-ai/gateway-l2/blob/main/contracts/CiphertextManager.sol contract CiphertextManager { function addCiphertextMaterial( - uint256 ctHandle, + bytes32 ctHandle, uint256 keyId, - uint256 chainId, bytes32 ciphertextDigest, bytes32 snsCiphertextDigest ) public {} diff --git a/fhevm-engine/transaction-sender/src/ops/add_ciphertext.rs b/fhevm-engine/transaction-sender/src/ops/add_ciphertext.rs index 4df113cc..5c0336d0 100644 --- a/fhevm-engine/transaction-sender/src/ops/add_ciphertext.rs +++ b/fhevm-engine/transaction-sender/src/ops/add_ciphertext.rs @@ -199,7 +199,6 @@ where } }; - let chain_id = tenant_info.chain_id; let handle: Vec = row.handle.clone(); let (ciphertext64_digest, ciphertext128_digest) = @@ -214,7 +213,7 @@ where } }; - let handle_u256 = U256::from_be_bytes(try_into_array::<32>(row.handle.clone())?); + let handle_bytes32 = FixedBytes::from(try_into_array::<32>(handle.clone())?); let key_id = U256::from_be_bytes(tenant_info.key_id); info!( @@ -229,9 +228,8 @@ where let txn_request = match &self.gas { Some(gas_limit) => ciphertext_manager .addCiphertextMaterial( - handle_u256, + handle_bytes32, key_id, - U256::from(chain_id), ciphertext64_digest, ciphertext128_digest, ) @@ -239,9 +237,8 @@ where .with_gas_limit(*gas_limit), None => ciphertext_manager .addCiphertextMaterial( - handle_u256, + handle_bytes32, key_id, - U256::from(chain_id), ciphertext64_digest, ciphertext128_digest, ) diff --git a/fhevm-engine/transaction-sender/src/ops/allow_handle.rs b/fhevm-engine/transaction-sender/src/ops/allow_handle.rs index 196a85bd..81d02f4b 100644 --- a/fhevm-engine/transaction-sender/src/ops/allow_handle.rs +++ b/fhevm-engine/transaction-sender/src/ops/allow_handle.rs @@ -9,7 +9,7 @@ use crate::{nonce_managed_provider::NonceManagedProvider, ops::common::try_into_ use super::TransactionOperation; use alloy::{ network::{Ethereum, TransactionBuilder}, - primitives::{Address, U256}, + primitives::{Address, FixedBytes}, providers::Provider, rpc::types::TransactionRequest, sol, @@ -247,18 +247,18 @@ where h_as_hex, event_type, account_addr, chain_id, ); - let handle_u256 = U256::from_be_bytes(try_into_array::<32>(handle)?); + let handle_bytes32 = FixedBytes::from(try_into_array::<32>(handle)?); let txn_request = match event_type { AllowEvents::AllowedForDecryption => { // Call allowPublicDecrypt when account_address is null match &self.gas { Some(gas_limit) => acl_manager - .allowPublicDecrypt(U256::from(chain_id), handle_u256) + .allowPublicDecrypt(handle_bytes32) .into_transaction_request() .with_gas_limit(*gas_limit), None => acl_manager - .allowPublicDecrypt(U256::from(chain_id), handle_u256) + .allowPublicDecrypt(handle_bytes32) .into_transaction_request(), } } @@ -275,11 +275,11 @@ where match &self.gas { Some(gas_limit) => acl_manager - .allowAccount(U256::from(chain_id), handle_u256, address) + .allowAccount(handle_bytes32, address) .into_transaction_request() .with_gas_limit(*gas_limit), None => acl_manager - .allowAccount(U256::from(chain_id), handle_u256, address) + .allowAccount(handle_bytes32, address) .into_transaction_request(), } } diff --git a/fhevm-engine/zkproof-worker/src/verifier.rs b/fhevm-engine/zkproof-worker/src/verifier.rs index d9221e19..22f72d6d 100644 --- a/fhevm-engine/zkproof-worker/src/verifier.rs +++ b/fhevm-engine/zkproof-worker/src/verifier.rs @@ -1,9 +1,7 @@ use alloy_primitives::Address; use fhevm_engine_common::tenant_keys::TfheTenantKeys; use fhevm_engine_common::tenant_keys::{self, FetchTenantKeyResult}; -use fhevm_engine_common::tfhe_ops::{ - current_ciphertext_version, extract_ct_list, -}; +use fhevm_engine_common::tfhe_ops::{current_ciphertext_version, extract_ct_list}; use fhevm_engine_common::types::SupportedFheCiphertexts; use fhevm_engine_common::utils::safe_deserialize; @@ -36,9 +34,7 @@ pub(crate) struct Ciphertext { } /// Executes the main loop for handling verify_proofs requests inserted in the database -pub async fn execute_verify_proofs_loop( - conf: &Config, -) -> Result<(), ExecutionError> { +pub async fn execute_verify_proofs_loop(conf: &Config) -> Result<(), ExecutionError> { info!("Starting with config {:?}", conf); // Tenants key cache is shared amongst all workers @@ -47,8 +43,7 @@ pub async fn execute_verify_proofs_loop( ))); // Each worker needs at least 3 pg connections - let pool_connections = - std::cmp::max(conf.pg_pool_connections, 3 * conf.worker_thread_count); + let pool_connections = std::cmp::max(conf.pg_pool_connections, 3 * conf.worker_thread_count); // DB Connection pool is shared amongst all workers let pool = PgPoolOptions::new() @@ -67,9 +62,7 @@ pub async fn execute_verify_proofs_loop( // Spawn a ZK-proof worker // All workers compete for zk-proof tasks queued in the 'verify_proof' table. task_set.spawn(async move { - if let Err(err) = - execute_worker(&conf, &pool, &tenant_key_cache).await - { + if let Err(err) = execute_worker(&conf, &pool, &tenant_key_cache).await { error!("executor failed with {}", err); } }); @@ -92,13 +85,10 @@ async fn execute_worker( ) -> Result<(), ExecutionError> { let mut listener = PgListener::connect_with(pool).await?; listener.listen(&conf.listen_database_channel).await?; - let idle_poll_interval = - Duration::from_secs(conf.pg_polling_interval as u64); + let idle_poll_interval = Duration::from_secs(conf.pg_polling_interval as u64); loop { - if let Err(e) = - execute_verify_proof_routine(pool, tenant_key_cache, conf).await - { + if let Err(e) = execute_verify_proof_routine(pool, tenant_key_cache, conf).await { error!(target: "zkpok", "Execution err: {}", e); } else { let count = get_remaining_tasks(pool).await?; @@ -161,14 +151,9 @@ async fn execute_verify_proof_routine( input_len = format!("{}", input.len()), ); - let keys = tenant_keys::fetch_tenant_server_key( - chain_id, - pool, - tenant_key_cache, - false, - ) - .await - .map_err(|err| ExecutionError::ServerKeysNotFound(err.to_string()))?; + let keys = tenant_keys::fetch_tenant_server_key(chain_id, pool, tenant_key_cache, false) + .await + .map_err(|err| ExecutionError::ServerKeysNotFound(err.to_string()))?; let tenant_id = keys.tenant_id; info!(message = "Keys retrieved", request_id, chain_id); @@ -248,9 +233,7 @@ pub(crate) fn verify_proof( set_server_key(keys.server_key.clone()); let cts: Vec = - try_verify_and_expand_ciphertext_list( - request_id, raw_ct, keys, aux_data, - )?; + try_verify_and_expand_ciphertext_list(request_id, raw_ct, keys, aux_data)?; let mut h = Keccak256::new(); h.update(raw_ct); @@ -292,10 +275,9 @@ fn create_ciphertext( aux_data: &auxiliary::ZkData, ) -> Ciphertext { let (serialized_type, compressed) = the_ct.compress(); - let chain_id_bytes: [u8; 32] = - alloy_primitives::U256::from(aux_data.chain_id) - .to_owned() - .to_be_bytes(); + let chain_id_bytes: [u8; 32] = alloy_primitives::U256::from(aux_data.chain_id) + .to_owned() + .to_be_bytes(); let mut handle_hash = Keccak256::new(); handle_hash.update(blob_hash); @@ -311,7 +293,9 @@ fn create_ciphertext( assert_eq!(handle.len(), 32); // idx cast to u8 must succeed because we don't allow // more handles than u8 size - handle[29] = ct_idx as u8; + handle[21] = ct_idx as u8; + // TODO: change chain ID to be u64 + handle[22..30].copy_from_slice(&(aux_data.chain_id as u64).to_be_bytes()); handle[30] = serialized_type as u8; handle[31] = current_ciphertext_version() as u8;